Commit 713d8c8a authored by Declan Snyder's avatar Declan Snyder Committed by Anas Nashif
Browse files

drivers: nxp_enet: Fix tx error handling



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: default avatarDeclan Snyder <declan.snyder@nxp.com>
(cherry picked from commit b29190c3)
parent 4c806352
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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: