Browse Source

Fix e1000 receive tail pointer (RDT) handling

e1000 should now work in VMware.
tags/v0.9.3
Marty Connor 17 years ago
parent
commit
ff476c04e9
2 changed files with 7 additions and 7 deletions
  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 View File

365
 	rctl = E1000_READ_REG ( hw, RCTL );
365
 	rctl = E1000_READ_REG ( hw, RCTL );
366
 	E1000_WRITE_REG ( hw, RCTL, rctl & ~E1000_RCTL_EN );
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
 	/* Setup the HW Rx Head and Tail Descriptor Pointers and
370
 	/* Setup the HW Rx Head and Tail Descriptor Pointers and
371
 	 * the Base and Length of the Rx Descriptor Ring */	 
371
 	 * the Base and Length of the Rx Descriptor Ring */	 
375
 	E1000_WRITE_REG ( hw, RDLEN, adapter->rx_ring_size );
375
 	E1000_WRITE_REG ( hw, RDLEN, adapter->rx_ring_size );
376
 
376
 
377
 	E1000_WRITE_REG ( hw, RDH, 0 );
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
 	/* Enable Receives */
380
 	/* Enable Receives */
381
 	rctl = ( E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_SZ_2048 |
381
 	rctl = ( E1000_RCTL_EN | E1000_RCTL_BAM | E1000_RCTL_SZ_2048 |
661
 	 */
661
 	 */
662
 	while ( 1 ) {
662
 	while ( 1 ) {
663
 	
663
 	
664
-		i = adapter->rx_tail;;
664
+		i = adapter->rx_curr;
665
 		
665
 		
666
 		rx_curr_desc = ( void * )  ( adapter->rx_base ) + 
666
 		rx_curr_desc = ( void * )  ( adapter->rx_base ) + 
667
 			          ( i * sizeof ( *adapter->rx_base ) ); 
667
 			          ( i * sizeof ( *adapter->rx_base ) ); 
676
 	
676
 	
677
 		rx_len = rx_curr_desc->length;
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
                       i, rx_status, rx_len );
680
                       i, rx_status, rx_len );
681
                 
681
                 
682
                 rx_err = rx_curr_desc->errors;
682
                 rx_err = rx_curr_desc->errors;
707
 		memset ( rx_curr_desc, 0, sizeof ( *rx_curr_desc ) );
707
 		memset ( rx_curr_desc, 0, sizeof ( *rx_curr_desc ) );
708
 		rx_curr_desc->buffer_addr = tmp_buffer_addr;
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 View File

271
 	uint32_t tx_tail;
271
 	uint32_t tx_tail;
272
 	uint32_t tx_fill_ctr;
272
 	uint32_t tx_fill_ctr;
273
 	
273
 	
274
-	uint32_t rx_tail;
274
+	uint32_t rx_curr;
275
 
275
 
276
 	uint32_t ioaddr;
276
 	uint32_t ioaddr;
277
 	uint32_t irqno;
277
 	uint32_t irqno;

Loading…
Cancel
Save