Commit bd2371eb authored by Jeff Garzik's avatar Jeff Garzik

e1000: For sanity, reformat e1000_set_mac_type(), struct e1000_hw[_stats]

Makes future changes a bit more readable.
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 2b65326e
...@@ -308,141 +308,141 @@ e1000_phy_init_script(struct e1000_hw *hw) ...@@ -308,141 +308,141 @@ e1000_phy_init_script(struct e1000_hw *hw)
int32_t int32_t
e1000_set_mac_type(struct e1000_hw *hw) e1000_set_mac_type(struct e1000_hw *hw)
{ {
DEBUGFUNC("e1000_set_mac_type"); DEBUGFUNC("e1000_set_mac_type");
switch (hw->device_id) { switch (hw->device_id) {
case E1000_DEV_ID_82542: case E1000_DEV_ID_82542:
switch (hw->revision_id) { switch (hw->revision_id) {
case E1000_82542_2_0_REV_ID: case E1000_82542_2_0_REV_ID:
hw->mac_type = e1000_82542_rev2_0; hw->mac_type = e1000_82542_rev2_0;
break; break;
case E1000_82542_2_1_REV_ID: case E1000_82542_2_1_REV_ID:
hw->mac_type = e1000_82542_rev2_1; hw->mac_type = e1000_82542_rev2_1;
break; break;
default: default:
/* Invalid 82542 revision ID */ /* Invalid 82542 revision ID */
return -E1000_ERR_MAC_TYPE; return -E1000_ERR_MAC_TYPE;
} }
break; break;
case E1000_DEV_ID_82543GC_FIBER: case E1000_DEV_ID_82543GC_FIBER:
case E1000_DEV_ID_82543GC_COPPER: case E1000_DEV_ID_82543GC_COPPER:
hw->mac_type = e1000_82543; hw->mac_type = e1000_82543;
break; break;
case E1000_DEV_ID_82544EI_COPPER: case E1000_DEV_ID_82544EI_COPPER:
case E1000_DEV_ID_82544EI_FIBER: case E1000_DEV_ID_82544EI_FIBER:
case E1000_DEV_ID_82544GC_COPPER: case E1000_DEV_ID_82544GC_COPPER:
case E1000_DEV_ID_82544GC_LOM: case E1000_DEV_ID_82544GC_LOM:
hw->mac_type = e1000_82544; hw->mac_type = e1000_82544;
break; break;
case E1000_DEV_ID_82540EM: case E1000_DEV_ID_82540EM:
case E1000_DEV_ID_82540EM_LOM: case E1000_DEV_ID_82540EM_LOM:
case E1000_DEV_ID_82540EP: case E1000_DEV_ID_82540EP:
case E1000_DEV_ID_82540EP_LOM: case E1000_DEV_ID_82540EP_LOM:
case E1000_DEV_ID_82540EP_LP: case E1000_DEV_ID_82540EP_LP:
hw->mac_type = e1000_82540; hw->mac_type = e1000_82540;
break; break;
case E1000_DEV_ID_82545EM_COPPER: case E1000_DEV_ID_82545EM_COPPER:
case E1000_DEV_ID_82545EM_FIBER: case E1000_DEV_ID_82545EM_FIBER:
hw->mac_type = e1000_82545; hw->mac_type = e1000_82545;
break; break;
case E1000_DEV_ID_82545GM_COPPER: case E1000_DEV_ID_82545GM_COPPER:
case E1000_DEV_ID_82545GM_FIBER: case E1000_DEV_ID_82545GM_FIBER:
case E1000_DEV_ID_82545GM_SERDES: case E1000_DEV_ID_82545GM_SERDES:
hw->mac_type = e1000_82545_rev_3; hw->mac_type = e1000_82545_rev_3;
break; break;
case E1000_DEV_ID_82546EB_COPPER: case E1000_DEV_ID_82546EB_COPPER:
case E1000_DEV_ID_82546EB_FIBER: case E1000_DEV_ID_82546EB_FIBER:
case E1000_DEV_ID_82546EB_QUAD_COPPER: case E1000_DEV_ID_82546EB_QUAD_COPPER:
hw->mac_type = e1000_82546; hw->mac_type = e1000_82546;
break; break;
case E1000_DEV_ID_82546GB_COPPER: case E1000_DEV_ID_82546GB_COPPER:
case E1000_DEV_ID_82546GB_FIBER: case E1000_DEV_ID_82546GB_FIBER:
case E1000_DEV_ID_82546GB_SERDES: case E1000_DEV_ID_82546GB_SERDES:
case E1000_DEV_ID_82546GB_PCIE: case E1000_DEV_ID_82546GB_PCIE:
case E1000_DEV_ID_82546GB_QUAD_COPPER: case E1000_DEV_ID_82546GB_QUAD_COPPER:
case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3: case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
hw->mac_type = e1000_82546_rev_3; hw->mac_type = e1000_82546_rev_3;
break; break;
case E1000_DEV_ID_82541EI: case E1000_DEV_ID_82541EI:
case E1000_DEV_ID_82541EI_MOBILE: case E1000_DEV_ID_82541EI_MOBILE:
case E1000_DEV_ID_82541ER_LOM: case E1000_DEV_ID_82541ER_LOM:
hw->mac_type = e1000_82541; hw->mac_type = e1000_82541;
break; break;
case E1000_DEV_ID_82541ER: case E1000_DEV_ID_82541ER:
case E1000_DEV_ID_82541GI: case E1000_DEV_ID_82541GI:
case E1000_DEV_ID_82541GI_LF: case E1000_DEV_ID_82541GI_LF:
case E1000_DEV_ID_82541GI_MOBILE: case E1000_DEV_ID_82541GI_MOBILE:
hw->mac_type = e1000_82541_rev_2; hw->mac_type = e1000_82541_rev_2;
break; break;
case E1000_DEV_ID_82547EI: case E1000_DEV_ID_82547EI:
case E1000_DEV_ID_82547EI_MOBILE: case E1000_DEV_ID_82547EI_MOBILE:
hw->mac_type = e1000_82547; hw->mac_type = e1000_82547;
break; break;
case E1000_DEV_ID_82547GI: case E1000_DEV_ID_82547GI:
hw->mac_type = e1000_82547_rev_2; hw->mac_type = e1000_82547_rev_2;
break; break;
case E1000_DEV_ID_82571EB_COPPER: case E1000_DEV_ID_82571EB_COPPER:
case E1000_DEV_ID_82571EB_FIBER: case E1000_DEV_ID_82571EB_FIBER:
case E1000_DEV_ID_82571EB_SERDES: case E1000_DEV_ID_82571EB_SERDES:
case E1000_DEV_ID_82571EB_QUAD_COPPER: case E1000_DEV_ID_82571EB_QUAD_COPPER:
case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE:
hw->mac_type = e1000_82571; hw->mac_type = e1000_82571;
break; break;
case E1000_DEV_ID_82572EI_COPPER: case E1000_DEV_ID_82572EI_COPPER:
case E1000_DEV_ID_82572EI_FIBER: case E1000_DEV_ID_82572EI_FIBER:
case E1000_DEV_ID_82572EI_SERDES: case E1000_DEV_ID_82572EI_SERDES:
case E1000_DEV_ID_82572EI: case E1000_DEV_ID_82572EI:
hw->mac_type = e1000_82572; hw->mac_type = e1000_82572;
break; break;
case E1000_DEV_ID_82573E: case E1000_DEV_ID_82573E:
case E1000_DEV_ID_82573E_IAMT: case E1000_DEV_ID_82573E_IAMT:
case E1000_DEV_ID_82573L: case E1000_DEV_ID_82573L:
hw->mac_type = e1000_82573; hw->mac_type = e1000_82573;
break; break;
case E1000_DEV_ID_80003ES2LAN_COPPER_SPT: case E1000_DEV_ID_80003ES2LAN_COPPER_SPT:
case E1000_DEV_ID_80003ES2LAN_SERDES_SPT: case E1000_DEV_ID_80003ES2LAN_SERDES_SPT:
case E1000_DEV_ID_80003ES2LAN_COPPER_DPT: case E1000_DEV_ID_80003ES2LAN_COPPER_DPT:
case E1000_DEV_ID_80003ES2LAN_SERDES_DPT: case E1000_DEV_ID_80003ES2LAN_SERDES_DPT:
hw->mac_type = e1000_80003es2lan; hw->mac_type = e1000_80003es2lan;
break; break;
case E1000_DEV_ID_ICH8_IGP_M_AMT: case E1000_DEV_ID_ICH8_IGP_M_AMT:
case E1000_DEV_ID_ICH8_IGP_AMT: case E1000_DEV_ID_ICH8_IGP_AMT:
case E1000_DEV_ID_ICH8_IGP_C: case E1000_DEV_ID_ICH8_IGP_C:
case E1000_DEV_ID_ICH8_IFE: case E1000_DEV_ID_ICH8_IFE:
case E1000_DEV_ID_ICH8_IFE_GT: case E1000_DEV_ID_ICH8_IFE_GT:
case E1000_DEV_ID_ICH8_IFE_G: case E1000_DEV_ID_ICH8_IFE_G:
case E1000_DEV_ID_ICH8_IGP_M: case E1000_DEV_ID_ICH8_IGP_M:
hw->mac_type = e1000_ich8lan; hw->mac_type = e1000_ich8lan;
break; break;
default: default:
/* Should never have loaded on this device */ /* Should never have loaded on this device */
return -E1000_ERR_MAC_TYPE; return -E1000_ERR_MAC_TYPE;
} }
switch (hw->mac_type) { switch (hw->mac_type) {
case e1000_ich8lan: case e1000_ich8lan:
hw->swfwhw_semaphore_present = TRUE; hw->swfwhw_semaphore_present = TRUE;
hw->asf_firmware_present = TRUE; hw->asf_firmware_present = TRUE;
break; break;
case e1000_80003es2lan: case e1000_80003es2lan:
hw->swfw_sync_present = TRUE; hw->swfw_sync_present = TRUE;
/* fall through */ /* fall through */
case e1000_82571: case e1000_82571:
case e1000_82572: case e1000_82572:
case e1000_82573: case e1000_82573:
hw->eeprom_semaphore_present = TRUE; hw->eeprom_semaphore_present = TRUE;
/* fall through */ /* fall through */
case e1000_82541: case e1000_82541:
case e1000_82547: case e1000_82547:
case e1000_82541_rev_2: case e1000_82541_rev_2:
case e1000_82547_rev_2: case e1000_82547_rev_2:
hw->asf_firmware_present = TRUE; hw->asf_firmware_present = TRUE;
break; break;
default: default:
break; break;
} }
return E1000_SUCCESS; return E1000_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -1304,162 +1304,162 @@ struct e1000_ffvt_entry { ...@@ -1304,162 +1304,162 @@ struct e1000_ffvt_entry {
/* Statistics counters collected by the MAC */ /* Statistics counters collected by the MAC */
struct e1000_hw_stats { struct e1000_hw_stats {
uint64_t crcerrs; uint64_t crcerrs;
uint64_t algnerrc; uint64_t algnerrc;
uint64_t symerrs; uint64_t symerrs;
uint64_t rxerrc; uint64_t rxerrc;
uint64_t txerrc; uint64_t txerrc;
uint64_t mpc; uint64_t mpc;
uint64_t scc; uint64_t scc;
uint64_t ecol; uint64_t ecol;
uint64_t mcc; uint64_t mcc;
uint64_t latecol; uint64_t latecol;
uint64_t colc; uint64_t colc;
uint64_t dc; uint64_t dc;
uint64_t tncrs; uint64_t tncrs;
uint64_t sec; uint64_t sec;
uint64_t cexterr; uint64_t cexterr;
uint64_t rlec; uint64_t rlec;
uint64_t xonrxc; uint64_t xonrxc;
uint64_t xontxc; uint64_t xontxc;
uint64_t xoffrxc; uint64_t xoffrxc;
uint64_t xofftxc; uint64_t xofftxc;
uint64_t fcruc; uint64_t fcruc;
uint64_t prc64; uint64_t prc64;
uint64_t prc127; uint64_t prc127;
uint64_t prc255; uint64_t prc255;
uint64_t prc511; uint64_t prc511;
uint64_t prc1023; uint64_t prc1023;
uint64_t prc1522; uint64_t prc1522;
uint64_t gprc; uint64_t gprc;
uint64_t bprc; uint64_t bprc;
uint64_t mprc; uint64_t mprc;
uint64_t gptc; uint64_t gptc;
uint64_t gorcl; uint64_t gorcl;
uint64_t gorch; uint64_t gorch;
uint64_t gotcl; uint64_t gotcl;
uint64_t gotch; uint64_t gotch;
uint64_t rnbc; uint64_t rnbc;
uint64_t ruc; uint64_t ruc;
uint64_t rfc; uint64_t rfc;
uint64_t roc; uint64_t roc;
uint64_t rlerrc; uint64_t rlerrc;
uint64_t rjc; uint64_t rjc;
uint64_t mgprc; uint64_t mgprc;
uint64_t mgpdc; uint64_t mgpdc;
uint64_t mgptc; uint64_t mgptc;
uint64_t torl; uint64_t torl;
uint64_t torh; uint64_t torh;
uint64_t totl; uint64_t totl;
uint64_t toth; uint64_t toth;
uint64_t tpr; uint64_t tpr;
uint64_t tpt; uint64_t tpt;
uint64_t ptc64; uint64_t ptc64;
uint64_t ptc127; uint64_t ptc127;
uint64_t ptc255; uint64_t ptc255;
uint64_t ptc511; uint64_t ptc511;
uint64_t ptc1023; uint64_t ptc1023;
uint64_t ptc1522; uint64_t ptc1522;
uint64_t mptc; uint64_t mptc;
uint64_t bptc; uint64_t bptc;
uint64_t tsctc; uint64_t tsctc;
uint64_t tsctfc; uint64_t tsctfc;
uint64_t iac; uint64_t iac;
uint64_t icrxptc; uint64_t icrxptc;
uint64_t icrxatc; uint64_t icrxatc;
uint64_t ictxptc; uint64_t ictxptc;
uint64_t ictxatc; uint64_t ictxatc;
uint64_t ictxqec; uint64_t ictxqec;
uint64_t ictxqmtc; uint64_t ictxqmtc;
uint64_t icrxdmtc; uint64_t icrxdmtc;
uint64_t icrxoc; uint64_t icrxoc;
}; };
/* Structure containing variables used by the shared code (e1000_hw.c) */ /* Structure containing variables used by the shared code (e1000_hw.c) */
struct e1000_hw { struct e1000_hw {
uint8_t __iomem *hw_addr; uint8_t __iomem *hw_addr;
uint8_t __iomem *flash_address; uint8_t __iomem *flash_address;
e1000_mac_type mac_type; e1000_mac_type mac_type;
e1000_phy_type phy_type; e1000_phy_type phy_type;
uint32_t phy_init_script; uint32_t phy_init_script;
e1000_media_type media_type; e1000_media_type media_type;
void *back; void *back;
struct e1000_shadow_ram *eeprom_shadow_ram; struct e1000_shadow_ram *eeprom_shadow_ram;
uint32_t flash_bank_size; uint32_t flash_bank_size;
uint32_t flash_base_addr; uint32_t flash_base_addr;
e1000_fc_type fc; e1000_fc_type fc;
e1000_bus_speed bus_speed; e1000_bus_speed bus_speed;
e1000_bus_width bus_width; e1000_bus_width bus_width;
e1000_bus_type bus_type; e1000_bus_type bus_type;
struct e1000_eeprom_info eeprom; struct e1000_eeprom_info eeprom;
e1000_ms_type master_slave; e1000_ms_type master_slave;
e1000_ms_type original_master_slave; e1000_ms_type original_master_slave;
e1000_ffe_config ffe_config_state; e1000_ffe_config ffe_config_state;
uint32_t asf_firmware_present; uint32_t asf_firmware_present;
uint32_t eeprom_semaphore_present; uint32_t eeprom_semaphore_present;
uint32_t swfw_sync_present; uint32_t swfw_sync_present;
uint32_t swfwhw_semaphore_present; uint32_t swfwhw_semaphore_present;
unsigned long io_base; unsigned long io_base;
uint32_t phy_id; uint32_t phy_id;
uint32_t phy_revision; uint32_t phy_revision;
uint32_t phy_addr; uint32_t phy_addr;
uint32_t original_fc; uint32_t original_fc;
uint32_t txcw; uint32_t txcw;
uint32_t autoneg_failed; uint32_t autoneg_failed;
uint32_t max_frame_size; uint32_t max_frame_size;
uint32_t min_frame_size; uint32_t min_frame_size;
uint32_t mc_filter_type; uint32_t mc_filter_type;
uint32_t num_mc_addrs; uint32_t num_mc_addrs;
uint32_t collision_delta; uint32_t collision_delta;
uint32_t tx_packet_delta; uint32_t tx_packet_delta;
uint32_t ledctl_default; uint32_t ledctl_default;
uint32_t ledctl_mode1; uint32_t ledctl_mode1;
uint32_t ledctl_mode2; uint32_t ledctl_mode2;
boolean_t tx_pkt_filtering; boolean_t tx_pkt_filtering;
struct e1000_host_mng_dhcp_cookie mng_cookie; struct e1000_host_mng_dhcp_cookie mng_cookie;
uint16_t phy_spd_default; uint16_t phy_spd_default;
uint16_t autoneg_advertised; uint16_t autoneg_advertised;
uint16_t pci_cmd_word; uint16_t pci_cmd_word;
uint16_t fc_high_water; uint16_t fc_high_water;
uint16_t fc_low_water; uint16_t fc_low_water;
uint16_t fc_pause_time; uint16_t fc_pause_time;
uint16_t current_ifs_val; uint16_t current_ifs_val;
uint16_t ifs_min_val; uint16_t ifs_min_val;
uint16_t ifs_max_val; uint16_t ifs_max_val;
uint16_t ifs_step_size; uint16_t ifs_step_size;
uint16_t ifs_ratio; uint16_t ifs_ratio;
uint16_t device_id; uint16_t device_id;
uint16_t vendor_id; uint16_t vendor_id;
uint16_t subsystem_id; uint16_t subsystem_id;
uint16_t subsystem_vendor_id; uint16_t subsystem_vendor_id;
uint8_t revision_id; uint8_t revision_id;
uint8_t autoneg; uint8_t autoneg;
uint8_t mdix; uint8_t mdix;
uint8_t forced_speed_duplex; uint8_t forced_speed_duplex;
uint8_t wait_autoneg_complete; uint8_t wait_autoneg_complete;
uint8_t dma_fairness; uint8_t dma_fairness;
uint8_t mac_addr[NODE_ADDRESS_SIZE]; uint8_t mac_addr[NODE_ADDRESS_SIZE];
uint8_t perm_mac_addr[NODE_ADDRESS_SIZE]; uint8_t perm_mac_addr[NODE_ADDRESS_SIZE];
boolean_t disable_polarity_correction; boolean_t disable_polarity_correction;
boolean_t speed_downgraded; boolean_t speed_downgraded;
e1000_smart_speed smart_speed; e1000_smart_speed smart_speed;
e1000_dsp_config dsp_config_state; e1000_dsp_config dsp_config_state;
boolean_t get_link_status; boolean_t get_link_status;
boolean_t serdes_link_down; boolean_t serdes_link_down;
boolean_t tbi_compatibility_en; boolean_t tbi_compatibility_en;
boolean_t tbi_compatibility_on; boolean_t tbi_compatibility_on;
boolean_t laa_is_present; boolean_t laa_is_present;
boolean_t phy_reset_disable; boolean_t phy_reset_disable;
boolean_t initialize_hw_bits_disable; boolean_t initialize_hw_bits_disable;
boolean_t fc_send_xon; boolean_t fc_send_xon;
boolean_t fc_strict_ieee; boolean_t fc_strict_ieee;
boolean_t report_tx_early; boolean_t report_tx_early;
boolean_t adaptive_ifs; boolean_t adaptive_ifs;
boolean_t ifs_params_forced; boolean_t ifs_params_forced;
boolean_t in_ifs_mode; boolean_t in_ifs_mode;
boolean_t mng_reg_access_disabled; boolean_t mng_reg_access_disabled;
boolean_t leave_av_bit_off; boolean_t leave_av_bit_off;
boolean_t kmrn_lock_loss_workaround_disabled; boolean_t kmrn_lock_loss_workaround_disabled;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment