Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Autonegotiation fixes. NIC now autonegotiates to whatever the switch …
…supports.
  • Loading branch information
Marty Connor committed Nov 20, 2007
1 parent e41550b commit 8973caa
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
31 changes: 17 additions & 14 deletions src/drivers/net/e1000/e1000.c
Expand Up @@ -267,10 +267,16 @@ e1000_sw_init ( struct e1000_adapter *adapter )
/* Disable Flow Control */
hw->fc = E1000_FC_NONE;

adapter->rx_buffer_len = E1000_RXBUFFER_2048;
adapter->eeprom_wol = 0;
adapter->wol = adapter->eeprom_wol;
adapter->en_mng_pt = 0;
adapter->rx_int_delay = 0;
adapter->rx_abs_int_delay = 0;

adapter->rx_buffer_len = 1600;
adapter->rx_ps_bsize0 = E1000_RXBUFFER_128;
hw->max_frame_size = E1000_RXBUFFER_2048;
hw->min_frame_size = 64;
hw->max_frame_size = 1600;
hw->min_frame_size = ETH_ZLEN;

/* identify the MAC */

Expand All @@ -294,7 +300,10 @@ e1000_sw_init ( struct e1000_adapter *adapter )

e1000_set_media_type ( hw );

hw->wait_autoneg_complete = FALSE;
hw->autoneg = TRUE;
hw->autoneg_advertised = AUTONEG_ADVERTISE_SPEED_DEFAULT;
hw->wait_autoneg_complete = TRUE;

hw->tbi_compatibility_en = TRUE;
hw->adaptive_ifs = TRUE;

Expand Down Expand Up @@ -512,7 +521,7 @@ e1000_setup_rx_resources ( struct e1000_adapter *adapter )

for ( i = 0; i < NUM_RX_DESC; i++ ) {

adapter->rx_iobuf[i] = alloc_iob ( E1000_RXBUFFER_2048 );
adapter->rx_iobuf[i] = alloc_iob ( 1600 );

/* If unable to allocate all iobufs, free any that
* were successfully allocated, and return an error
Expand Down Expand Up @@ -1014,13 +1023,7 @@ e1000_probe ( struct pci_device *pdev,
adapter->netdev = netdev;
adapter->pdev = pdev;
adapter->hw.back = adapter;
adapter->eeprom_wol = 0;
adapter->wol = adapter->eeprom_wol;
#if 0
adapter->en_mng_pt = 0;
adapter->rx_int_delay = 0;
adapter->rx_abs_int_delay = 0;
#endif

mmio_start = pci_bar_start ( pdev, PCI_BASE_ADDRESS_0 );
mmio_len = pci_bar_size ( pdev, PCI_BASE_ADDRESS_0 );

Expand Down Expand Up @@ -1169,8 +1172,8 @@ e1000_open ( struct net_device *netdev )
/* allocate transmit descriptors */
err = e1000_setup_tx_resources ( adapter );
if (err) {
goto err_setup_tx;
DBG ( "Error setting up TX resources!\n" );
goto err_setup_tx;
}

/* allocate receive descriptors */
Expand All @@ -1186,7 +1189,7 @@ e1000_open ( struct net_device *netdev )

e1000_irq_enable ( adapter );

return E1000_SUCCESS;
return 0;

err_setup_rx:
e1000_free_tx_resources ( adapter );
Expand Down
8 changes: 4 additions & 4 deletions src/drivers/net/e1000/e1000_hw.h
Expand Up @@ -598,7 +598,7 @@ struct e1000_rx_desc {
uint8_t status; /* Descriptor status */
uint8_t errors; /* Descriptor Errors */
uint16_t special;
} __attribute__ (( packed )) ;
};

/* Receive Descriptor - Extended */
union e1000_rx_desc_extended {
Expand Down Expand Up @@ -729,7 +729,7 @@ struct e1000_tx_desc {
uint16_t special;
} fields;
} upper;
} __attribute__ (( packed )) ;
};

/* Transmit Descriptor bit definitions */
#define E1000_TXD_DTYP_D 0x00100000 /* Data Descriptor */
Expand Down Expand Up @@ -1381,8 +1381,8 @@ struct e1000_hw_stats {

/* Structure containing variables used by the shared code (e1000_hw.c) */
struct e1000_hw {
uint8_t *hw_addr;
uint8_t *flash_address;
uint8_t *hw_addr;
uint8_t *flash_address;
e1000_mac_type mac_type;
e1000_phy_type phy_type;
uint32_t phy_init_script;
Expand Down
1 change: 1 addition & 0 deletions src/drivers/net/e1000/e1000_osdep.h
Expand Up @@ -26,6 +26,7 @@
*******************************************************************************/


/* glue for the OS independent part of e1000
* includes register access macros
*/
Expand Down

0 comments on commit 8973caa

Please sign in to comment.