Parcourir la source

Fix e1000 receive tail pointer (RDT) handling

e1000 should now work in VMware.
tags/v0.9.3
Marty Connor il y a 17 ans
Parent
révision
ff476c04e9
2 fichiers modifiés avec 7 ajouts et 7 suppressions
  1. 6
    6
      src/drivers/net/e1000/e1000.c
  2. 1
    1
      src/drivers/net/e1000/e1000.h

+ 6
- 6
src/drivers/net/e1000/e1000.c Voir le fichier

@@ -365,7 +365,7 @@ e1000_configure_rx ( struct e1000_adapter *adapter )
365 365
 	rctl = E1000_READ_REG ( hw, RCTL );
366 366
 	E1000_WRITE_REG ( hw, RCTL, rctl & ~E1000_RCTL_EN );
367 367
 
368
-	adapter->rx_tail = 0;
368
+	adapter->rx_curr = 0;
369 369
 
370 370
 	/* Setup the HW Rx Head and Tail Descriptor Pointers and
371 371
 	 * the Base and Length of the Rx Descriptor Ring */	 
@@ -375,7 +375,7 @@ e1000_configure_rx ( struct e1000_adapter *adapter )
375 375
 	E1000_WRITE_REG ( hw, RDLEN, adapter->rx_ring_size );
376 376
 
377 377
 	E1000_WRITE_REG ( hw, RDH, 0 );
378
-	E1000_WRITE_REG ( hw, RDT, NUM_TX_DESC );
378
+	E1000_WRITE_REG ( hw, RDT, NUM_RX_DESC - 1 );
379 379
 	
380 380
 	/* Enable Receives */
381 381
 	rctl = ( E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_SZ_2048 |
@@ -661,7 +661,7 @@ e1000_poll ( struct net_device *netdev )
661 661
 	 */
662 662
 	while ( 1 ) {
663 663
 	
664
-		i = adapter->rx_tail;;
664
+		i = adapter->rx_curr;
665 665
 		
666 666
 		rx_curr_desc = ( void * )  ( adapter->rx_base ) + 
667 667
 			          ( i * sizeof ( *adapter->rx_base ) ); 
@@ -676,7 +676,7 @@ e1000_poll ( struct net_device *netdev )
676 676
 	
677 677
 		rx_len = rx_curr_desc->length;
678 678
 
679
-                DBG ( "Received packet, rx_tail: %ld rx_status: %#08lx rx_len: %ld\n",
679
+                DBG ( "Received packet, rx_curr: %ld  rx_status: %#08lx  rx_len: %ld\n",
680 680
                       i, rx_status, rx_len );
681 681
                 
682 682
                 rx_err = rx_curr_desc->errors;
@@ -707,9 +707,9 @@ e1000_poll ( struct net_device *netdev )
707 707
 		memset ( rx_curr_desc, 0, sizeof ( *rx_curr_desc ) );
708 708
 		rx_curr_desc->buffer_addr = tmp_buffer_addr;
709 709
 
710
-		E1000_WRITE_REG ( hw, RDT, adapter->rx_tail );
710
+		E1000_WRITE_REG ( hw, RDT, adapter->rx_curr );
711 711
 
712
-		adapter->rx_tail = ( adapter->rx_tail + 1 ) % NUM_RX_DESC;
712
+		adapter->rx_curr = ( adapter->rx_curr + 1 ) % NUM_RX_DESC;
713 713
 	}
714 714
 }				
715 715
 

+ 1
- 1
src/drivers/net/e1000/e1000.h Voir le fichier

@@ -271,7 +271,7 @@ struct e1000_adapter {
271 271
 	uint32_t tx_tail;
272 272
 	uint32_t tx_fill_ctr;
273 273
 	
274
-	uint32_t rx_tail;
274
+	uint32_t rx_curr;
275 275
 
276 276
 	uint32_t ioaddr;
277 277
 	uint32_t irqno;

Chargement…
Annuler
Enregistrer