Skip to content

Commit

Permalink
drivers: nxp_enet: Fix tx error handling
Browse files Browse the repository at this point in the history
The code path for error handling and timestamping in tx path
was meant to be identical in function to old eth_mcux driver,
but there is actually a discrepancy causing no error handling
for timestamped frames, fix it.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
  • Loading branch information
decsny authored and nashif committed Sep 25, 2024
1 parent 9abc17b commit b29190c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/ethernet/nxp_enet/eth_nxp_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,16 @@ static int eth_nxp_enet_tx(const struct device *dev, struct net_pkt *pkt)

ret = ENET_SendFrame(data->base, &data->enet_handle, data->tx_frame_buf,
total_len, RING_ID, frame_is_timestamped, pkt);
if (ret == kStatus_Success) {

if (ret != kStatus_Success) {
LOG_ERR("ENET_SendFrame error: %d", ret);
ENET_ReclaimTxDescriptor(data->base, &data->enet_handle, RING_ID);
ret = -EIO;
goto exit;
}

if (frame_is_timestamped) {
eth_wait_for_ptp_ts(dev, pkt);
} else {
LOG_ERR("ENET_SendFrame error: %d", ret);
ENET_ReclaimTxDescriptor(data->base, &data->enet_handle, RING_ID);
}

exit:
Expand Down

0 comments on commit b29190c

Please sign in to comment.