Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/netdev: revise return values of .confirm_send() #20995

Merged
merged 2 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cpu/sam0_common/sam0_eth/eth-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
8 changes: 5 additions & 3 deletions drivers/include/net/netdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading