Lines Matching +full:hw +full:- +full:flow +full:- +full:ctrl
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 1999 - 2018 Intel Corporation. */
18 static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw,
21 static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
25 * ixgbe_set_pcie_completion_timeout - set pci-e completion timeout
26 * @hw: pointer to the HW structure
30 * than the 10ms recommended by the pci-e spec. To address this we need to
34 static void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw) in ixgbe_set_pcie_completion_timeout() argument
36 u32 gcr = IXGBE_READ_REG(hw, IXGBE_GCR); in ixgbe_set_pcie_completion_timeout()
39 if (ixgbe_removed(hw->hw_addr)) in ixgbe_set_pcie_completion_timeout()
60 pcie_devctl2 = ixgbe_read_pci_cfg_word(hw, IXGBE_PCI_DEVICE_CONTROL2); in ixgbe_set_pcie_completion_timeout()
62 ixgbe_write_pci_cfg_word(hw, IXGBE_PCI_DEVICE_CONTROL2, pcie_devctl2); in ixgbe_set_pcie_completion_timeout()
66 IXGBE_WRITE_REG(hw, IXGBE_GCR, gcr); in ixgbe_set_pcie_completion_timeout()
69 static s32 ixgbe_get_invariants_82598(struct ixgbe_hw *hw) in ixgbe_get_invariants_82598() argument
71 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_get_invariants_82598()
74 ixgbe_identify_phy_generic(hw); in ixgbe_get_invariants_82598()
76 mac->mcft_size = IXGBE_82598_MC_TBL_SIZE; in ixgbe_get_invariants_82598()
77 mac->vft_size = IXGBE_82598_VFT_TBL_SIZE; in ixgbe_get_invariants_82598()
78 mac->num_rar_entries = IXGBE_82598_RAR_ENTRIES; in ixgbe_get_invariants_82598()
79 mac->rx_pb_size = IXGBE_82598_RX_PB_SIZE; in ixgbe_get_invariants_82598()
80 mac->max_rx_queues = IXGBE_82598_MAX_RX_QUEUES; in ixgbe_get_invariants_82598()
81 mac->max_tx_queues = IXGBE_82598_MAX_TX_QUEUES; in ixgbe_get_invariants_82598()
82 mac->max_msix_vectors = ixgbe_get_pcie_msix_count_generic(hw); in ixgbe_get_invariants_82598()
88 * ixgbe_init_phy_ops_82598 - PHY/SFP specific init
89 * @hw: pointer to hardware structure
96 static s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw) in ixgbe_init_phy_ops_82598() argument
98 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_phy_ops_82598()
99 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_phy_ops_82598()
104 phy->ops.identify(hw); in ixgbe_init_phy_ops_82598()
107 if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) { in ixgbe_init_phy_ops_82598()
108 mac->ops.setup_link = &ixgbe_setup_copper_link_82598; in ixgbe_init_phy_ops_82598()
109 mac->ops.get_link_capabilities = in ixgbe_init_phy_ops_82598()
113 switch (hw->phy.type) { in ixgbe_init_phy_ops_82598()
115 phy->ops.setup_link = &ixgbe_setup_phy_link_tnx; in ixgbe_init_phy_ops_82598()
116 phy->ops.check_link = &ixgbe_check_phy_link_tnx; in ixgbe_init_phy_ops_82598()
119 phy->ops.reset = &ixgbe_reset_phy_nl; in ixgbe_init_phy_ops_82598()
122 ret_val = phy->ops.identify_sfp(hw); in ixgbe_init_phy_ops_82598()
125 if (hw->phy.sfp_type == ixgbe_sfp_type_unknown) in ixgbe_init_phy_ops_82598()
126 return -EOPNOTSUPP; in ixgbe_init_phy_ops_82598()
129 ret_val = ixgbe_get_sfp_init_sequence_offsets(hw, in ixgbe_init_phy_ops_82598()
133 return -EOPNOTSUPP; in ixgbe_init_phy_ops_82598()
143 * ixgbe_start_hw_82598 - Prepare hardware for Tx/Rx
144 * @hw: pointer to hardware structure
151 static s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw) in ixgbe_start_hw_82598() argument
155 ret_val = ixgbe_start_hw_generic(hw); in ixgbe_start_hw_82598()
160 ixgbe_set_pcie_completion_timeout(hw); in ixgbe_start_hw_82598()
166 * ixgbe_get_link_capabilities_82598 - Determines link capabilities
167 * @hw: pointer to hardware structure
169 * @autoneg: boolean auto-negotiation value
173 static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, in ixgbe_get_link_capabilities_82598() argument
184 if (hw->mac.orig_link_settings_stored) in ixgbe_get_link_capabilities_82598()
185 autoc = hw->mac.orig_autoc; in ixgbe_get_link_capabilities_82598()
187 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); in ixgbe_get_link_capabilities_82598()
216 return -EIO; in ixgbe_get_link_capabilities_82598()
223 * ixgbe_get_media_type_82598 - Determines media type
224 * @hw: pointer to hardware structure
228 static enum ixgbe_media_type ixgbe_get_media_type_82598(struct ixgbe_hw *hw) in ixgbe_get_media_type_82598() argument
231 switch (hw->phy.type) { in ixgbe_get_media_type_82598()
241 switch (hw->device_id) { in ixgbe_get_media_type_82598()
269 * ixgbe_fc_enable_82598 - Enable flow control
270 * @hw: pointer to hardware structure
272 * Enable flow control according to the current settings.
274 static s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) in ixgbe_fc_enable_82598() argument
285 if (!hw->fc.pause_time) in ixgbe_fc_enable_82598()
286 return -EINVAL; in ixgbe_fc_enable_82598()
290 if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && in ixgbe_fc_enable_82598()
291 hw->fc.high_water[i]) { in ixgbe_fc_enable_82598()
292 if (!hw->fc.low_water[i] || in ixgbe_fc_enable_82598()
293 hw->fc.low_water[i] >= hw->fc.high_water[i]) { in ixgbe_fc_enable_82598()
294 hw_dbg(hw, "Invalid water mark configuration\n"); in ixgbe_fc_enable_82598()
295 return -EINVAL; in ixgbe_fc_enable_82598()
305 hw->mac.ops.check_link(hw, &link_speed, &link_up, false); in ixgbe_fc_enable_82598()
307 switch (hw->fc.requested_mode) { in ixgbe_fc_enable_82598()
309 hw->fc.requested_mode = ixgbe_fc_tx_pause; in ixgbe_fc_enable_82598()
312 hw->fc.requested_mode = ixgbe_fc_none; in ixgbe_fc_enable_82598()
321 hw->mac.ops.fc_autoneg(hw); in ixgbe_fc_enable_82598()
323 /* Disable any previous flow control settings */ in ixgbe_fc_enable_82598()
324 fctrl_reg = IXGBE_READ_REG(hw, IXGBE_FCTRL); in ixgbe_fc_enable_82598()
327 rmcs_reg = IXGBE_READ_REG(hw, IXGBE_RMCS); in ixgbe_fc_enable_82598()
332 * 0: Flow control is completely disabled in ixgbe_fc_enable_82598()
333 * 1: Rx flow control is enabled (we can receive pause frames, in ixgbe_fc_enable_82598()
335 * 2: Tx flow control is enabled (we can send pause frames but in ixgbe_fc_enable_82598()
337 * 3: Both Rx and Tx flow control (symmetric) are enabled. in ixgbe_fc_enable_82598()
340 switch (hw->fc.current_mode) { in ixgbe_fc_enable_82598()
343 * Flow control is disabled by software override or autoneg. in ixgbe_fc_enable_82598()
344 * The code below will actually disable it in the HW. in ixgbe_fc_enable_82598()
349 * Rx Flow control is enabled and Tx Flow control is in ixgbe_fc_enable_82598()
360 * Tx Flow control is enabled, and Rx Flow control is in ixgbe_fc_enable_82598()
366 /* Flow control (both Rx and Tx) is enabled by SW override. */ in ixgbe_fc_enable_82598()
371 hw_dbg(hw, "Flow control param set incorrectly\n"); in ixgbe_fc_enable_82598()
372 return -EIO; in ixgbe_fc_enable_82598()
375 /* Set 802.3x based flow control settings. */ in ixgbe_fc_enable_82598()
377 IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl_reg); in ixgbe_fc_enable_82598()
378 IXGBE_WRITE_REG(hw, IXGBE_RMCS, rmcs_reg); in ixgbe_fc_enable_82598()
382 if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && in ixgbe_fc_enable_82598()
383 hw->fc.high_water[i]) { in ixgbe_fc_enable_82598()
384 fcrtl = (hw->fc.low_water[i] << 10) | IXGBE_FCRTL_XONE; in ixgbe_fc_enable_82598()
385 fcrth = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN; in ixgbe_fc_enable_82598()
386 IXGBE_WRITE_REG(hw, IXGBE_FCRTL(i), fcrtl); in ixgbe_fc_enable_82598()
387 IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), fcrth); in ixgbe_fc_enable_82598()
389 IXGBE_WRITE_REG(hw, IXGBE_FCRTL(i), 0); in ixgbe_fc_enable_82598()
390 IXGBE_WRITE_REG(hw, IXGBE_FCRTH(i), 0); in ixgbe_fc_enable_82598()
396 reg = hw->fc.pause_time * 0x00010001; in ixgbe_fc_enable_82598()
398 IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), reg); in ixgbe_fc_enable_82598()
400 /* Configure flow control refresh threshold value */ in ixgbe_fc_enable_82598()
401 IXGBE_WRITE_REG(hw, IXGBE_FCRTV, hw->fc.pause_time / 2); in ixgbe_fc_enable_82598()
407 * ixgbe_start_mac_link_82598 - Configures MAC link settings
408 * @hw: pointer to hardware structure
414 static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw, in ixgbe_start_mac_link_82598() argument
423 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); in ixgbe_start_mac_link_82598()
425 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg); in ixgbe_start_mac_link_82598()
435 links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); in ixgbe_start_mac_link_82598()
441 status = -EIO; in ixgbe_start_mac_link_82598()
442 hw_dbg(hw, "Autonegotiation did not complete.\n"); in ixgbe_start_mac_link_82598()
454 * ixgbe_validate_link_ready - Function looks for phy link
455 * @hw: pointer to hardware structure
460 static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw) in ixgbe_validate_link_ready() argument
465 if (hw->device_id != IXGBE_DEV_ID_82598AT2) in ixgbe_validate_link_ready()
470 hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, &an_reg); in ixgbe_validate_link_ready()
480 hw_dbg(hw, "Link was indicated but link is down\n"); in ixgbe_validate_link_ready()
481 return -EIO; in ixgbe_validate_link_ready()
488 * ixgbe_check_mac_link_82598 - Get link/speed status
489 * @hw: pointer to hardware structure
496 static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, in ixgbe_check_mac_link_82598() argument
510 if (hw->phy.type == ixgbe_phy_nl) { in ixgbe_check_mac_link_82598()
511 hw->phy.ops.read_reg(hw, 0xC79F, MDIO_MMD_PMAPMD, &link_reg); in ixgbe_check_mac_link_82598()
512 hw->phy.ops.read_reg(hw, 0xC79F, MDIO_MMD_PMAPMD, &link_reg); in ixgbe_check_mac_link_82598()
513 hw->phy.ops.read_reg(hw, 0xC00C, MDIO_MMD_PMAPMD, in ixgbe_check_mac_link_82598()
525 hw->phy.ops.read_reg(hw, 0xC79F, in ixgbe_check_mac_link_82598()
528 hw->phy.ops.read_reg(hw, 0xC00C, in ixgbe_check_mac_link_82598()
543 links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); in ixgbe_check_mac_link_82598()
553 links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); in ixgbe_check_mac_link_82598()
567 if ((hw->device_id == IXGBE_DEV_ID_82598AT2) && *link_up && in ixgbe_check_mac_link_82598()
568 (ixgbe_validate_link_ready(hw) != 0)) in ixgbe_check_mac_link_82598()
575 * ixgbe_setup_mac_link_82598 - Set MAC link speed
576 * @hw: pointer to hardware structure
582 static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_82598() argument
588 u32 curr_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); in ixgbe_setup_mac_link_82598()
593 ixgbe_get_link_capabilities_82598(hw, &link_capabilities, &autoneg); in ixgbe_setup_mac_link_82598()
597 return -EINVAL; in ixgbe_setup_mac_link_82598()
608 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc); in ixgbe_setup_mac_link_82598()
615 return ixgbe_start_mac_link_82598(hw, autoneg_wait_to_complete); in ixgbe_setup_mac_link_82598()
620 * ixgbe_setup_copper_link_82598 - Set the PHY autoneg advertised field
621 * @hw: pointer to hardware structure
627 static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw, in ixgbe_setup_copper_link_82598() argument
634 status = hw->phy.ops.setup_link_speed(hw, speed, in ixgbe_setup_copper_link_82598()
637 ixgbe_start_mac_link_82598(hw, autoneg_wait_to_complete); in ixgbe_setup_copper_link_82598()
643 * ixgbe_reset_hw_82598 - Performs hardware reset
644 * @hw: pointer to hardware structure
650 static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw) in ixgbe_reset_hw_82598() argument
654 u32 ctrl; in ixgbe_reset_hw_82598() local
661 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_82598()
670 hw->mac.ops.read_analog_reg8(hw, IXGBE_ATLAS_PDN_LPBK, &analog_val); in ixgbe_reset_hw_82598()
673 hw->mac.ops.read_analog_reg8(hw, IXGBE_ATLAS_PDN_LPBK, in ixgbe_reset_hw_82598()
676 hw->mac.ops.write_analog_reg8(hw, IXGBE_ATLAS_PDN_LPBK, in ixgbe_reset_hw_82598()
679 hw->mac.ops.read_analog_reg8(hw, IXGBE_ATLAS_PDN_10G, in ixgbe_reset_hw_82598()
682 hw->mac.ops.write_analog_reg8(hw, IXGBE_ATLAS_PDN_10G, in ixgbe_reset_hw_82598()
685 hw->mac.ops.read_analog_reg8(hw, IXGBE_ATLAS_PDN_1G, in ixgbe_reset_hw_82598()
688 hw->mac.ops.write_analog_reg8(hw, IXGBE_ATLAS_PDN_1G, in ixgbe_reset_hw_82598()
691 hw->mac.ops.read_analog_reg8(hw, IXGBE_ATLAS_PDN_AN, in ixgbe_reset_hw_82598()
694 hw->mac.ops.write_analog_reg8(hw, IXGBE_ATLAS_PDN_AN, in ixgbe_reset_hw_82598()
699 if (hw->phy.reset_disable == false) { in ixgbe_reset_hw_82598()
703 phy_status = hw->phy.ops.init(hw); in ixgbe_reset_hw_82598()
704 if (phy_status == -EOPNOTSUPP) in ixgbe_reset_hw_82598()
706 if (phy_status == -ENOENT) in ixgbe_reset_hw_82598()
709 hw->phy.ops.reset(hw); in ixgbe_reset_hw_82598()
717 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL) | IXGBE_CTRL_RST; in ixgbe_reset_hw_82598()
718 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl); in ixgbe_reset_hw_82598()
719 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_hw_82598()
722 /* Poll for reset bit to self-clear indicating reset is complete */ in ixgbe_reset_hw_82598()
724 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_82598()
725 if (!(ctrl & IXGBE_CTRL_RST)) in ixgbe_reset_hw_82598()
729 if (ctrl & IXGBE_CTRL_RST) { in ixgbe_reset_hw_82598()
730 status = -EIO; in ixgbe_reset_hw_82598()
731 hw_dbg(hw, "Reset polling failed to complete.\n"); in ixgbe_reset_hw_82598()
739 * for any pending HW events to complete. in ixgbe_reset_hw_82598()
741 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_82598()
742 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_82598()
746 gheccr = IXGBE_READ_REG(hw, IXGBE_GHECCR); in ixgbe_reset_hw_82598()
748 IXGBE_WRITE_REG(hw, IXGBE_GHECCR, gheccr); in ixgbe_reset_hw_82598()
755 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); in ixgbe_reset_hw_82598()
756 if (hw->mac.orig_link_settings_stored == false) { in ixgbe_reset_hw_82598()
757 hw->mac.orig_autoc = autoc; in ixgbe_reset_hw_82598()
758 hw->mac.orig_link_settings_stored = true; in ixgbe_reset_hw_82598()
759 } else if (autoc != hw->mac.orig_autoc) { in ixgbe_reset_hw_82598()
760 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, hw->mac.orig_autoc); in ixgbe_reset_hw_82598()
764 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_82598()
770 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_82598()
779 * ixgbe_set_vmdq_82598 - Associate a VMDq set index with a rx address
780 * @hw: pointer to hardware struct
784 static s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) in ixgbe_set_vmdq_82598() argument
787 u32 rar_entries = hw->mac.num_rar_entries; in ixgbe_set_vmdq_82598()
791 hw_dbg(hw, "RAR index %d is out of range.\n", rar); in ixgbe_set_vmdq_82598()
792 return -EINVAL; in ixgbe_set_vmdq_82598()
795 rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(rar)); in ixgbe_set_vmdq_82598()
798 IXGBE_WRITE_REG(hw, IXGBE_RAH(rar), rar_high); in ixgbe_set_vmdq_82598()
803 * ixgbe_clear_vmdq_82598 - Disassociate a VMDq set index from an rx address
804 * @hw: pointer to hardware struct
808 static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) in ixgbe_clear_vmdq_82598() argument
811 u32 rar_entries = hw->mac.num_rar_entries; in ixgbe_clear_vmdq_82598()
816 hw_dbg(hw, "RAR index %d is out of range.\n", rar); in ixgbe_clear_vmdq_82598()
817 return -EINVAL; in ixgbe_clear_vmdq_82598()
820 rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(rar)); in ixgbe_clear_vmdq_82598()
823 IXGBE_WRITE_REG(hw, IXGBE_RAH(rar), rar_high); in ixgbe_clear_vmdq_82598()
830 * ixgbe_set_vfta_82598 - Set VLAN filter table
831 * @hw: pointer to hardware structure
835 * @vlvf_bypass: boolean flag - unused
839 static s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind, in ixgbe_set_vfta_82598() argument
848 return -EINVAL; in ixgbe_set_vfta_82598()
850 /* Determine 32-bit word position in array */ in ixgbe_set_vfta_82598()
858 bits = IXGBE_READ_REG(hw, IXGBE_VFTAVIND(vftabyte, regindex)); in ixgbe_set_vfta_82598()
861 IXGBE_WRITE_REG(hw, IXGBE_VFTAVIND(vftabyte, regindex), bits); in ixgbe_set_vfta_82598()
866 bits = IXGBE_READ_REG(hw, IXGBE_VFTA(regindex)); in ixgbe_set_vfta_82598()
873 IXGBE_WRITE_REG(hw, IXGBE_VFTA(regindex), bits); in ixgbe_set_vfta_82598()
879 * ixgbe_clear_vfta_82598 - Clear VLAN filter table
880 * @hw: pointer to hardware structure
884 static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw) in ixgbe_clear_vfta_82598() argument
889 for (offset = 0; offset < hw->mac.vft_size; offset++) in ixgbe_clear_vfta_82598()
890 IXGBE_WRITE_REG(hw, IXGBE_VFTA(offset), 0); in ixgbe_clear_vfta_82598()
893 for (offset = 0; offset < hw->mac.vft_size; offset++) in ixgbe_clear_vfta_82598()
894 IXGBE_WRITE_REG(hw, IXGBE_VFTAVIND(vlanbyte, offset), in ixgbe_clear_vfta_82598()
901 * ixgbe_read_analog_reg8_82598 - Reads 8 bit Atlas analog register
902 * @hw: pointer to hardware structure
908 static s32 ixgbe_read_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 *val) in ixgbe_read_analog_reg8_82598() argument
912 IXGBE_WRITE_REG(hw, IXGBE_ATLASCTL, in ixgbe_read_analog_reg8_82598()
914 IXGBE_WRITE_FLUSH(hw); in ixgbe_read_analog_reg8_82598()
916 atlas_ctl = IXGBE_READ_REG(hw, IXGBE_ATLASCTL); in ixgbe_read_analog_reg8_82598()
923 * ixgbe_write_analog_reg8_82598 - Writes 8 bit Atlas analog register
924 * @hw: pointer to hardware structure
930 static s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val) in ixgbe_write_analog_reg8_82598() argument
935 IXGBE_WRITE_REG(hw, IXGBE_ATLASCTL, atlas_ctl); in ixgbe_write_analog_reg8_82598()
936 IXGBE_WRITE_FLUSH(hw); in ixgbe_write_analog_reg8_82598()
943 * ixgbe_read_i2c_phy_82598 - Reads 8 bit word over I2C interface.
944 * @hw: pointer to hardware structure
951 static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr, in ixgbe_read_i2c_phy_82598() argument
961 if (IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1) in ixgbe_read_i2c_phy_82598()
966 if (hw->mac.ops.acquire_swfw_sync(hw, gssr) != 0) in ixgbe_read_i2c_phy_82598()
967 return -EBUSY; in ixgbe_read_i2c_phy_82598()
969 if (hw->phy.type == ixgbe_phy_nl) { in ixgbe_read_i2c_phy_82598()
977 hw->phy.ops.write_reg_mdi(hw, in ixgbe_read_i2c_phy_82598()
984 hw->phy.ops.read_reg_mdi(hw, in ixgbe_read_i2c_phy_82598()
995 hw_dbg(hw, "EEPROM read did not pass.\n"); in ixgbe_read_i2c_phy_82598()
996 status = -ENOENT; in ixgbe_read_i2c_phy_82598()
1001 hw->phy.ops.read_reg_mdi(hw, IXGBE_MDIO_PMA_PMD_SDA_SCL_DATA, in ixgbe_read_i2c_phy_82598()
1006 status = -EIO; in ixgbe_read_i2c_phy_82598()
1010 hw->mac.ops.release_swfw_sync(hw, gssr); in ixgbe_read_i2c_phy_82598()
1015 * ixgbe_read_i2c_eeprom_82598 - Reads 8 bit word over I2C interface.
1016 * @hw: pointer to hardware structure
1022 static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset, in ixgbe_read_i2c_eeprom_82598() argument
1025 return ixgbe_read_i2c_phy_82598(hw, IXGBE_I2C_EEPROM_DEV_ADDR, in ixgbe_read_i2c_eeprom_82598()
1030 * ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface.
1031 * @hw: pointer to hardware structure
1035 * Performs 8 byte read operation to SFP module's SFF-8472 data over I2C
1037 static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset, in ixgbe_read_i2c_sff8472_82598() argument
1040 return ixgbe_read_i2c_phy_82598(hw, IXGBE_I2C_EEPROM_DEV_ADDR2, in ixgbe_read_i2c_sff8472_82598()
1045 * ixgbe_set_lan_id_multi_port_pcie_82598 - Set LAN id for PCIe multiple
1047 * @hw: pointer to the HW structure
1052 static void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw) in ixgbe_set_lan_id_multi_port_pcie_82598() argument
1054 struct ixgbe_bus_info *bus = &hw->bus; in ixgbe_set_lan_id_multi_port_pcie_82598()
1058 ixgbe_set_lan_id_multi_port_pcie(hw); in ixgbe_set_lan_id_multi_port_pcie_82598()
1061 hw->eeprom.ops.read(hw, IXGBE_PCIE_GENERAL_PTR, &pci_gen); in ixgbe_set_lan_id_multi_port_pcie_82598()
1064 hw->eeprom.ops.read(hw, pci_gen + IXGBE_PCIE_CTRL2, &pci_ctrl2); in ixgbe_set_lan_id_multi_port_pcie_82598()
1071 bus->func = 0; in ixgbe_set_lan_id_multi_port_pcie_82598()
1077 * ixgbe_set_rxpba_82598 - Initialize RX packet buffer
1078 * @hw: pointer to hardware structure
1083 static void ixgbe_set_rxpba_82598(struct ixgbe_hw *hw, int num_pb, in ixgbe_set_rxpba_82598() argument
1098 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize); in ixgbe_set_rxpba_82598()
1099 /* Setup the last four at 48KB...don't re-init i */ in ixgbe_set_rxpba_82598()
1106 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize); in ixgbe_set_rxpba_82598()
1112 IXGBE_WRITE_REG(hw, IXGBE_TXPBSIZE(i), IXGBE_TXPBSIZE_40KB); in ixgbe_set_rxpba_82598()