Browse Source

[efi] Free transmit ring entry before calling netdev_tx_complete()

The snpnet driver uses netdev_tx_defer() and so must ensure that space
in the (single-entry) transmit descriptor ring is freed up before
calling netdev_tx_complete().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
b71e93bb71
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/drivers/net/efi/snpnet.c

+ 3
- 1
src/drivers/net/efi/snpnet.c View File

@@ -185,6 +185,7 @@ static int snpnet_transmit ( struct net_device *netdev,
185 185
  */
186 186
 static void snpnet_poll_tx ( struct net_device *netdev ) {
187 187
 	struct snp_nic *snp = netdev->priv;
188
+	struct io_buffer *iobuf;
188 189
 	UINT32 irq;
189 190
 	VOID *txbuf;
190 191
 	EFI_STATUS efirc;
@@ -212,8 +213,9 @@ static void snpnet_poll_tx ( struct net_device *netdev ) {
212 213
 	}
213 214
 
214 215
 	/* Complete transmission */
215
-	netdev_tx_complete ( netdev, snp->txbuf );
216
+	iobuf = snp->txbuf;
216 217
 	snp->txbuf = NULL;
218
+	netdev_tx_complete ( netdev, iobuf );
217 219
 }
218 220
 
219 221
 /**

Loading…
Cancel
Save