1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #20995 from benpicco/confirm_send-retval

drivers/netdev: revise return values of `.confirm_send()`
This commit is contained in:
Marian Buschsieweke 2024-11-15 22:46:58 +00:00 committed by GitHub
commit dedc8f950f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 7 deletions

View File

@ -221,13 +221,13 @@ static int _sam0_eth_confirm_send(netdev_t *netdev, void *info)
return -EAGAIN;
}
/* Retry Limit Exceeded */
if (tsr & GMAC_TSR_RLE) {
/* Retry Limit Exceeded, Collision Occurred */
if (tsr & (GMAC_TSR_RLE | GMAC_TSR_COL)) {
return -EBUSY;
}
/* Transmit Frame Corruption, Collision Occurred */
if (tsr & (GMAC_TSR_TFC | GMAC_TSR_COL)) {
/* Transmit Frame Corruption */
if (tsr & GMAC_TSR_TFC) {
return -EIO;
}

View File

@ -468,10 +468,12 @@ typedef struct netdev_driver {
* frame delimiters, etc. May be an estimate for performance
* reasons.)
* @retval -EAGAIN Transmission still ongoing. (Call later again!)
* @retval -ECOMM Any kind of transmission error, such as collision
* detected, layer 2 ACK timeout, etc.
* @retval -EHOSTUNREACH Layer 2 ACK timeout
* @retval -EBUSY Medium is busy. (E.g. Auto-CCA failed / timed out,
* collision detected)
* @retval -ENETDOWN Interface is not connected / powered down
* @retval -EIO Any kind of transmission error
* Use @p info for more details
* @retval -EBUSY Medium is busy. (E.g. Auto-CCA failed / timed out)
* @retval <0 Other error. (Please use a negative errno code.)
*
* @warning After netdev_driver_t::send was called and returned zero, this