summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/interface/pxe/pxe_undi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/i386/interface/pxe/pxe_undi.c')
-rw-r--r--src/arch/i386/interface/pxe/pxe_undi.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/arch/i386/interface/pxe/pxe_undi.c b/src/arch/i386/interface/pxe/pxe_undi.c
index e284c905..bd387ea5 100644
--- a/src/arch/i386/interface/pxe/pxe_undi.c
+++ b/src/arch/i386/interface/pxe/pxe_undi.c
@@ -316,18 +316,22 @@ PXENV_EXIT_t pxenv_undi_transmit ( struct s_PXENV_UNDI_TRANSMIT
}
}
+ /* Flag transmission as in-progress. Do this before starting
+ * to transmit the packet, because the ISR may trigger before
+ * we return from netdev_tx().
+ */
+ undi_tx_count++;
+
/* Transmit packet */
- DBG2 ( "\n" ); /* ISR may trigger before we return from netdev_tx() */
+ DBG2 ( "\n" );
if ( ( rc = netdev_tx ( pxe_netdev, iobuf ) ) != 0 ) {
DBG2 ( "PXENV_UNDI_TRANSMIT could not transmit: %s\n",
strerror ( rc ) );
+ undi_tx_count--;
undi_transmit->Status = PXENV_STATUS ( rc );
return PXENV_EXIT_FAILURE;
}
- /* Flag transmission as in-progress */
- undi_tx_count++;
-
undi_transmit->Status = PXENV_STATUS_SUCCESS;
return PXENV_EXIT_SUCCESS;
}