소스 검색

Autonegotiation fixes. NIC now autonegotiates to whatever the switch supports.

tags/v0.9.3
Marty Connor 17 년 전
부모
커밋
8973caa1e6
3개의 변경된 파일22개의 추가작업 그리고 18개의 파일을 삭제
  1. 17
    14
      src/drivers/net/e1000/e1000.c
  2. 4
    4
      src/drivers/net/e1000/e1000_hw.h
  3. 1
    0
      src/drivers/net/e1000/e1000_osdep.h

+ 17
- 14
src/drivers/net/e1000/e1000.c 파일 보기

@@ -267,10 +267,16 @@ e1000_sw_init ( struct e1000_adapter *adapter )
267 267
 	/* Disable Flow Control */
268 268
 	hw->fc = E1000_FC_NONE;
269 269
 
270
-	adapter->rx_buffer_len =  E1000_RXBUFFER_2048;
270
+	adapter->eeprom_wol = 0;
271
+	adapter->wol = adapter->eeprom_wol;
272
+	adapter->en_mng_pt  = 0;
273
+	adapter->rx_int_delay = 0;
274
+	adapter->rx_abs_int_delay = 0;
275
+
276
+	adapter->rx_buffer_len =  1600;
271 277
 	adapter->rx_ps_bsize0 = E1000_RXBUFFER_128;
272
-	hw->max_frame_size =  E1000_RXBUFFER_2048;
273
-	hw->min_frame_size = 64;
278
+	hw->max_frame_size =  1600;
279
+	hw->min_frame_size = ETH_ZLEN;
274 280
 
275 281
 	/* identify the MAC */
276 282
 
@@ -294,7 +300,10 @@ e1000_sw_init ( struct e1000_adapter *adapter )
294 300
 
295 301
 	e1000_set_media_type ( hw );
296 302
 
297
-	hw->wait_autoneg_complete = FALSE;
303
+	hw->autoneg = TRUE;
304
+	hw->autoneg_advertised = AUTONEG_ADVERTISE_SPEED_DEFAULT;
305
+	hw->wait_autoneg_complete = TRUE;
306
+
298 307
 	hw->tbi_compatibility_en = TRUE;
299 308
 	hw->adaptive_ifs = TRUE;
300 309
 
@@ -512,7 +521,7 @@ e1000_setup_rx_resources ( struct e1000_adapter *adapter )
512 521
 
513 522
 	for ( i = 0; i < NUM_RX_DESC; i++ ) {
514 523
 	
515
-		adapter->rx_iobuf[i] = alloc_iob ( E1000_RXBUFFER_2048 );
524
+		adapter->rx_iobuf[i] = alloc_iob ( 1600 );
516 525
 		
517 526
 		/* If unable to allocate all iobufs, free any that
518 527
 		 * were successfully allocated, and return an error 
@@ -1014,13 +1023,7 @@ e1000_probe ( struct pci_device *pdev,
1014 1023
 	adapter->netdev     = netdev;
1015 1024
 	adapter->pdev       = pdev;
1016 1025
 	adapter->hw.back    = adapter;
1017
-	adapter->eeprom_wol = 0;
1018
-	adapter->wol = adapter->eeprom_wol;
1019
-#if 0	
1020
-	adapter->en_mng_pt  = 0;
1021
-	adapter->rx_int_delay = 0;
1022
-	adapter->rx_abs_int_delay = 0;
1023
-#endif
1026
+
1024 1027
 	mmio_start = pci_bar_start ( pdev, PCI_BASE_ADDRESS_0 );
1025 1028
 	mmio_len   = pci_bar_size  ( pdev, PCI_BASE_ADDRESS_0 );
1026 1029
 
@@ -1169,8 +1172,8 @@ e1000_open ( struct net_device *netdev )
1169 1172
 	/* allocate transmit descriptors */
1170 1173
 	err = e1000_setup_tx_resources ( adapter );
1171 1174
 	if (err) {
1172
-		goto err_setup_tx;
1173 1175
 		DBG ( "Error setting up TX resources!\n" );
1176
+		goto err_setup_tx;
1174 1177
 	}
1175 1178
 
1176 1179
 	/* allocate receive descriptors */
@@ -1186,7 +1189,7 @@ e1000_open ( struct net_device *netdev )
1186 1189
 	
1187 1190
 	e1000_irq_enable ( adapter );
1188 1191
 
1189
-	return E1000_SUCCESS;
1192
+	return 0;
1190 1193
 
1191 1194
 err_setup_rx:
1192 1195
 	e1000_free_tx_resources ( adapter );

+ 4
- 4
src/drivers/net/e1000/e1000_hw.h 파일 보기

@@ -598,7 +598,7 @@ struct e1000_rx_desc {
598 598
     uint8_t status;      /* Descriptor status */
599 599
     uint8_t errors;      /* Descriptor Errors */
600 600
     uint16_t special;
601
-} __attribute__ (( packed )) ;
601
+};
602 602
 
603 603
 /* Receive Descriptor - Extended */
604 604
 union e1000_rx_desc_extended {
@@ -729,7 +729,7 @@ struct e1000_tx_desc {
729 729
             uint16_t special;
730 730
         } fields;
731 731
     } upper;
732
-}  __attribute__ (( packed )) ;
732
+};
733 733
 
734 734
 /* Transmit Descriptor bit definitions */
735 735
 #define E1000_TXD_DTYP_D     0x00100000 /* Data Descriptor */
@@ -1381,8 +1381,8 @@ struct e1000_hw_stats {
1381 1381
 
1382 1382
 /* Structure containing variables used by the shared code (e1000_hw.c) */
1383 1383
 struct e1000_hw {
1384
-        uint8_t			*hw_addr;
1385
-	uint8_t 		*flash_address;
1384
+	uint8_t			*hw_addr;
1385
+	uint8_t			*flash_address;
1386 1386
 	e1000_mac_type		mac_type;
1387 1387
 	e1000_phy_type		phy_type;
1388 1388
 	uint32_t		phy_init_script;

+ 1
- 0
src/drivers/net/e1000/e1000_osdep.h 파일 보기

@@ -26,6 +26,7 @@
26 26
 
27 27
 *******************************************************************************/
28 28
 
29
+
29 30
 /* glue for the OS independent part of e1000
30 31
  * includes register access macros
31 32
  */

Loading…
취소
저장