Lines Matching +full:gbe +full:- +full:50

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 1999 - 2024 Intel Corporation. */
41 * ixgbe_device_supports_autoneg_fc - Check if phy supports autoneg flow
55 switch (hw->phy.media_type) { in ixgbe_device_supports_autoneg_fc()
58 switch (hw->device_id) { in ixgbe_device_supports_autoneg_fc()
65 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_device_supports_autoneg_fc()
75 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_XFI) in ixgbe_device_supports_autoneg_fc()
82 switch (hw->device_id) { in ixgbe_device_supports_autoneg_fc()
106 hw->device_id); in ixgbe_device_supports_autoneg_fc()
112 * ixgbe_setup_fc_generic - Set up flow control
128 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_generic()
130 return -EINVAL; in ixgbe_setup_fc_generic()
137 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_generic()
138 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_generic()
145 switch (hw->phy.media_type) { in ixgbe_setup_fc_generic()
148 ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &reg_bp); in ixgbe_setup_fc_generic()
158 hw->phy.ops.read_reg(hw, MDIO_AN_ADVERTISE, in ixgbe_setup_fc_generic()
175 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_generic()
179 if (hw->phy.media_type == ixgbe_media_type_backplane) in ixgbe_setup_fc_generic()
182 else if (hw->phy.media_type == ixgbe_media_type_copper) in ixgbe_setup_fc_generic()
192 if (hw->phy.media_type == ixgbe_media_type_backplane) { in ixgbe_setup_fc_generic()
195 } else if (hw->phy.media_type == ixgbe_media_type_copper) { in ixgbe_setup_fc_generic()
213 if (hw->phy.media_type == ixgbe_media_type_backplane) in ixgbe_setup_fc_generic()
216 else if (hw->phy.media_type == ixgbe_media_type_copper) in ixgbe_setup_fc_generic()
221 return -EIO; in ixgbe_setup_fc_generic()
224 if (hw->mac.type != ixgbe_mac_X540) { in ixgbe_setup_fc_generic()
226 * Enable auto-negotiation between the MAC & PHY; in ixgbe_setup_fc_generic()
233 if (hw->fc.strict_ieee) in ixgbe_setup_fc_generic()
245 if (hw->phy.media_type == ixgbe_media_type_backplane) { in ixgbe_setup_fc_generic()
250 ret_val = hw->mac.ops.prot_autoc_write(hw, reg_bp, locked); in ixgbe_setup_fc_generic()
254 } else if ((hw->phy.media_type == ixgbe_media_type_copper) && in ixgbe_setup_fc_generic()
256 hw->phy.ops.write_reg(hw, MDIO_AN_ADVERTISE, in ixgbe_setup_fc_generic()
265 * ixgbe_start_hw_generic - Prepare hardware for Tx/Rx
280 hw->phy.media_type = hw->mac.ops.get_media_type(hw); in ixgbe_start_hw_generic()
283 hw->phy.ops.identify(hw); in ixgbe_start_hw_generic()
286 hw->mac.ops.clear_vfta(hw); in ixgbe_start_hw_generic()
289 hw->mac.ops.clear_hw_cntrs(hw); in ixgbe_start_hw_generic()
298 if (hw->mac.ops.setup_fc) { in ixgbe_start_hw_generic()
299 ret_val = hw->mac.ops.setup_fc(hw); in ixgbe_start_hw_generic()
305 switch (hw->mac.type) { in ixgbe_start_hw_generic()
309 hw->mac.ops.get_device_caps(hw, &device_caps); in ixgbe_start_hw_generic()
311 hw->need_crosstalk_fix = false; in ixgbe_start_hw_generic()
313 hw->need_crosstalk_fix = true; in ixgbe_start_hw_generic()
316 hw->need_crosstalk_fix = false; in ixgbe_start_hw_generic()
321 hw->adapter_stopped = false; in ixgbe_start_hw_generic()
327 * ixgbe_start_hw_gen2 - Init sequence for common device family
331 * of 10 GbE devices.
342 for (i = 0; i < hw->mac.max_tx_queues; i++) { in ixgbe_start_hw_gen2()
352 * ixgbe_init_hw_generic - Generic hardware initialization
366 status = hw->mac.ops.reset_hw(hw); in ixgbe_init_hw_generic()
370 status = hw->mac.ops.start_hw(hw); in ixgbe_init_hw_generic()
374 if (hw->mac.ops.init_led_link_act) in ixgbe_init_hw_generic()
375 hw->mac.ops.init_led_link_act(hw); in ixgbe_init_hw_generic()
381 * ixgbe_clear_hw_cntrs_generic - Generic clear hardware counters
403 if (hw->mac.type >= ixgbe_mac_82599EB) { in ixgbe_clear_hw_cntrs_generic()
414 if (hw->mac.type >= ixgbe_mac_82599EB) { in ixgbe_clear_hw_cntrs_generic()
422 if (hw->mac.type >= ixgbe_mac_82599EB) in ixgbe_clear_hw_cntrs_generic()
439 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_clear_hw_cntrs_generic()
464 if (hw->mac.type >= ixgbe_mac_82599EB) { in ixgbe_clear_hw_cntrs_generic()
476 if (hw->mac.type == ixgbe_mac_X550 || in ixgbe_clear_hw_cntrs_generic()
477 hw->mac.type == ixgbe_mac_X540 || in ixgbe_clear_hw_cntrs_generic()
478 hw->mac.type == ixgbe_mac_e610) { in ixgbe_clear_hw_cntrs_generic()
479 if (hw->phy.id == 0) in ixgbe_clear_hw_cntrs_generic()
480 hw->phy.ops.identify(hw); in ixgbe_clear_hw_cntrs_generic()
483 if (hw->mac.type == ixgbe_mac_X550 || hw->mac.type == ixgbe_mac_X540) { in ixgbe_clear_hw_cntrs_generic()
484 hw->phy.ops.read_reg(hw, IXGBE_PCRC8ECL, MDIO_MMD_PCS, &i); in ixgbe_clear_hw_cntrs_generic()
485 hw->phy.ops.read_reg(hw, IXGBE_PCRC8ECH, MDIO_MMD_PCS, &i); in ixgbe_clear_hw_cntrs_generic()
486 hw->phy.ops.read_reg(hw, IXGBE_LDPCECL, MDIO_MMD_PCS, &i); in ixgbe_clear_hw_cntrs_generic()
487 hw->phy.ops.read_reg(hw, IXGBE_LDPCECH, MDIO_MMD_PCS, &i); in ixgbe_clear_hw_cntrs_generic()
494 * ixgbe_read_pba_string_generic - Reads part number string from EEPROM
512 return -EINVAL; in ixgbe_read_pba_string_generic()
515 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM0_PTR, &data); in ixgbe_read_pba_string_generic()
521 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM1_PTR, &pba_ptr); in ixgbe_read_pba_string_generic()
538 return -ENOSPC; in ixgbe_read_pba_string_generic()
548 pba_num[6] = '-'; in ixgbe_read_pba_string_generic()
556 /* switch all the data but the '-' to hex char */ in ixgbe_read_pba_string_generic()
561 pba_num[offset] += 'A' - 0xA; in ixgbe_read_pba_string_generic()
567 ret_val = hw->eeprom.ops.read(hw, pba_ptr, &length); in ixgbe_read_pba_string_generic()
575 return -EIO; in ixgbe_read_pba_string_generic()
579 if (pba_num_size < (((u32)length * 2) - 1)) { in ixgbe_read_pba_string_generic()
581 return -ENOSPC; in ixgbe_read_pba_string_generic()
586 length--; in ixgbe_read_pba_string_generic()
589 ret_val = hw->eeprom.ops.read(hw, pba_ptr + offset, &data); in ixgbe_read_pba_string_generic()
603 * ixgbe_get_mac_addr_generic - Generic get MAC address
660 * ixgbe_get_bus_info_generic - Generic set PCI bus info
669 hw->bus.type = ixgbe_bus_type_pci_express; in ixgbe_get_bus_info_generic()
672 if (hw->mac.type == ixgbe_mac_e610) in ixgbe_get_bus_info_generic()
678 hw->bus.width = ixgbe_convert_bus_width(link_status); in ixgbe_get_bus_info_generic()
679 hw->bus.speed = ixgbe_convert_bus_speed(link_status); in ixgbe_get_bus_info_generic()
681 hw->mac.ops.set_lan_id(hw); in ixgbe_get_bus_info_generic()
687 * ixgbe_set_lan_id_multi_port_pcie - Set LAN id for PCIe multiple port devices
690 * Determines the LAN function id by reading memory-mapped registers
695 struct ixgbe_bus_info *bus = &hw->bus; in ixgbe_set_lan_id_multi_port_pcie()
700 bus->func = FIELD_GET(IXGBE_STATUS_LAN_ID, reg); in ixgbe_set_lan_id_multi_port_pcie()
701 bus->lan_id = bus->func; in ixgbe_set_lan_id_multi_port_pcie()
706 bus->func ^= 0x1; in ixgbe_set_lan_id_multi_port_pcie()
709 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP) { in ixgbe_set_lan_id_multi_port_pcie()
710 hw->eeprom.ops.read(hw, IXGBE_EEPROM_CTRL_4, &ee_ctrl_4); in ixgbe_set_lan_id_multi_port_pcie()
711 bus->instance_id = FIELD_GET(IXGBE_EE_CTRL_4_INST_ID, in ixgbe_set_lan_id_multi_port_pcie()
717 * ixgbe_stop_adapter_generic - Generic stop Tx/Rx units
734 hw->adapter_stopped = true; in ixgbe_stop_adapter_generic()
737 hw->mac.ops.disable_rx(hw); in ixgbe_stop_adapter_generic()
746 for (i = 0; i < hw->mac.max_tx_queues; i++) in ixgbe_stop_adapter_generic()
750 for (i = 0; i < hw->mac.max_rx_queues; i++) { in ixgbe_stop_adapter_generic()
762 * Prevent the PCI-E bus from hanging by disabling PCI-E primary in ixgbe_stop_adapter_generic()
769 * ixgbe_init_led_link_act_generic - Store the LED index link/activity.
777 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_led_link_act_generic()
789 mac->led_link_act = i; in ixgbe_init_led_link_act_generic()
797 switch (hw->mac.type) { in ixgbe_init_led_link_act_generic()
799 mac->led_link_act = 0; in ixgbe_init_led_link_act_generic()
802 mac->led_link_act = 1; in ixgbe_init_led_link_act_generic()
805 mac->led_link_act = 2; in ixgbe_init_led_link_act_generic()
812 * ixgbe_led_on_generic - Turns on the software controllable LEDs.
821 return -EINVAL; in ixgbe_led_on_generic()
833 * ixgbe_led_off_generic - Turns off the software controllable LEDs.
842 return -EINVAL; in ixgbe_led_off_generic()
854 * ixgbe_init_eeprom_params_generic - Initialize EEPROM params
862 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_generic()
866 if (eeprom->type == ixgbe_eeprom_uninitialized) { in ixgbe_init_eeprom_params_generic()
867 eeprom->type = ixgbe_eeprom_none; in ixgbe_init_eeprom_params_generic()
870 eeprom->semaphore_delay = 10; in ixgbe_init_eeprom_params_generic()
872 eeprom->word_page_size = 0; in ixgbe_init_eeprom_params_generic()
880 eeprom->type = ixgbe_eeprom_spi; in ixgbe_init_eeprom_params_generic()
887 eeprom->word_size = BIT(eeprom_size + in ixgbe_init_eeprom_params_generic()
892 eeprom->address_bits = 16; in ixgbe_init_eeprom_params_generic()
894 eeprom->address_bits = 8; in ixgbe_init_eeprom_params_generic()
896 eeprom->type, eeprom->word_size, eeprom->address_bits); in ixgbe_init_eeprom_params_generic()
903 * ixgbe_write_eeprom_buffer_bit_bang_generic - Write EEPROM using bit-bang
909 * Reads 16 bit word(s) from EEPROM through bit-bang method
917 hw->eeprom.ops.init_params(hw); in ixgbe_write_eeprom_buffer_bit_bang_generic()
919 if (words == 0 || (offset + words > hw->eeprom.word_size)) in ixgbe_write_eeprom_buffer_bit_bang_generic()
920 return -EINVAL; in ixgbe_write_eeprom_buffer_bit_bang_generic()
926 if ((hw->eeprom.word_page_size == 0) && in ixgbe_write_eeprom_buffer_bit_bang_generic()
936 count = (words - i) / IXGBE_EEPROM_RD_BUFFER_MAX_COUNT > 0 ? in ixgbe_write_eeprom_buffer_bit_bang_generic()
937 IXGBE_EEPROM_RD_BUFFER_MAX_COUNT : (words - i); in ixgbe_write_eeprom_buffer_bit_bang_generic()
949 * ixgbe_write_eeprom_buffer_bit_bang - Writes 16 bit word(s) to EEPROM
974 return -EIO; in ixgbe_write_eeprom_buffer_bit_bang()
990 if ((hw->eeprom.address_bits == 8) && in ixgbe_write_eeprom_buffer_bit_bang()
994 /* Send the Write command (8-bit opcode + addr) */ in ixgbe_write_eeprom_buffer_bit_bang()
998 hw->eeprom.address_bits); in ixgbe_write_eeprom_buffer_bit_bang()
1000 page_size = hw->eeprom.word_page_size; in ixgbe_write_eeprom_buffer_bit_bang()
1012 if (((offset + i) & (page_size - 1)) == in ixgbe_write_eeprom_buffer_bit_bang()
1013 (page_size - 1)) in ixgbe_write_eeprom_buffer_bit_bang()
1020 /* Done with writing - release the EEPROM */ in ixgbe_write_eeprom_buffer_bit_bang()
1027 * ixgbe_write_eeprom_generic - Writes 16 bit value to EEPROM
1037 hw->eeprom.ops.init_params(hw); in ixgbe_write_eeprom_generic()
1039 if (offset >= hw->eeprom.word_size) in ixgbe_write_eeprom_generic()
1040 return -EINVAL; in ixgbe_write_eeprom_generic()
1046 * ixgbe_read_eeprom_buffer_bit_bang_generic - Read EEPROM using bit-bang
1052 * Reads 16 bit word(s) from EEPROM through bit-bang method
1060 hw->eeprom.ops.init_params(hw); in ixgbe_read_eeprom_buffer_bit_bang_generic()
1062 if (words == 0 || (offset + words > hw->eeprom.word_size)) in ixgbe_read_eeprom_buffer_bit_bang_generic()
1063 return -EINVAL; in ixgbe_read_eeprom_buffer_bit_bang_generic()
1071 count = (words - i) / IXGBE_EEPROM_RD_BUFFER_MAX_COUNT > 0 ? in ixgbe_read_eeprom_buffer_bit_bang_generic()
1072 IXGBE_EEPROM_RD_BUFFER_MAX_COUNT : (words - i); in ixgbe_read_eeprom_buffer_bit_bang_generic()
1085 * ixgbe_read_eeprom_buffer_bit_bang - Read EEPROM using bit-bang
1091 * Reads 16 bit word(s) from EEPROM through bit-bang method
1108 return -EIO; in ixgbe_read_eeprom_buffer_bit_bang()
1116 if ((hw->eeprom.address_bits == 8) && in ixgbe_read_eeprom_buffer_bit_bang()
1124 hw->eeprom.address_bits); in ixgbe_read_eeprom_buffer_bit_bang()
1138 * ixgbe_read_eeprom_bit_bang_generic - Read EEPROM word using bit-bang
1143 * Reads 16 bit value from EEPROM through bit-bang method
1148 hw->eeprom.ops.init_params(hw); in ixgbe_read_eeprom_bit_bang_generic()
1150 if (offset >= hw->eeprom.word_size) in ixgbe_read_eeprom_bit_bang_generic()
1151 return -EINVAL; in ixgbe_read_eeprom_bit_bang_generic()
1157 * ixgbe_read_eerd_buffer_generic - Read EEPROM word(s) using EERD
1172 hw->eeprom.ops.init_params(hw); in ixgbe_read_eerd_buffer_generic()
1174 if (words == 0 || offset >= hw->eeprom.word_size) in ixgbe_read_eerd_buffer_generic()
1175 return -EINVAL; in ixgbe_read_eerd_buffer_generic()
1197 * ixgbe_detect_eeprom_page_size_generic - Detect EEPROM page size
1215 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX; in ixgbe_detect_eeprom_page_size_generic()
1218 hw->eeprom.word_page_size = 0; in ixgbe_detect_eeprom_page_size_generic()
1230 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX - data[0]; in ixgbe_detect_eeprom_page_size_generic()
1233 hw->eeprom.word_page_size); in ixgbe_detect_eeprom_page_size_generic()
1238 * ixgbe_read_eerd_generic - Read EEPROM word using EERD
1251 * ixgbe_write_eewr_buffer_generic - Write EEPROM word(s) using EEWR
1266 hw->eeprom.ops.init_params(hw); in ixgbe_write_eewr_buffer_generic()
1268 if (words == 0 || offset >= hw->eeprom.word_size) in ixgbe_write_eewr_buffer_generic()
1269 return -EINVAL; in ixgbe_write_eewr_buffer_generic()
1295 * ixgbe_write_eewr_generic - Write EEPROM word using EEWR
1308 * ixgbe_poll_eerd_eewr_done - Poll EERD read or EEWR write status
1331 return -EIO; in ixgbe_poll_eerd_eewr_done()
1335 * ixgbe_acquire_eeprom - Acquire EEPROM using bit-bang
1338 * Prepares EEPROM for access using bit-bang method. This function should
1346 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) != 0) in ixgbe_acquire_eeprom()
1347 return -EBUSY; in ixgbe_acquire_eeprom()
1368 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_acquire_eeprom()
1369 return -EIO; in ixgbe_acquire_eeprom()
1382 * ixgbe_get_eeprom_semaphore - Get hardware semaphore
1385 * Sets the hardware semaphores so EEPROM access can occur for bit-bang method
1402 usleep_range(50, 100); in ixgbe_get_eeprom_semaphore()
1406 hw_dbg(hw, "Driver can't access the Eeprom - SMBI Semaphore not granted.\n"); in ixgbe_get_eeprom_semaphore()
1414 usleep_range(50, 100); in ixgbe_get_eeprom_semaphore()
1422 return -EIO; in ixgbe_get_eeprom_semaphore()
1441 usleep_range(50, 100); in ixgbe_get_eeprom_semaphore()
1450 return -EIO; in ixgbe_get_eeprom_semaphore()
1457 * ixgbe_release_eeprom_semaphore - Release hardware semaphore
1475 * ixgbe_ready_eeprom - Polls for EEPROM ready
1501 * On some parts, SPI write time could vary from 0-20mSec on 3.3V in ixgbe_ready_eeprom()
1502 * devices (and only 0-5mSec on 5V devices) in ixgbe_ready_eeprom()
1506 return -EIO; in ixgbe_ready_eeprom()
1513 * ixgbe_standby_eeprom - Returns EEPROM to a "standby" state
1534 * ixgbe_shift_out_eeprom_bits - Shift data bits out to the EEPROM.
1552 mask = BIT(count - 1); in ixgbe_shift_out_eeprom_bits()
1589 * ixgbe_shift_in_eeprom_bits - Shift data bits in from the EEPROM
1627 * ixgbe_raise_eeprom_clk - Raises the EEPROM's clock input.
1644 * ixgbe_lower_eeprom_clk - Lowers the EEPROM's clock input.
1661 * ixgbe_release_eeprom - Release EEPROM, release semaphores
1682 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_release_eeprom()
1688 usleep_range(hw->eeprom.semaphore_delay * 1000, in ixgbe_release_eeprom()
1689 hw->eeprom.semaphore_delay * 2000); in ixgbe_release_eeprom()
1693 * ixgbe_calc_eeprom_checksum_generic - Calculates and returns the checksum
1705 /* Include 0x0-0x3F in the checksum */ in ixgbe_calc_eeprom_checksum_generic()
1707 if (hw->eeprom.ops.read(hw, i, &word)) { in ixgbe_calc_eeprom_checksum_generic()
1716 if (hw->eeprom.ops.read(hw, i, &pointer)) { in ixgbe_calc_eeprom_checksum_generic()
1718 return -EIO; in ixgbe_calc_eeprom_checksum_generic()
1725 if (hw->eeprom.ops.read(hw, pointer, &length)) { in ixgbe_calc_eeprom_checksum_generic()
1727 return -EIO; in ixgbe_calc_eeprom_checksum_generic()
1734 if (hw->eeprom.ops.read(hw, j, &word)) { in ixgbe_calc_eeprom_checksum_generic()
1736 return -EIO; in ixgbe_calc_eeprom_checksum_generic()
1742 checksum = (u16)IXGBE_EEPROM_SUM - checksum; in ixgbe_calc_eeprom_checksum_generic()
1748 * ixgbe_validate_eeprom_checksum_generic - Validate EEPROM checksum
1767 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_generic()
1773 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_generic()
1779 status = hw->eeprom.ops.read(hw, IXGBE_EEPROM_CHECKSUM, &read_checksum); in ixgbe_validate_eeprom_checksum_generic()
1789 status = -EIO; in ixgbe_validate_eeprom_checksum_generic()
1799 * ixgbe_update_eeprom_checksum_generic - Updates the EEPROM checksum
1812 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_generic()
1818 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_update_eeprom_checksum_generic()
1824 status = hw->eeprom.ops.write(hw, IXGBE_EEPROM_CHECKSUM, checksum); in ixgbe_update_eeprom_checksum_generic()
1830 * ixgbe_set_rar_generic - Set Rx address register
1843 u32 rar_entries = hw->mac.num_rar_entries; in ixgbe_set_rar_generic()
1848 return -EINVAL; in ixgbe_set_rar_generic()
1852 hw->mac.ops.set_vmdq(hw, index, vmdq); in ixgbe_set_rar_generic()
1886 * ixgbe_clear_rar_generic - Remove Rx address register
1895 u32 rar_entries = hw->mac.num_rar_entries; in ixgbe_clear_rar_generic()
1900 return -EINVAL; in ixgbe_clear_rar_generic()
1920 hw->mac.ops.clear_vmdq(hw, index, IXGBE_CLEAR_VMDQ_ALL); in ixgbe_clear_rar_generic()
1926 * ixgbe_init_rx_addrs_generic - Initializes receive address filters.
1936 u32 rar_entries = hw->mac.num_rar_entries; in ixgbe_init_rx_addrs_generic()
1943 if (!is_valid_ether_addr(hw->mac.addr)) { in ixgbe_init_rx_addrs_generic()
1945 hw->mac.ops.get_mac_addr(hw, hw->mac.addr); in ixgbe_init_rx_addrs_generic()
1947 hw_dbg(hw, " Keeping Current RAR0 Addr =%pM\n", hw->mac.addr); in ixgbe_init_rx_addrs_generic()
1951 hw_dbg(hw, " New MAC Addr =%pM\n", hw->mac.addr); in ixgbe_init_rx_addrs_generic()
1953 hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0, IXGBE_RAH_AV); in ixgbe_init_rx_addrs_generic()
1957 hw->mac.ops.clear_vmdq(hw, 0, IXGBE_CLEAR_VMDQ_ALL); in ixgbe_init_rx_addrs_generic()
1959 hw->addr_ctrl.overflow_promisc = 0; in ixgbe_init_rx_addrs_generic()
1961 hw->addr_ctrl.rar_used_count = 1; in ixgbe_init_rx_addrs_generic()
1964 hw_dbg(hw, "Clearing RAR[1-%d]\n", rar_entries - 1); in ixgbe_init_rx_addrs_generic()
1971 hw->addr_ctrl.mta_in_use = 0; in ixgbe_init_rx_addrs_generic()
1972 IXGBE_WRITE_REG(hw, IXGBE_MCSTCTRL, hw->mac.mc_filter_type); in ixgbe_init_rx_addrs_generic()
1975 for (i = 0; i < hw->mac.mcft_size; i++) in ixgbe_init_rx_addrs_generic()
1978 if (hw->mac.ops.init_uta_tables) in ixgbe_init_rx_addrs_generic()
1979 hw->mac.ops.init_uta_tables(hw); in ixgbe_init_rx_addrs_generic()
1985 * ixgbe_mta_vector - Determines bit-vector in multicast table to set
1990 * bit-vector to set in the multicast table. The hardware uses 12 bits, from
1991 * incoming rx multicast addresses, to determine the bit-vector to check in
1992 * the MTA. Which of the 4 combination, of 12-bits, the hardware uses is set
2000 switch (hw->mac.mc_filter_type) { in ixgbe_mta_vector()
2018 /* vector can only be 12-bits or boundary will be exceeded */ in ixgbe_mta_vector()
2024 * ixgbe_set_mta - Set bit-vector in multicast table
2028 * Sets the bit-vector in the multicast table.
2036 hw->addr_ctrl.mta_in_use++; in ixgbe_set_mta()
2039 hw_dbg(hw, " bit-vector = 0x%03X\n", vector); in ixgbe_set_mta()
2042 * The MTA is a register array of 128 32-bit registers. It is treated in ixgbe_set_mta()
2052 hw->mac.mta_shadow[vector_reg] |= BIT(vector_bit); in ixgbe_set_mta()
2056 * ixgbe_update_mc_addr_list_generic - Updates MAC list of multicast addresses
2075 hw->addr_ctrl.num_mc_addrs = netdev_mc_count(netdev); in ixgbe_update_mc_addr_list_generic()
2076 hw->addr_ctrl.mta_in_use = 0; in ixgbe_update_mc_addr_list_generic()
2080 memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow)); in ixgbe_update_mc_addr_list_generic()
2085 ixgbe_set_mta(hw, ha->addr); in ixgbe_update_mc_addr_list_generic()
2089 for (i = 0; i < hw->mac.mcft_size; i++) in ixgbe_update_mc_addr_list_generic()
2091 hw->mac.mta_shadow[i]); in ixgbe_update_mc_addr_list_generic()
2093 if (hw->addr_ctrl.mta_in_use > 0) in ixgbe_update_mc_addr_list_generic()
2095 IXGBE_MCSTCTRL_MFE | hw->mac.mc_filter_type); in ixgbe_update_mc_addr_list_generic()
2102 * ixgbe_enable_mc_generic - Enable multicast address in RAR
2109 struct ixgbe_addr_filter_info *a = &hw->addr_ctrl; in ixgbe_enable_mc_generic()
2111 if (a->mta_in_use > 0) in ixgbe_enable_mc_generic()
2113 hw->mac.mc_filter_type); in ixgbe_enable_mc_generic()
2119 * ixgbe_disable_mc_generic - Disable multicast address in RAR
2126 struct ixgbe_addr_filter_info *a = &hw->addr_ctrl; in ixgbe_disable_mc_generic()
2128 if (a->mta_in_use > 0) in ixgbe_disable_mc_generic()
2129 IXGBE_WRITE_REG(hw, IXGBE_MCSTCTRL, hw->mac.mc_filter_type); in ixgbe_disable_mc_generic()
2135 * ixgbe_fc_enable_generic - Enable flow control
2148 if (!hw->fc.pause_time) in ixgbe_fc_enable_generic()
2149 return -EINVAL; in ixgbe_fc_enable_generic()
2153 if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && in ixgbe_fc_enable_generic()
2154 hw->fc.high_water[i]) { in ixgbe_fc_enable_generic()
2155 if (!hw->fc.low_water[i] || in ixgbe_fc_enable_generic()
2156 hw->fc.low_water[i] >= hw->fc.high_water[i]) { in ixgbe_fc_enable_generic()
2158 return -EINVAL; in ixgbe_fc_enable_generic()
2164 hw->mac.ops.fc_autoneg(hw); in ixgbe_fc_enable_generic()
2183 switch (hw->fc.current_mode) { in ixgbe_fc_enable_generic()
2215 return -EIO; in ixgbe_fc_enable_generic()
2225 if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && in ixgbe_fc_enable_generic()
2226 hw->fc.high_water[i]) { in ixgbe_fc_enable_generic()
2227 fcrtl = (hw->fc.low_water[i] << 10) | IXGBE_FCRTL_XONE; in ixgbe_fc_enable_generic()
2229 fcrth = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN; in ixgbe_fc_enable_generic()
2235 * to the Rx packet buffer size - 24KB. This allows in ixgbe_fc_enable_generic()
2239 fcrth = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(i)) - 24576; in ixgbe_fc_enable_generic()
2246 reg = hw->fc.pause_time * 0x00010001U; in ixgbe_fc_enable_generic()
2250 IXGBE_WRITE_REG(hw, IXGBE_FCRTV, hw->fc.pause_time / 2); in ixgbe_fc_enable_generic()
2256 * ixgbe_negotiate_fc - Negotiate flow control
2272 return -EINVAL; in ixgbe_negotiate_fc()
2282 if (hw->fc.requested_mode == ixgbe_fc_full) { in ixgbe_negotiate_fc()
2283 hw->fc.current_mode = ixgbe_fc_full; in ixgbe_negotiate_fc()
2286 hw->fc.current_mode = ixgbe_fc_rx_pause; in ixgbe_negotiate_fc()
2291 hw->fc.current_mode = ixgbe_fc_tx_pause; in ixgbe_negotiate_fc()
2295 hw->fc.current_mode = ixgbe_fc_rx_pause; in ixgbe_negotiate_fc()
2298 hw->fc.current_mode = ixgbe_fc_none; in ixgbe_negotiate_fc()
2305 * ixgbe_fc_autoneg_fiber - Enable flow control on 1 gig fiber
2317 * - link is up but AN did not complete, or if in ixgbe_fc_autoneg_fiber()
2318 * - link is up and AN completed but timed out in ixgbe_fc_autoneg_fiber()
2324 return -EIO; in ixgbe_fc_autoneg_fiber()
2339 * ixgbe_fc_autoneg_backplane - Enable flow control IEEE clause 37
2351 * - backplane autoneg was not completed, or if in ixgbe_fc_autoneg_backplane()
2352 * - we are 82599 and link partner is not AN enabled in ixgbe_fc_autoneg_backplane()
2356 return -EIO; in ixgbe_fc_autoneg_backplane()
2358 if (hw->mac.type == ixgbe_mac_82599EB) { in ixgbe_fc_autoneg_backplane()
2361 return -EIO; in ixgbe_fc_autoneg_backplane()
2378 * ixgbe_fc_autoneg_copper - Enable flow control IEEE clause 37
2388 hw->phy.ops.read_reg(hw, MDIO_AN_ADVERTISE, in ixgbe_fc_autoneg_copper()
2391 hw->phy.ops.read_reg(hw, MDIO_AN_LPA, in ixgbe_fc_autoneg_copper()
2402 * ixgbe_fc_autoneg - Configure flow control
2411 int ret_val = -EIO; in ixgbe_fc_autoneg()
2417 * - FC autoneg is disabled, or if in ixgbe_fc_autoneg()
2418 * - link is not up. in ixgbe_fc_autoneg()
2423 if (hw->fc.disable_fc_autoneg) in ixgbe_fc_autoneg()
2426 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg()
2430 switch (hw->phy.media_type) { in ixgbe_fc_autoneg()
2454 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg()
2456 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg()
2457 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg()
2462 * ixgbe_pcie_timeout_poll - Return number of times to poll for completion
2465 * System-wide timeout range is encoded in PCIe Device Control2 register.
2509 * ixgbe_disable_pcie_primary - Disable PCI-express primary access
2512 * Disables PCI-Express primary access and verifies there are no pending
2513 * requests. -EALREADY is returned if primary disable
2532 hw_dbg(hw, "GIO disable did not set - requesting resets\n"); in ixgbe_disable_pcie_primary()
2538 ixgbe_removed(hw->hw_addr)) in ixgbe_disable_pcie_primary()
2556 hw_dbg(hw, "GIO Primary Disable bit didn't clear - requesting resets\n"); in ixgbe_disable_pcie_primary()
2558 hw->mac.flags |= IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_disable_pcie_primary()
2560 if (hw->mac.type >= ixgbe_mac_X550) in ixgbe_disable_pcie_primary()
2571 if (ixgbe_removed(hw->hw_addr)) in ixgbe_disable_pcie_primary()
2578 return -EALREADY; in ixgbe_disable_pcie_primary()
2582 * ixgbe_acquire_swfw_sync - Acquire SWFW semaphore
2603 return -EBUSY; in ixgbe_acquire_swfw_sync()
2623 return -EBUSY; in ixgbe_acquire_swfw_sync()
2627 * ixgbe_release_swfw_sync - Release SWFW semaphore
2649 * prot_autoc_read_generic - Hides MAC differences needed for AUTOC read
2665 * prot_autoc_write_generic - Hides MAC differences needed for AUTOC write
2678 * ixgbe_disable_rx_buff_generic - Stops the receive data path
2698 /* Use interrupt-safe sleep just in case */ in ixgbe_disable_rx_buff_generic()
2711 * ixgbe_enable_rx_buff_generic - Enables the receive data path
2729 * ixgbe_enable_rx_dma_generic - Enable the Rx DMA unit
2738 hw->mac.ops.enable_rx(hw); in ixgbe_enable_rx_dma_generic()
2740 hw->mac.ops.disable_rx(hw); in ixgbe_enable_rx_dma_generic()
2746 * ixgbe_blink_led_start_generic - Blink LED based on index.
2760 return -EINVAL; in ixgbe_blink_led_start_generic()
2763 * Link must be up to auto-blink the LEDs; in ixgbe_blink_led_start_generic()
2766 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_blink_led_start_generic()
2769 ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg); in ixgbe_blink_led_start_generic()
2776 ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked); in ixgbe_blink_led_start_generic()
2794 * ixgbe_blink_led_stop_generic - Stop blinking LED based on index.
2806 return -EINVAL; in ixgbe_blink_led_stop_generic()
2808 ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg); in ixgbe_blink_led_stop_generic()
2815 ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked); in ixgbe_blink_led_stop_generic()
2829 * ixgbe_get_san_mac_addr_offset - Get SAN MAC address offset from the EEPROM
2846 ret_val = hw->eeprom.ops.read(hw, IXGBE_SAN_MAC_ADDR_PTR, in ixgbe_get_san_mac_addr_offset()
2856 * ixgbe_get_san_mac_addr_generic - SAN MAC address retrieval from the EEPROM
2861 * per-port, so set_lan_id() must be called before reading the addresses.
2863 * upon for non-SFP connections, so we must call it here.
2881 hw->mac.ops.set_lan_id(hw); in ixgbe_get_san_mac_addr_generic()
2883 (hw->bus.func) ? (san_mac_offset += IXGBE_SAN_MAC_ADDR_PORT1_OFFSET) : in ixgbe_get_san_mac_addr_generic()
2886 ret_val = hw->eeprom.ops.read(hw, san_mac_offset, in ixgbe_get_san_mac_addr_generic()
2909 * ixgbe_get_pcie_msix_count_generic - Gets MSI-X vector count
2912 * Read PCIe configuration space, and get the MSI-X vector count from
2921 switch (hw->mac.type) { in ixgbe_get_pcie_msix_count_generic()
2943 if (ixgbe_removed(hw->hw_addr)) in ixgbe_get_pcie_msix_count_generic()
2947 /* MSI-X count is zero-based in HW */ in ixgbe_get_pcie_msix_count_generic()
2957 * ixgbe_clear_vmdq_generic - Disassociate a VMDq pool index from a rx address
2965 u32 rar_entries = hw->mac.num_rar_entries; in ixgbe_clear_vmdq_generic()
2970 return -EINVAL; in ixgbe_clear_vmdq_generic()
2976 if (ixgbe_removed(hw->hw_addr)) in ixgbe_clear_vmdq_generic()
2995 mpsar_hi &= ~BIT(vmdq - 32); in ixgbe_clear_vmdq_generic()
3001 rar != 0 && rar != hw->mac.san_mac_rar_index) in ixgbe_clear_vmdq_generic()
3002 hw->mac.ops.clear_rar(hw, rar); in ixgbe_clear_vmdq_generic()
3008 * ixgbe_set_vmdq_generic - Associate a VMDq pool index with a rx address
3016 u32 rar_entries = hw->mac.num_rar_entries; in ixgbe_set_vmdq_generic()
3021 return -EINVAL; in ixgbe_set_vmdq_generic()
3030 mpsar |= BIT(vmdq - 32); in ixgbe_set_vmdq_generic()
3037 * ixgbe_set_vmdq_san_mac_generic - Associate VMDq pool index with a rx address
3044 * MPSAR table needs to be updated for SAN_MAC RAR [hw->mac.san_mac_rar_index]
3048 u32 rar = hw->mac.san_mac_rar_index; in ixgbe_set_vmdq_san_mac_generic()
3055 IXGBE_WRITE_REG(hw, IXGBE_MPSAR_HI(rar), BIT(vmdq - 32)); in ixgbe_set_vmdq_san_mac_generic()
3062 * ixgbe_init_uta_tables_generic - Initialize the Unicast Table Array
3076 * ixgbe_find_vlvf_slot - find the vlanid or the first empty slot
3098 first_empty_slot = vlvf_bypass ? -ENOSPC : 0; in ixgbe_find_vlvf_slot()
3106 * pre-decrement loop covering (IXGBE_VLVF_ENTRIES - 1) .. 1 in ixgbe_find_vlvf_slot()
3108 for (regindex = IXGBE_VLVF_ENTRIES; --regindex;) { in ixgbe_find_vlvf_slot()
3122 return first_empty_slot ? : -ENOSPC; in ixgbe_find_vlvf_slot()
3126 * ixgbe_set_vfta_generic - Set VLAN filter table
3142 return -EINVAL; in ixgbe_set_vfta_generic()
3145 * this is a 2 part operation - first the VFTA, then the in ixgbe_set_vfta_generic()
3151 * The VFTA is a bitstring made up of 128 32-bit registers in ixgbe_set_vfta_generic()
3153 * bits[11-5]: which register in ixgbe_set_vfta_generic()
3154 * bits[4-0]: which bit in the register in ixgbe_set_vfta_generic()
3196 !IXGBE_READ_REG(hw, IXGBE_VLVFB(vlvf_index * 2 + 1 - vind / 32))) { in ixgbe_set_vfta_generic()
3241 * ixgbe_clear_vfta_generic - Clear VLAN filter table
3250 for (offset = 0; offset < hw->mac.vft_size; offset++) in ixgbe_clear_vfta_generic()
3263 * ixgbe_need_crosstalk_fix - Determine if we need to do cross talk fix
3272 if (!hw->need_crosstalk_fix) in ixgbe_need_crosstalk_fix()
3276 switch (hw->mac.ops.get_media_type(hw)) { in ixgbe_need_crosstalk_fix()
3288 * ixgbe_check_mac_link_generic - Determine link and speed status
3309 switch (hw->mac.type) { in ixgbe_check_mac_link_generic()
3320 /* sanity check - No SFP+ devices here */ in ixgbe_check_mac_link_generic()
3376 if ((hw->mac.type >= ixgbe_mac_X550) && in ixgbe_check_mac_link_generic()
3386 if ((hw->mac.type >= ixgbe_mac_X550 || in ixgbe_check_mac_link_generic()
3387 hw->mac.type == ixgbe_mac_e610) && in ixgbe_check_mac_link_generic()
3395 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T || in ixgbe_check_mac_link_generic()
3396 hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L) { in ixgbe_check_mac_link_generic()
3408 * ixgbe_get_wwn_prefix_generic - Get alternative WWNN/WWPN prefix from
3429 if (hw->eeprom.ops.read(hw, offset, &alt_san_mac_blk_offset)) in ixgbe_get_wwn_prefix_generic()
3438 if (hw->eeprom.ops.read(hw, offset, &caps)) in ixgbe_get_wwn_prefix_generic()
3445 if (hw->eeprom.ops.read(hw, offset, wwnn_prefix)) in ixgbe_get_wwn_prefix_generic()
3449 if (hw->eeprom.ops.read(hw, offset, wwpn_prefix)) in ixgbe_get_wwn_prefix_generic()
3460 * ixgbe_set_mac_anti_spoofing - Enable/Disable MAC anti-spoofing
3462 * @enable: enable or disable switch for MAC anti-spoofing
3463 * @vf: Virtual Function pool - VF Pool to set for MAC anti-spoofing
3472 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_set_mac_anti_spoofing()
3484 * ixgbe_set_vlan_anti_spoofing - Enable/Disable VLAN anti-spoofing
3486 * @enable: enable or disable switch for VLAN anti-spoofing
3487 * @vf: Virtual Function pool - VF Pool to set for VLAN anti-spoofing
3496 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_set_vlan_anti_spoofing()
3508 * ixgbe_get_device_caps_generic - Get additional device capabilities
3517 hw->eeprom.ops.read(hw, IXGBE_DEVICE_CAPS, device_caps); in ixgbe_get_device_caps_generic()
3523 * ixgbe_set_rxpba_generic - Initialize RX packet buffer
3534 u32 pbsize = hw->mac.rx_pb_size; in ixgbe_set_rxpba_generic()
3539 pbsize -= headroom; in ixgbe_set_rxpba_generic()
3553 pbsize -= rxpktsize * (num_pb / 2); in ixgbe_set_rxpba_generic()
3560 rxpktsize = (pbsize / (num_pb - i)) << IXGBE_RXPBSIZE_SHIFT; in ixgbe_set_rxpba_generic()
3574 txpbthresh = (txpktsize / 1024) - IXGBE_TXPKT_SIZE_MAX; in ixgbe_set_rxpba_generic()
3589 * ixgbe_calculate_checksum - Calculate checksum for buffer
3607 return (u8) (0 - sum); in ixgbe_calculate_checksum()
3611 * ixgbe_hic_unlocked - Issue command to manageability block unlocked
3619 * semaphore, -EINVAL when incorrect parameters passed or -EIO when
3632 hw_dbg(hw, "Buffer length failure buffersize-%d.\n", length); in ixgbe_hic_unlocked()
3633 return -EINVAL; in ixgbe_hic_unlocked()
3644 return -EIO; in ixgbe_hic_unlocked()
3650 return -EINVAL; in ixgbe_hic_unlocked()
3675 return -EIO; in ixgbe_hic_unlocked()
3681 * ixgbe_host_interface_command - Issue command to manageability block
3695 * else return -EIO or -EINVAL.
3709 hw_dbg(hw, "Buffer length failure buffersize-%d.\n", length); in ixgbe_host_interface_command()
3710 return -EINVAL; in ixgbe_host_interface_command()
3713 status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM); in ixgbe_host_interface_command()
3734 buf_len = hdr->buf_len; in ixgbe_host_interface_command()
3740 status = -EIO; in ixgbe_host_interface_command()
3754 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM); in ixgbe_host_interface_command()
3760 * ixgbe_set_fw_drv_ver_generic - Sends driver version to firmware
3771 * else returns -EBUSY when encountering an error acquiring
3772 * semaphore or -EIO when command fails.
3785 fw_cmd.port_num = hw->bus.func; in ixgbe_set_fw_drv_ver_generic()
3808 ret_val = -EIO; in ixgbe_set_fw_drv_ver_generic()
3817 * ixgbe_clear_tx_pending - Clear pending TX work from the PCIe fifo
3833 if (!(hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED)) in ixgbe_clear_tx_pending()
3855 if (ixgbe_removed(hw->hw_addr)) in ixgbe_clear_tx_pending()
3889 * ixgbe_get_ets_data - Extracts the ETS bit data
3901 status = hw->eeprom.ops.read(hw, IXGBE_ETS_CFG, ets_offset); in ixgbe_get_ets_data()
3906 return -EOPNOTSUPP; in ixgbe_get_ets_data()
3908 status = hw->eeprom.ops.read(hw, *ets_offset, ets_cfg); in ixgbe_get_ets_data()
3913 return -EOPNOTSUPP; in ixgbe_get_ets_data()
3919 * ixgbe_get_thermal_sensor_data_generic - Gathers thermal sensor data
3932 struct ixgbe_thermal_sensor_data *data = &hw->mac.thermal_sensor_data; in ixgbe_get_thermal_sensor_data_generic()
3936 return -EOPNOTSUPP; in ixgbe_get_thermal_sensor_data_generic()
3950 status = hw->eeprom.ops.read(hw, (ets_offset + 1 + i), in ixgbe_get_thermal_sensor_data_generic()
3961 status = hw->phy.ops.read_i2c_byte(hw, in ixgbe_get_thermal_sensor_data_generic()
3964 &data->sensor[i].temp); in ixgbe_get_thermal_sensor_data_generic()
3974 * ixgbe_init_thermal_sensor_thresh_generic - Inits thermal sensor thresholds
3982 struct ixgbe_thermal_sensor_data *data = &hw->mac.thermal_sensor_data; in ixgbe_init_thermal_sensor_thresh_generic()
3996 return -EOPNOTSUPP; in ixgbe_init_thermal_sensor_thresh_generic()
4011 if (hw->eeprom.ops.read(hw, ets_offset + 1 + i, &ets_sensor)) { in ixgbe_init_thermal_sensor_thresh_generic()
4022 hw->phy.ops.write_i2c_byte(hw, in ixgbe_init_thermal_sensor_thresh_generic()
4029 data->sensor[i].location = sensor_location; in ixgbe_init_thermal_sensor_thresh_generic()
4030 data->sensor[i].caution_thresh = therm_limit; in ixgbe_init_thermal_sensor_thresh_generic()
4031 data->sensor[i].max_op_thresh = therm_limit - low_thresh_delta; in ixgbe_init_thermal_sensor_thresh_generic()
4038 * ixgbe_get_orom_version - Return option ROM from EEPROM
4043 * if valid option ROM version, nvm_ver->or_valid set to true
4044 * else nvm_ver->or_valid is false.
4051 nvm_ver->or_valid = false; in ixgbe_get_orom_version()
4053 hw->eeprom.ops.read(hw, NVM_OROM_OFFSET, &offset); in ixgbe_get_orom_version()
4059 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_HI, &eeprom_cfg_blkh); in ixgbe_get_orom_version()
4060 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_LOW, &eeprom_cfg_blkl); in ixgbe_get_orom_version()
4068 nvm_ver->or_valid = true; in ixgbe_get_orom_version()
4069 nvm_ver->or_major = eeprom_cfg_blkl >> NVM_OROM_SHIFT; in ixgbe_get_orom_version()
4070 nvm_ver->or_build = (eeprom_cfg_blkl << NVM_OROM_SHIFT) | in ixgbe_get_orom_version()
4072 nvm_ver->or_patch = eeprom_cfg_blkh & NVM_OROM_PATCH_MASK; in ixgbe_get_orom_version()
4076 * ixgbe_get_oem_prod_version - Etrack ID from EEPROM
4080 * if valid OEM product version, nvm_ver->oem_valid set to true
4081 * else nvm_ver->oem_valid is false.
4088 nvm_ver->oem_valid = false; in ixgbe_get_oem_prod_version()
4089 hw->eeprom.ops.read(hw, NVM_OEM_PROD_VER_PTR, &offset); in ixgbe_get_oem_prod_version()
4096 hw->eeprom.ops.read(hw, offset, &mod_len); in ixgbe_get_oem_prod_version()
4097 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_CAP_OFF, &cap); in ixgbe_get_oem_prod_version()
4104 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_L, &prod_ver); in ixgbe_get_oem_prod_version()
4105 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_H, &rel_num); in ixgbe_get_oem_prod_version()
4112 nvm_ver->oem_major = prod_ver >> NVM_VER_SHIFT; in ixgbe_get_oem_prod_version()
4113 nvm_ver->oem_minor = prod_ver & NVM_VER_MASK; in ixgbe_get_oem_prod_version()
4114 nvm_ver->oem_release = rel_num; in ixgbe_get_oem_prod_version()
4115 nvm_ver->oem_valid = true; in ixgbe_get_oem_prod_version()
4119 * ixgbe_get_etk_id - Return Etrack ID from EEPROM
4131 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_LOW, &etk_id_l)) in ixgbe_get_etk_id()
4133 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_HI, &etk_id_h)) in ixgbe_get_etk_id()
4140 nvm_ver->etk_id = etk_id_h; in ixgbe_get_etk_id()
4141 nvm_ver->etk_id |= (etk_id_l << NVM_ETK_SHIFT); in ixgbe_get_etk_id()
4143 nvm_ver->etk_id = etk_id_l; in ixgbe_get_etk_id()
4144 nvm_ver->etk_id |= (etk_id_h << NVM_ETK_SHIFT); in ixgbe_get_etk_id()
4154 if (hw->mac.type != ixgbe_mac_82598EB) { in ixgbe_disable_rx_generic()
4161 hw->mac.set_lben = true; in ixgbe_disable_rx_generic()
4163 hw->mac.set_lben = false; in ixgbe_disable_rx_generic()
4178 if (hw->mac.type != ixgbe_mac_82598EB) { in ixgbe_enable_rx_generic()
4179 if (hw->mac.set_lben) { in ixgbe_enable_rx_generic()
4185 hw->mac.set_lben = false; in ixgbe_enable_rx_generic()
4190 /** ixgbe_mng_present - returns true when management capability is present
4197 if (hw->mac.type < ixgbe_mac_82599EB) in ixgbe_mng_present()
4206 * ixgbe_setup_mac_link_multispeed_fiber - Set MAC link speed
4224 /* Mask off requested but non-supported speeds */ in ixgbe_setup_mac_link_multispeed_fiber()
4225 status = hw->mac.ops.get_link_capabilities(hw, &link_speed, &autoneg); in ixgbe_setup_mac_link_multispeed_fiber()
4239 switch (hw->phy.media_type) { in ixgbe_setup_mac_link_multispeed_fiber()
4241 hw->mac.ops.set_rate_select_speed(hw, in ixgbe_setup_mac_link_multispeed_fiber()
4252 /* Allow module to change analog characteristics (1G->10G) */ in ixgbe_setup_mac_link_multispeed_fiber()
4255 status = hw->mac.ops.setup_mac_link(hw, in ixgbe_setup_mac_link_multispeed_fiber()
4262 if (hw->mac.ops.flap_tx_laser) in ixgbe_setup_mac_link_multispeed_fiber()
4263 hw->mac.ops.flap_tx_laser(hw); in ixgbe_setup_mac_link_multispeed_fiber()
4274 status = hw->mac.ops.check_link(hw, &link_speed, in ixgbe_setup_mac_link_multispeed_fiber()
4290 switch (hw->phy.media_type) { in ixgbe_setup_mac_link_multispeed_fiber()
4292 hw->mac.ops.set_rate_select_speed(hw, in ixgbe_setup_mac_link_multispeed_fiber()
4303 /* Allow module to change analog characteristics (10G->1G) */ in ixgbe_setup_mac_link_multispeed_fiber()
4306 status = hw->mac.ops.setup_mac_link(hw, in ixgbe_setup_mac_link_multispeed_fiber()
4313 if (hw->mac.ops.flap_tx_laser) in ixgbe_setup_mac_link_multispeed_fiber()
4314 hw->mac.ops.flap_tx_laser(hw); in ixgbe_setup_mac_link_multispeed_fiber()
4320 status = hw->mac.ops.check_link(hw, &link_speed, &link_up, in ixgbe_setup_mac_link_multispeed_fiber()
4340 hw->phy.autoneg_advertised = 0; in ixgbe_setup_mac_link_multispeed_fiber()
4343 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_10GB_FULL; in ixgbe_setup_mac_link_multispeed_fiber()
4346 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_1GB_FULL; in ixgbe_setup_mac_link_multispeed_fiber()
4352 * ixgbe_set_soft_rate_select_speed - Set module link speed
4378 status = hw->phy.ops.read_i2c_byte(hw, IXGBE_SFF_SFF_8472_OSCB, in ixgbe_set_soft_rate_select_speed()
4388 status = hw->phy.ops.write_i2c_byte(hw, IXGBE_SFF_SFF_8472_OSCB, in ixgbe_set_soft_rate_select_speed()
4397 status = hw->phy.ops.read_i2c_byte(hw, IXGBE_SFF_SFF_8472_ESCB, in ixgbe_set_soft_rate_select_speed()
4407 status = hw->phy.ops.write_i2c_byte(hw, IXGBE_SFF_SFF_8472_ESCB, in ixgbe_set_soft_rate_select_speed()