e1000e: add support for the 82567LM-4 device
Subsystems (2)
PATCH 2/3 e1000e: add support for 82567LM-3 and 82567LF-3 (ICH10D) parts
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
Add support for new LOM devices on the latest generation ICHx platforms.
---
drivers/net/e1000e/defines.h | 2 + drivers/net/e1000e/e1000.h | 3 + drivers/net/e1000e/ethtool.c | 22 +++++- drivers/net/e1000e/hw.h | 3 + drivers/net/e1000e/ich8lan.c | 154 +++++++++++++++++++++++++++++++++++++++--- drivers/net/e1000e/netdev.c | 25 +++++++ drivers/net/e1000e/phy.c | 85 +++++++++++++++++++++++ 7 files changed, 280 insertions(+), 14 deletions(-)
drivers/net/e1000e/defines.h +2 -0
@@ -505,6 +505,7 @@#define NWAY_LPAR_ASM_DIR 0x0800/* LP Asymmetric Pause Direction bit */ /* Autoneg Expansion Register */ +#define NWAY_ER_LP_NWAY_CAPS 0x0001/* LP has Auto Neg Capability */ /* 1000BASE-T Control Register */ #define CR_1000T_HD_CAPS 0x0100/* Advertise 1000T HD capability */
@@ -540,6 +541,7 @@#define E1000_EECD_DO 0x00000008/* NVM Data Out */ #define E1000_EECD_REQ 0x00000040/* NVM Access Request */ #define E1000_EECD_GNT 0x00000080/* NVM Access Grant */ +#define E1000_EECD_PRES 0x00000100/* NVM Present */ #define E1000_EECD_SIZE 0x00000200/* NVM Size (0=64 word 1=256 word) */ /* NVM Addressing bits based on type (0-small, 1-large) */ #define E1000_EECD_ADDR_BITS 0x00000400
drivers/net/e1000e/e1000.h +3 -0
@@ -98,6 +98,7 @@ enum e1000_boards { board_80003es2lan, board_ich8lan, board_ich9lan, + board_ich10lan, }; struct e1000_queue_stats {
@@ -374,6 +375,7 @@ extern struct e1000_info e1000_82572_info;extern struct e1000_info e1000_82573_info;extern struct e1000_info e1000_ich8_info;extern struct e1000_info e1000_ich9_info; +extern struct e1000_info e1000_ich10_info;extern struct e1000_info e1000_es2_info;extern s32 e1000e_read_pba_num (struct e1000_hw *hw,u32 *pba_num);
@@ -446,6 +448,7 @@ extern s32 e1000e_get_cable_length_m88(struct e1000_hw *hw);extern s32 e1000e_get_phy_info_m88 (struct e1000_hw *hw);extern s32 e1000e_read_phy_reg_m88 (struct e1000_hw *hw,u32 offset,u16 *data);extern s32 e1000e_write_phy_reg_m88 (struct e1000_hw *hw,u32 offset,u16 data); +extern s32 e1000e_phy_init_script_igp3 (struct e1000_hw *hw);extern enum e1000_phy_type e1000e_get_phy_type_from_id (u32 phy_id);extern s32 e1000e_determine_phy_address (struct e1000_hw *hw);extern s32 e1000e_write_phy_reg_bm (struct e1000_hw *hw,u32 offset,u16 data);
drivers/net/e1000e/ethtool.c +18 -4
@@ -781,6 +781,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)case e1000_82573:case e1000_ich8lan:case e1000_ich9lan: +case e1000_ich10lan: toggle =0x7FFFF033 ;break ;default :
@@ -833,7 +834,9 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)REG_PATTERN_TEST (E1000_TIDV ,0x0000FFFF ,0x0000FFFF );for (i =0 ; i < mac->rar_entry_count; i++)REG_PATTERN_TEST_ARRAY (E1000_RA , ((i <<1 ) +1 ), -0x8003FFFF ,0xFFFFFFFF ); + ((mac->type == e1000_ich10lan) ? +0x8007FFFF :0x8003FFFF ), +0xFFFFFFFF );for (i =0 ; i < mac->mta_reg_count; i++)REG_PATTERN_TEST_ARRAY (E1000_MTA , i,0xFFFFFFFF ,0xFFFFFFFF );
@@ -905,12 +908,23 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)/* Test each interrupt */ for (i =0 ; i <10 ; i++) { -if ((adapter->flags &FLAG_IS_ICH ) && (i ==8 )) -continue ; -/* Interrupt to test */ mask =1 << i; +if (adapter->flags &FLAG_IS_ICH ) { +switch (mask) { +case E1000_ICR_RXSEQ : +continue ; +case 0x00000100 : +if (adapter->hw.mac.type == e1000_ich8lan || + adapter->hw.mac.type == e1000_ich9lan) +continue ; +break ; +default : +break ; + } + } +if (!shared_int) {/* * Disable the interrupt to be reported in
drivers/net/e1000e/hw.h +3 -0
@@ -357,6 +357,8 @@ enum e1e_registers {#define E1000_DEV_ID_ICH10_R_BM_LM 0x10CC#define E1000_DEV_ID_ICH10_R_BM_LF 0x10CD#define E1000_DEV_ID_ICH10_R_BM_V 0x10CE +#define E1000_DEV_ID_ICH10_D_BM_LM 0x10DE +#define E1000_DEV_ID_ICH10_D_BM_LF 0x10DF#define E1000_FUNC_1 1
@@ -367,6 +369,7 @@ enum e1000_mac_type { e1000_80003es2lan, e1000_ich8lan, e1000_ich9lan, + e1000_ich10lan, }; enum e1000_media_type {
drivers/net/e1000e/ich8lan.c +144 -10
234 lines not on this page · raw message
drivers/net/e1000e/netdev.c +25 -0
@@ -58,6 +58,7 @@ static const struct e1000_info *e1000_info_tbl[] = { [board_80003es2lan] = &e1000_es2_info, [board_ich8lan] = &e1000_ich8_info, [board_ich9lan] = &e1000_ich9_info, + [board_ich10lan] = &e1000_ich10_info, };#ifdef DEBUG
@@ -3201,6 +3202,27 @@ static void e1000_watchdog_task(struct work_struct *work) &adapter->link_duplex);e1000_print_link_info (adapter);/* +* On supported PHYs, check for duplex mismatch only +* if link has autonegotiated at 10/100 half +*/ +if ((hw->phy.type == e1000_phy_igp_3 || + hw->phy.type == e1000_phy_bm) && + (hw->mac.autoneg == true) && + (adapter->link_speed ==SPEED_10 || + adapter->link_speed ==SPEED_100 ) && + (adapter->link_duplex ==HALF_DUPLEX )) { +u16 autoneg_exp; + +e1e_rphy (hw,PHY_AUTONEG_EXP , &autoneg_exp); + +if (!(autoneg_exp &NWAY_ER_LP_NWAY_CAPS )) +e_info ("Autonegotiated half duplex but" +" link partner cannot autoneg. " +" Try forcing full duplex if " +"link gets many collisions.\n" ); + } + +/* * tweak tx_queue_len according to speed/duplex * and adjust the timeout factor */
@@ -4776,6 +4798,9 @@ static struct pci_device_id e1000_pci_tbl[] = { { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_R_BM_LF), board_ich9lan }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_R_BM_V), board_ich9lan }, + { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LM), board_ich10lan }, + { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LF), board_ich10lan }, + { } /* terminate list */ };MODULE_DEVICE_TABLE (pci, e1000_pci_tbl);
drivers/net/e1000e/phy.c +85 -0
91 lines not on this page · raw message
PATCH 3/3 e1000e: add support for new 82574L part
In reply to Jeff KirsherFrom: Bruce Allan <[email protected]>
This new part has the same feature set as previous parts with the addition of MSX-X support.
---
drivers/net/e1000e/82571.c | 153 +++++++++++- drivers/net/e1000e/defines.h | 13 + drivers/net/e1000e/e1000.h | 28 ++ drivers/net/e1000e/es2lan.c | 2 drivers/net/e1000e/ethtool.c | 38 ++- drivers/net/e1000e/hw.h | 11 + drivers/net/e1000e/ich8lan.c | 18 + drivers/net/e1000e/lib.c | 7 - drivers/net/e1000e/netdev.c | 531 ++++++++++++++++++++++++++++++++++++++++-- drivers/net/e1000e/param.c | 27 ++ drivers/net/e1000e/phy.c | 109 +++++++++ 11 files changed, 880 insertions(+), 57 deletions(-)
drivers/net/e1000e/82571.c +140 -13
@@ -38,6 +38,7 @@* 82573V Gigabit Ethernet Controller (Copper) * 82573E Gigabit Ethernet Controller (Copper) * 82573L Gigabit Ethernet Controller +* 82574L Gigabit Network Connection */ #include <linux/netdevice.h>
@@ -54,6 +55,8 @@#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000 +#define E1000_NVM_INIT_CTRL2_MNGM 0x6000/* Manageability Operation Mode mask */ +static s32 e1000_get_phy_id_82571 (struct e1000_hw *hw);static s32 e1000_setup_copper_link_82571 (struct e1000_hw *hw);static s32 e1000_setup_fiber_serdes_link_82571 (struct e1000_hw *hw);
@@ -63,6 +66,8 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw);static void e1000_initialize_hw_bits_82571 (struct e1000_hw *hw);static s32 e1000_setup_link_82571 (struct e1000_hw *hw);static void e1000_clear_hw_cntrs_82571 (struct e1000_hw *hw); +static bool e1000_check_mng_mode_82574 (struct e1000_hw *hw); +static s32 e1000_led_on_82574 (struct e1000_hw *hw);/** * e1000_init_phy_params_82571 - Init PHY func ptrs.
@@ -92,6 +97,9 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)case e1000_82573: phy->type = e1000_phy_m88;break ; +case e1000_82574: + phy->type = e1000_phy_bm; +break ;default :return -E1000_ERR_PHY ;break ;
@@ -111,6 +119,10 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)if (phy->id !=M88E1111_I_PHY_ID )return -E1000_ERR_PHY ;break ; +case e1000_82574: +if (phy->id !=BME1000_E_PHY_ID_R2 ) +return -E1000_ERR_PHY ; +break ;default :return -E1000_ERR_PHY ;break ;
@@ -150,6 +162,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)switch (hw->mac.type) {case e1000_82573: +case e1000_82574:if (((eecd >>15 ) &0x3 ) ==0x3 ) { nvm->type = e1000_nvm_flash_hw; nvm->word_size =2048 ;
@@ -245,6 +258,17 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)break ; } +switch (hw->mac.type) { +case e1000_82574: + func->check_mng_mode = e1000_check_mng_mode_82574; + func->led_on = e1000_led_on_82574; +break ; +default : + func->check_mng_mode = e1000e_check_mng_mode_generic; + func->led_on = e1000e_led_on_generic; +break ; + } +return 0 ; }
@@ -330,6 +354,8 @@ static s32 e1000_get_variants_82571(struct e1000_adapter *adapter)static s32 e1000_get_phy_id_82571 (struct e1000_hw *hw) {struct e1000_phy_info *phy = &hw->phy; +s32 ret_val; +u16 phy_id =0 ;switch (hw->mac.type) {case e1000_82571:
@@ -345,6 +371,20 @@ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)case e1000_82573:return e1000e_get_phy_id (hw);break ; +case e1000_82574: + ret_val =e1e_rphy (hw,PHY_ID1 , &phy_id); +if (ret_val) +return ret_val; + + phy->id = (u32)(phy_id <<16 ); +udelay (20 ); + ret_val =e1e_rphy (hw,PHY_ID2 , &phy_id); +if (ret_val) +return ret_val; + + phy->id |= (u32)(phy_id); + phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK ); +break ;default :return -E1000_ERR_PHY ;break ;
@@ -421,7 +461,7 @@ static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw)if (ret_val)return ret_val; -if (hw->mac.type != e1000_82573) +if (hw->mac.type != e1000_82573 && hw->mac.type != e1000_82574) ret_val =e1000e_acquire_nvm (hw);if (ret_val)
@@ -461,6 +501,7 @@ static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words,switch (hw->mac.type) {case e1000_82573: +case e1000_82574: ret_val =e1000_write_nvm_eewr_82571 (hw, offset, words, data);break ;case e1000_82571:
@@ -735,7 +776,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)* Must acquire the MDIO ownership before MAC reset. * Ownership defaults to firmware after a reset. */ -if (hw->mac.type == e1000_82573) { +if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { extcnf_ctrl =er32 (EXTCNF_CTRL ); extcnf_ctrl |=E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP ;
@@ -776,7 +817,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)* Need to wait for Phy configuration completion before accessing * NVM and Phy. */ -if (hw->mac.type == e1000_82573) +if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574)msleep (25 );/* Clear any pending interrupt events. */
@@ -843,7 +884,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)ew32 (TXDCTL (0 ), reg_data);/* ...for both queues. */ -if (mac->type != e1000_82573) { +if (mac->type != e1000_82573 && mac->type != e1000_82574) { reg_data =er32 (TXDCTL (1 )); reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH ) | E1000_TXDCTL_FULL_TX_DESC_WB |
@@ -918,19 +959,28 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) }/* Device Control */ -if (hw->mac.type == e1000_82573) { +if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { reg =er32 (CTRL ); reg &= ~(1 <<29 );ew32 (CTRL , reg); }/* Extended Device Control */ -if (hw->mac.type == e1000_82573) { +if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { reg =er32 (CTRL_EXT ); reg &= ~(1 <<23 ); reg |= (1 <<22 );ew32 (CTRL_EXT , reg); } + +/* PCI-Ex Control Register */ +if (hw->mac.type == e1000_82574) { + reg =er32 (GCR ); + reg |= (1 <<22 ); +ew32 (GCR , reg); + } + +return ; }/**
@@ -947,7 +997,7 @@ void e1000e_clear_vfta(struct e1000_hw *hw)u32 vfta_offset =0 ;u32 vfta_bit_in_reg =0 ; -if (hw->mac.type == e1000_82573) { +if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) {if (hw->mng_cookie.vlan_id !=0 ) {/* * The VFTA is a 4096b bit-field, each identifying
@@ -976,6 +1026,48 @@ void e1000e_clear_vfta(struct e1000_hw *hw) }/** +* e1000_check_mng_mode_82574 - Check manageability is enabled +* @hw: pointer to the HW structure +* +* Reads the NVM Initialization Control Word 2 and returns true +* (>0) if any manageability is enabled, else false (0). +**/ +static bool e1000_check_mng_mode_82574 (struct e1000_hw *hw) +{ +u16 data; + +e1000_read_nvm (hw,NVM_INIT_CONTROL2_REG ,1 , &data); +return (data &E1000_NVM_INIT_CTRL2_MNGM ) !=0 ; +} + +/** +* e1000_led_on_82574 - Turn LED on +* @hw: pointer to the HW structure +* +* Turn LED on. +**/ +static s32 e1000_led_on_82574 (struct e1000_hw *hw) +{ +u32 ctrl; +u32 i; + + ctrl = hw->mac.ledctl_mode2; +if (!(E1000_STATUS_LU &er32 (STATUS ))) { +/* +* If no link, then turn LED on by setting the invert bit +* for each LED that's "on" (0x0E) in ledctl_mode2. +*/ +for (i =0 ; i <4 ; i++) +if (((hw->mac.ledctl_mode2 >> (i *8 )) &0xFF ) == +E1000_LEDCTL_MODE_LED_ON ) + ctrl |= (E1000_LEDCTL_LED0_IVRT << (i *8 )); + } +ew32 (LEDCTL , ctrl); + +return 0 ; +} + +/** * e1000_update_mc_addr_list_82571 - Update Multicast addresses * @hw: pointer to the HW structure * @mc_addr_list: array of multicast addresses to program
@@ -1018,7 +1110,8 @@ static s32 e1000_setup_link_82571(struct e1000_hw *hw)* the default flow control setting, so we explicitly * set it to full. */ -if (hw->mac.type == e1000_82573) +if ((hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) && + hw->fc.type == e1000_fc_default) hw->fc.type = e1000_fc_full;return e1000e_setup_link (hw);
@@ -1045,6 +1138,7 @@ static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw)switch (hw->phy.type) {case e1000_phy_m88: +case e1000_phy_bm: ret_val =e1000e_copper_link_setup_m88 (hw);break ;case e1000_phy_igp_2:
@@ -1114,11 +1208,10 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data)return ret_val; } -if (hw->mac.type == e1000_82573 && +if ((hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) && *data ==ID_LED_RESERVED_F746 ) *data =ID_LED_DEFAULT_82573 ; -else if (*data ==ID_LED_RESERVED_0000 || - *data ==ID_LED_RESERVED_FFFF ) +else if (*data ==ID_LED_RESERVED_0000 || *data ==ID_LED_RESERVED_FFFF ) *data =ID_LED_DEFAULT ;return 0 ;
@@ -1265,13 +1358,13 @@ static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw) }static struct e1000_mac_operations e82571_mac_ops = { - .mng_mode_enab =E1000_MNG_IAMT_MODE <<E1000_FWSM_MODE_SHIFT , +/* .check_mng_mode: mac type dependent */ /* .check_for_link: media type dependent */ .cleanup_led = e1000e_cleanup_led_generic, .clear_hw_cntrs = e1000_clear_hw_cntrs_82571, .get_bus_info = e1000e_get_bus_info_pcie,/* .get_link_up_info: media type dependent */ - .led_on = e1000e_led_on_generic, +/* .led_on: mac type dependent */ .led_off = e1000e_led_off_generic, .update_mc_addr_list = e1000_update_mc_addr_list_82571, .reset_hw = e1000_reset_hw_82571,
@@ -1312,6 +1405,22 @@ static struct e1000_phy_operations e82_phy_ops_m88 = { .write_phy_reg = e1000e_write_phy_reg_m88, }; +static struct e1000_phy_operations e82_phy_ops_bm = { + .acquire_phy = e1000_get_hw_semaphore_82571, + .check_reset_block = e1000e_check_reset_block_generic, + .commit_phy = e1000e_phy_sw_reset, + .force_speed_duplex = e1000e_phy_force_speed_duplex_m88, + .get_cfg_done = e1000e_get_cfg_done, + .get_cable_length = e1000e_get_cable_length_m88, + .get_phy_info = e1000e_get_phy_info_m88, + .read_phy_reg = e1000e_read_phy_reg_bm2, + .release_phy = e1000_put_hw_semaphore_82571, + .reset_phy = e1000e_phy_hw_reset_generic, + .set_d0_lplu_state = e1000_set_d0_lplu_state_82571, + .set_d3_lplu_state = e1000e_set_d3_lplu_state, + .write_phy_reg = e1000e_write_phy_reg_bm2, +}; +static struct e1000_nvm_operations e82571_nvm_ops = { .acquire_nvm = e1000_acquire_nvm_82571, .read_nvm = e1000e_read_nvm_eerd,
@@ -1375,3 +1484,21 @@ struct e1000_info e1000_82573_info = { .nvm_ops = &e82571_nvm_ops, }; +struct e1000_info e1000_82574_info = { + .mac = e1000_82574, + .flags =FLAG_HAS_HW_VLAN_FILTER + |FLAG_HAS_MSIX + |FLAG_HAS_JUMBO_FRAMES + |FLAG_HAS_WOL + |FLAG_APME_IN_CTRL3 + |FLAG_RX_CSUM_ENABLED + |FLAG_HAS_SMART_POWER_DOWN + |FLAG_HAS_AMT + |FLAG_HAS_CTRLEXT_ON_LOAD , + .pba =20 , + .get_variants = e1000_get_variants_82571, + .mac_ops = &e82571_mac_ops, + .phy_ops = &e82_phy_ops_bm, + .nvm_ops = &e82571_nvm_ops, +}; +
drivers/net/e1000e/defines.h +13 -0
@@ -71,9 +71,11 @@#define E1000_CTRL_EXT_RO_DIS 0x00020000/* Relaxed Ordering disable */ #define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000#define E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES 0x00C00000 +#define E1000_CTRL_EXT_EIAME 0x01000000#define E1000_CTRL_EXT_DRV_LOAD 0x10000000/* Driver loaded bit for FW */ #define E1000_CTRL_EXT_IAME 0x08000000/* Interrupt acknowledge Auto-mask */ #define E1000_CTRL_EXT_INT_TIMER_CLR 0x20000000/* Clear Interrupt timers after IMS clear */ +#define E1000_CTRL_EXT_PBA_CLR 0x80000000/* PBA Clear */ /* Receive Descriptor bit definitions */ #define E1000_RXD_STAT_DD 0x01/* Descriptor Done */
@@ -299,6 +301,7 @@#define E1000_RXCSUM_IPPCSE 0x00001000/* IP payload checksum enable */ /* Header split receive */ +#define E1000_RFCTL_ACK_DIS 0x00001000#define E1000_RFCTL_EXTEN 0x00008000#define E1000_RFCTL_IPV6_EX_DIS 0x00010000#define E1000_RFCTL_NEW_IPV6_EXT_DIS 0x00020000
@@ -363,6 +366,11 @@#define E1000_ICR_RXDMT0 0x00000010/* Rx desc min. threshold (0) */ #define E1000_ICR_RXT0 0x00000080/* Rx timer intr (ring 0) */ #define E1000_ICR_INT_ASSERTED 0x80000000/* If this bit asserted, the driver should claim the interrupt */ +#define E1000_ICR_RXQ0 0x00100000/* Rx Queue 0 Interrupt */ +#define E1000_ICR_RXQ1 0x00200000/* Rx Queue 1 Interrupt */ +#define E1000_ICR_TXQ0 0x00400000/* Tx Queue 0 Interrupt */ +#define E1000_ICR_TXQ1 0x00800000/* Tx Queue 1 Interrupt */ +#define E1000_ICR_OTHER 0x01000000/* Other Interrupts */ /* * This defines the bits that are set in the Interrupt Mask
@@ -386,6 +394,11 @@#define E1000_IMS_RXSEQ E1000_ICR_RXSEQ/* Rx sequence error */ #define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0/* Rx desc min. threshold */ #define E1000_IMS_RXT0 E1000_ICR_RXT0/* Rx timer intr */ +#define E1000_IMS_RXQ0 E1000_ICR_RXQ0/* Rx Queue 0 Interrupt */ +#define E1000_IMS_RXQ1 E1000_ICR_RXQ1/* Rx Queue 1 Interrupt */ +#define E1000_IMS_TXQ0 E1000_ICR_TXQ0/* Tx Queue 0 Interrupt */ +#define E1000_IMS_TXQ1 E1000_ICR_TXQ1/* Tx Queue 1 Interrupt */ +#define E1000_IMS_OTHER E1000_ICR_OTHER/* Other Interrupts */ /* Interrupt Cause Set */ #define E1000_ICS_LSC E1000_ICR_LSC/* Link Status Change */
drivers/net/e1000e/e1000.h +27 -1
@@ -62,6 +62,11 @@ struct e1000_info; e_printk(KERN_NOTICE, adapter, format, ## arg) +/* Interrupt modes, as used by the IntMode paramter */ +#define E1000E_INT_MODE_LEGACY 0 +#define E1000E_INT_MODE_MSI 1 +#define E1000E_INT_MODE_MSIX 2 + /* Tx/Rx descriptor defines */ #define E1000_DEFAULT_TXD 256 #define E1000_MAX_TXD 4096
@@ -95,6 +100,7 @@ enum e1000_boards { board_82571, board_82572, board_82573, + board_82574, board_80003es2lan, board_ich8lan, board_ich9lan,
@@ -147,6 +153,12 @@ struct e1000_ring {/* array of buffer information structs */ struct e1000_buffer *buffer_info; +char name[IFNAMSIZ +5 ]; +u32 ims_val; +u32 itr_val; +u16 itr_register; +int set_itr; +struct sk_buff *rx_skb_top;struct e1000_queue_stats stats;
@@ -275,6 +287,9 @@ struct e1000_adapter {u32 test_icr;u32 msg_enable; +struct msix_entry *msix_entries; +int int_mode; +u32 eiac_mask;u32 eeprom_wol;u32 wol;
@@ -307,6 +322,7 @@ struct e1000_info {#define FLAG_HAS_SWSM_ON_LOAD (1 << 6)#define FLAG_HAS_JUMBO_FRAMES (1 << 7)#define FLAG_IS_ICH (1 << 9) +#define FLAG_HAS_MSIX (1 << 10)#define FLAG_HAS_SMART_POWER_DOWN (1 << 11)#define FLAG_IS_QUAD_PORT_A (1 << 12)#define FLAG_IS_QUAD_PORT (1 << 13)
@@ -365,6 +381,8 @@ extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter);extern void e1000e_free_rx_resources (struct e1000_adapter *adapter);extern void e1000e_free_tx_resources (struct e1000_adapter *adapter);extern void e1000e_update_stats (struct e1000_adapter *adapter); +extern void e1000e_set_interrupt_capability (struct e1000_adapter *adapter); +extern void e1000e_reset_interrupt_capability (struct e1000_adapter *adapter);extern unsigned int copybreak;
@@ -373,6 +391,7 @@ extern char *e1000e_get_hw_dev_name(struct e1000_hw *hw);extern struct e1000_info e1000_82571_info;extern struct e1000_info e1000_82572_info;extern struct e1000_info e1000_82573_info; +extern struct e1000_info e1000_82574_info;extern struct e1000_info e1000_ich8_info;extern struct e1000_info e1000_ich9_info;extern struct e1000_info e1000_ich10_info;
@@ -453,6 +472,8 @@ extern enum e1000_phy_type e1000e_get_phy_type_from_id(u32 phy_id);extern s32 e1000e_determine_phy_address (struct e1000_hw *hw);extern s32 e1000e_write_phy_reg_bm (struct e1000_hw *hw,u32 offset,u16 data);extern s32 e1000e_read_phy_reg_bm (struct e1000_hw *hw,u32 offset,u16 *data); +extern s32 e1000e_read_phy_reg_bm2 (struct e1000_hw *hw,u32 offset,u16 *data); +extern s32 e1000e_write_phy_reg_bm2 (struct e1000_hw *hw,u32 offset,u16 data);extern void e1000e_phy_force_speed_duplex_setup (struct e1000_hw *hw,u16 *phy_ctrl);extern s32 e1000e_write_kmrn_reg (struct e1000_hw *hw,u32 offset,u16 data);extern s32 e1000e_read_kmrn_reg (struct e1000_hw *hw,u32 offset,u16 *data);
@@ -523,7 +544,12 @@ static inline s32 e1000_get_phy_info(struct e1000_hw *hw)return hw->phy.ops.get_phy_info (hw); } -extern bool e1000e_check_mng_mode (struct e1000_hw *hw); +static inline s32 e1000e_check_mng_mode (struct e1000_hw *hw) +{ +return hw->mac.ops.check_mng_mode (hw); +} + +extern bool e1000e_check_mng_mode_generic (struct e1000_hw *hw);extern bool e1000e_enable_tx_pkt_filtering (struct e1000_hw *hw);extern s32 e1000e_mng_write_dhcp_info (struct e1000_hw *hw,u8 *buffer,u16 length);
drivers/net/e1000e/es2lan.c +1 -1
@@ -1247,7 +1247,7 @@ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw) }static struct e1000_mac_operations es2_mac_ops = { - .mng_mode_enab =E1000_MNG_IAMT_MODE <<E1000_FWSM_MODE_SHIFT , + .check_mng_mode = e1000e_check_mng_mode_generic,/* check_for_link dependent on media type */ .cleanup_led = e1000e_cleanup_led_generic, .clear_hw_cntrs = e1000_clear_hw_cntrs_80003es2lan,
drivers/net/e1000e/ethtool.c +29 -9
@@ -568,6 +568,7 @@ static int e1000_set_eeprom(struct net_device *netdev,* and flush shadow RAM for 82573 controllers */ if ((ret_val ==0 ) && ((first_word <=NVM_CHECKSUM_REG ) || + (hw->mac.type == e1000_82574) || (hw->mac.type == e1000_82573)))e1000e_update_nvm_checksum (hw);
@@ -779,6 +780,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) toggle =0x7FFFF3FF ;break ;case e1000_82573: +case e1000_82574:case e1000_ich8lan:case e1000_ich9lan:case e1000_ich10lan:
@@ -887,10 +889,18 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)u32 shared_int =1 ;u32 irq = adapter->pdev->irq;int i; +int ret_val =0 ; +int int_mode =E1000E_INT_MODE_LEGACY ; *data =0 ; -/* NOTE: we don't test MSI interrupts here, yet */ +/* NOTE: we don't test MSI/MSI-X interrupts here, yet */ +if (adapter->int_mode ==E1000E_INT_MODE_MSIX ) { + int_mode = adapter->int_mode; +e1000e_reset_interrupt_capability (adapter); + adapter->int_mode =E1000E_INT_MODE_LEGACY ; +e1000e_set_interrupt_capability (adapter); + }/* Hook up test interrupt handler just for this test */ if (!request_irq (irq, &e1000_test_intr,IRQF_PROBE_SHARED , netdev->name, netdev)) {
@@ -898,7 +908,8 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) }else if (request_irq (irq, &e1000_test_intr,IRQF_SHARED , netdev->name, netdev)) { *data =1 ; -return -1 ; + ret_val =-1 ; + goto out; }e_info ("testing %s interrupt\n" , (shared_int ?"shared" :"unshared" ));
@@ -988,7 +999,14 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)/* Unhook test interrupt handler */ free_irq (irq, netdev); -return *data; +out: +if (int_mode ==E1000E_INT_MODE_MSIX ) { +e1000e_reset_interrupt_capability (adapter); + adapter->int_mode = int_mode; +e1000e_set_interrupt_capability (adapter); + } + +return ret_val; }static void e1000_free_desc_rings (struct e1000_adapter *adapter)
@@ -1769,11 +1787,13 @@ static void e1000_led_blink_callback(unsigned long data)static int e1000_phys_id (struct net_device *netdev,u32 data) {struct e1000_adapter *adapter =netdev_priv (netdev); +struct e1000_hw *hw = &adapter->hw;if (!data) data =INT_MAX ; -if (adapter->hw.phy.type == e1000_phy_ife) { +if ((hw->phy.type == e1000_phy_ife) || + (hw->mac.type == e1000_82574)) {if (!adapter->blink_timer.function) {init_timer (&adapter->blink_timer); adapter->blink_timer.function =
@@ -1783,16 +1803,16 @@ static int e1000_phys_id(struct net_device *netdev, u32 data)mod_timer (&adapter->blink_timer, jiffies);msleep_interruptible (data *1000 );del_timer_sync (&adapter->blink_timer); -e1e_wphy (&adapter->hw, -IFE_PHY_SPECIAL_CONTROL_LED ,0 ); +if (hw->phy.type == e1000_phy_ife) +e1e_wphy (hw,IFE_PHY_SPECIAL_CONTROL_LED ,0 ); }else { -e1000e_blink_led (&adapter->hw); +e1000e_blink_led (hw);msleep_interruptible (data *1000 ); } - adapter->hw.mac.ops.led_off (&adapter->hw); + hw->mac.ops.led_off (hw);clear_bit (E1000_LED_ON , &adapter->led_status); - adapter->hw.mac.ops.cleanup_led (&adapter->hw); + hw->mac.ops.cleanup_led (hw);return 0 ; }
drivers/net/e1000e/hw.h +9 -2
@@ -65,7 +65,11 @@ enum e1e_registers {E1000_ICS =0x000C8 ,/* Interrupt Cause Set - WO */ E1000_IMS =0x000D0 ,/* Interrupt Mask Set - RW */ E1000_IMC =0x000D8 ,/* Interrupt Mask Clear - WO */ +E1000_EIAC_82574 =0x000DC ,/* Ext. Interrupt Auto Clear - RW */ E1000_IAM =0x000E0 ,/* Interrupt Acknowledge Auto Mask */ +E1000_IVAR =0x000E4 ,/* Interrupt Vector Allocation - RW */ +E1000_EITR_82574_BASE =0x000E8 ,/* Interrupt Throttling - RW */ +#define E1000_EITR_82574(_n) (E1000_EITR_82574_BASE + (_n << 2))E1000_RCTL =0x00100 ,/* Rx Control - RW */ E1000_FCTTV =0x00170 ,/* Flow Control Transmit Timer Value - RW */ E1000_TXCW = 0x00178, /* Tx Configuration Word - RW */
@@ -332,6 +336,7 @@ enum e1e_registers {#define E1000_DEV_ID_82573E 0x108B#define E1000_DEV_ID_82573E_IAMT 0x108C#define E1000_DEV_ID_82573L 0x109A +#define E1000_DEV_ID_82574L 0x10D3#define E1000_DEV_ID_80003ES2LAN_COPPER_DPT 0x1096#define E1000_DEV_ID_80003ES2LAN_SERDES_DPT 0x1098
@@ -360,12 +365,15 @@ enum e1e_registers {#define E1000_DEV_ID_ICH10_D_BM_LM 0x10DE#define E1000_DEV_ID_ICH10_D_BM_LF 0x10DF +#define E1000_REVISION_4 4 +#define E1000_FUNC_1 1enum e1000_mac_type { e1000_82571, e1000_82572, e1000_82573, + e1000_82574, e1000_80003es2lan, e1000_ich8lan, e1000_ich9lan,
@@ -700,8 +708,7 @@ struct e1000_host_mng_command_info {/* Function pointers and static data for the MAC. */ struct e1000_mac_operations { -u32 mng_mode_enab; - +bool (*check_mng_mode)(struct e1000_hw *);s32 (*check_for_link)(struct e1000_hw *);s32 (*cleanup_led)(struct e1000_hw *);void (*clear_hw_cntrs)(struct e1000_hw *);
drivers/net/e1000e/ich8lan.c +17 -1
@@ -422,6 +422,22 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw) }/** +* e1000_check_mng_mode_ich8lan - Checks management mode +* @hw: pointer to the HW structure +* +* This checks if the adapter has manageability enabled. +* This is a function pointer entry point only called by read/write +* routines for the PHY and NVM parts. +**/ +static bool e1000_check_mng_mode_ich8lan (struct e1000_hw *hw) +{ +u32 fwsm =er32 (FWSM ); + +return (fwsm &E1000_FWSM_MODE_MASK ) == + (E1000_ICH_MNG_IAMT_MODE <<E1000_FWSM_MODE_SHIFT ); +} + +/** * e1000_check_reset_block_ich8lan - Check if PHY reset is blocked * @hw: pointer to the HW structure *
@@ -2400,7 +2416,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw) }static struct e1000_mac_operations ich8_mac_ops = { - .mng_mode_enab =E1000_ICH_MNG_IAMT_MODE <<E1000_FWSM_MODE_SHIFT , + .check_mng_mode = e1000_check_mng_mode_ich8lan, .check_for_link = e1000e_check_for_copper_link, .cleanup_led = e1000_cleanup_led_ich8lan, .clear_hw_cntrs = e1000_clear_hw_cntrs_ich8lan,
drivers/net/e1000e/lib.c +4 -3
@@ -2222,17 +2222,18 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw) }/** -* e1000e_check_mng_mode - check management mode +* e1000e_check_mng_mode_generic - check management mode * @hw: pointer to the HW structure * * Reads the firmware semaphore register and returns true (>0) if * manageability is enabled, else false (0). **/ -bool e1000e_check_mng_mode (struct e1000_hw *hw) +bool e1000e_check_mng_mode_generic (struct e1000_hw *hw) {u32 fwsm =er32 (FWSM ); -return (fwsm &E1000_FWSM_MODE_MASK ) == hw->mac.ops.mng_mode_enab; +return (fwsm &E1000_FWSM_MODE_MASK ) == + (E1000_MNG_IAMT_MODE <<E1000_FWSM_MODE_SHIFT ); }/**
drivers/net/e1000e/netdev.c +505 -26
708 lines not on this page · raw message
drivers/net/e1000e/param.c +27 -0
@@ -114,6 +114,15 @@ E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");#define DEFAULT_ITR 3#define MAX_ITR 100000#define MIN_ITR 100 +/* IntMode (Interrupt Mode) +* +* Valid Range: 0 - 2 +* +* Default Value: 2 (MSI-X) +*/ +E1000_PARAM (IntMode,"Interrupt Mode" ); +#define MAX_INTMODE 2 +#define MIN_INTMODE 0/* * Enable Smart Power Down of the PHY
@@ -352,6 +361,24 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) adapter->itr =20000 ; } } + {/* Interrupt Mode */ +struct e1000_option opt = { + .type = range_option, + .name ="Interrupt Mode" , + .err ="defaulting to 2 (MSI-X)" , + .def =E1000E_INT_MODE_MSIX , + .arg = { .r = { .min =MIN_INTMODE , + .max =MAX_INTMODE } } + }; + +if (num_IntMode > bd) { +unsigned int int_mode = IntMode[bd]; +e1000_validate_option (&int_mode, &opt, adapter); + adapter->int_mode = int_mode; + }else { + adapter->int_mode = opt.def; + } + } {/* Smart Power Down */ const struct e1000_option opt = { .type = enable_option,
drivers/net/e1000e/phy.c +108 -1
127 lines not on this page · raw message
PATCH 1/3 e1000e: add support for the 82567LM-4 device
From: Bruce Allan <[email protected]>
Enable PCI device ID for a new combination of MAC and PHY already supported in the driver.
---
drivers/net/e1000e/hw.h | 1 + drivers/net/e1000e/ich8lan.c | 1 + drivers/net/e1000e/netdev.c | 1 + 3 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/e1000e/hw.h +1 -0
@@ -346,6 +346,7 @@ enum e1e_registers {#define E1000_DEV_ID_ICH8_IFE_G 0x10C5#define E1000_DEV_ID_ICH8_IGP_M 0x104D#define E1000_DEV_ID_ICH9_IGP_AMT 0x10BD +#define E1000_DEV_ID_ICH9_BM 0x10E5#define E1000_DEV_ID_ICH9_IGP_M_AMT 0x10F5#define E1000_DEV_ID_ICH9_IGP_M 0x10BF#define E1000_DEV_ID_ICH9_IGP_M_V 0x10CB
drivers/net/e1000e/ich8lan.c +1 -0
@@ -44,6 +44,7 @@* 82567LF-2 Gigabit Network Connection * 82567V-2 Gigabit Network Connection * 82562GT-3 10/100 Network Connection +* 82567LM-4 Gigabit Network Connection */ #include <linux/netdevice.h>
drivers/net/e1000e/netdev.c +1 -0
@@ -4767,6 +4767,7 @@ static struct pci_device_id e1000_pci_tbl[] = { { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE_GT), board_ich9lan }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_AMT), board_ich9lan }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_C), board_ich9lan }, + { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_BM), board_ich9lan }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_M), board_ich9lan }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_M_AMT), board_ich9lan }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_M_V), board_ich9lan },
Re: [NET-NEXT PATCH 3/3] e1000e: add support for new 82574L part
In reply to Jeff KirsherHi Jeff,
also in this patch, you have unresolved merge conflicts. Please see my other email on hints on resolving this.
Quoted 1 line · Jeff Kirsher
drivers/net/e1000e/netdev.c
Best Regards
Ingo Oeser