Lines Matching refs:hw
178 static bool ixgbe_check_cfg_remove(struct ixgbe_hw *hw, struct pci_dev *pdev);
199 ixgbe_check_cfg_remove(&adapter->hw, parent_dev)) in ixgbe_read_pci_cfg_word_parent()
206 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_get_parent_bus_info() local
210 hw->bus.type = ixgbe_bus_type_pci_express; in ixgbe_get_parent_bus_info()
221 hw->bus.width = ixgbe_convert_bus_width(link_status); in ixgbe_get_parent_bus_info()
222 hw->bus.speed = ixgbe_convert_bus_speed(link_status); in ixgbe_get_parent_bus_info()
236 static inline bool ixgbe_pcie_from_parent(struct ixgbe_hw *hw) in ixgbe_pcie_from_parent() argument
238 switch (hw->device_id) { in ixgbe_pcie_from_parent()
250 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_check_minimum_link() local
260 if (hw->bus.type == ixgbe_bus_type_internal) in ixgbe_check_minimum_link()
264 if (ixgbe_pcie_from_parent(&adapter->hw)) in ixgbe_check_minimum_link()
322 static void ixgbe_remove_adapter(struct ixgbe_hw *hw) in ixgbe_remove_adapter() argument
324 struct ixgbe_adapter *adapter = hw->back; in ixgbe_remove_adapter()
326 if (!hw->hw_addr) in ixgbe_remove_adapter()
328 hw->hw_addr = NULL; in ixgbe_remove_adapter()
334 static void ixgbe_check_remove(struct ixgbe_hw *hw, u32 reg) in ixgbe_check_remove() argument
345 ixgbe_remove_adapter(hw); in ixgbe_check_remove()
348 value = ixgbe_read_reg(hw, IXGBE_STATUS); in ixgbe_check_remove()
350 ixgbe_remove_adapter(hw); in ixgbe_check_remove()
366 u32 ixgbe_read_reg(struct ixgbe_hw *hw, u32 reg) in ixgbe_read_reg() argument
368 u8 __iomem *reg_addr = ACCESS_ONCE(hw->hw_addr); in ixgbe_read_reg()
375 ixgbe_check_remove(hw, reg); in ixgbe_read_reg()
379 static bool ixgbe_check_cfg_remove(struct ixgbe_hw *hw, struct pci_dev *pdev) in ixgbe_check_cfg_remove() argument
385 ixgbe_remove_adapter(hw); in ixgbe_check_cfg_remove()
391 u16 ixgbe_read_pci_cfg_word(struct ixgbe_hw *hw, u32 reg) in ixgbe_read_pci_cfg_word() argument
393 struct ixgbe_adapter *adapter = hw->back; in ixgbe_read_pci_cfg_word()
396 if (ixgbe_removed(hw->hw_addr)) in ixgbe_read_pci_cfg_word()
400 ixgbe_check_cfg_remove(hw, adapter->pdev)) in ixgbe_read_pci_cfg_word()
406 static u32 ixgbe_read_pci_cfg_dword(struct ixgbe_hw *hw, u32 reg) in ixgbe_read_pci_cfg_dword() argument
408 struct ixgbe_adapter *adapter = hw->back; in ixgbe_read_pci_cfg_dword()
411 if (ixgbe_removed(hw->hw_addr)) in ixgbe_read_pci_cfg_dword()
415 ixgbe_check_cfg_remove(hw, adapter->pdev)) in ixgbe_read_pci_cfg_dword()
421 void ixgbe_write_pci_cfg_word(struct ixgbe_hw *hw, u32 reg, u16 value) in ixgbe_write_pci_cfg_word() argument
423 struct ixgbe_adapter *adapter = hw->back; in ixgbe_write_pci_cfg_word()
425 if (ixgbe_removed(hw->hw_addr)) in ixgbe_write_pci_cfg_word()
480 static void ixgbe_regdump(struct ixgbe_hw *hw, struct ixgbe_reg_info *reginfo) in ixgbe_regdump() argument
489 regs[i] = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); in ixgbe_regdump()
493 regs[i] = IXGBE_READ_REG(hw, IXGBE_DCA_RXCTRL(i)); in ixgbe_regdump()
497 regs[i] = IXGBE_READ_REG(hw, IXGBE_RDLEN(i)); in ixgbe_regdump()
501 regs[i] = IXGBE_READ_REG(hw, IXGBE_RDH(i)); in ixgbe_regdump()
505 regs[i] = IXGBE_READ_REG(hw, IXGBE_RDT(i)); in ixgbe_regdump()
509 regs[i] = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); in ixgbe_regdump()
513 regs[i] = IXGBE_READ_REG(hw, IXGBE_RDBAL(i)); in ixgbe_regdump()
517 regs[i] = IXGBE_READ_REG(hw, IXGBE_RDBAH(i)); in ixgbe_regdump()
521 regs[i] = IXGBE_READ_REG(hw, IXGBE_TDBAL(i)); in ixgbe_regdump()
525 regs[i] = IXGBE_READ_REG(hw, IXGBE_TDBAH(i)); in ixgbe_regdump()
529 regs[i] = IXGBE_READ_REG(hw, IXGBE_TDLEN(i)); in ixgbe_regdump()
533 regs[i] = IXGBE_READ_REG(hw, IXGBE_TDH(i)); in ixgbe_regdump()
537 regs[i] = IXGBE_READ_REG(hw, IXGBE_TDT(i)); in ixgbe_regdump()
541 regs[i] = IXGBE_READ_REG(hw, IXGBE_TXDCTL(i)); in ixgbe_regdump()
545 IXGBE_READ_REG(hw, reginfo->ofs)); in ixgbe_regdump()
565 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_dump() local
598 ixgbe_regdump(hw, reginfo); in ixgbe_dump()
827 ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT); in ixgbe_release_hw_control()
828 IXGBE_WRITE_REG(&adapter->hw, IXGBE_CTRL_EXT, in ixgbe_release_hw_control()
837 ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT); in ixgbe_get_hw_control()
838 IXGBE_WRITE_REG(&adapter->hw, IXGBE_CTRL_EXT, in ixgbe_get_hw_control()
854 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_set_ivar() local
855 switch (hw->mac.type) { in ixgbe_set_ivar()
861 ivar = IXGBE_READ_REG(hw, IXGBE_IVAR(index)); in ixgbe_set_ivar()
864 IXGBE_WRITE_REG(hw, IXGBE_IVAR(index), ivar); in ixgbe_set_ivar()
874 ivar = IXGBE_READ_REG(&adapter->hw, IXGBE_IVAR_MISC); in ixgbe_set_ivar()
877 IXGBE_WRITE_REG(&adapter->hw, IXGBE_IVAR_MISC, ivar); in ixgbe_set_ivar()
883 ivar = IXGBE_READ_REG(hw, IXGBE_IVAR(queue >> 1)); in ixgbe_set_ivar()
886 IXGBE_WRITE_REG(hw, IXGBE_IVAR(queue >> 1), ivar); in ixgbe_set_ivar()
899 switch (adapter->hw.mac.type) { in ixgbe_irq_rearm_queues()
902 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EICS, mask); in ixgbe_irq_rearm_queues()
909 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EICS_EX(0), mask); in ixgbe_irq_rearm_queues()
911 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EICS_EX(1), mask); in ixgbe_irq_rearm_queues()
942 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_update_xoff_rx_lfc() local
947 if ((hw->fc.current_mode != ixgbe_fc_full) && in ixgbe_update_xoff_rx_lfc()
948 (hw->fc.current_mode != ixgbe_fc_rx_pause)) in ixgbe_update_xoff_rx_lfc()
951 switch (hw->mac.type) { in ixgbe_update_xoff_rx_lfc()
953 data = IXGBE_READ_REG(hw, IXGBE_LXOFFRXC); in ixgbe_update_xoff_rx_lfc()
956 data = IXGBE_READ_REG(hw, IXGBE_LXOFFRXCNT); in ixgbe_update_xoff_rx_lfc()
971 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_update_xoff_received() local
990 switch (hw->mac.type) { in ixgbe_update_xoff_received()
992 pxoffrxc = IXGBE_READ_REG(hw, IXGBE_PXOFFRXC(i)); in ixgbe_update_xoff_received()
995 pxoffrxc = IXGBE_READ_REG(hw, IXGBE_PXOFFRXCNT(i)); in ixgbe_update_xoff_received()
1021 struct ixgbe_hw *hw; in ixgbe_get_tx_pending() local
1029 hw = &adapter->hw; in ixgbe_get_tx_pending()
1030 head = IXGBE_READ_REG(hw, IXGBE_TDH(ring->reg_idx)); in ixgbe_get_tx_pending()
1031 tail = IXGBE_READ_REG(hw, IXGBE_TDT(ring->reg_idx)); in ixgbe_get_tx_pending()
1192 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_clean_tx_irq() local
1202 IXGBE_READ_REG(hw, IXGBE_TDH(tx_ring->reg_idx)), in ixgbe_clean_tx_irq()
1203 IXGBE_READ_REG(hw, IXGBE_TDT(tx_ring->reg_idx)), in ixgbe_clean_tx_irq()
1247 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_update_tx_dca() local
1254 switch (hw->mac.type) { in ixgbe_update_tx_dca()
1277 IXGBE_WRITE_REG(hw, reg_offset, txctrl); in ixgbe_update_tx_dca()
1284 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_update_rx_dca() local
1291 switch (hw->mac.type) { in ixgbe_update_rx_dca()
1309 IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(reg_idx), rxctrl); in ixgbe_update_rx_dca()
1338 IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_CTRL, in ixgbe_setup_dca()
1341 IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_CTRL, in ixgbe_setup_dca()
1365 IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_CTRL, in __ixgbe_notify_dca()
1374 IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_CTRL, in __ixgbe_notify_dca()
2193 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITRSEL, eitrsel); in ixgbe_configure_msix()
2213 switch (adapter->hw.mac.type) { in ixgbe_configure_msix()
2227 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(v_idx), 1950); in ixgbe_configure_msix()
2235 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIAC, mask); in ixgbe_configure_msix()
2320 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_write_eitr() local
2324 switch (adapter->hw.mac.type) { in ixgbe_write_eitr()
2342 IXGBE_WRITE_REG(hw, IXGBE_EITR(v_idx), itr_reg); in ixgbe_write_eitr()
2388 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_check_overtemp_subtask() local
2400 switch (hw->device_id) { in ixgbe_check_overtemp_subtask()
2413 if (!(eicr & IXGBE_EICR_LSC) && hw->mac.ops.check_link) { in ixgbe_check_overtemp_subtask()
2417 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_check_overtemp_subtask()
2424 if (hw->phy.ops.check_overtemp(hw) != IXGBE_ERR_OVERTEMP) in ixgbe_check_overtemp_subtask()
2429 if (adapter->hw.mac.type >= ixgbe_mac_X540) in ixgbe_check_overtemp_subtask()
2431 if (!(eicr & IXGBE_EICR_GPI_SDP0(hw))) in ixgbe_check_overtemp_subtask()
2442 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_check_fan_failure() local
2445 (eicr & IXGBE_EICR_GPI_SDP1(hw))) { in ixgbe_check_fan_failure()
2448 IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1(hw)); in ixgbe_check_fan_failure()
2454 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_check_overtemp_event() local
2459 switch (adapter->hw.mac.type) { in ixgbe_check_overtemp_event()
2465 if (((eicr & IXGBE_EICR_GPI_SDP0(hw)) || in ixgbe_check_overtemp_event()
2485 static inline bool ixgbe_is_sfp(struct ixgbe_hw *hw) in ixgbe_is_sfp() argument
2487 switch (hw->mac.type) { in ixgbe_is_sfp()
2489 if (hw->phy.type == ixgbe_phy_nl) in ixgbe_is_sfp()
2494 switch (hw->mac.ops.get_media_type(hw)) { in ixgbe_is_sfp()
2508 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_check_sfp_event() local
2509 u32 eicr_mask = IXGBE_EICR_GPI_SDP2(hw); in ixgbe_check_sfp_event()
2511 if (!ixgbe_is_sfp(hw)) in ixgbe_check_sfp_event()
2515 if (hw->mac.type >= ixgbe_mac_X540) in ixgbe_check_sfp_event()
2520 IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr_mask); in ixgbe_check_sfp_event()
2528 if (adapter->hw.mac.type == ixgbe_mac_82599EB && in ixgbe_check_sfp_event()
2529 (eicr & IXGBE_EICR_GPI_SDP1(hw))) { in ixgbe_check_sfp_event()
2531 IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1(hw)); in ixgbe_check_sfp_event()
2541 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_check_lsc() local
2547 IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_LSC); in ixgbe_check_lsc()
2548 IXGBE_WRITE_FLUSH(hw); in ixgbe_check_lsc()
2557 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_irq_enable_queues() local
2559 switch (hw->mac.type) { in ixgbe_irq_enable_queues()
2562 IXGBE_WRITE_REG(hw, IXGBE_EIMS, mask); in ixgbe_irq_enable_queues()
2570 IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(0), mask); in ixgbe_irq_enable_queues()
2573 IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(1), mask); in ixgbe_irq_enable_queues()
2585 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_irq_disable_queues() local
2587 switch (hw->mac.type) { in ixgbe_irq_disable_queues()
2590 IXGBE_WRITE_REG(hw, IXGBE_EIMC, mask); in ixgbe_irq_disable_queues()
2598 IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(0), mask); in ixgbe_irq_disable_queues()
2601 IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(1), mask); in ixgbe_irq_disable_queues()
2616 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_irq_enable() local
2624 switch (adapter->hw.mac.type) { in ixgbe_irq_enable()
2626 mask |= IXGBE_EIMS_GPI_SDP0(hw); in ixgbe_irq_enable()
2637 mask |= IXGBE_EIMS_GPI_SDP1(hw); in ixgbe_irq_enable()
2638 switch (adapter->hw.mac.type) { in ixgbe_irq_enable()
2640 mask |= IXGBE_EIMS_GPI_SDP1(hw); in ixgbe_irq_enable()
2641 mask |= IXGBE_EIMS_GPI_SDP2(hw); in ixgbe_irq_enable()
2646 if (adapter->hw.device_id == IXGBE_DEV_ID_X550EM_X_SFP) in ixgbe_irq_enable()
2647 mask |= IXGBE_EIMS_GPI_SDP0(&adapter->hw); in ixgbe_irq_enable()
2648 if (adapter->hw.phy.type == ixgbe_phy_x550em_ext_t) in ixgbe_irq_enable()
2661 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask); in ixgbe_irq_enable()
2665 IXGBE_WRITE_FLUSH(&adapter->hw); in ixgbe_irq_enable()
2671 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_msix_other() local
2680 eicr = IXGBE_READ_REG(hw, IXGBE_EICS); in ixgbe_msix_other()
2691 IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr); in ixgbe_msix_other()
2699 switch (hw->mac.type) { in ixgbe_msix_other()
2704 if (hw->phy.type == ixgbe_phy_x550em_ext_t && in ixgbe_msix_other()
2708 IXGBE_WRITE_REG(hw, IXGBE_EICR, in ixgbe_msix_other()
2715 IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_ECC); in ixgbe_msix_other()
2729 IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_FLOW_DIR); in ixgbe_msix_other()
2900 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_intr() local
2908 IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_IRQ_CLEAR_MASK); in ixgbe_intr()
2912 eicr = IXGBE_READ_REG(hw, IXGBE_EICR); in ixgbe_intr()
2929 switch (hw->mac.type) { in ixgbe_intr()
2940 IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_ECC); in ixgbe_intr()
3024 switch (adapter->hw.mac.type) { in ixgbe_irq_disable()
3026 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0); in ixgbe_irq_disable()
3032 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFF0000); in ixgbe_irq_disable()
3033 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(0), ~0); in ixgbe_irq_disable()
3034 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(1), ~0); in ixgbe_irq_disable()
3039 IXGBE_WRITE_FLUSH(&adapter->hw); in ixgbe_irq_disable()
3065 e_info(hw, "Legacy interrupt IVAR setup done\n"); in ixgbe_configure_msi_and_legacy()
3078 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_configure_tx_ring() local
3085 IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), 0); in ixgbe_configure_tx_ring()
3086 IXGBE_WRITE_FLUSH(hw); in ixgbe_configure_tx_ring()
3088 IXGBE_WRITE_REG(hw, IXGBE_TDBAL(reg_idx), in ixgbe_configure_tx_ring()
3090 IXGBE_WRITE_REG(hw, IXGBE_TDBAH(reg_idx), (tdba >> 32)); in ixgbe_configure_tx_ring()
3091 IXGBE_WRITE_REG(hw, IXGBE_TDLEN(reg_idx), in ixgbe_configure_tx_ring()
3093 IXGBE_WRITE_REG(hw, IXGBE_TDH(reg_idx), 0); in ixgbe_configure_tx_ring()
3094 IXGBE_WRITE_REG(hw, IXGBE_TDT(reg_idx), 0); in ixgbe_configure_tx_ring()
3141 IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), txdctl); in ixgbe_configure_tx_ring()
3144 if (hw->mac.type == ixgbe_mac_82598EB && in ixgbe_configure_tx_ring()
3145 !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP)) in ixgbe_configure_tx_ring()
3151 txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(reg_idx)); in ixgbe_configure_tx_ring()
3159 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_setup_mtqc() local
3163 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_setup_mtqc()
3167 rttdcs = IXGBE_READ_REG(hw, IXGBE_RTTDCS); in ixgbe_setup_mtqc()
3169 IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); in ixgbe_setup_mtqc()
3191 IXGBE_WRITE_REG(hw, IXGBE_MTQC, mtqc); in ixgbe_setup_mtqc()
3195 u32 sectx = IXGBE_READ_REG(hw, IXGBE_SECTXMINIFG); in ixgbe_setup_mtqc()
3197 IXGBE_WRITE_REG(hw, IXGBE_SECTXMINIFG, sectx); in ixgbe_setup_mtqc()
3202 IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); in ixgbe_setup_mtqc()
3213 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_configure_tx() local
3219 if (hw->mac.type != ixgbe_mac_82598EB) { in ixgbe_configure_tx()
3221 dmatxctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); in ixgbe_configure_tx()
3223 IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, dmatxctl); in ixgbe_configure_tx()
3234 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_enable_rx_drop() local
3236 u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(reg_idx)); in ixgbe_enable_rx_drop()
3240 IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(reg_idx), srrctl); in ixgbe_enable_rx_drop()
3246 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_disable_rx_drop() local
3248 u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(reg_idx)); in ixgbe_disable_rx_drop()
3252 IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(reg_idx), srrctl); in ixgbe_disable_rx_drop()
3277 !(adapter->hw.fc.current_mode & ixgbe_fc_tx_pause) && !pfc_en)) { in ixgbe_set_rx_drop_en()
3291 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_configure_srrctl() local
3295 if (hw->mac.type == ixgbe_mac_82598EB) { in ixgbe_configure_srrctl()
3314 IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(reg_idx), srrctl); in ixgbe_configure_srrctl()
3328 if (adapter->hw.mac.type < ixgbe_mac_X550) in ixgbe_rss_indir_tbl_entries()
3346 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_store_reta() local
3357 if (adapter->hw.mac.type == ixgbe_mac_82598EB) in ixgbe_store_reta()
3367 IXGBE_WRITE_REG(hw, IXGBE_RETA(i >> 2), reta); in ixgbe_store_reta()
3369 IXGBE_WRITE_REG(hw, IXGBE_ERETA((i >> 2) - 32), in ixgbe_store_reta()
3386 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_store_vfreta() local
3394 IXGBE_WRITE_REG(hw, IXGBE_PFVFRETA(i >> 2, pf_pool), in ixgbe_store_vfreta()
3403 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_setup_reta() local
3417 IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), adapter->rss_key[i]); in ixgbe_setup_reta()
3434 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_setup_vfreta() local
3441 IXGBE_WRITE_REG(hw, IXGBE_PFVFRSSRK(i, pf_pool), in ixgbe_setup_vfreta()
3457 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_setup_mrqc() local
3462 rxcsum = IXGBE_READ_REG(hw, IXGBE_RXCSUM); in ixgbe_setup_mrqc()
3464 IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum); in ixgbe_setup_mrqc()
3466 if (adapter->hw.mac.type == ixgbe_mac_82598EB) { in ixgbe_setup_mrqc()
3503 if ((hw->mac.type >= ixgbe_mac_X550) && in ixgbe_setup_mrqc()
3509 IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc); in ixgbe_setup_mrqc()
3515 IXGBE_WRITE_REG(hw, IXGBE_PFVFMRQC(pf_pool), vfmrqc); in ixgbe_setup_mrqc()
3519 IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc); in ixgbe_setup_mrqc()
3531 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_configure_rscctl() local
3538 rscctrl = IXGBE_READ_REG(hw, IXGBE_RSCCTL(reg_idx)); in ixgbe_configure_rscctl()
3546 IXGBE_WRITE_REG(hw, IXGBE_RSCCTL(reg_idx), rscctrl); in ixgbe_configure_rscctl()
3553 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_rx_desc_queue_enable() local
3558 if (ixgbe_removed(hw->hw_addr)) in ixgbe_rx_desc_queue_enable()
3561 if (hw->mac.type == ixgbe_mac_82598EB && in ixgbe_rx_desc_queue_enable()
3562 !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP)) in ixgbe_rx_desc_queue_enable()
3567 rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(reg_idx)); in ixgbe_rx_desc_queue_enable()
3579 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_disable_rx_queue() local
3584 if (ixgbe_removed(hw->hw_addr)) in ixgbe_disable_rx_queue()
3586 rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(reg_idx)); in ixgbe_disable_rx_queue()
3590 IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(reg_idx), rxdctl); in ixgbe_disable_rx_queue()
3592 if (hw->mac.type == ixgbe_mac_82598EB && in ixgbe_disable_rx_queue()
3593 !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP)) in ixgbe_disable_rx_queue()
3599 rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(reg_idx)); in ixgbe_disable_rx_queue()
3611 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_configure_rx_ring() local
3617 rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(reg_idx)); in ixgbe_configure_rx_ring()
3620 IXGBE_WRITE_REG(hw, IXGBE_RDBAL(reg_idx), (rdba & DMA_BIT_MASK(32))); in ixgbe_configure_rx_ring()
3621 IXGBE_WRITE_REG(hw, IXGBE_RDBAH(reg_idx), (rdba >> 32)); in ixgbe_configure_rx_ring()
3622 IXGBE_WRITE_REG(hw, IXGBE_RDLEN(reg_idx), in ixgbe_configure_rx_ring()
3624 IXGBE_WRITE_REG(hw, IXGBE_RDH(reg_idx), 0); in ixgbe_configure_rx_ring()
3625 IXGBE_WRITE_REG(hw, IXGBE_RDT(reg_idx), 0); in ixgbe_configure_rx_ring()
3631 if (hw->mac.type == ixgbe_mac_82598EB) { in ixgbe_configure_rx_ring()
3645 IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(reg_idx), rxdctl); in ixgbe_configure_rx_ring()
3653 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_setup_psrtype() local
3664 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_setup_psrtype()
3673 IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(VMDQ_P(pool)), psrtype); in ixgbe_setup_psrtype()
3678 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_configure_virtualization() local
3686 vmdctl = IXGBE_READ_REG(hw, IXGBE_VT_CTL); in ixgbe_configure_virtualization()
3691 IXGBE_WRITE_REG(hw, IXGBE_VT_CTL, vmdctl); in ixgbe_configure_virtualization()
3697 IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset), (~0) << vf_shift); in ixgbe_configure_virtualization()
3698 IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset ^ 1), reg_offset - 1); in ixgbe_configure_virtualization()
3699 IXGBE_WRITE_REG(hw, IXGBE_VFTE(reg_offset), (~0) << vf_shift); in ixgbe_configure_virtualization()
3700 IXGBE_WRITE_REG(hw, IXGBE_VFTE(reg_offset ^ 1), reg_offset - 1); in ixgbe_configure_virtualization()
3702 IXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, IXGBE_PFDTXGSWC_VT_LBEN); in ixgbe_configure_virtualization()
3705 hw->mac.ops.set_vmdq(hw, 0, VMDQ_P(0)); in ixgbe_configure_virtualization()
3723 IXGBE_WRITE_REG(hw, IXGBE_GCR_EXT, gcr_ext); in ixgbe_configure_virtualization()
3727 hw->mac.ops.set_mac_anti_spoofing(hw, (adapter->num_vfs != 0), in ixgbe_configure_virtualization()
3733 if (hw->mac.ops.set_ethertype_anti_spoofing) { in ixgbe_configure_virtualization()
3734 IXGBE_WRITE_REG(hw, IXGBE_ETQF(IXGBE_ETQF_FILTER_LLDP), in ixgbe_configure_virtualization()
3739 IXGBE_WRITE_REG(hw, IXGBE_ETQF(IXGBE_ETQF_FILTER_FC), in ixgbe_configure_virtualization()
3751 if (hw->mac.ops.set_ethertype_anti_spoofing) in ixgbe_configure_virtualization()
3752 hw->mac.ops.set_ethertype_anti_spoofing(hw, true, i); in ixgbe_configure_virtualization()
3762 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_set_rx_buffer_len() local
3781 mhadd = IXGBE_READ_REG(hw, IXGBE_MHADD); in ixgbe_set_rx_buffer_len()
3786 IXGBE_WRITE_REG(hw, IXGBE_MHADD, mhadd); in ixgbe_set_rx_buffer_len()
3789 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); in ixgbe_set_rx_buffer_len()
3792 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); in ixgbe_set_rx_buffer_len()
3809 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_setup_rdrxctl() local
3810 u32 rdrxctl = IXGBE_READ_REG(hw, IXGBE_RDRXCTL); in ixgbe_setup_rdrxctl()
3812 switch (hw->mac.type) { in ixgbe_setup_rdrxctl()
3834 IXGBE_WRITE_REG(hw, IXGBE_RSCDBU, in ixgbe_setup_rdrxctl()
3835 (IXGBE_RSCDBU_RSCACKDIS | IXGBE_READ_REG(hw, IXGBE_RSCDBU))); in ixgbe_setup_rdrxctl()
3846 IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rdrxctl); in ixgbe_setup_rdrxctl()
3857 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_configure_rx() local
3862 hw->mac.ops.disable_rx(hw); in ixgbe_configure_rx()
3868 rfctl = IXGBE_READ_REG(hw, IXGBE_RFCTL); in ixgbe_configure_rx()
3872 IXGBE_WRITE_REG(hw, IXGBE_RFCTL, rfctl); in ixgbe_configure_rx()
3887 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); in ixgbe_configure_rx()
3889 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_configure_rx()
3894 hw->mac.ops.enable_rx_dma(hw, rxctrl); in ixgbe_configure_rx()
3901 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_vlan_rx_add_vid() local
3904 hw->mac.ops.set_vfta(&adapter->hw, vid, VMDQ_P(0), true); in ixgbe_vlan_rx_add_vid()
3914 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_vlan_rx_kill_vid() local
3917 hw->mac.ops.set_vfta(&adapter->hw, vid, VMDQ_P(0), false); in ixgbe_vlan_rx_kill_vid()
3929 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_vlan_strip_disable() local
3933 switch (hw->mac.type) { in ixgbe_vlan_strip_disable()
3935 vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL); in ixgbe_vlan_strip_disable()
3937 IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl); in ixgbe_vlan_strip_disable()
3949 vlnctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(j)); in ixgbe_vlan_strip_disable()
3951 IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(j), vlnctrl); in ixgbe_vlan_strip_disable()
3965 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_vlan_strip_enable() local
3969 switch (hw->mac.type) { in ixgbe_vlan_strip_enable()
3971 vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL); in ixgbe_vlan_strip_enable()
3973 IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl); in ixgbe_vlan_strip_enable()
3985 vlnctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(j)); in ixgbe_vlan_strip_enable()
3987 IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(j), vlnctrl); in ixgbe_vlan_strip_enable()
4017 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_write_mc_addr_list() local
4022 if (hw->mac.ops.update_mc_addr_list) in ixgbe_write_mc_addr_list()
4023 hw->mac.ops.update_mc_addr_list(hw, netdev); in ixgbe_write_mc_addr_list()
4037 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_full_sync_mac_table() local
4039 for (i = 0; i < hw->mac.num_rar_entries; i++) { in ixgbe_full_sync_mac_table()
4041 hw->mac.ops.set_rar(hw, i, adapter->mac_table[i].addr, in ixgbe_full_sync_mac_table()
4045 hw->mac.ops.clear_rar(hw, i); in ixgbe_full_sync_mac_table()
4054 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_sync_mac_table() local
4056 for (i = 0; i < hw->mac.num_rar_entries; i++) { in ixgbe_sync_mac_table()
4060 hw->mac.ops.set_rar(hw, i, in ixgbe_sync_mac_table()
4065 hw->mac.ops.clear_rar(hw, i); in ixgbe_sync_mac_table()
4076 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_flush_sw_mac_table() local
4078 for (i = 0; i < hw->mac.num_rar_entries; i++) { in ixgbe_flush_sw_mac_table()
4089 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_available_rars() local
4092 for (i = 0; i < hw->mac.num_rar_entries; i++) { in ixgbe_available_rars()
4103 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_mac_set_default_filter() local
4109 hw->mac.ops.set_rar(hw, 0, adapter->mac_table[0].addr, in ixgbe_mac_set_default_filter()
4116 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_add_mac_filter() local
4122 for (i = 0; i < hw->mac.num_rar_entries; i++) { in ixgbe_add_mac_filter()
4139 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_del_mac_filter() local
4144 for (i = 0; i < hw->mac.num_rar_entries; i++) { in ixgbe_del_mac_filter()
4198 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_set_rx_mode() local
4204 fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); in ixgbe_set_rx_mode()
4205 vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL); in ixgbe_set_rx_mode()
4217 hw->addr_ctrl.user_set_promisc = true; in ixgbe_set_rx_mode()
4233 hw->addr_ctrl.user_set_promisc = false; in ixgbe_set_rx_mode()
4259 if (hw->mac.type != ixgbe_mac_82598EB) { in ixgbe_set_rx_mode()
4260 vmolr |= IXGBE_READ_REG(hw, IXGBE_VMOLR(VMDQ_P(0))) & in ixgbe_set_rx_mode()
4263 IXGBE_WRITE_REG(hw, IXGBE_VMOLR(VMDQ_P(0)), vmolr); in ixgbe_set_rx_mode()
4278 IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl); in ixgbe_set_rx_mode()
4279 IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); in ixgbe_set_rx_mode()
4312 switch (adapter->hw.mac.type) { in ixgbe_clear_vxlan_port()
4315 IXGBE_WRITE_REG(&adapter->hw, IXGBE_VXLANCTRL, 0); in ixgbe_clear_vxlan_port()
4336 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_configure_dcb() local
4340 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_configure_dcb()
4345 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_configure_dcb()
4355 ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame, in ixgbe_configure_dcb()
4357 ixgbe_dcb_calculate_tc_credits(hw, &adapter->dcb_cfg, max_frame, in ixgbe_configure_dcb()
4359 ixgbe_dcb_hw_config(hw, &adapter->dcb_cfg); in ixgbe_configure_dcb()
4361 ixgbe_dcb_hw_ets(&adapter->hw, in ixgbe_configure_dcb()
4364 ixgbe_dcb_hw_pfc_config(&adapter->hw, in ixgbe_configure_dcb()
4370 if (hw->mac.type != ixgbe_mac_82598EB) { in ixgbe_configure_dcb()
4380 IXGBE_WRITE_REG(hw, IXGBE_RQTC, msb * 0x11111111); in ixgbe_configure_dcb()
4396 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_hpbthresh() local
4413 switch (hw->mac.type) { in ixgbe_hpbthresh()
4430 rx_pba = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(pb)) >> 10; in ixgbe_hpbthresh()
4456 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_lpbthresh() local
4473 switch (hw->mac.type) { in ixgbe_lpbthresh()
4493 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_pbthresh_setup() local
4501 hw->fc.high_water[i] = ixgbe_hpbthresh(adapter, i); in ixgbe_pbthresh_setup()
4502 hw->fc.low_water[i] = ixgbe_lpbthresh(adapter, i); in ixgbe_pbthresh_setup()
4505 if (hw->fc.low_water[i] > hw->fc.high_water[i]) in ixgbe_pbthresh_setup()
4506 hw->fc.low_water[i] = 0; in ixgbe_pbthresh_setup()
4510 hw->fc.high_water[i] = 0; in ixgbe_pbthresh_setup()
4515 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_configure_pb() local
4525 hw->mac.ops.set_rxpba(hw, tc, hdrm, PBA_STRATEGY_EQUAL); in ixgbe_configure_pb()
4531 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_fdir_filter_restore() local
4538 ixgbe_fdir_set_input_mask_82599(hw, &adapter->fdir_mask); in ixgbe_fdir_filter_restore()
4542 ixgbe_fdir_write_perfect_filter_82599(hw, in ixgbe_fdir_filter_restore()
4556 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_macvlan_set_rx_mode() local
4560 vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(pool)); in ixgbe_macvlan_set_rx_mode()
4570 hw->mac.ops.update_mc_addr_list(hw, dev); in ixgbe_macvlan_set_rx_mode()
4573 IXGBE_WRITE_REG(hw, IXGBE_VMOLR(pool), vmolr); in ixgbe_macvlan_set_rx_mode()
4580 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_fwd_psrtype() local
4588 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_fwd_psrtype()
4596 IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(VMDQ_P(pool)), psrtype); in ixgbe_fwd_psrtype()
4764 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_configure() local
4779 switch (hw->mac.type) { in ixgbe_configure()
4782 hw->mac.ops.disable_rx_buff(hw); in ixgbe_configure()
4789 ixgbe_init_fdir_signature_82599(&adapter->hw, in ixgbe_configure()
4792 ixgbe_init_fdir_perfect_82599(&adapter->hw, in ixgbe_configure()
4797 switch (hw->mac.type) { in ixgbe_configure()
4800 hw->mac.ops.enable_rx_buff(hw); in ixgbe_configure()
4834 if (adapter->hw.mac.type == ixgbe_mac_82598EB) in ixgbe_sfp_link_config()
4847 static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw) in ixgbe_non_sfp_link_config() argument
4853 if (hw->mac.ops.check_link) in ixgbe_non_sfp_link_config()
4854 ret = hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_non_sfp_link_config()
4859 speed = hw->phy.autoneg_advertised; in ixgbe_non_sfp_link_config()
4860 if ((!speed) && (hw->mac.ops.get_link_capabilities)) in ixgbe_non_sfp_link_config()
4861 ret = hw->mac.ops.get_link_capabilities(hw, &speed, in ixgbe_non_sfp_link_config()
4866 if (hw->mac.ops.setup_link) in ixgbe_non_sfp_link_config()
4867 ret = hw->mac.ops.setup_link(hw, speed, link_up); in ixgbe_non_sfp_link_config()
4874 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_setup_gpie() local
4885 switch (hw->mac.type) { in ixgbe_setup_gpie()
4887 IXGBE_WRITE_REG(hw, IXGBE_EIAM, IXGBE_EICS_RTX_QUEUE); in ixgbe_setup_gpie()
4894 IXGBE_WRITE_REG(hw, IXGBE_EIAM_EX(0), 0xFFFFFFFF); in ixgbe_setup_gpie()
4895 IXGBE_WRITE_REG(hw, IXGBE_EIAM_EX(1), 0xFFFFFFFF); in ixgbe_setup_gpie()
4901 IXGBE_WRITE_REG(hw, IXGBE_EIAM, IXGBE_EICS_RTX_QUEUE); in ixgbe_setup_gpie()
4925 switch (adapter->hw.mac.type) { in ixgbe_setup_gpie()
4936 gpie |= IXGBE_SDP1_GPIEN(hw); in ixgbe_setup_gpie()
4938 switch (hw->mac.type) { in ixgbe_setup_gpie()
4949 IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); in ixgbe_setup_gpie()
4954 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_up_complete() local
4967 if (hw->mac.ops.enable_tx_laser) in ixgbe_up_complete()
4968 hw->mac.ops.enable_tx_laser(hw); in ixgbe_up_complete()
4970 if (hw->phy.ops.set_phy_power) in ixgbe_up_complete()
4971 hw->phy.ops.set_phy_power(hw, true); in ixgbe_up_complete()
4977 if (ixgbe_is_sfp(hw)) { in ixgbe_up_complete()
4980 err = ixgbe_non_sfp_link_config(hw); in ixgbe_up_complete()
4986 IXGBE_READ_REG(hw, IXGBE_EICR); in ixgbe_up_complete()
4994 u32 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_up_complete()
5006 ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); in ixgbe_up_complete()
5008 IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext); in ixgbe_up_complete()
5042 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_reset() local
5047 if (ixgbe_removed(hw->hw_addr)) in ixgbe_reset()
5058 err = hw->mac.ops.init_hw(hw); in ixgbe_reset()
5087 if (hw->mac.san_mac_rar_index) in ixgbe_reset()
5088 hw->mac.ops.set_vmdq_san_mac(hw, VMDQ_P(0)); in ixgbe_reset()
5093 if (hw->phy.ops.set_phy_power) { in ixgbe_reset()
5095 hw->phy.ops.set_phy_power(hw, false); in ixgbe_reset()
5097 hw->phy.ops.set_phy_power(hw, true); in ixgbe_reset()
5177 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_down() local
5187 hw->mac.ops.disable_rx(hw); in ixgbe_down()
5227 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITRSEL, 0); in ixgbe_down()
5243 IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), IXGBE_TXDCTL_SWFLSH); in ixgbe_down()
5247 switch (hw->mac.type) { in ixgbe_down()
5252 IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, in ixgbe_down()
5253 (IXGBE_READ_REG(hw, IXGBE_DMATXCTL) & in ixgbe_down()
5264 if (hw->mac.ops.disable_tx_laser) in ixgbe_down()
5265 hw->mac.ops.disable_tx_laser(hw); in ixgbe_down()
5293 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_sw_init() local
5304 hw->vendor_id = pdev->vendor; in ixgbe_sw_init()
5305 hw->device_id = pdev->device; in ixgbe_sw_init()
5306 hw->revision_id = pdev->revision; in ixgbe_sw_init()
5307 hw->subsystem_vendor_id = pdev->subsystem_vendor; in ixgbe_sw_init()
5308 hw->subsystem_device_id = pdev->subsystem_device; in ixgbe_sw_init()
5332 hw->mac.num_rar_entries, in ixgbe_sw_init()
5336 switch (hw->mac.type) { in ixgbe_sw_init()
5340 if (hw->device_id == IXGBE_DEV_ID_82598AT) in ixgbe_sw_init()
5356 if (hw->device_id == IXGBE_DEV_ID_82599_T3_LOM) in ixgbe_sw_init()
5360 fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM(hw)); in ixgbe_sw_init()
5386 switch (hw->mac.type) { in ixgbe_sw_init()
5425 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_sw_init()
5426 hw->fc.current_mode = ixgbe_fc_full; /* init for ethtool output */ in ixgbe_sw_init()
5428 hw->fc.pause_time = IXGBE_DEFAULT_FCPAUSE; in ixgbe_sw_init()
5429 hw->fc.send_xon = true; in ixgbe_sw_init()
5430 hw->fc.disable_fc_autoneg = ixgbe_device_supports_autoneg_fc(hw); in ixgbe_sw_init()
5437 if (hw->mac.type != ixgbe_mac_82598EB) { in ixgbe_sw_init()
5459 if (ixgbe_init_eeprom_params_generic(hw)) { in ixgbe_sw_init()
5745 (adapter->hw.mac.type == ixgbe_mac_82599EB) && in ixgbe_change_mtu()
5775 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_open() local
5834 if (hw->phy.ops.set_phy_power && !adapter->wol) in ixgbe_open()
5835 hw->phy.ops.set_phy_power(&adapter->hw, false); in ixgbe_open()
5848 if (adapter->hw.phy.ops.enter_lplu) { in ixgbe_close_suspend()
5849 adapter->hw.phy.reset_disable = true; in ixgbe_close_suspend()
5851 adapter->hw.phy.ops.enter_lplu(&adapter->hw); in ixgbe_close_suspend()
5852 adapter->hw.phy.reset_disable = false; in ixgbe_close_suspend()
5896 adapter->hw.hw_addr = adapter->io_addr; in ixgbe_resume()
5918 IXGBE_WRITE_REG(&adapter->hw, IXGBE_WUS, ~0); in ixgbe_resume()
5940 struct ixgbe_hw *hw = &adapter->hw; in __ixgbe_shutdown() local
5962 if (hw->mac.ops.stop_link_on_d3) in __ixgbe_shutdown()
5963 hw->mac.ops.stop_link_on_d3(hw); in __ixgbe_shutdown()
5969 if (hw->mac.ops.enable_tx_laser) in __ixgbe_shutdown()
5970 hw->mac.ops.enable_tx_laser(hw); in __ixgbe_shutdown()
5974 fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); in __ixgbe_shutdown()
5976 IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); in __ixgbe_shutdown()
5979 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); in __ixgbe_shutdown()
5981 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl); in __ixgbe_shutdown()
5983 IXGBE_WRITE_REG(hw, IXGBE_WUFC, wufc); in __ixgbe_shutdown()
5985 IXGBE_WRITE_REG(hw, IXGBE_WUC, 0); in __ixgbe_shutdown()
5986 IXGBE_WRITE_REG(hw, IXGBE_WUFC, 0); in __ixgbe_shutdown()
5989 switch (hw->mac.type) { in __ixgbe_shutdown()
6004 if (hw->phy.ops.set_phy_power && !*enable_wake) in __ixgbe_shutdown()
6005 hw->phy.ops.set_phy_power(hw, false); in __ixgbe_shutdown()
6055 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_update_stats() local
6109 hwstats->crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS); in ixgbe_update_stats()
6114 mpc = IXGBE_READ_REG(hw, IXGBE_MPC(i)); in ixgbe_update_stats()
6118 hwstats->pxontxc[i] += IXGBE_READ_REG(hw, IXGBE_PXONTXC(i)); in ixgbe_update_stats()
6119 hwstats->pxofftxc[i] += IXGBE_READ_REG(hw, IXGBE_PXOFFTXC(i)); in ixgbe_update_stats()
6120 switch (hw->mac.type) { in ixgbe_update_stats()
6122 hwstats->rnbc[i] += IXGBE_READ_REG(hw, IXGBE_RNBC(i)); in ixgbe_update_stats()
6123 hwstats->qbtc[i] += IXGBE_READ_REG(hw, IXGBE_QBTC(i)); in ixgbe_update_stats()
6124 hwstats->qbrc[i] += IXGBE_READ_REG(hw, IXGBE_QBRC(i)); in ixgbe_update_stats()
6126 IXGBE_READ_REG(hw, IXGBE_PXONRXC(i)); in ixgbe_update_stats()
6133 IXGBE_READ_REG(hw, IXGBE_PXONRXCNT(i)); in ixgbe_update_stats()
6142 hwstats->qptc[i] += IXGBE_READ_REG(hw, IXGBE_QPTC(i)); in ixgbe_update_stats()
6143 hwstats->qprc[i] += IXGBE_READ_REG(hw, IXGBE_QPRC(i)); in ixgbe_update_stats()
6144 if ((hw->mac.type == ixgbe_mac_82599EB) || in ixgbe_update_stats()
6145 (hw->mac.type == ixgbe_mac_X540) || in ixgbe_update_stats()
6146 (hw->mac.type == ixgbe_mac_X550) || in ixgbe_update_stats()
6147 (hw->mac.type == ixgbe_mac_X550EM_x)) { in ixgbe_update_stats()
6148 hwstats->qbtc[i] += IXGBE_READ_REG(hw, IXGBE_QBTC_L(i)); in ixgbe_update_stats()
6149 IXGBE_READ_REG(hw, IXGBE_QBTC_H(i)); /* to clear */ in ixgbe_update_stats()
6150 hwstats->qbrc[i] += IXGBE_READ_REG(hw, IXGBE_QBRC_L(i)); in ixgbe_update_stats()
6151 IXGBE_READ_REG(hw, IXGBE_QBRC_H(i)); /* to clear */ in ixgbe_update_stats()
6155 hwstats->gprc += IXGBE_READ_REG(hw, IXGBE_GPRC); in ixgbe_update_stats()
6162 switch (hw->mac.type) { in ixgbe_update_stats()
6164 hwstats->lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXC); in ixgbe_update_stats()
6165 hwstats->gorc += IXGBE_READ_REG(hw, IXGBE_GORCH); in ixgbe_update_stats()
6166 hwstats->gotc += IXGBE_READ_REG(hw, IXGBE_GOTCH); in ixgbe_update_stats()
6167 hwstats->tor += IXGBE_READ_REG(hw, IXGBE_TORH); in ixgbe_update_stats()
6173 hwstats->o2bgptc += IXGBE_READ_REG(hw, IXGBE_O2BGPTC); in ixgbe_update_stats()
6174 hwstats->o2bspc += IXGBE_READ_REG(hw, IXGBE_O2BSPC); in ixgbe_update_stats()
6175 hwstats->b2ospc += IXGBE_READ_REG(hw, IXGBE_B2OSPC); in ixgbe_update_stats()
6176 hwstats->b2ogprc += IXGBE_READ_REG(hw, IXGBE_B2OGPRC); in ixgbe_update_stats()
6180 IXGBE_READ_REG(hw, IXGBE_QPRDC(i)); in ixgbe_update_stats()
6181 hwstats->gorc += IXGBE_READ_REG(hw, IXGBE_GORCL); in ixgbe_update_stats()
6182 IXGBE_READ_REG(hw, IXGBE_GORCH); /* to clear */ in ixgbe_update_stats()
6183 hwstats->gotc += IXGBE_READ_REG(hw, IXGBE_GOTCL); in ixgbe_update_stats()
6184 IXGBE_READ_REG(hw, IXGBE_GOTCH); /* to clear */ in ixgbe_update_stats()
6185 hwstats->tor += IXGBE_READ_REG(hw, IXGBE_TORL); in ixgbe_update_stats()
6186 IXGBE_READ_REG(hw, IXGBE_TORH); /* to clear */ in ixgbe_update_stats()
6187 hwstats->lxonrxc += IXGBE_READ_REG(hw, IXGBE_LXONRXCNT); in ixgbe_update_stats()
6188 hwstats->fdirmatch += IXGBE_READ_REG(hw, IXGBE_FDIRMATCH); in ixgbe_update_stats()
6189 hwstats->fdirmiss += IXGBE_READ_REG(hw, IXGBE_FDIRMISS); in ixgbe_update_stats()
6191 hwstats->fccrc += IXGBE_READ_REG(hw, IXGBE_FCCRC); in ixgbe_update_stats()
6192 hwstats->fcoerpdc += IXGBE_READ_REG(hw, IXGBE_FCOERPDC); in ixgbe_update_stats()
6193 hwstats->fcoeprc += IXGBE_READ_REG(hw, IXGBE_FCOEPRC); in ixgbe_update_stats()
6194 hwstats->fcoeptc += IXGBE_READ_REG(hw, IXGBE_FCOEPTC); in ixgbe_update_stats()
6195 hwstats->fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); in ixgbe_update_stats()
6196 hwstats->fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); in ixgbe_update_stats()
6216 bprc = IXGBE_READ_REG(hw, IXGBE_BPRC); in ixgbe_update_stats()
6218 hwstats->mprc += IXGBE_READ_REG(hw, IXGBE_MPRC); in ixgbe_update_stats()
6219 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_update_stats()
6221 hwstats->roc += IXGBE_READ_REG(hw, IXGBE_ROC); in ixgbe_update_stats()
6222 hwstats->prc64 += IXGBE_READ_REG(hw, IXGBE_PRC64); in ixgbe_update_stats()
6223 hwstats->prc127 += IXGBE_READ_REG(hw, IXGBE_PRC127); in ixgbe_update_stats()
6224 hwstats->prc255 += IXGBE_READ_REG(hw, IXGBE_PRC255); in ixgbe_update_stats()
6225 hwstats->prc511 += IXGBE_READ_REG(hw, IXGBE_PRC511); in ixgbe_update_stats()
6226 hwstats->prc1023 += IXGBE_READ_REG(hw, IXGBE_PRC1023); in ixgbe_update_stats()
6227 hwstats->prc1522 += IXGBE_READ_REG(hw, IXGBE_PRC1522); in ixgbe_update_stats()
6228 hwstats->rlec += IXGBE_READ_REG(hw, IXGBE_RLEC); in ixgbe_update_stats()
6229 lxon = IXGBE_READ_REG(hw, IXGBE_LXONTXC); in ixgbe_update_stats()
6231 lxoff = IXGBE_READ_REG(hw, IXGBE_LXOFFTXC); in ixgbe_update_stats()
6233 hwstats->gptc += IXGBE_READ_REG(hw, IXGBE_GPTC); in ixgbe_update_stats()
6234 hwstats->mptc += IXGBE_READ_REG(hw, IXGBE_MPTC); in ixgbe_update_stats()
6242 hwstats->ruc += IXGBE_READ_REG(hw, IXGBE_RUC); in ixgbe_update_stats()
6243 hwstats->rfc += IXGBE_READ_REG(hw, IXGBE_RFC); in ixgbe_update_stats()
6244 hwstats->rjc += IXGBE_READ_REG(hw, IXGBE_RJC); in ixgbe_update_stats()
6245 hwstats->tpr += IXGBE_READ_REG(hw, IXGBE_TPR); in ixgbe_update_stats()
6246 hwstats->ptc64 += IXGBE_READ_REG(hw, IXGBE_PTC64); in ixgbe_update_stats()
6248 hwstats->ptc127 += IXGBE_READ_REG(hw, IXGBE_PTC127); in ixgbe_update_stats()
6249 hwstats->ptc255 += IXGBE_READ_REG(hw, IXGBE_PTC255); in ixgbe_update_stats()
6250 hwstats->ptc511 += IXGBE_READ_REG(hw, IXGBE_PTC511); in ixgbe_update_stats()
6251 hwstats->ptc1023 += IXGBE_READ_REG(hw, IXGBE_PTC1023); in ixgbe_update_stats()
6252 hwstats->ptc1522 += IXGBE_READ_REG(hw, IXGBE_PTC1522); in ixgbe_update_stats()
6253 hwstats->bptc += IXGBE_READ_REG(hw, IXGBE_BPTC); in ixgbe_update_stats()
6272 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_fdir_reinit_subtask() local
6290 if (ixgbe_reinit_fdir_tables_82599(hw) == 0) { in ixgbe_fdir_reinit_subtask()
6295 IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_FLOW_DIR); in ixgbe_fdir_reinit_subtask()
6313 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_check_hang_subtask() local
6335 IXGBE_WRITE_REG(hw, IXGBE_EICS, in ixgbe_check_hang_subtask()
6357 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_watchdog_update_link() local
6365 if (hw->mac.ops.check_link) { in ixgbe_watchdog_update_link()
6366 hw->mac.ops.check_link(hw, &link_speed, &link_up, false); in ixgbe_watchdog_update_link()
6377 hw->mac.ops.fc_enable(hw); in ixgbe_watchdog_update_link()
6385 IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMC_LSC); in ixgbe_watchdog_update_link()
6386 IXGBE_WRITE_FLUSH(hw); in ixgbe_watchdog_update_link()
6418 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_watchdog_link_is_up() local
6431 switch (hw->mac.type) { in ixgbe_watchdog_link_is_up()
6433 u32 frctl = IXGBE_READ_REG(hw, IXGBE_FCTRL); in ixgbe_watchdog_link_is_up()
6434 u32 rmcs = IXGBE_READ_REG(hw, IXGBE_RMCS); in ixgbe_watchdog_link_is_up()
6443 u32 mflcn = IXGBE_READ_REG(hw, IXGBE_MFLCN); in ixgbe_watchdog_link_is_up()
6444 u32 fccfg = IXGBE_READ_REG(hw, IXGBE_FCCFG); in ixgbe_watchdog_link_is_up()
6515 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_watchdog_link_is_down() local
6525 if (ixgbe_is_sfp(hw) && hw->mac.type == ixgbe_mac_82598EB) in ixgbe_watchdog_link_is_down()
6554 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_vf_tx_pending() local
6564 if (hw->mac.type >= ixgbe_mac_X550) in ixgbe_vf_tx_pending()
6571 h = IXGBE_READ_REG(hw, IXGBE_PVFTDHN(q_per_pool, i, j)); in ixgbe_vf_tx_pending()
6572 t = IXGBE_READ_REG(hw, IXGBE_PVFTDTN(q_per_pool, i, j)); in ixgbe_vf_tx_pending()
6617 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_check_for_bad_vf() local
6627 gpc = IXGBE_READ_REG(hw, IXGBE_TXDGPC); in ixgbe_check_for_bad_vf()
6667 if (adapter->hw.mac.type == ixgbe_mac_82598EB || in ixgbe_spoof_check()
6671 ssvpc = IXGBE_READ_REG(&adapter->hw, IXGBE_SSVPC); in ixgbe_spoof_check()
6726 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_sfp_detection_subtask() local
6744 err = hw->phy.ops.identify_sfp(hw); in ixgbe_sfp_detection_subtask()
6769 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_sfp_detection_subtask()
6770 err = hw->phy.ops.reset(hw); in ixgbe_sfp_detection_subtask()
6772 err = hw->mac.ops.setup_sfp(hw); in ixgbe_sfp_detection_subtask()
6778 e_info(probe, "detected SFP+: %d\n", hw->phy.sfp_type); in ixgbe_sfp_detection_subtask()
6799 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_sfp_link_config_subtask() local
6812 speed = hw->phy.autoneg_advertised; in ixgbe_sfp_link_config_subtask()
6813 if ((!speed) && (hw->mac.ops.get_link_capabilities)) { in ixgbe_sfp_link_config_subtask()
6814 hw->mac.ops.get_link_capabilities(hw, &speed, &autoneg); in ixgbe_sfp_link_config_subtask()
6823 if (hw->mac.ops.setup_link) in ixgbe_sfp_link_config_subtask()
6824 hw->mac.ops.setup_link(hw, speed, true); in ixgbe_sfp_link_config_subtask()
6854 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_phy_interrupt_subtask() local
6862 if (!hw->phy.ops.handle_lasi) in ixgbe_phy_interrupt_subtask()
6865 status = hw->phy.ops.handle_lasi(&adapter->hw); in ixgbe_phy_interrupt_subtask()
6903 if (ixgbe_removed(adapter->hw.hw_addr)) { in ixgbe_service_task()
7443 ixgbe_fdir_add_signature_filter_82599(&q_vector->adapter->hw, in ixgbe_atr()
7660 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_set_mac() local
7667 ixgbe_del_mac_filter(adapter, hw->mac.addr, VMDQ_P(0)); in ixgbe_set_mac()
7669 memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len); in ixgbe_set_mac()
7671 ret = ixgbe_add_mac_filter(adapter, hw->mac.addr, VMDQ_P(0)); in ixgbe_set_mac()
7679 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_mdio_read() local
7683 if (prtad != hw->phy.mdio.prtad) in ixgbe_mdio_read()
7685 rc = hw->phy.ops.read_reg(hw, addr, devad, &value); in ixgbe_mdio_read()
7695 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_mdio_write() local
7697 if (prtad != hw->phy.mdio.prtad) in ixgbe_mdio_write()
7699 return hw->phy.ops.write_reg(hw, addr, devad, value); in ixgbe_mdio_write()
7712 return mdio_mii_ioctl(&adapter->hw.phy.mdio, if_mii(req), cmd); in ixgbe_ioctl()
7727 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_add_sanmac_netdev() local
7729 if (is_valid_ether_addr(hw->mac.san_addr)) { in ixgbe_add_sanmac_netdev()
7731 err = dev_addr_add(dev, hw->mac.san_addr, NETDEV_HW_ADDR_T_SAN); in ixgbe_add_sanmac_netdev()
7735 hw->mac.ops.set_vmdq_san_mac(hw, VMDQ_P(0)); in ixgbe_add_sanmac_netdev()
7751 struct ixgbe_mac_info *mac = &adapter->hw.mac; in ixgbe_del_sanmac_netdev()
7841 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_validate_rtr() local
7848 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_validate_rtr()
7851 reg = IXGBE_READ_REG(hw, IXGBE_RTRUP2TC); in ixgbe_validate_rtr()
7863 IXGBE_WRITE_REG(hw, IXGBE_RTRUP2TC, reg); in ixgbe_validate_rtr()
7903 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_setup_tc() local
7910 if (hw->mac.type == ixgbe_mac_82598EB && tc && tc < MAX_TRAFFIC_CLASS) in ixgbe_setup_tc()
7935 if (adapter->hw.mac.type == ixgbe_mac_82598EB) { in ixgbe_setup_tc()
7936 adapter->last_lfc_mode = adapter->hw.fc.requested_mode; in ixgbe_setup_tc()
7937 adapter->hw.fc.requested_mode = ixgbe_fc_none; in ixgbe_setup_tc()
7942 if (adapter->hw.mac.type == ixgbe_mac_82598EB) in ixgbe_setup_tc()
7943 adapter->hw.fc.requested_mode = adapter->last_lfc_mode; in ixgbe_setup_tc()
8099 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_add_vxlan_port() local
8119 IXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, new_port); in ixgbe_add_vxlan_port()
8175 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_configure_bridge_mode() local
8182 IXGBE_WRITE_REG(&adapter->hw, IXGBE_PFDTXGSWC, 0); in ixgbe_configure_bridge_mode()
8188 vmdctl = IXGBE_READ_REG(hw, IXGBE_VMD_CTL); in ixgbe_configure_bridge_mode()
8190 IXGBE_WRITE_REG(hw, IXGBE_VMD_CTL, vmdctl); in ixgbe_configure_bridge_mode()
8197 if (hw->mac.ops.set_source_address_pruning) in ixgbe_configure_bridge_mode()
8198 hw->mac.ops.set_source_address_pruning(hw, in ixgbe_configure_bridge_mode()
8205 IXGBE_WRITE_REG(&adapter->hw, IXGBE_PFDTXGSWC, in ixgbe_configure_bridge_mode()
8211 vmdctl = IXGBE_READ_REG(hw, IXGBE_VMD_CTL); in ixgbe_configure_bridge_mode()
8214 IXGBE_WRITE_REG(hw, IXGBE_VMD_CTL, vmdctl); in ixgbe_configure_bridge_mode()
8221 if (hw->mac.ops.set_source_address_pruning) in ixgbe_configure_bridge_mode()
8222 hw->mac.ops.set_source_address_pruning(hw, in ixgbe_configure_bridge_mode()
8466 if (ixgbe_pcie_from_parent(&adapter->hw)) in ixgbe_enumerate_functions()
8503 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_wol_supported() local
8514 if (hw->bus.func != 0) in ixgbe_wol_supported()
8550 (hw->bus.func == 0))) { in ixgbe_wol_supported()
8567 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_get_platform_mac_addr() local
8572 ether_addr_copy(hw->mac.perm_addr, addr); in ixgbe_get_platform_mac_addr()
8578 ether_addr_copy(hw->mac.perm_addr, idprom->id_ethaddr); in ixgbe_get_platform_mac_addr()
8597 struct ixgbe_hw *hw; in ixgbe_probe() local
8667 hw = &adapter->hw; in ixgbe_probe()
8668 hw->back = adapter; in ixgbe_probe()
8671 hw->hw_addr = ioremap(pci_resource_start(pdev, 0), in ixgbe_probe()
8673 adapter->io_addr = hw->hw_addr; in ixgbe_probe()
8674 if (!hw->hw_addr) { in ixgbe_probe()
8685 memcpy(&hw->mac.ops, ii->mac_ops, sizeof(hw->mac.ops)); in ixgbe_probe()
8686 hw->mac.type = ii->mac; in ixgbe_probe()
8687 hw->mvals = ii->mvals; in ixgbe_probe()
8690 memcpy(&hw->eeprom.ops, ii->eeprom_ops, sizeof(hw->eeprom.ops)); in ixgbe_probe()
8691 eec = IXGBE_READ_REG(hw, IXGBE_EEC(hw)); in ixgbe_probe()
8692 if (ixgbe_removed(hw->hw_addr)) { in ixgbe_probe()
8698 hw->eeprom.ops.read = &ixgbe_read_eeprom_bit_bang_generic; in ixgbe_probe()
8701 memcpy(&hw->phy.ops, ii->phy_ops, sizeof(hw->phy.ops)); in ixgbe_probe()
8702 hw->phy.sfp_type = ixgbe_sfp_type_unknown; in ixgbe_probe()
8704 hw->phy.mdio.prtad = MDIO_PRTAD_NONE; in ixgbe_probe()
8705 hw->phy.mdio.mmds = 0; in ixgbe_probe()
8706 hw->phy.mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22; in ixgbe_probe()
8707 hw->phy.mdio.dev = netdev; in ixgbe_probe()
8708 hw->phy.mdio.mdio_read = ixgbe_mdio_read; in ixgbe_probe()
8709 hw->phy.mdio.mdio_write = ixgbe_mdio_write; in ixgbe_probe()
8711 ii->get_invariants(hw); in ixgbe_probe()
8719 switch (adapter->hw.mac.type) { in ixgbe_probe()
8724 IXGBE_WRITE_REG(&adapter->hw, IXGBE_WUS, ~0); in ixgbe_probe()
8735 u32 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_probe()
8741 hw->allow_unsupported_sfp = allow_unsupported_sfp; in ixgbe_probe()
8744 hw->phy.reset_if_overtemp = true; in ixgbe_probe()
8745 err = hw->mac.ops.reset_hw(hw); in ixgbe_probe()
8746 hw->phy.reset_if_overtemp = false; in ixgbe_probe()
8760 if (adapter->hw.mac.type == ixgbe_mac_82598EB) in ixgbe_probe()
8763 ixgbe_init_mbx_params_pf(hw); in ixgbe_probe()
8764 memcpy(&hw->mbx.ops, ii->mbx_ops, sizeof(hw->mbx.ops)); in ixgbe_probe()
8782 switch (adapter->hw.mac.type) { in ixgbe_probe()
8811 switch (adapter->hw.mac.type) { in ixgbe_probe()
8831 if (hw->mac.ops.get_device_caps) { in ixgbe_probe()
8832 hw->mac.ops.get_device_caps(hw, &device_caps); in ixgbe_probe()
8860 if (hw->eeprom.ops.validate_checksum(hw, NULL) < 0) { in ixgbe_probe()
8868 memcpy(netdev->dev_addr, hw->mac.perm_addr, netdev->addr_len); in ixgbe_probe()
8876 ixgbe_mac_set_default_filter(adapter, hw->mac.perm_addr); in ixgbe_probe()
8881 if (ixgbe_removed(hw->hw_addr)) { in ixgbe_probe()
8895 hw->eeprom.ops.read(hw, 0x2c, &adapter->eeprom_cap); in ixgbe_probe()
8896 hw->wol_enabled = ixgbe_wol_supported(adapter, pdev->device, in ixgbe_probe()
8898 if (hw->wol_enabled) in ixgbe_probe()
8904 hw->eeprom.ops.read(hw, 0x2e, &adapter->eeprom_verh); in ixgbe_probe()
8905 hw->eeprom.ops.read(hw, 0x2d, &adapter->eeprom_verl); in ixgbe_probe()
8908 if (ixgbe_pcie_from_parent(hw)) in ixgbe_probe()
8911 hw->mac.ops.get_bus_info(hw); in ixgbe_probe()
8918 switch (hw->mac.type) { in ixgbe_probe()
8931 err = ixgbe_read_pba_string_generic(hw, part_str, sizeof(part_str)); in ixgbe_probe()
8934 if (ixgbe_is_sfp(hw) && hw->phy.sfp_type != ixgbe_sfp_type_not_present) in ixgbe_probe()
8936 hw->mac.type, hw->phy.type, hw->phy.sfp_type, in ixgbe_probe()
8940 hw->mac.type, hw->phy.type, part_str); in ixgbe_probe()
8945 err = hw->mac.ops.start_hw(hw); in ixgbe_probe()
8963 if (hw->mac.ops.disable_tx_laser) in ixgbe_probe()
8964 hw->mac.ops.disable_tx_laser(hw); in ixgbe_probe()
8984 if (hw->mac.ops.set_fw_drv_ver) in ixgbe_probe()
8985 hw->mac.ops.set_fw_drv_ver(hw, 0xFF, 0xFF, 0xFF, in ixgbe_probe()
9001 if (ixgbe_mng_enabled(hw) && ixgbe_is_sfp(hw) && hw->mac.ops.setup_link) in ixgbe_probe()
9002 hw->mac.ops.setup_link(hw, in ixgbe_probe()
9059 IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_CTRL, in ixgbe_remove()
9117 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_io_error_detected() local
9123 if (adapter->hw.mac.type == ixgbe_mac_82598EB || in ixgbe_io_error_detected()
9138 dw0 = ixgbe_read_pci_cfg_dword(hw, pos + PCI_ERR_HEADER_LOG); in ixgbe_io_error_detected()
9139 dw1 = ixgbe_read_pci_cfg_dword(hw, pos + PCI_ERR_HEADER_LOG + 4); in ixgbe_io_error_detected()
9140 dw2 = ixgbe_read_pci_cfg_dword(hw, pos + PCI_ERR_HEADER_LOG + 8); in ixgbe_io_error_detected()
9141 dw3 = ixgbe_read_pci_cfg_dword(hw, pos + PCI_ERR_HEADER_LOG + 12); in ixgbe_io_error_detected()
9142 if (ixgbe_removed(hw->hw_addr)) in ixgbe_io_error_detected()
9159 switch (adapter->hw.mac.type) { in ixgbe_io_error_detected()
9251 adapter->hw.hw_addr = adapter->io_addr; in ixgbe_io_slot_reset()
9259 IXGBE_WRITE_REG(&adapter->hw, IXGBE_WUS, ~0); in ixgbe_io_slot_reset()