Lines Matching +full:crosstalk +full:- +full:enable

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 1999 - 2018 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()
64 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_device_supports_autoneg_fc()
74 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_XFI) in ixgbe_device_supports_autoneg_fc()
81 switch (hw->device_id) { in ixgbe_device_supports_autoneg_fc()
103 hw->device_id); in ixgbe_device_supports_autoneg_fc()
109 * ixgbe_setup_fc_generic - Set up flow control
125 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_generic()
127 return -EINVAL; in ixgbe_setup_fc_generic()
134 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_generic()
135 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_generic()
142 switch (hw->phy.media_type) { in ixgbe_setup_fc_generic()
145 ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &reg_bp); in ixgbe_setup_fc_generic()
155 hw->phy.ops.read_reg(hw, MDIO_AN_ADVERTISE, in ixgbe_setup_fc_generic()
172 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_generic()
176 if (hw->phy.media_type == ixgbe_media_type_backplane) in ixgbe_setup_fc_generic()
179 else if (hw->phy.media_type == ixgbe_media_type_copper) in ixgbe_setup_fc_generic()
189 if (hw->phy.media_type == ixgbe_media_type_backplane) { in ixgbe_setup_fc_generic()
192 } else if (hw->phy.media_type == ixgbe_media_type_copper) { in ixgbe_setup_fc_generic()
210 if (hw->phy.media_type == ixgbe_media_type_backplane) in ixgbe_setup_fc_generic()
213 else if (hw->phy.media_type == ixgbe_media_type_copper) in ixgbe_setup_fc_generic()
218 return -EIO; in ixgbe_setup_fc_generic()
221 if (hw->mac.type != ixgbe_mac_X540) { in ixgbe_setup_fc_generic()
223 * Enable auto-negotiation between the MAC & PHY; in ixgbe_setup_fc_generic()
230 if (hw->fc.strict_ieee) in ixgbe_setup_fc_generic()
242 if (hw->phy.media_type == ixgbe_media_type_backplane) { in ixgbe_setup_fc_generic()
247 ret_val = hw->mac.ops.prot_autoc_write(hw, reg_bp, locked); in ixgbe_setup_fc_generic()
251 } else if ((hw->phy.media_type == ixgbe_media_type_copper) && in ixgbe_setup_fc_generic()
253 hw->phy.ops.write_reg(hw, MDIO_AN_ADVERTISE, in ixgbe_setup_fc_generic()
262 * ixgbe_start_hw_generic - Prepare hardware for Tx/Rx
277 hw->phy.media_type = hw->mac.ops.get_media_type(hw); in ixgbe_start_hw_generic()
280 hw->phy.ops.identify(hw); in ixgbe_start_hw_generic()
283 hw->mac.ops.clear_vfta(hw); in ixgbe_start_hw_generic()
286 hw->mac.ops.clear_hw_cntrs(hw); in ixgbe_start_hw_generic()
295 if (hw->mac.ops.setup_fc) { in ixgbe_start_hw_generic()
296 ret_val = hw->mac.ops.setup_fc(hw); in ixgbe_start_hw_generic()
301 /* Cashe bit indicating need for crosstalk fix */ in ixgbe_start_hw_generic()
302 switch (hw->mac.type) { in ixgbe_start_hw_generic()
306 hw->mac.ops.get_device_caps(hw, &device_caps); in ixgbe_start_hw_generic()
308 hw->need_crosstalk_fix = false; in ixgbe_start_hw_generic()
310 hw->need_crosstalk_fix = true; in ixgbe_start_hw_generic()
313 hw->need_crosstalk_fix = false; in ixgbe_start_hw_generic()
318 hw->adapter_stopped = false; in ixgbe_start_hw_generic()
324 * ixgbe_start_hw_gen2 - Init sequence for common device family
338 for (i = 0; i < hw->mac.max_tx_queues; i++) { in ixgbe_start_hw_gen2()
348 * ixgbe_init_hw_generic - Generic hardware initialization
362 status = hw->mac.ops.reset_hw(hw); in ixgbe_init_hw_generic()
366 status = hw->mac.ops.start_hw(hw); in ixgbe_init_hw_generic()
370 if (hw->mac.ops.init_led_link_act) in ixgbe_init_hw_generic()
371 hw->mac.ops.init_led_link_act(hw); in ixgbe_init_hw_generic()
377 * ixgbe_clear_hw_cntrs_generic - Generic clear hardware counters
399 if (hw->mac.type >= ixgbe_mac_82599EB) { in ixgbe_clear_hw_cntrs_generic()
410 if (hw->mac.type >= ixgbe_mac_82599EB) { in ixgbe_clear_hw_cntrs_generic()
418 if (hw->mac.type >= ixgbe_mac_82599EB) in ixgbe_clear_hw_cntrs_generic()
435 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_clear_hw_cntrs_generic()
460 if (hw->mac.type >= ixgbe_mac_82599EB) { in ixgbe_clear_hw_cntrs_generic()
472 if (hw->mac.type == ixgbe_mac_X550 || hw->mac.type == ixgbe_mac_X540) { in ixgbe_clear_hw_cntrs_generic()
473 if (hw->phy.id == 0) in ixgbe_clear_hw_cntrs_generic()
474 hw->phy.ops.identify(hw); in ixgbe_clear_hw_cntrs_generic()
475 hw->phy.ops.read_reg(hw, IXGBE_PCRC8ECL, MDIO_MMD_PCS, &i); in ixgbe_clear_hw_cntrs_generic()
476 hw->phy.ops.read_reg(hw, IXGBE_PCRC8ECH, MDIO_MMD_PCS, &i); in ixgbe_clear_hw_cntrs_generic()
477 hw->phy.ops.read_reg(hw, IXGBE_LDPCECL, MDIO_MMD_PCS, &i); in ixgbe_clear_hw_cntrs_generic()
478 hw->phy.ops.read_reg(hw, IXGBE_LDPCECH, MDIO_MMD_PCS, &i); in ixgbe_clear_hw_cntrs_generic()
485 * ixgbe_read_pba_string_generic - Reads part number string from EEPROM
503 return -EINVAL; in ixgbe_read_pba_string_generic()
506 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM0_PTR, &data); in ixgbe_read_pba_string_generic()
512 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM1_PTR, &pba_ptr); in ixgbe_read_pba_string_generic()
529 return -ENOSPC; in ixgbe_read_pba_string_generic()
539 pba_num[6] = '-'; in ixgbe_read_pba_string_generic()
547 /* switch all the data but the '-' to hex char */ in ixgbe_read_pba_string_generic()
552 pba_num[offset] += 'A' - 0xA; in ixgbe_read_pba_string_generic()
558 ret_val = hw->eeprom.ops.read(hw, pba_ptr, &length); in ixgbe_read_pba_string_generic()
566 return -EIO; in ixgbe_read_pba_string_generic()
570 if (pba_num_size < (((u32)length * 2) - 1)) { in ixgbe_read_pba_string_generic()
572 return -ENOSPC; in ixgbe_read_pba_string_generic()
577 length--; in ixgbe_read_pba_string_generic()
580 ret_val = hw->eeprom.ops.read(hw, pba_ptr + offset, &data); in ixgbe_read_pba_string_generic()
594 * ixgbe_get_mac_addr_generic - Generic get MAC address
651 * ixgbe_get_bus_info_generic - Generic set PCI bus info
660 hw->bus.type = ixgbe_bus_type_pci_express; in ixgbe_get_bus_info_generic()
665 hw->bus.width = ixgbe_convert_bus_width(link_status); in ixgbe_get_bus_info_generic()
666 hw->bus.speed = ixgbe_convert_bus_speed(link_status); in ixgbe_get_bus_info_generic()
668 hw->mac.ops.set_lan_id(hw); in ixgbe_get_bus_info_generic()
674 * ixgbe_set_lan_id_multi_port_pcie - Set LAN id for PCIe multiple port devices
677 * Determines the LAN function id by reading memory-mapped registers
682 struct ixgbe_bus_info *bus = &hw->bus; in ixgbe_set_lan_id_multi_port_pcie()
687 bus->func = FIELD_GET(IXGBE_STATUS_LAN_ID, reg); in ixgbe_set_lan_id_multi_port_pcie()
688 bus->lan_id = bus->func; in ixgbe_set_lan_id_multi_port_pcie()
693 bus->func ^= 0x1; in ixgbe_set_lan_id_multi_port_pcie()
696 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP) { in ixgbe_set_lan_id_multi_port_pcie()
697 hw->eeprom.ops.read(hw, IXGBE_EEPROM_CTRL_4, &ee_ctrl_4); in ixgbe_set_lan_id_multi_port_pcie()
698 bus->instance_id = FIELD_GET(IXGBE_EE_CTRL_4_INST_ID, in ixgbe_set_lan_id_multi_port_pcie()
704 * ixgbe_stop_adapter_generic - Generic stop Tx/Rx units
721 hw->adapter_stopped = true; in ixgbe_stop_adapter_generic()
724 hw->mac.ops.disable_rx(hw); in ixgbe_stop_adapter_generic()
733 for (i = 0; i < hw->mac.max_tx_queues; i++) in ixgbe_stop_adapter_generic()
737 for (i = 0; i < hw->mac.max_rx_queues; i++) { in ixgbe_stop_adapter_generic()
749 * Prevent the PCI-E bus from hanging by disabling PCI-E primary in ixgbe_stop_adapter_generic()
756 * ixgbe_init_led_link_act_generic - Store the LED index link/activity.
764 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_led_link_act_generic()
776 mac->led_link_act = i; in ixgbe_init_led_link_act_generic()
784 switch (hw->mac.type) { in ixgbe_init_led_link_act_generic()
786 mac->led_link_act = 0; in ixgbe_init_led_link_act_generic()
789 mac->led_link_act = 1; in ixgbe_init_led_link_act_generic()
792 mac->led_link_act = 2; in ixgbe_init_led_link_act_generic()
799 * ixgbe_led_on_generic - Turns on the software controllable LEDs.
808 return -EINVAL; in ixgbe_led_on_generic()
820 * ixgbe_led_off_generic - Turns off the software controllable LEDs.
829 return -EINVAL; in ixgbe_led_off_generic()
841 * ixgbe_init_eeprom_params_generic - Initialize EEPROM params
849 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_generic()
853 if (eeprom->type == ixgbe_eeprom_uninitialized) { in ixgbe_init_eeprom_params_generic()
854 eeprom->type = ixgbe_eeprom_none; in ixgbe_init_eeprom_params_generic()
857 eeprom->semaphore_delay = 10; in ixgbe_init_eeprom_params_generic()
859 eeprom->word_page_size = 0; in ixgbe_init_eeprom_params_generic()
867 eeprom->type = ixgbe_eeprom_spi; in ixgbe_init_eeprom_params_generic()
874 eeprom->word_size = BIT(eeprom_size + in ixgbe_init_eeprom_params_generic()
879 eeprom->address_bits = 16; in ixgbe_init_eeprom_params_generic()
881 eeprom->address_bits = 8; in ixgbe_init_eeprom_params_generic()
883 eeprom->type, eeprom->word_size, eeprom->address_bits); in ixgbe_init_eeprom_params_generic()
890 * ixgbe_write_eeprom_buffer_bit_bang_generic - Write EEPROM using bit-bang
896 * Reads 16 bit word(s) from EEPROM through bit-bang method
904 hw->eeprom.ops.init_params(hw); in ixgbe_write_eeprom_buffer_bit_bang_generic()
906 if (words == 0 || (offset + words > hw->eeprom.word_size)) in ixgbe_write_eeprom_buffer_bit_bang_generic()
907 return -EINVAL; in ixgbe_write_eeprom_buffer_bit_bang_generic()
913 if ((hw->eeprom.word_page_size == 0) && in ixgbe_write_eeprom_buffer_bit_bang_generic()
923 count = (words - i) / IXGBE_EEPROM_RD_BUFFER_MAX_COUNT > 0 ? in ixgbe_write_eeprom_buffer_bit_bang_generic()
924 IXGBE_EEPROM_RD_BUFFER_MAX_COUNT : (words - i); in ixgbe_write_eeprom_buffer_bit_bang_generic()
936 * ixgbe_write_eeprom_buffer_bit_bang - Writes 16 bit word(s) to EEPROM
961 return -EIO; in ixgbe_write_eeprom_buffer_bit_bang()
967 /* Send the WRITE ENABLE command (8 bit opcode) */ in ixgbe_write_eeprom_buffer_bit_bang()
977 if ((hw->eeprom.address_bits == 8) && in ixgbe_write_eeprom_buffer_bit_bang()
981 /* Send the Write command (8-bit opcode + addr) */ in ixgbe_write_eeprom_buffer_bit_bang()
985 hw->eeprom.address_bits); in ixgbe_write_eeprom_buffer_bit_bang()
987 page_size = hw->eeprom.word_page_size; in ixgbe_write_eeprom_buffer_bit_bang()
999 if (((offset + i) & (page_size - 1)) == in ixgbe_write_eeprom_buffer_bit_bang()
1000 (page_size - 1)) in ixgbe_write_eeprom_buffer_bit_bang()
1007 /* Done with writing - release the EEPROM */ in ixgbe_write_eeprom_buffer_bit_bang()
1014 * ixgbe_write_eeprom_generic - Writes 16 bit value to EEPROM
1024 hw->eeprom.ops.init_params(hw); in ixgbe_write_eeprom_generic()
1026 if (offset >= hw->eeprom.word_size) in ixgbe_write_eeprom_generic()
1027 return -EINVAL; in ixgbe_write_eeprom_generic()
1033 * ixgbe_read_eeprom_buffer_bit_bang_generic - Read EEPROM using bit-bang
1039 * Reads 16 bit word(s) from EEPROM through bit-bang method
1047 hw->eeprom.ops.init_params(hw); in ixgbe_read_eeprom_buffer_bit_bang_generic()
1049 if (words == 0 || (offset + words > hw->eeprom.word_size)) in ixgbe_read_eeprom_buffer_bit_bang_generic()
1050 return -EINVAL; in ixgbe_read_eeprom_buffer_bit_bang_generic()
1058 count = (words - i) / IXGBE_EEPROM_RD_BUFFER_MAX_COUNT > 0 ? in ixgbe_read_eeprom_buffer_bit_bang_generic()
1059 IXGBE_EEPROM_RD_BUFFER_MAX_COUNT : (words - i); in ixgbe_read_eeprom_buffer_bit_bang_generic()
1072 * ixgbe_read_eeprom_buffer_bit_bang - Read EEPROM using bit-bang
1078 * Reads 16 bit word(s) from EEPROM through bit-bang method
1095 return -EIO; in ixgbe_read_eeprom_buffer_bit_bang()
1103 if ((hw->eeprom.address_bits == 8) && in ixgbe_read_eeprom_buffer_bit_bang()
1111 hw->eeprom.address_bits); in ixgbe_read_eeprom_buffer_bit_bang()
1125 * ixgbe_read_eeprom_bit_bang_generic - Read EEPROM word using bit-bang
1130 * Reads 16 bit value from EEPROM through bit-bang method
1135 hw->eeprom.ops.init_params(hw); in ixgbe_read_eeprom_bit_bang_generic()
1137 if (offset >= hw->eeprom.word_size) in ixgbe_read_eeprom_bit_bang_generic()
1138 return -EINVAL; in ixgbe_read_eeprom_bit_bang_generic()
1144 * ixgbe_read_eerd_buffer_generic - Read EEPROM word(s) using EERD
1159 hw->eeprom.ops.init_params(hw); in ixgbe_read_eerd_buffer_generic()
1161 if (words == 0 || offset >= hw->eeprom.word_size) in ixgbe_read_eerd_buffer_generic()
1162 return -EINVAL; in ixgbe_read_eerd_buffer_generic()
1184 * ixgbe_detect_eeprom_page_size_generic - Detect EEPROM page size
1202 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX; in ixgbe_detect_eeprom_page_size_generic()
1205 hw->eeprom.word_page_size = 0; in ixgbe_detect_eeprom_page_size_generic()
1217 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX - data[0]; in ixgbe_detect_eeprom_page_size_generic()
1220 hw->eeprom.word_page_size); in ixgbe_detect_eeprom_page_size_generic()
1225 * ixgbe_read_eerd_generic - Read EEPROM word using EERD
1238 * ixgbe_write_eewr_buffer_generic - Write EEPROM word(s) using EEWR
1253 hw->eeprom.ops.init_params(hw); in ixgbe_write_eewr_buffer_generic()
1255 if (words == 0 || offset >= hw->eeprom.word_size) in ixgbe_write_eewr_buffer_generic()
1256 return -EINVAL; in ixgbe_write_eewr_buffer_generic()
1282 * ixgbe_write_eewr_generic - Write EEPROM word using EEWR
1295 * ixgbe_poll_eerd_eewr_done - Poll EERD read or EEWR write status
1318 return -EIO; in ixgbe_poll_eerd_eewr_done()
1322 * ixgbe_acquire_eeprom - Acquire EEPROM using bit-bang
1325 * Prepares EEPROM for access using bit-bang method. This function should
1333 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) != 0) in ixgbe_acquire_eeprom()
1334 return -EBUSY; in ixgbe_acquire_eeprom()
1355 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_acquire_eeprom()
1356 return -EIO; in ixgbe_acquire_eeprom()
1369 * ixgbe_get_eeprom_semaphore - Get hardware semaphore
1372 * Sets the hardware semaphores so EEPROM access can occur for bit-bang method
1393 hw_dbg(hw, "Driver can't access the Eeprom - SMBI Semaphore not granted.\n"); in ixgbe_get_eeprom_semaphore()
1409 return -EIO; in ixgbe_get_eeprom_semaphore()
1437 return -EIO; in ixgbe_get_eeprom_semaphore()
1444 * ixgbe_release_eeprom_semaphore - Release hardware semaphore
1462 * ixgbe_ready_eeprom - Polls for EEPROM ready
1488 * On some parts, SPI write time could vary from 0-20mSec on 3.3V in ixgbe_ready_eeprom()
1489 * devices (and only 0-5mSec on 5V devices) in ixgbe_ready_eeprom()
1493 return -EIO; in ixgbe_ready_eeprom()
1500 * ixgbe_standby_eeprom - Returns EEPROM to a "standby" state
1521 * ixgbe_shift_out_eeprom_bits - Shift data bits out to the EEPROM.
1539 mask = BIT(count - 1); in ixgbe_shift_out_eeprom_bits()
1576 * ixgbe_shift_in_eeprom_bits - Shift data bits in from the EEPROM
1614 * ixgbe_raise_eeprom_clk - Raises the EEPROM's clock input.
1631 * ixgbe_lower_eeprom_clk - Lowers the EEPROM's clock input.
1648 * ixgbe_release_eeprom - Release EEPROM, release semaphores
1669 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_release_eeprom()
1675 usleep_range(hw->eeprom.semaphore_delay * 1000, in ixgbe_release_eeprom()
1676 hw->eeprom.semaphore_delay * 2000); in ixgbe_release_eeprom()
1680 * ixgbe_calc_eeprom_checksum_generic - Calculates and returns the checksum
1692 /* Include 0x0-0x3F in the checksum */ in ixgbe_calc_eeprom_checksum_generic()
1694 if (hw->eeprom.ops.read(hw, i, &word)) { in ixgbe_calc_eeprom_checksum_generic()
1703 if (hw->eeprom.ops.read(hw, i, &pointer)) { in ixgbe_calc_eeprom_checksum_generic()
1705 return -EIO; in ixgbe_calc_eeprom_checksum_generic()
1712 if (hw->eeprom.ops.read(hw, pointer, &length)) { in ixgbe_calc_eeprom_checksum_generic()
1714 return -EIO; in ixgbe_calc_eeprom_checksum_generic()
1721 if (hw->eeprom.ops.read(hw, j, &word)) { in ixgbe_calc_eeprom_checksum_generic()
1723 return -EIO; in ixgbe_calc_eeprom_checksum_generic()
1729 checksum = (u16)IXGBE_EEPROM_SUM - checksum; in ixgbe_calc_eeprom_checksum_generic()
1735 * ixgbe_validate_eeprom_checksum_generic - Validate EEPROM checksum
1754 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_generic()
1760 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_generic()
1766 status = hw->eeprom.ops.read(hw, IXGBE_EEPROM_CHECKSUM, &read_checksum); in ixgbe_validate_eeprom_checksum_generic()
1776 status = -EIO; in ixgbe_validate_eeprom_checksum_generic()
1786 * ixgbe_update_eeprom_checksum_generic - Updates the EEPROM checksum
1799 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_generic()
1805 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_update_eeprom_checksum_generic()
1811 status = hw->eeprom.ops.write(hw, IXGBE_EEPROM_CHECKSUM, checksum); in ixgbe_update_eeprom_checksum_generic()
1817 * ixgbe_set_rar_generic - Set Rx address register
1830 u32 rar_entries = hw->mac.num_rar_entries; in ixgbe_set_rar_generic()
1835 return -EINVAL; in ixgbe_set_rar_generic()
1839 hw->mac.ops.set_vmdq(hw, index, vmdq); in ixgbe_set_rar_generic()
1873 * ixgbe_clear_rar_generic - Remove Rx address register
1882 u32 rar_entries = hw->mac.num_rar_entries; in ixgbe_clear_rar_generic()
1887 return -EINVAL; in ixgbe_clear_rar_generic()
1907 hw->mac.ops.clear_vmdq(hw, index, IXGBE_CLEAR_VMDQ_ALL); in ixgbe_clear_rar_generic()
1913 * ixgbe_init_rx_addrs_generic - Initializes receive address filters.
1923 u32 rar_entries = hw->mac.num_rar_entries; in ixgbe_init_rx_addrs_generic()
1930 if (!is_valid_ether_addr(hw->mac.addr)) { in ixgbe_init_rx_addrs_generic()
1932 hw->mac.ops.get_mac_addr(hw, hw->mac.addr); in ixgbe_init_rx_addrs_generic()
1934 hw_dbg(hw, " Keeping Current RAR0 Addr =%pM\n", hw->mac.addr); in ixgbe_init_rx_addrs_generic()
1938 hw_dbg(hw, " New MAC Addr =%pM\n", hw->mac.addr); in ixgbe_init_rx_addrs_generic()
1940 hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0, IXGBE_RAH_AV); in ixgbe_init_rx_addrs_generic()
1944 hw->mac.ops.clear_vmdq(hw, 0, IXGBE_CLEAR_VMDQ_ALL); in ixgbe_init_rx_addrs_generic()
1946 hw->addr_ctrl.overflow_promisc = 0; in ixgbe_init_rx_addrs_generic()
1948 hw->addr_ctrl.rar_used_count = 1; in ixgbe_init_rx_addrs_generic()
1951 hw_dbg(hw, "Clearing RAR[1-%d]\n", rar_entries - 1); in ixgbe_init_rx_addrs_generic()
1958 hw->addr_ctrl.mta_in_use = 0; in ixgbe_init_rx_addrs_generic()
1959 IXGBE_WRITE_REG(hw, IXGBE_MCSTCTRL, hw->mac.mc_filter_type); in ixgbe_init_rx_addrs_generic()
1962 for (i = 0; i < hw->mac.mcft_size; i++) in ixgbe_init_rx_addrs_generic()
1965 if (hw->mac.ops.init_uta_tables) in ixgbe_init_rx_addrs_generic()
1966 hw->mac.ops.init_uta_tables(hw); in ixgbe_init_rx_addrs_generic()
1972 * ixgbe_mta_vector - Determines bit-vector in multicast table to set
1977 * bit-vector to set in the multicast table. The hardware uses 12 bits, from
1978 * incoming rx multicast addresses, to determine the bit-vector to check in
1979 * the MTA. Which of the 4 combination, of 12-bits, the hardware uses is set
1987 switch (hw->mac.mc_filter_type) { in ixgbe_mta_vector()
2005 /* vector can only be 12-bits or boundary will be exceeded */ in ixgbe_mta_vector()
2011 * ixgbe_set_mta - Set bit-vector in multicast table
2015 * Sets the bit-vector in the multicast table.
2023 hw->addr_ctrl.mta_in_use++; in ixgbe_set_mta()
2026 hw_dbg(hw, " bit-vector = 0x%03X\n", vector); in ixgbe_set_mta()
2029 * The MTA is a register array of 128 32-bit registers. It is treated in ixgbe_set_mta()
2039 hw->mac.mta_shadow[vector_reg] |= BIT(vector_bit); in ixgbe_set_mta()
2043 * ixgbe_update_mc_addr_list_generic - Updates MAC list of multicast addresses
2062 hw->addr_ctrl.num_mc_addrs = netdev_mc_count(netdev); in ixgbe_update_mc_addr_list_generic()
2063 hw->addr_ctrl.mta_in_use = 0; in ixgbe_update_mc_addr_list_generic()
2067 memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow)); in ixgbe_update_mc_addr_list_generic()
2072 ixgbe_set_mta(hw, ha->addr); in ixgbe_update_mc_addr_list_generic()
2075 /* Enable mta */ in ixgbe_update_mc_addr_list_generic()
2076 for (i = 0; i < hw->mac.mcft_size; i++) in ixgbe_update_mc_addr_list_generic()
2078 hw->mac.mta_shadow[i]); in ixgbe_update_mc_addr_list_generic()
2080 if (hw->addr_ctrl.mta_in_use > 0) in ixgbe_update_mc_addr_list_generic()
2082 IXGBE_MCSTCTRL_MFE | hw->mac.mc_filter_type); in ixgbe_update_mc_addr_list_generic()
2089 * ixgbe_enable_mc_generic - Enable multicast address in RAR
2096 struct ixgbe_addr_filter_info *a = &hw->addr_ctrl; in ixgbe_enable_mc_generic()
2098 if (a->mta_in_use > 0) in ixgbe_enable_mc_generic()
2100 hw->mac.mc_filter_type); in ixgbe_enable_mc_generic()
2106 * ixgbe_disable_mc_generic - Disable multicast address in RAR
2113 struct ixgbe_addr_filter_info *a = &hw->addr_ctrl; in ixgbe_disable_mc_generic()
2115 if (a->mta_in_use > 0) in ixgbe_disable_mc_generic()
2116 IXGBE_WRITE_REG(hw, IXGBE_MCSTCTRL, hw->mac.mc_filter_type); in ixgbe_disable_mc_generic()
2122 * ixgbe_fc_enable_generic - Enable flow control
2125 * Enable flow control according to the current settings.
2135 if (!hw->fc.pause_time) in ixgbe_fc_enable_generic()
2136 return -EINVAL; in ixgbe_fc_enable_generic()
2140 if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && in ixgbe_fc_enable_generic()
2141 hw->fc.high_water[i]) { in ixgbe_fc_enable_generic()
2142 if (!hw->fc.low_water[i] || in ixgbe_fc_enable_generic()
2143 hw->fc.low_water[i] >= hw->fc.high_water[i]) { in ixgbe_fc_enable_generic()
2145 return -EINVAL; in ixgbe_fc_enable_generic()
2151 hw->mac.ops.fc_autoneg(hw); in ixgbe_fc_enable_generic()
2170 switch (hw->fc.current_mode) { in ixgbe_fc_enable_generic()
2202 return -EIO; in ixgbe_fc_enable_generic()
2210 /* Set up and enable Rx high/low water mark thresholds, enable XON. */ in ixgbe_fc_enable_generic()
2212 if ((hw->fc.current_mode & ixgbe_fc_tx_pause) && in ixgbe_fc_enable_generic()
2213 hw->fc.high_water[i]) { in ixgbe_fc_enable_generic()
2214 fcrtl = (hw->fc.low_water[i] << 10) | IXGBE_FCRTL_XONE; in ixgbe_fc_enable_generic()
2216 fcrth = (hw->fc.high_water[i] << 10) | IXGBE_FCRTH_FCEN; in ixgbe_fc_enable_generic()
2222 * to the Rx packet buffer size - 24KB. This allows in ixgbe_fc_enable_generic()
2226 fcrth = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(i)) - 24576; in ixgbe_fc_enable_generic()
2233 reg = hw->fc.pause_time * 0x00010001U; in ixgbe_fc_enable_generic()
2237 IXGBE_WRITE_REG(hw, IXGBE_FCRTV, hw->fc.pause_time / 2); in ixgbe_fc_enable_generic()
2243 * ixgbe_negotiate_fc - Negotiate flow control
2259 return -EINVAL; in ixgbe_negotiate_fc()
2269 if (hw->fc.requested_mode == ixgbe_fc_full) { in ixgbe_negotiate_fc()
2270 hw->fc.current_mode = ixgbe_fc_full; in ixgbe_negotiate_fc()
2273 hw->fc.current_mode = ixgbe_fc_rx_pause; in ixgbe_negotiate_fc()
2278 hw->fc.current_mode = ixgbe_fc_tx_pause; in ixgbe_negotiate_fc()
2282 hw->fc.current_mode = ixgbe_fc_rx_pause; in ixgbe_negotiate_fc()
2285 hw->fc.current_mode = ixgbe_fc_none; in ixgbe_negotiate_fc()
2292 * ixgbe_fc_autoneg_fiber - Enable flow control on 1 gig fiber
2295 * Enable flow control according on 1 gig fiber.
2304 * - link is up but AN did not complete, or if in ixgbe_fc_autoneg_fiber()
2305 * - link is up and AN completed but timed out in ixgbe_fc_autoneg_fiber()
2311 return -EIO; in ixgbe_fc_autoneg_fiber()
2326 * ixgbe_fc_autoneg_backplane - Enable flow control IEEE clause 37
2329 * Enable flow control according to IEEE clause 37.
2338 * - backplane autoneg was not completed, or if in ixgbe_fc_autoneg_backplane()
2339 * - we are 82599 and link partner is not AN enabled in ixgbe_fc_autoneg_backplane()
2343 return -EIO; in ixgbe_fc_autoneg_backplane()
2345 if (hw->mac.type == ixgbe_mac_82599EB) { in ixgbe_fc_autoneg_backplane()
2348 return -EIO; in ixgbe_fc_autoneg_backplane()
2365 * ixgbe_fc_autoneg_copper - Enable flow control IEEE clause 37
2368 * Enable flow control according to IEEE clause 37.
2375 hw->phy.ops.read_reg(hw, MDIO_AN_ADVERTISE, in ixgbe_fc_autoneg_copper()
2378 hw->phy.ops.read_reg(hw, MDIO_AN_LPA, in ixgbe_fc_autoneg_copper()
2389 * ixgbe_fc_autoneg - Configure flow control
2398 int ret_val = -EIO; in ixgbe_fc_autoneg()
2404 * - FC autoneg is disabled, or if in ixgbe_fc_autoneg()
2405 * - link is not up. in ixgbe_fc_autoneg()
2410 if (hw->fc.disable_fc_autoneg) in ixgbe_fc_autoneg()
2413 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg()
2417 switch (hw->phy.media_type) { in ixgbe_fc_autoneg()
2441 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg()
2443 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg()
2444 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg()
2449 * ixgbe_pcie_timeout_poll - Return number of times to poll for completion
2452 * System-wide timeout range is encoded in PCIe Device Control2 register.
2496 * ixgbe_disable_pcie_primary - Disable PCI-express primary access
2499 * Disables PCI-Express primary access and verifies there are no pending
2500 * requests. -EALREADY is returned if primary disable
2519 hw_dbg(hw, "GIO disable did not set - requesting resets\n"); in ixgbe_disable_pcie_primary()
2525 ixgbe_removed(hw->hw_addr)) in ixgbe_disable_pcie_primary()
2543 hw_dbg(hw, "GIO Primary Disable bit didn't clear - requesting resets\n"); in ixgbe_disable_pcie_primary()
2545 hw->mac.flags |= IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_disable_pcie_primary()
2547 if (hw->mac.type >= ixgbe_mac_X550) in ixgbe_disable_pcie_primary()
2558 if (ixgbe_removed(hw->hw_addr)) in ixgbe_disable_pcie_primary()
2565 return -EALREADY; in ixgbe_disable_pcie_primary()
2569 * ixgbe_acquire_swfw_sync - Acquire SWFW semaphore
2590 return -EBUSY; in ixgbe_acquire_swfw_sync()
2610 return -EBUSY; in ixgbe_acquire_swfw_sync()
2614 * ixgbe_release_swfw_sync - Release SWFW semaphore
2636 * prot_autoc_read_generic - Hides MAC differences needed for AUTOC read
2652 * prot_autoc_write_generic - Hides MAC differences needed for AUTOC write
2665 * ixgbe_disable_rx_buff_generic - Stops the receive data path
2685 /* Use interrupt-safe sleep just in case */ in ixgbe_disable_rx_buff_generic()
2698 * ixgbe_enable_rx_buff_generic - Enables the receive data path
2716 * ixgbe_enable_rx_dma_generic - Enable the Rx DMA unit
2725 hw->mac.ops.enable_rx(hw); in ixgbe_enable_rx_dma_generic()
2727 hw->mac.ops.disable_rx(hw); in ixgbe_enable_rx_dma_generic()
2733 * ixgbe_blink_led_start_generic - Blink LED based on index.
2747 return -EINVAL; in ixgbe_blink_led_start_generic()
2750 * Link must be up to auto-blink the LEDs; in ixgbe_blink_led_start_generic()
2753 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_blink_led_start_generic()
2756 ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg); in ixgbe_blink_led_start_generic()
2763 ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked); in ixgbe_blink_led_start_generic()
2781 * ixgbe_blink_led_stop_generic - Stop blinking LED based on index.
2793 return -EINVAL; in ixgbe_blink_led_stop_generic()
2795 ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg); in ixgbe_blink_led_stop_generic()
2802 ret_val = hw->mac.ops.prot_autoc_write(hw, autoc_reg, locked); in ixgbe_blink_led_stop_generic()
2816 * ixgbe_get_san_mac_addr_offset - Get SAN MAC address offset from the EEPROM
2833 ret_val = hw->eeprom.ops.read(hw, IXGBE_SAN_MAC_ADDR_PTR, in ixgbe_get_san_mac_addr_offset()
2843 * ixgbe_get_san_mac_addr_generic - SAN MAC address retrieval from the EEPROM
2848 * per-port, so set_lan_id() must be called before reading the addresses.
2850 * upon for non-SFP connections, so we must call it here.
2868 hw->mac.ops.set_lan_id(hw); in ixgbe_get_san_mac_addr_generic()
2870 (hw->bus.func) ? (san_mac_offset += IXGBE_SAN_MAC_ADDR_PORT1_OFFSET) : in ixgbe_get_san_mac_addr_generic()
2873 ret_val = hw->eeprom.ops.read(hw, san_mac_offset, in ixgbe_get_san_mac_addr_generic()
2896 * ixgbe_get_pcie_msix_count_generic - Gets MSI-X vector count
2899 * Read PCIe configuration space, and get the MSI-X vector count from
2908 switch (hw->mac.type) { in ixgbe_get_pcie_msix_count_generic()
2926 if (ixgbe_removed(hw->hw_addr)) in ixgbe_get_pcie_msix_count_generic()
2930 /* MSI-X count is zero-based in HW */ in ixgbe_get_pcie_msix_count_generic()
2940 * ixgbe_clear_vmdq_generic - Disassociate a VMDq pool index from a rx address
2948 u32 rar_entries = hw->mac.num_rar_entries; in ixgbe_clear_vmdq_generic()
2953 return -EINVAL; in ixgbe_clear_vmdq_generic()
2959 if (ixgbe_removed(hw->hw_addr)) in ixgbe_clear_vmdq_generic()
2978 mpsar_hi &= ~BIT(vmdq - 32); in ixgbe_clear_vmdq_generic()
2984 rar != 0 && rar != hw->mac.san_mac_rar_index) in ixgbe_clear_vmdq_generic()
2985 hw->mac.ops.clear_rar(hw, rar); in ixgbe_clear_vmdq_generic()
2991 * ixgbe_set_vmdq_generic - Associate a VMDq pool index with a rx address
2999 u32 rar_entries = hw->mac.num_rar_entries; in ixgbe_set_vmdq_generic()
3004 return -EINVAL; in ixgbe_set_vmdq_generic()
3013 mpsar |= BIT(vmdq - 32); in ixgbe_set_vmdq_generic()
3020 * ixgbe_set_vmdq_san_mac_generic - Associate VMDq pool index with a rx address
3027 * MPSAR table needs to be updated for SAN_MAC RAR [hw->mac.san_mac_rar_index]
3031 u32 rar = hw->mac.san_mac_rar_index; in ixgbe_set_vmdq_san_mac_generic()
3038 IXGBE_WRITE_REG(hw, IXGBE_MPSAR_HI(rar), BIT(vmdq - 32)); in ixgbe_set_vmdq_san_mac_generic()
3045 * ixgbe_init_uta_tables_generic - Initialize the Unicast Table Array
3059 * ixgbe_find_vlvf_slot - find the vlanid or the first empty slot
3081 first_empty_slot = vlvf_bypass ? -ENOSPC : 0; in ixgbe_find_vlvf_slot()
3083 /* add VLAN enable bit for comparison */ in ixgbe_find_vlvf_slot()
3089 * pre-decrement loop covering (IXGBE_VLVF_ENTRIES - 1) .. 1 in ixgbe_find_vlvf_slot()
3091 for (regindex = IXGBE_VLVF_ENTRIES; --regindex;) { in ixgbe_find_vlvf_slot()
3105 return first_empty_slot ? : -ENOSPC; in ixgbe_find_vlvf_slot()
3109 * ixgbe_set_vfta_generic - Set VLAN filter table
3125 return -EINVAL; in ixgbe_set_vfta_generic()
3128 * this is a 2 part operation - first the VFTA, then the in ixgbe_set_vfta_generic()
3134 * The VFTA is a bitstring made up of 128 32-bit registers in ixgbe_set_vfta_generic()
3135 * that enable the particular VLAN id, much like the MTA: in ixgbe_set_vfta_generic()
3136 * bits[11-5]: which register in ixgbe_set_vfta_generic()
3137 * bits[4-0]: which bit in the register in ixgbe_set_vfta_generic()
3179 !IXGBE_READ_REG(hw, IXGBE_VLVFB(vlvf_index * 2 + 1 - vind / 32))) { in ixgbe_set_vfta_generic()
3211 /* record pool change and enable VLAN ID if not already enabled */ in ixgbe_set_vfta_generic()
3224 * ixgbe_clear_vfta_generic - Clear VLAN filter table
3233 for (offset = 0; offset < hw->mac.vft_size; offset++) in ixgbe_clear_vfta_generic()
3246 * ixgbe_need_crosstalk_fix - Determine if we need to do cross talk fix
3250 * crosstalk fix
3255 if (!hw->need_crosstalk_fix) in ixgbe_need_crosstalk_fix()
3259 switch (hw->mac.ops.get_media_type(hw)) { in ixgbe_need_crosstalk_fix()
3271 * ixgbe_check_mac_link_generic - Determine link and speed status
3286 /* If Crosstalk fix enabled do the sanity check of making sure in ixgbe_check_mac_link_generic()
3292 switch (hw->mac.type) { in ixgbe_check_mac_link_generic()
3303 /* sanity check - No SFP+ devices here */ in ixgbe_check_mac_link_generic()
3359 if ((hw->mac.type >= ixgbe_mac_X550) && in ixgbe_check_mac_link_generic()
3369 if ((hw->mac.type >= ixgbe_mac_X550) && in ixgbe_check_mac_link_generic()
3377 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T || in ixgbe_check_mac_link_generic()
3378 hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L) { in ixgbe_check_mac_link_generic()
3390 * ixgbe_get_wwn_prefix_generic - Get alternative WWNN/WWPN prefix from
3411 if (hw->eeprom.ops.read(hw, offset, &alt_san_mac_blk_offset)) in ixgbe_get_wwn_prefix_generic()
3420 if (hw->eeprom.ops.read(hw, offset, &caps)) in ixgbe_get_wwn_prefix_generic()
3427 if (hw->eeprom.ops.read(hw, offset, wwnn_prefix)) in ixgbe_get_wwn_prefix_generic()
3431 if (hw->eeprom.ops.read(hw, offset, wwpn_prefix)) in ixgbe_get_wwn_prefix_generic()
3442 * ixgbe_set_mac_anti_spoofing - Enable/Disable MAC anti-spoofing
3444 * @enable: enable or disable switch for MAC anti-spoofing
3445 * @vf: Virtual Function pool - VF Pool to set for MAC anti-spoofing
3448 void ixgbe_set_mac_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf) in ixgbe_set_mac_anti_spoofing() argument
3454 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_set_mac_anti_spoofing()
3458 if (enable) in ixgbe_set_mac_anti_spoofing()
3466 * ixgbe_set_vlan_anti_spoofing - Enable/Disable VLAN anti-spoofing
3468 * @enable: enable or disable switch for VLAN anti-spoofing
3469 * @vf: Virtual Function pool - VF Pool to set for VLAN anti-spoofing
3472 void ixgbe_set_vlan_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf) in ixgbe_set_vlan_anti_spoofing() argument
3478 if (hw->mac.type == ixgbe_mac_82598EB) in ixgbe_set_vlan_anti_spoofing()
3482 if (enable) in ixgbe_set_vlan_anti_spoofing()
3490 * ixgbe_get_device_caps_generic - Get additional device capabilities
3499 hw->eeprom.ops.read(hw, IXGBE_DEVICE_CAPS, device_caps); in ixgbe_get_device_caps_generic()
3505 * ixgbe_set_rxpba_generic - Initialize RX packet buffer
3516 u32 pbsize = hw->mac.rx_pb_size; in ixgbe_set_rxpba_generic()
3521 pbsize -= headroom; in ixgbe_set_rxpba_generic()
3535 pbsize -= rxpktsize * (num_pb / 2); in ixgbe_set_rxpba_generic()
3542 rxpktsize = (pbsize / (num_pb - i)) << IXGBE_RXPBSIZE_SHIFT; in ixgbe_set_rxpba_generic()
3556 txpbthresh = (txpktsize / 1024) - IXGBE_TXPKT_SIZE_MAX; in ixgbe_set_rxpba_generic()
3571 * ixgbe_calculate_checksum - Calculate checksum for buffer
3589 return (u8) (0 - sum); in ixgbe_calculate_checksum()
3593 * ixgbe_hic_unlocked - Issue command to manageability block unlocked
3601 * semaphore, -EINVAL when incorrect parameters passed or -EIO when
3614 hw_dbg(hw, "Buffer length failure buffersize-%d.\n", length); in ixgbe_hic_unlocked()
3615 return -EINVAL; in ixgbe_hic_unlocked()
3626 return -EIO; in ixgbe_hic_unlocked()
3632 return -EINVAL; in ixgbe_hic_unlocked()
3657 return -EIO; in ixgbe_hic_unlocked()
3663 * ixgbe_host_interface_command - Issue command to manageability block
3677 * else return -EIO or -EINVAL.
3691 hw_dbg(hw, "Buffer length failure buffersize-%d.\n", length); in ixgbe_host_interface_command()
3692 return -EINVAL; in ixgbe_host_interface_command()
3695 status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM); in ixgbe_host_interface_command()
3716 buf_len = hdr->buf_len; in ixgbe_host_interface_command()
3722 status = -EIO; in ixgbe_host_interface_command()
3736 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_SW_MNG_SM); in ixgbe_host_interface_command()
3742 * ixgbe_set_fw_drv_ver_generic - Sends driver version to firmware
3753 * else returns -EBUSY when encountering an error acquiring
3754 * semaphore or -EIO when command fails.
3767 fw_cmd.port_num = hw->bus.func; in ixgbe_set_fw_drv_ver_generic()
3790 ret_val = -EIO; in ixgbe_set_fw_drv_ver_generic()
3799 * ixgbe_clear_tx_pending - Clear pending TX work from the PCIe fifo
3815 if (!(hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED)) in ixgbe_clear_tx_pending()
3819 * Set loopback enable to prevent any transmits from being sent in ixgbe_clear_tx_pending()
3837 if (ixgbe_removed(hw->hw_addr)) in ixgbe_clear_tx_pending()
3871 * ixgbe_get_ets_data - Extracts the ETS bit data
3883 status = hw->eeprom.ops.read(hw, IXGBE_ETS_CFG, ets_offset); in ixgbe_get_ets_data()
3888 return -EOPNOTSUPP; in ixgbe_get_ets_data()
3890 status = hw->eeprom.ops.read(hw, *ets_offset, ets_cfg); in ixgbe_get_ets_data()
3895 return -EOPNOTSUPP; in ixgbe_get_ets_data()
3901 * ixgbe_get_thermal_sensor_data_generic - Gathers thermal sensor data
3914 struct ixgbe_thermal_sensor_data *data = &hw->mac.thermal_sensor_data; in ixgbe_get_thermal_sensor_data_generic()
3918 return -EOPNOTSUPP; in ixgbe_get_thermal_sensor_data_generic()
3932 status = hw->eeprom.ops.read(hw, (ets_offset + 1 + i), in ixgbe_get_thermal_sensor_data_generic()
3943 status = hw->phy.ops.read_i2c_byte(hw, in ixgbe_get_thermal_sensor_data_generic()
3946 &data->sensor[i].temp); in ixgbe_get_thermal_sensor_data_generic()
3956 * ixgbe_init_thermal_sensor_thresh_generic - Inits thermal sensor thresholds
3964 struct ixgbe_thermal_sensor_data *data = &hw->mac.thermal_sensor_data; in ixgbe_init_thermal_sensor_thresh_generic()
3978 return -EOPNOTSUPP; in ixgbe_init_thermal_sensor_thresh_generic()
3993 if (hw->eeprom.ops.read(hw, ets_offset + 1 + i, &ets_sensor)) { in ixgbe_init_thermal_sensor_thresh_generic()
4004 hw->phy.ops.write_i2c_byte(hw, in ixgbe_init_thermal_sensor_thresh_generic()
4011 data->sensor[i].location = sensor_location; in ixgbe_init_thermal_sensor_thresh_generic()
4012 data->sensor[i].caution_thresh = therm_limit; in ixgbe_init_thermal_sensor_thresh_generic()
4013 data->sensor[i].max_op_thresh = therm_limit - low_thresh_delta; in ixgbe_init_thermal_sensor_thresh_generic()
4020 * ixgbe_get_orom_version - Return option ROM from EEPROM
4025 * if valid option ROM version, nvm_ver->or_valid set to true
4026 * else nvm_ver->or_valid is false.
4033 nvm_ver->or_valid = false; in ixgbe_get_orom_version()
4035 hw->eeprom.ops.read(hw, NVM_OROM_OFFSET, &offset); in ixgbe_get_orom_version()
4041 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_HI, &eeprom_cfg_blkh); in ixgbe_get_orom_version()
4042 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_LOW, &eeprom_cfg_blkl); in ixgbe_get_orom_version()
4050 nvm_ver->or_valid = true; in ixgbe_get_orom_version()
4051 nvm_ver->or_major = eeprom_cfg_blkl >> NVM_OROM_SHIFT; in ixgbe_get_orom_version()
4052 nvm_ver->or_build = (eeprom_cfg_blkl << NVM_OROM_SHIFT) | in ixgbe_get_orom_version()
4054 nvm_ver->or_patch = eeprom_cfg_blkh & NVM_OROM_PATCH_MASK; in ixgbe_get_orom_version()
4058 * ixgbe_get_oem_prod_version - Etrack ID from EEPROM
4062 * if valid OEM product version, nvm_ver->oem_valid set to true
4063 * else nvm_ver->oem_valid is false.
4070 nvm_ver->oem_valid = false; in ixgbe_get_oem_prod_version()
4071 hw->eeprom.ops.read(hw, NVM_OEM_PROD_VER_PTR, &offset); in ixgbe_get_oem_prod_version()
4078 hw->eeprom.ops.read(hw, offset, &mod_len); in ixgbe_get_oem_prod_version()
4079 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_CAP_OFF, &cap); in ixgbe_get_oem_prod_version()
4086 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_L, &prod_ver); in ixgbe_get_oem_prod_version()
4087 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_H, &rel_num); in ixgbe_get_oem_prod_version()
4094 nvm_ver->oem_major = prod_ver >> NVM_VER_SHIFT; in ixgbe_get_oem_prod_version()
4095 nvm_ver->oem_minor = prod_ver & NVM_VER_MASK; in ixgbe_get_oem_prod_version()
4096 nvm_ver->oem_release = rel_num; in ixgbe_get_oem_prod_version()
4097 nvm_ver->oem_valid = true; in ixgbe_get_oem_prod_version()
4101 * ixgbe_get_etk_id - Return Etrack ID from EEPROM
4113 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_LOW, &etk_id_l)) in ixgbe_get_etk_id()
4115 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_HI, &etk_id_h)) in ixgbe_get_etk_id()
4122 nvm_ver->etk_id = etk_id_h; in ixgbe_get_etk_id()
4123 nvm_ver->etk_id |= (etk_id_l << NVM_ETK_SHIFT); in ixgbe_get_etk_id()
4125 nvm_ver->etk_id = etk_id_l; in ixgbe_get_etk_id()
4126 nvm_ver->etk_id |= (etk_id_h << NVM_ETK_SHIFT); in ixgbe_get_etk_id()
4136 if (hw->mac.type != ixgbe_mac_82598EB) { in ixgbe_disable_rx_generic()
4143 hw->mac.set_lben = true; in ixgbe_disable_rx_generic()
4145 hw->mac.set_lben = false; in ixgbe_disable_rx_generic()
4160 if (hw->mac.type != ixgbe_mac_82598EB) { in ixgbe_enable_rx_generic()
4161 if (hw->mac.set_lben) { in ixgbe_enable_rx_generic()
4167 hw->mac.set_lben = false; in ixgbe_enable_rx_generic()
4172 /** ixgbe_mng_present - returns true when management capability is present
4179 if (hw->mac.type < ixgbe_mac_82599EB) in ixgbe_mng_present()
4188 * ixgbe_setup_mac_link_multispeed_fiber - Set MAC link speed
4206 /* Mask off requested but non-supported speeds */ in ixgbe_setup_mac_link_multispeed_fiber()
4207 status = hw->mac.ops.get_link_capabilities(hw, &link_speed, &autoneg); in ixgbe_setup_mac_link_multispeed_fiber()
4221 switch (hw->phy.media_type) { in ixgbe_setup_mac_link_multispeed_fiber()
4223 hw->mac.ops.set_rate_select_speed(hw, in ixgbe_setup_mac_link_multispeed_fiber()
4234 /* Allow module to change analog characteristics (1G->10G) */ in ixgbe_setup_mac_link_multispeed_fiber()
4237 status = hw->mac.ops.setup_mac_link(hw, in ixgbe_setup_mac_link_multispeed_fiber()
4244 if (hw->mac.ops.flap_tx_laser) in ixgbe_setup_mac_link_multispeed_fiber()
4245 hw->mac.ops.flap_tx_laser(hw); in ixgbe_setup_mac_link_multispeed_fiber()
4256 status = hw->mac.ops.check_link(hw, &link_speed, in ixgbe_setup_mac_link_multispeed_fiber()
4272 switch (hw->phy.media_type) { in ixgbe_setup_mac_link_multispeed_fiber()
4274 hw->mac.ops.set_rate_select_speed(hw, in ixgbe_setup_mac_link_multispeed_fiber()
4285 /* Allow module to change analog characteristics (10G->1G) */ in ixgbe_setup_mac_link_multispeed_fiber()
4288 status = hw->mac.ops.setup_mac_link(hw, in ixgbe_setup_mac_link_multispeed_fiber()
4295 if (hw->mac.ops.flap_tx_laser) in ixgbe_setup_mac_link_multispeed_fiber()
4296 hw->mac.ops.flap_tx_laser(hw); in ixgbe_setup_mac_link_multispeed_fiber()
4302 status = hw->mac.ops.check_link(hw, &link_speed, &link_up, in ixgbe_setup_mac_link_multispeed_fiber()
4322 hw->phy.autoneg_advertised = 0; in ixgbe_setup_mac_link_multispeed_fiber()
4325 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_10GB_FULL; in ixgbe_setup_mac_link_multispeed_fiber()
4328 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_1GB_FULL; in ixgbe_setup_mac_link_multispeed_fiber()
4334 * ixgbe_set_soft_rate_select_speed - Set module link speed
4360 status = hw->phy.ops.read_i2c_byte(hw, IXGBE_SFF_SFF_8472_OSCB, in ixgbe_set_soft_rate_select_speed()
4370 status = hw->phy.ops.write_i2c_byte(hw, IXGBE_SFF_SFF_8472_OSCB, in ixgbe_set_soft_rate_select_speed()
4379 status = hw->phy.ops.read_i2c_byte(hw, IXGBE_SFF_SFF_8472_ESCB, in ixgbe_set_soft_rate_select_speed()
4389 status = hw->phy.ops.write_i2c_byte(hw, IXGBE_SFF_SFF_8472_ESCB, in ixgbe_set_soft_rate_select_speed()