Browse Source

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

tags/v0.9.3
Marty Connor 17 years ago
parent
commit
8973caa1e6

+ 17
- 14
src/drivers/net/e1000/e1000.c View File

267
 	/* Disable Flow Control */
267
 	/* Disable Flow Control */
268
 	hw->fc = E1000_FC_NONE;
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
 	adapter->rx_ps_bsize0 = E1000_RXBUFFER_128;
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
 	/* identify the MAC */
281
 	/* identify the MAC */
276
 
282
 
294
 
300
 
295
 	e1000_set_media_type ( hw );
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
 	hw->tbi_compatibility_en = TRUE;
307
 	hw->tbi_compatibility_en = TRUE;
299
 	hw->adaptive_ifs = TRUE;
308
 	hw->adaptive_ifs = TRUE;
300
 
309
 
512
 
521
 
513
 	for ( i = 0; i < NUM_RX_DESC; i++ ) {
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
 		/* If unable to allocate all iobufs, free any that
526
 		/* If unable to allocate all iobufs, free any that
518
 		 * were successfully allocated, and return an error 
527
 		 * were successfully allocated, and return an error 
1014
 	adapter->netdev     = netdev;
1023
 	adapter->netdev     = netdev;
1015
 	adapter->pdev       = pdev;
1024
 	adapter->pdev       = pdev;
1016
 	adapter->hw.back    = adapter;
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
 	mmio_start = pci_bar_start ( pdev, PCI_BASE_ADDRESS_0 );
1027
 	mmio_start = pci_bar_start ( pdev, PCI_BASE_ADDRESS_0 );
1025
 	mmio_len   = pci_bar_size  ( pdev, PCI_BASE_ADDRESS_0 );
1028
 	mmio_len   = pci_bar_size  ( pdev, PCI_BASE_ADDRESS_0 );
1026
 
1029
 
1169
 	/* allocate transmit descriptors */
1172
 	/* allocate transmit descriptors */
1170
 	err = e1000_setup_tx_resources ( adapter );
1173
 	err = e1000_setup_tx_resources ( adapter );
1171
 	if (err) {
1174
 	if (err) {
1172
-		goto err_setup_tx;
1173
 		DBG ( "Error setting up TX resources!\n" );
1175
 		DBG ( "Error setting up TX resources!\n" );
1176
+		goto err_setup_tx;
1174
 	}
1177
 	}
1175
 
1178
 
1176
 	/* allocate receive descriptors */
1179
 	/* allocate receive descriptors */
1186
 	
1189
 	
1187
 	e1000_irq_enable ( adapter );
1190
 	e1000_irq_enable ( adapter );
1188
 
1191
 
1189
-	return E1000_SUCCESS;
1192
+	return 0;
1190
 
1193
 
1191
 err_setup_rx:
1194
 err_setup_rx:
1192
 	e1000_free_tx_resources ( adapter );
1195
 	e1000_free_tx_resources ( adapter );

+ 4
- 4
src/drivers/net/e1000/e1000_hw.h View File

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

+ 1
- 0
src/drivers/net/e1000/e1000_osdep.h View File

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

Loading…
Cancel
Save