Browse Source

added netdev_tx_complete to natsemi.c

tags/v0.9.3
Udayan Kumar 17 years ago
parent
commit
6d4dafdc6e
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/drivers/net/natsemi.c

+ 6
- 0
src/drivers/net/natsemi.c View File

@@ -45,6 +45,9 @@ struct natsemi_nic {
45 45
 	 * alternatively substracting sizeof(head) and sizeof(list_head) can also 
46 46
 	 * give the same.*/
47 47
 	struct io_buffer *iobuf[NUM_RX_DESC];
48
+	/*netdev_tx_complete needs pointer to the iobuf of the data so as to free 
49
+	  it form the memory.*/
50
+	struct io_buffer *tx_iobuf[TX_RING_SIZE];
48 51
 	struct spi_bit_basher spibit;
49 52
 	struct spi_device eeprom;
50 53
 	struct nvo_block nvo;
@@ -415,6 +418,8 @@ static int nat_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) {
415 418
 	}
416 419
 
417 420
 	//DBG_HD(iobuf->data,iob_len(iobuf));
421
+	/* to be used in netdev_tx_complete*/
422
+	nat->tx_iobuf[nat->tx_cur]=iobuf;
418 423
 
419 424
 	/* Pad and align packet */
420 425
 	iob_pad ( iobuf, ETH_ZLEN );
@@ -473,6 +478,7 @@ static void nat_poll ( struct net_device *netdev, unsigned int rx_quota ) {
473 478
 			DBG("Success in transmitting Packet with data\n");
474 479
 		//	DBG_HD(&nat->tx[nat->tx_dirty].bufptr,130);
475 480
 		}
481
+		netdev_tx_complete(netdev,nat->tx_iobuf[nat->tx_dirty]);
476 482
 		/* setting cmdsts zero, indicating that it can be reused */
477 483
 		nat->tx[nat->tx_dirty].cmdsts=0;
478 484
 		nat->tx_dirty=(nat->tx_dirty +1) % TX_RING_SIZE;

Loading…
Cancel
Save