Lines Matching +full:temperature +full:- +full:lookup +full:- +full:table

2   SPDX-License-Identifier: BSD-3-Clause
43 * ixgbe_init_aci - initialization routine for Admin Command Interface
50 ixgbe_init_lock(&hw->aci.lock); in ixgbe_init_aci()
54 * ixgbe_shutdown_aci - shutdown routine for Admin Command Interface
61 ixgbe_destroy_lock(&hw->aci.lock); in ixgbe_shutdown_aci()
65 * ixgbe_should_retry_aci_send_cmd_execute - decide if ACI command should
88 * ixgbe_aci_send_cmd_execute - execute sending FW Admin Command to FW Admin
99 * * - IXGBE_SUCCESS - success.
100 * * - IXGBE_ERR_ACI_DISABLED - CSR mechanism is not enabled.
101 * * - IXGBE_ERR_ACI_BUSY - CSR mechanism is busy.
102 * * - IXGBE_ERR_PARAM - buf_size is too big or
104 * * - IXGBE_ERR_ACI_TIMEOUT - Admin Command X command timeout.
105 * * - IXGBE_ERR_ACI_ERROR - Admin Command X invalid state of HICR register or
121 hw->aci.last_status = IXGBE_ACI_RC_OK; in ixgbe_aci_send_cmd_execute()
130 hw->aci.last_status = IXGBE_ACI_RC_EBUSY; in ixgbe_aci_send_cmd_execute()
134 opcode = desc->opcode; in ixgbe_aci_send_cmd_execute()
142 desc->flags |= IXGBE_CPU_TO_LE16(IXGBE_ACI_FLAG_BUF); in ixgbe_aci_send_cmd_execute()
145 if (desc->flags & IXGBE_CPU_TO_LE16(IXGBE_ACI_FLAG_BUF)) { in ixgbe_aci_send_cmd_execute()
175 desc->flags |= in ixgbe_aci_send_cmd_execute()
178 desc->datalen = IXGBE_CPU_TO_LE16(buf_size); in ixgbe_aci_send_cmd_execute()
180 if (desc->flags & IXGBE_CPU_TO_LE16(IXGBE_ACI_FLAG_RD)) { in ixgbe_aci_send_cmd_execute()
251 if (desc->opcode != opcode && in ixgbe_aci_send_cmd_execute()
257 if (desc->retval != IXGBE_ACI_RC_OK) { in ixgbe_aci_send_cmd_execute()
258 hw->aci.last_status = (enum ixgbe_aci_err)desc->retval; in ixgbe_aci_send_cmd_execute()
264 if (valid_buf && (desc->flags & in ixgbe_aci_send_cmd_execute()
281 * ixgbe_aci_send_cmd - send FW Admin Command to FW Admin Command Interface
305 opcode = IXGBE_LE16_TO_CPU(desc->opcode); in ixgbe_aci_send_cmd()
319 ixgbe_acquire_lock(&hw->aci.lock); in ixgbe_aci_send_cmd()
321 last_status = hw->aci.last_status; in ixgbe_aci_send_cmd()
322 ixgbe_release_lock(&hw->aci.lock); in ixgbe_aci_send_cmd()
342 * ixgbe_aci_check_event_pending - check if there are any pending events
355 ep_bit_mask = hw->bus.func ? GL_FWSTS_EP_PF1 : GL_FWSTS_EP_PF0; in ixgbe_aci_check_event_pending()
363 * ixgbe_aci_get_event - get an event from ACI
381 if (!e || (!e->msg_buf && e->buf_len) || (e->msg_buf && !e->buf_len)) in ixgbe_aci_get_event()
384 ixgbe_acquire_lock(&hw->aci.lock); in ixgbe_aci_get_event()
394 status = ixgbe_aci_send_cmd_execute(hw, &desc, e->msg_buf, e->buf_len); in ixgbe_aci_get_event()
405 e->msg_len = MIN_T(u16, IXGBE_LE16_TO_CPU(desc.datalen), e->buf_len); in ixgbe_aci_get_event()
407 memcpy(&e->desc, &desc, sizeof(e->desc)); in ixgbe_aci_get_event()
415 ixgbe_release_lock(&hw->aci.lock); in ixgbe_aci_get_event()
421 * ixgbe_fill_dflt_direct_cmd_desc - fill ACI descriptor with default values.
432 desc->opcode = IXGBE_CPU_TO_LE16(opcode); in ixgbe_fill_dflt_direct_cmd_desc()
433 desc->flags = IXGBE_CPU_TO_LE16(IXGBE_ACI_FLAG_SI); in ixgbe_fill_dflt_direct_cmd_desc()
437 * ixgbe_aci_get_fw_ver - get the firmware version
457 hw->fw_branch = resp->fw_branch; in ixgbe_aci_get_fw_ver()
458 hw->fw_maj_ver = resp->fw_major; in ixgbe_aci_get_fw_ver()
459 hw->fw_min_ver = resp->fw_minor; in ixgbe_aci_get_fw_ver()
460 hw->fw_patch = resp->fw_patch; in ixgbe_aci_get_fw_ver()
461 hw->fw_build = IXGBE_LE32_TO_CPU(resp->fw_build); in ixgbe_aci_get_fw_ver()
462 hw->api_branch = resp->api_branch; in ixgbe_aci_get_fw_ver()
463 hw->api_maj_ver = resp->api_major; in ixgbe_aci_get_fw_ver()
464 hw->api_min_ver = resp->api_minor; in ixgbe_aci_get_fw_ver()
465 hw->api_patch = resp->api_patch; in ixgbe_aci_get_fw_ver()
472 * ixgbe_aci_send_driver_ver - send the driver version to firmware
496 cmd->major_ver = dv->major_ver; in ixgbe_aci_send_driver_ver()
497 cmd->minor_ver = dv->minor_ver; in ixgbe_aci_send_driver_ver()
498 cmd->build_ver = dv->build_ver; in ixgbe_aci_send_driver_ver()
499 cmd->subbuild_ver = dv->subbuild_ver; in ixgbe_aci_send_driver_ver()
502 while (len < sizeof(dv->driver_string) && in ixgbe_aci_send_driver_ver()
503 IS_ASCII(dv->driver_string[len]) && dv->driver_string[len]) in ixgbe_aci_send_driver_ver()
506 return ixgbe_aci_send_cmd(hw, &desc, dv->driver_string, len); in ixgbe_aci_send_driver_ver()
510 * ixgbe_aci_req_res - request a common resource
538 cmd_resp->res_id = IXGBE_CPU_TO_LE16(res); in ixgbe_aci_req_res()
539 cmd_resp->access_type = IXGBE_CPU_TO_LE16(access); in ixgbe_aci_req_res()
540 cmd_resp->res_number = IXGBE_CPU_TO_LE32(sdp_number); in ixgbe_aci_req_res()
541 cmd_resp->timeout = IXGBE_CPU_TO_LE32(*timeout); in ixgbe_aci_req_res()
552 if (!status || hw->aci.last_status == IXGBE_ACI_RC_EBUSY) in ixgbe_aci_req_res()
553 *timeout = IXGBE_LE32_TO_CPU(cmd_resp->timeout); in ixgbe_aci_req_res()
559 * ixgbe_aci_release_res - release a common resource using ACI
579 cmd->res_id = IXGBE_CPU_TO_LE16(res); in ixgbe_aci_release_res()
580 cmd->res_number = IXGBE_CPU_TO_LE32(sdp_number); in ixgbe_aci_release_res()
586 * ixgbe_acquire_res - acquire the ownership of a resource
630 retry_timeout - delay : 0; in ixgbe_acquire_res()
647 * ixgbe_release_res - release a common resource
672 * ixgbe_parse_common_caps - Parse common device/function capabilities
689 u32 logical_id = IXGBE_LE32_TO_CPU(elem->logical_id); in ixgbe_parse_common_caps()
690 u32 phys_id = IXGBE_LE32_TO_CPU(elem->phys_id); in ixgbe_parse_common_caps()
691 u32 number = IXGBE_LE32_TO_CPU(elem->number); in ixgbe_parse_common_caps()
692 u16 cap = IXGBE_LE16_TO_CPU(elem->cap); in ixgbe_parse_common_caps()
699 caps->valid_functions = number; in ixgbe_parse_common_caps()
702 caps->sr_iov_1_1 = (number == 1); in ixgbe_parse_common_caps()
705 caps->vmdq = (number == 1); in ixgbe_parse_common_caps()
708 caps->dcb = (number == 1); in ixgbe_parse_common_caps()
709 caps->active_tc_bitmap = logical_id; in ixgbe_parse_common_caps()
710 caps->maxtc = phys_id; in ixgbe_parse_common_caps()
713 caps->rss_table_size = number; in ixgbe_parse_common_caps()
714 caps->rss_table_entry_width = logical_id; in ixgbe_parse_common_caps()
717 caps->num_rxq = number; in ixgbe_parse_common_caps()
718 caps->rxq_first_id = phys_id; in ixgbe_parse_common_caps()
721 caps->num_txq = number; in ixgbe_parse_common_caps()
722 caps->txq_first_id = phys_id; in ixgbe_parse_common_caps()
725 caps->num_msix_vectors = number; in ixgbe_parse_common_caps()
726 caps->msix_vector_first_id = phys_id; in ixgbe_parse_common_caps()
731 caps->sec_rev_disabled = in ixgbe_parse_common_caps()
734 caps->update_disabled = in ixgbe_parse_common_caps()
737 caps->nvm_unified_update = in ixgbe_parse_common_caps()
740 caps->netlist_auth = in ixgbe_parse_common_caps()
745 caps->max_mtu = number; in ixgbe_parse_common_caps()
748 caps->pcie_reset_avoidance = (number > 0); in ixgbe_parse_common_caps()
751 caps->reset_restrict_support = (number == 1); in ixgbe_parse_common_caps()
758 u8 index = cap - IXGBE_ACI_CAPS_EXT_TOPO_DEV_IMG0; in ixgbe_parse_common_caps()
760 caps->ext_topo_dev_img_ver_high[index] = number; in ixgbe_parse_common_caps()
761 caps->ext_topo_dev_img_ver_low[index] = logical_id; in ixgbe_parse_common_caps()
762 caps->ext_topo_dev_img_part_num[index] = in ixgbe_parse_common_caps()
765 caps->ext_topo_dev_img_load_en[index] = in ixgbe_parse_common_caps()
767 caps->ext_topo_dev_img_prog_en[index] = in ixgbe_parse_common_caps()
772 caps->orom_recovery_update = (number == 1); in ixgbe_parse_common_caps()
775 caps->next_cluster_id_support = (number == 1); in ixgbe_parse_common_caps()
777 prefix, caps->next_cluster_id_support); in ixgbe_parse_common_caps()
788 * ixgbe_hweight8 - count set bits among the 8 lowest bits
805 * ixgbe_hweight32 - count set bits among the 32 lowest bits
828 * ixgbe_parse_valid_functions_cap - Parse IXGBE_ACI_CAPS_VALID_FUNCTIONS caps
840 u32 number = IXGBE_LE32_TO_CPU(cap->number); in ixgbe_parse_valid_functions_cap()
844 dev_p->num_funcs = ixgbe_hweight32(number); in ixgbe_parse_valid_functions_cap()
848 * ixgbe_parse_vf_dev_caps - Parse IXGBE_ACI_CAPS_VF device caps
859 u32 number = IXGBE_LE32_TO_CPU(cap->number); in ixgbe_parse_vf_dev_caps()
863 dev_p->num_vfs_exposed = number; in ixgbe_parse_vf_dev_caps()
867 * ixgbe_parse_vsi_dev_caps - Parse IXGBE_ACI_CAPS_VSI device caps
878 u32 number = IXGBE_LE32_TO_CPU(cap->number); in ixgbe_parse_vsi_dev_caps()
882 dev_p->num_vsi_allocd_to_host = number; in ixgbe_parse_vsi_dev_caps()
886 * ixgbe_parse_fdir_dev_caps - Parse IXGBE_ACI_CAPS_FD device caps
897 u32 number = IXGBE_LE32_TO_CPU(cap->number); in ixgbe_parse_fdir_dev_caps()
901 dev_p->num_flow_director_fltr = number; in ixgbe_parse_fdir_dev_caps()
905 * ixgbe_parse_dev_caps - Parse device capabilities
933 found = ixgbe_parse_common_caps(hw, &dev_p->common_cap, in ixgbe_parse_dev_caps()
960 * ixgbe_parse_vf_func_caps - Parse IXGBE_ACI_CAPS_VF function caps
971 u32 logical_id = IXGBE_LE32_TO_CPU(cap->logical_id); in ixgbe_parse_vf_func_caps()
972 u32 number = IXGBE_LE32_TO_CPU(cap->number); in ixgbe_parse_vf_func_caps()
976 func_p->num_allocd_vfs = number; in ixgbe_parse_vf_func_caps()
977 func_p->vf_base_id = logical_id; in ixgbe_parse_vf_func_caps()
981 * ixgbe_get_num_per_func - determine number of resources per PF
996 funcs = ixgbe_hweight8(hw->dev_caps.common_cap.valid_functions & in ixgbe_get_num_per_func()
1006 * ixgbe_parse_vsi_func_caps - Parse IXGBE_ACI_CAPS_VSI function caps
1017 func_p->guar_num_vsi = ixgbe_get_num_per_func(hw, IXGBE_MAX_VSI); in ixgbe_parse_vsi_func_caps()
1021 * ixgbe_parse_func_caps - Parse function capabilities
1047 ixgbe_parse_common_caps(hw, &func_p->common_cap, in ixgbe_parse_func_caps()
1066 * ixgbe_aci_list_caps - query function/device capabilities
1103 *cap_count = IXGBE_LE32_TO_CPU(cmd->count); in ixgbe_aci_list_caps()
1109 * ixgbe_discover_dev_caps - Read and extract device capabilities
1147 * ixgbe_discover_func_caps - Read and extract function capabilities
1186 * ixgbe_get_caps - get info about the HW
1197 status = ixgbe_discover_dev_caps(hw, &hw->dev_caps); in ixgbe_get_caps()
1201 return ixgbe_discover_func_caps(hw, &hw->func_caps); in ixgbe_get_caps()
1205 * ixgbe_aci_disable_rxen - disable RX
1223 cmd->lport_num = (u8)hw->bus.func; in ixgbe_aci_disable_rxen()
1229 * ixgbe_aci_get_phy_caps - returns PHY capabilities
1256 cmd->param0 |= IXGBE_CPU_TO_LE16(IXGBE_ACI_GET_PHY_RQM); in ixgbe_aci_get_phy_caps()
1258 cmd->param0 |= IXGBE_CPU_TO_LE16(report_mode); in ixgbe_aci_get_phy_caps()
1263 hw->phy.phy_type_low = IXGBE_LE64_TO_CPU(pcaps->phy_type_low); in ixgbe_aci_get_phy_caps()
1264 hw->phy.phy_type_high = IXGBE_LE64_TO_CPU(pcaps->phy_type_high); in ixgbe_aci_get_phy_caps()
1265 memcpy(hw->link.link_info.module_type, &pcaps->module_type, in ixgbe_aci_get_phy_caps()
1266 sizeof(hw->link.link_info.module_type)); in ixgbe_aci_get_phy_caps()
1273 * ixgbe_phy_caps_equals_cfg - check if capabilities match the PHY config
1299 if (phy_caps->phy_type_low != phy_cfg->phy_type_low || in ixgbe_phy_caps_equals_cfg()
1300 phy_caps->phy_type_high != phy_cfg->phy_type_high || in ixgbe_phy_caps_equals_cfg()
1301 ((phy_caps->caps & caps_mask) != (phy_cfg->caps & cfg_mask)) || in ixgbe_phy_caps_equals_cfg()
1302 phy_caps->low_power_ctrl_an != phy_cfg->low_power_ctrl_an || in ixgbe_phy_caps_equals_cfg()
1303 phy_caps->eee_cap != phy_cfg->eee_cap || in ixgbe_phy_caps_equals_cfg()
1304 phy_caps->eeer_value != phy_cfg->eeer_value || in ixgbe_phy_caps_equals_cfg()
1305 phy_caps->link_fec_options != phy_cfg->link_fec_opt) in ixgbe_phy_caps_equals_cfg()
1312 * ixgbe_copy_phy_caps_to_cfg - Copy PHY ability data to configuration data
1326 cfg->phy_type_low = caps->phy_type_low; in ixgbe_copy_phy_caps_to_cfg()
1327 cfg->phy_type_high = caps->phy_type_high; in ixgbe_copy_phy_caps_to_cfg()
1328 cfg->caps = caps->caps; in ixgbe_copy_phy_caps_to_cfg()
1329 cfg->low_power_ctrl_an = caps->low_power_ctrl_an; in ixgbe_copy_phy_caps_to_cfg()
1330 cfg->eee_cap = caps->eee_cap; in ixgbe_copy_phy_caps_to_cfg()
1331 cfg->eeer_value = caps->eeer_value; in ixgbe_copy_phy_caps_to_cfg()
1332 cfg->link_fec_opt = caps->link_fec_options; in ixgbe_copy_phy_caps_to_cfg()
1333 cfg->module_compliance_enforcement = in ixgbe_copy_phy_caps_to_cfg()
1334 caps->module_compliance_enforcement; in ixgbe_copy_phy_caps_to_cfg()
1338 * ixgbe_aci_set_phy_cfg - set PHY configuration
1359 /* Ensure that only valid bits of cfg->caps can be turned on. */ in ixgbe_aci_set_phy_cfg()
1360 if (cfg->caps & ~IXGBE_ACI_PHY_ENA_VALID_MASK) { in ixgbe_aci_set_phy_cfg()
1361 cfg->caps &= IXGBE_ACI_PHY_ENA_VALID_MASK; in ixgbe_aci_set_phy_cfg()
1370 hw->phy.curr_user_phy_cfg = *cfg; in ixgbe_aci_set_phy_cfg()
1376 * ixgbe_aci_set_link_restart_an - set up link and restart AN
1380 * Function sets up the link and restarts the Auto-Negotiation over the link.
1393 cmd->cmd_flags = IXGBE_ACI_RESTART_AN_LINK_RESTART; in ixgbe_aci_set_link_restart_an()
1395 cmd->cmd_flags |= IXGBE_ACI_RESTART_AN_LINK_ENABLE; in ixgbe_aci_set_link_restart_an()
1397 cmd->cmd_flags &= ~IXGBE_ACI_RESTART_AN_LINK_ENABLE; in ixgbe_aci_set_link_restart_an()
1403 * ixgbe_get_media_type_from_phy_type - Gets media type based on phy type
1421 hw_link_info = &hw->link.link_info; in ixgbe_get_media_type_from_phy_type()
1422 if (hw_link_info->phy_type_low && hw_link_info->phy_type_high) in ixgbe_get_media_type_from_phy_type()
1426 if (hw_link_info->phy_type_low) { in ixgbe_get_media_type_from_phy_type()
1432 if (hw_link_info->phy_type_low == IXGBE_PHY_TYPE_LOW_1G_SGMII && in ixgbe_get_media_type_from_phy_type()
1433 (hw_link_info->module_type[IXGBE_ACI_MOD_TYPE_IDENT] == in ixgbe_get_media_type_from_phy_type()
1435 hw_link_info->module_type[IXGBE_ACI_MOD_TYPE_IDENT] == in ixgbe_get_media_type_from_phy_type()
1439 switch (hw_link_info->phy_type_low) { in ixgbe_get_media_type_from_phy_type()
1464 switch (hw_link_info->phy_type_high) { in ixgbe_get_media_type_from_phy_type()
1473 * ixgbe_update_link_info - update status of the HW network link
1489 li = &hw->link.link_info; in ixgbe_update_link_info()
1495 if (li->link_info & IXGBE_ACI_MEDIA_AVAILABLE) { in ixgbe_update_link_info()
1506 memcpy(li->module_type, &pcaps->module_type, in ixgbe_update_link_info()
1507 sizeof(li->module_type)); in ixgbe_update_link_info()
1516 * ixgbe_get_link_status - get status of the HW network link
1533 if (hw->link.get_link_info) { in ixgbe_get_link_status()
1540 *link_up = hw->link.link_info.link_info & IXGBE_ACI_LINK_UP; in ixgbe_get_link_status()
1546 * ixgbe_aci_get_link_info - get the link status
1549 * @link: pointer to link status structure - optional
1572 li_old = &hw->link.link_info_old; in ixgbe_aci_get_link_info()
1573 li = &hw->link.link_info; in ixgbe_aci_get_link_info()
1574 hw_fc_info = &hw->fc; in ixgbe_aci_get_link_info()
1579 resp->cmd_flags = cmd_flags; in ixgbe_aci_get_link_info()
1590 li->link_speed = IXGBE_LE16_TO_CPU(link_data.link_speed); in ixgbe_aci_get_link_info()
1591 li->phy_type_low = IXGBE_LE64_TO_CPU(link_data.phy_type_low); in ixgbe_aci_get_link_info()
1592 li->phy_type_high = IXGBE_LE64_TO_CPU(link_data.phy_type_high); in ixgbe_aci_get_link_info()
1593 li->link_info = link_data.link_info; in ixgbe_aci_get_link_info()
1594 li->link_cfg_err = link_data.link_cfg_err; in ixgbe_aci_get_link_info()
1595 li->an_info = link_data.an_info; in ixgbe_aci_get_link_info()
1596 li->ext_info = link_data.ext_info; in ixgbe_aci_get_link_info()
1597 li->max_frame_size = IXGBE_LE16_TO_CPU(link_data.max_frame_size); in ixgbe_aci_get_link_info()
1598 li->fec_info = link_data.cfg & IXGBE_ACI_FEC_MASK; in ixgbe_aci_get_link_info()
1599 li->topo_media_conflict = link_data.topo_media_conflict; in ixgbe_aci_get_link_info()
1600 li->pacing = link_data.cfg & (IXGBE_ACI_CFG_PACING_M | in ixgbe_aci_get_link_info()
1607 hw_fc_info->current_mode = ixgbe_fc_full; in ixgbe_aci_get_link_info()
1609 hw_fc_info->current_mode = ixgbe_fc_tx_pause; in ixgbe_aci_get_link_info()
1611 hw_fc_info->current_mode = ixgbe_fc_rx_pause; in ixgbe_aci_get_link_info()
1613 hw_fc_info->current_mode = ixgbe_fc_none; in ixgbe_aci_get_link_info()
1615 li->lse_ena = !!(resp->cmd_flags & IXGBE_ACI_LSE_IS_ENABLED); in ixgbe_aci_get_link_info()
1622 hw->link.get_link_info = false; in ixgbe_aci_get_link_info()
1628 * ixgbe_aci_set_event_mask - set event mask
1646 cmd->event_mask = IXGBE_CPU_TO_LE16(mask); in ixgbe_aci_set_event_mask()
1651 * ixgbe_configure_lse - enable/disable link status events
1665 rc = ixgbe_aci_set_event_mask(hw, (u8)hw->bus.func, mask); in ixgbe_configure_lse()
1679 * ixgbe_aci_get_netlist_node - get a node handle
1712 * ixgbe_find_netlist_node - find a node handle
1716 * @node_handle: output parameter if node found - optional
1757 * ixgbe_aci_read_i2c - read I2C register value
1760 * @bus_addr: 7-bit I2C bus address
1762 * @params: I2C parameters: bit [7] - Repeated start,
1764 * bit [4] - I2C address type, bits [3:0] - data size
1765 * to read (0-16 bytes)
1790 cmd->i2c_bus_addr = IXGBE_CPU_TO_LE16(bus_addr); in ixgbe_aci_read_i2c()
1791 cmd->topo_addr = topo_addr; in ixgbe_aci_read_i2c()
1792 cmd->i2c_params = params; in ixgbe_aci_read_i2c()
1793 cmd->i2c_addr = addr; in ixgbe_aci_read_i2c()
1802 *data = resp->i2c_data[i]; in ixgbe_aci_read_i2c()
1811 * ixgbe_aci_write_i2c - write a value to I2C register
1814 * @bus_addr: 7-bit I2C bus address
1816 * @params: I2C parameters: bit [4] - I2C address type, bits [3:0] - data size
1817 * to write (0-7 bytes)
1842 cmd->i2c_bus_addr = IXGBE_CPU_TO_LE16(bus_addr); in ixgbe_aci_write_i2c()
1843 cmd->topo_addr = topo_addr; in ixgbe_aci_write_i2c()
1844 cmd->i2c_params = params; in ixgbe_aci_write_i2c()
1845 cmd->i2c_addr = addr; in ixgbe_aci_write_i2c()
1848 cmd->i2c_data[i] = *data; in ixgbe_aci_write_i2c()
1856 * ixgbe_aci_set_port_id_led - set LED value for the given port
1873 cmd->lport_num = (u8)hw->bus.func; in ixgbe_aci_set_port_id_led()
1874 cmd->lport_num_valid = IXGBE_ACI_PORT_ID_PORT_NUM_VALID; in ixgbe_aci_set_port_id_led()
1877 cmd->ident_mode = IXGBE_ACI_PORT_IDENT_LED_ORIG; in ixgbe_aci_set_port_id_led()
1879 cmd->ident_mode = IXGBE_ACI_PORT_IDENT_LED_BLINK; in ixgbe_aci_set_port_id_led()
1885 * ixgbe_aci_set_gpio - set GPIO pin state
1904 cmd->gpio_ctrl_handle = IXGBE_CPU_TO_LE16(gpio_ctrl_handle); in ixgbe_aci_set_gpio()
1905 cmd->gpio_num = pin_idx; in ixgbe_aci_set_gpio()
1906 cmd->gpio_val = value ? 1 : 0; in ixgbe_aci_set_gpio()
1912 * ixgbe_aci_get_gpio - get GPIO pin state
1932 cmd->gpio_ctrl_handle = IXGBE_CPU_TO_LE16(gpio_ctrl_handle); in ixgbe_aci_get_gpio()
1933 cmd->gpio_num = pin_idx; in ixgbe_aci_get_gpio()
1939 *value = !!cmd->gpio_val; in ixgbe_aci_get_gpio()
1944 * ixgbe_aci_sff_eeprom - read/write SFF EEPROM
1952 * @length: 1-16 for read, 1 for write.
1973 cmd->lport_num = (u8)(lport & 0xff); in ixgbe_aci_sff_eeprom()
1974 cmd->lport_num_valid = (u8)((lport >> 8) & 0x01); in ixgbe_aci_sff_eeprom()
1975 cmd->i2c_bus_addr = IXGBE_CPU_TO_LE16(((bus_addr >> 1) & in ixgbe_aci_sff_eeprom()
1980 cmd->i2c_offset = IXGBE_CPU_TO_LE16(mem_addr & 0xff); in ixgbe_aci_sff_eeprom()
1981 cmd->module_page = page; in ixgbe_aci_sff_eeprom()
1983 cmd->i2c_bus_addr |= IXGBE_CPU_TO_LE16(IXGBE_ACI_SFF_IS_WRITE); in ixgbe_aci_sff_eeprom()
1990 * ixgbe_aci_prog_topo_dev_nvm - program Topology Device NVM
2008 memcpy(&cmd->topo_params, topo_params, sizeof(*topo_params)); in ixgbe_aci_prog_topo_dev_nvm()
2014 * ixgbe_aci_read_topo_dev_nvm - read Topology Device NVM
2043 memcpy(&cmd->topo_params, topo_params, sizeof(*topo_params)); in ixgbe_aci_read_topo_dev_nvm()
2044 cmd->start_address = IXGBE_CPU_TO_LE32(start_address); in ixgbe_aci_read_topo_dev_nvm()
2050 memcpy(data, cmd->data_read, data_size); in ixgbe_aci_read_topo_dev_nvm()
2056 * ixgbe_acquire_nvm - Generic request for acquiring the NVM ownership
2079 * ixgbe_release_nvm - Generic request for releasing the NVM ownership
2098 * ixgbe_aci_read_nvm - read NVM
2126 cmd->cmd_flags |= IXGBE_ACI_NVM_FLASH_ONLY; in ixgbe_aci_read_nvm()
2130 cmd->cmd_flags |= IXGBE_ACI_NVM_LAST_CMD; in ixgbe_aci_read_nvm()
2131 cmd->module_typeid = IXGBE_CPU_TO_LE16(module_typeid); in ixgbe_aci_read_nvm()
2132 cmd->offset_low = IXGBE_CPU_TO_LE16(offset & 0xFFFF); in ixgbe_aci_read_nvm()
2133 cmd->offset_high = (offset >> 16) & 0xFF; in ixgbe_aci_read_nvm()
2134 cmd->length = IXGBE_CPU_TO_LE16(length); in ixgbe_aci_read_nvm()
2140 * ixgbe_aci_erase_nvm - erase NVM sector
2167 cmd->module_typeid = IXGBE_CPU_TO_LE16(module_typeid); in ixgbe_aci_erase_nvm()
2168 cmd->length = len; in ixgbe_aci_erase_nvm()
2169 cmd->offset_low = 0; in ixgbe_aci_erase_nvm()
2170 cmd->offset_high = 0; in ixgbe_aci_erase_nvm()
2176 * ixgbe_aci_update_nvm - update NVM
2204 cmd->cmd_flags |= command_flags; in ixgbe_aci_update_nvm()
2208 cmd->cmd_flags |= IXGBE_ACI_NVM_LAST_CMD; in ixgbe_aci_update_nvm()
2209 cmd->module_typeid = IXGBE_CPU_TO_LE16(module_typeid); in ixgbe_aci_update_nvm()
2210 cmd->offset_low = IXGBE_CPU_TO_LE16(offset & 0xFFFF); in ixgbe_aci_update_nvm()
2211 cmd->offset_high = (offset >> 16) & 0xFF; in ixgbe_aci_update_nvm()
2212 cmd->length = IXGBE_CPU_TO_LE16(length); in ixgbe_aci_update_nvm()
2220 * ixgbe_aci_read_nvm_cfg - read an NVM config block
2245 cmd->cmd_flags = cmd_flags; in ixgbe_aci_read_nvm_cfg()
2246 cmd->id = IXGBE_CPU_TO_LE16(field_id); in ixgbe_aci_read_nvm_cfg()
2250 *elem_count = IXGBE_LE16_TO_CPU(cmd->count); in ixgbe_aci_read_nvm_cfg()
2256 * ixgbe_aci_write_nvm_cfg - write an NVM config block
2279 cmd->count = IXGBE_CPU_TO_LE16(elem_count); in ixgbe_aci_write_nvm_cfg()
2280 cmd->cmd_flags = cmd_flags; in ixgbe_aci_write_nvm_cfg()
2286 * ixgbe_nvm_validate_checksum - validate checksum
2308 cmd->flags = IXGBE_ACI_NVM_CHECKSUM_VERIFY; in ixgbe_nvm_validate_checksum()
2315 if (IXGBE_LE16_TO_CPU(cmd->checksum) != in ixgbe_nvm_validate_checksum()
2326 * ixgbe_nvm_recalculate_checksum - recalculate checksum
2347 cmd->flags = IXGBE_ACI_NVM_CHECKSUM_RECALC; in ixgbe_nvm_recalculate_checksum()
2357 * ixgbe_nvm_write_activate - NVM activate write
2389 cmd->cmd_flags = LO_BYTE(cmd_flags); in ixgbe_nvm_write_activate()
2390 cmd->offset_high = HI_BYTE(cmd_flags); in ixgbe_nvm_write_activate()
2394 *response_flags = cmd->cmd_flags; in ixgbe_nvm_write_activate()
2400 * ixgbe_get_flash_bank_offset - Get offset into requested flash bank
2405 * Based on the module, lookup the module offset from the beginning of the
2415 struct ixgbe_bank_info *banks = &hw->flash.banks; in ixgbe_get_flash_bank_offset()
2422 offset = banks->nvm_ptr; in ixgbe_get_flash_bank_offset()
2423 size = banks->nvm_size; in ixgbe_get_flash_bank_offset()
2424 active_bank = banks->nvm_bank; in ixgbe_get_flash_bank_offset()
2427 offset = banks->orom_ptr; in ixgbe_get_flash_bank_offset()
2428 size = banks->orom_size; in ixgbe_get_flash_bank_offset()
2429 active_bank = banks->orom_bank; in ixgbe_get_flash_bank_offset()
2432 offset = banks->netlist_ptr; in ixgbe_get_flash_bank_offset()
2433 size = banks->netlist_size; in ixgbe_get_flash_bank_offset()
2434 active_bank = banks->netlist_bank; in ixgbe_get_flash_bank_offset()
2466 * ixgbe_read_flash_module - Read a word from one of the main NVM modules
2479 * hw->flash.banks data being setup by ixgbe_determine_active_flash_banks()
2508 * ixgbe_read_netlist_module - Read data from the netlist module area
2536 * ixgbe_read_nvm_module - Read from the active main NVM module
2565 * ixgbe_get_nvm_css_hdr_len - Read the CSS header length from the
2604 * ixgbe_read_nvm_sr_copy - Read a word from the Shadow RAM copy in the NVM bank
2632 * ixgbe_get_nvm_minsrevs - Get the minsrevs values from flash
2669 minsrevs->nvm = minsrev_h << 16 | minsrev_l; in ixgbe_get_nvm_minsrevs()
2670 minsrevs->nvm_valid = true; in ixgbe_get_nvm_minsrevs()
2678 minsrevs->orom = minsrev_h << 16 | minsrev_l; in ixgbe_get_nvm_minsrevs()
2679 minsrevs->orom_valid = true; in ixgbe_get_nvm_minsrevs()
2686 * ixgbe_update_nvm_minsrevs - Update minsrevs TLV data in flash
2691 * area of the flash. Reads the minsrevs->nvm_valid and minsrevs->orom_valid
2703 if (!minsrevs->nvm_valid && !minsrevs->orom_valid) { in ixgbe_update_nvm_minsrevs()
2717 if (minsrevs->nvm_valid) { in ixgbe_update_nvm_minsrevs()
2718 data.nvm_minsrev_l = IXGBE_CPU_TO_LE16(minsrevs->nvm & 0xFFFF); in ixgbe_update_nvm_minsrevs()
2719 data.nvm_minsrev_h = IXGBE_CPU_TO_LE16(minsrevs->nvm >> 16); in ixgbe_update_nvm_minsrevs()
2724 if (minsrevs->orom_valid) { in ixgbe_update_nvm_minsrevs()
2725 data.orom_minsrev_l = IXGBE_CPU_TO_LE16(minsrevs->orom & 0xFFFF); in ixgbe_update_nvm_minsrevs()
2726 data.orom_minsrev_h = IXGBE_CPU_TO_LE16(minsrevs->orom >> 16); in ixgbe_update_nvm_minsrevs()
2748 * ixgbe_get_nvm_srev - Read the security revision from the NVM CSS header
2778 * ixgbe_get_nvm_ver_info - Read NVM version information
2801 nvm->major = (ver & E610_NVM_VER_HI_MASK) >> E610_NVM_VER_HI_SHIFT; in ixgbe_get_nvm_ver_info()
2802 nvm->minor = (ver & E610_NVM_VER_LO_MASK) >> E610_NVM_VER_LO_SHIFT; in ixgbe_get_nvm_ver_info()
2815 nvm->eetrack = (eetrack_hi << 16) | eetrack_lo; in ixgbe_get_nvm_ver_info()
2817 status = ixgbe_get_nvm_srev(hw, bank, &nvm->srev); in ixgbe_get_nvm_ver_info()
2823 * ixgbe_get_inactive_nvm_ver - Read Option ROM version from the inactive bank
2839 * ixgbe_get_active_nvm_ver - Read Option ROM version from the active bank
2916 netlist->major = id_blk[IXGBE_NETLIST_ID_BLK_MAJOR_VER_HIGH] << 16 | in ixgbe_get_netlist_info()
2918 netlist->minor = id_blk[IXGBE_NETLIST_ID_BLK_MINOR_VER_HIGH] << 16 | in ixgbe_get_netlist_info()
2920 netlist->type = id_blk[IXGBE_NETLIST_ID_BLK_TYPE_HIGH] << 16 | in ixgbe_get_netlist_info()
2922 netlist->rev = id_blk[IXGBE_NETLIST_ID_BLK_REV_HIGH] << 16 | in ixgbe_get_netlist_info()
2924 netlist->cust_ver = id_blk[IXGBE_NETLIST_ID_BLK_CUST_VER]; in ixgbe_get_netlist_info()
2926 netlist->hash = id_blk[IXGBE_NETLIST_ID_BLK_SHA_HASH_WORD(15)] << 16 | in ixgbe_get_netlist_info()
2953 * ixgbe_read_sr_pointer - Read the value of a Shadow RAM pointer word
2987 * ixgbe_read_sr_area_size - Read an area size from a Shadow RAM word
3017 * ixgbe_discover_flash_size - Discover the available flash size.
3035 while ((max_size - min_size) > 1) { in ixgbe_discover_flash_size()
3042 hw->aci.last_status == IXGBE_ACI_RC_EINVAL) { in ixgbe_discover_flash_size()
3053 hw->flash.flash_size = max_size; in ixgbe_discover_flash_size()
3062 * ixgbe_determine_active_flash_banks - Discover active bank for each module
3075 struct ixgbe_bank_info *banks = &hw->flash.banks; in ixgbe_determine_active_flash_banks()
3091 banks->nvm_bank = IXGBE_1ST_FLASH_BANK; in ixgbe_determine_active_flash_banks()
3093 banks->nvm_bank = IXGBE_2ND_FLASH_BANK; in ixgbe_determine_active_flash_banks()
3096 banks->orom_bank = IXGBE_1ST_FLASH_BANK; in ixgbe_determine_active_flash_banks()
3098 banks->orom_bank = IXGBE_2ND_FLASH_BANK; in ixgbe_determine_active_flash_banks()
3101 banks->netlist_bank = IXGBE_1ST_FLASH_BANK; in ixgbe_determine_active_flash_banks()
3103 banks->netlist_bank = IXGBE_2ND_FLASH_BANK; in ixgbe_determine_active_flash_banks()
3106 &banks->nvm_ptr); in ixgbe_determine_active_flash_banks()
3112 &banks->nvm_size); in ixgbe_determine_active_flash_banks()
3118 &banks->orom_ptr); in ixgbe_determine_active_flash_banks()
3124 &banks->orom_size); in ixgbe_determine_active_flash_banks()
3130 &banks->netlist_ptr); in ixgbe_determine_active_flash_banks()
3136 &banks->netlist_size); in ixgbe_determine_active_flash_banks()
3145 * ixgbe_init_nvm - initializes NVM setting
3155 struct ixgbe_flash_info *flash = &hw->flash; in ixgbe_init_nvm()
3166 flash->sr_words = BIT(sr_size) * IXGBE_SR_WORDS_IN_1KB; in ixgbe_init_nvm()
3171 flash->blank_nvm_mode = false; in ixgbe_init_nvm()
3174 flash->blank_nvm_mode = true; in ixgbe_init_nvm()
3189 &flash->nvm); in ixgbe_init_nvm()
3196 &flash->netlist); in ixgbe_init_nvm()
3202 * ixgbe_sanitize_operate - Clear the user data
3232 * ixgbe_sanitize_nvm - Sanitize NVM
3249 cmd->cmd_flags = cmd_flags; in ixgbe_sanitize_nvm()
3253 *values = cmd->values; in ixgbe_sanitize_nvm()
3259 * ixgbe_read_sr_word_aci - Reads Shadow RAM via ACI
3261 * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF)
3284 * ixgbe_read_sr_buf_aci - Reads Shadow RAM buf via ACI
3286 * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF)
3312 * ixgbe_read_flat_nvm - Read portion of NVM by flat offset
3341 (hw->eeprom.word_size * 2u))) { in ixgbe_read_flat_nvm()
3354 IXGBE_ACI_MAX_BUFFER_SIZE - sector_offset, in ixgbe_read_flat_nvm()
3355 inlen - bytes_read); in ixgbe_read_flat_nvm()
3379 * ixgbe_check_sr_access_params - verify params for Shadow RAM R/W operations.
3388 * * - IXGBE_SUCCESS - success.
3389 * * - IXGBE_ERR_PARAM - NVM error: offset beyond SR limit or
3396 if ((offset + words) > hw->eeprom.word_size) { in ixgbe_check_sr_access_params()
3407 if (((offset + (words - 1)) / IXGBE_SR_SECTOR_SIZE_IN_WORDS) != in ixgbe_check_sr_access_params()
3417 * ixgbe_write_sr_word_aci - Writes Shadow RAM word
3443 * ixgbe_write_sr_buf_aci - Writes Shadow RAM buf
3486 * ixgbe_aci_alternate_write - write to alternate structure
3508 cmd->dword0_addr = IXGBE_CPU_TO_LE32(reg_addr0); in ixgbe_aci_alternate_write()
3509 cmd->dword1_addr = IXGBE_CPU_TO_LE32(reg_addr1); in ixgbe_aci_alternate_write()
3510 cmd->dword0_value = IXGBE_CPU_TO_LE32(reg_val0); in ixgbe_aci_alternate_write()
3511 cmd->dword1_value = IXGBE_CPU_TO_LE32(reg_val1); in ixgbe_aci_alternate_write()
3519 * ixgbe_aci_alternate_read - read from alternate structure
3546 cmd->dword0_addr = IXGBE_CPU_TO_LE32(reg_addr0); in ixgbe_aci_alternate_read()
3547 cmd->dword1_addr = IXGBE_CPU_TO_LE32(reg_addr1); in ixgbe_aci_alternate_read()
3552 *reg_val0 = IXGBE_LE32_TO_CPU(cmd->dword0_value); in ixgbe_aci_alternate_read()
3555 *reg_val1 = IXGBE_LE32_TO_CPU(cmd->dword1_value); in ixgbe_aci_alternate_read()
3562 * ixgbe_aci_alternate_write_done - check if writing to alternate structure
3585 cmd->flags = bios_mode; in ixgbe_aci_alternate_write_done()
3589 *reset_needed = (IXGBE_LE16_TO_CPU(cmd->flags) & in ixgbe_aci_alternate_write_done()
3596 * ixgbe_aci_alternate_clear - clear alternate structure
3618 * ixgbe_aci_get_internal_data - get internal FW/HW data
3621 * @table_id: table ID within cluster
3652 cmd->cluster_id = IXGBE_CPU_TO_LE16(cluster_id); in ixgbe_aci_get_internal_data()
3653 cmd->table_id = IXGBE_CPU_TO_LE16(table_id); in ixgbe_aci_get_internal_data()
3654 cmd->idx = IXGBE_CPU_TO_LE32(start); in ixgbe_aci_get_internal_data()
3662 *ret_next_cluster = IXGBE_LE16_TO_CPU(cmd->cluster_id); in ixgbe_aci_get_internal_data()
3664 *ret_next_table = IXGBE_LE16_TO_CPU(cmd->table_id); in ixgbe_aci_get_internal_data()
3666 *ret_next_index = IXGBE_LE32_TO_CPU(cmd->idx); in ixgbe_aci_get_internal_data()
3673 * ixgbe_validate_nvm_rw_reg - Check that an NVM access request is valid
3687 switch (cmd->offset) { in ixgbe_validate_nvm_rw_reg()
3701 if (cmd->offset == (u32)GL_HIDA(i)) in ixgbe_validate_nvm_rw_reg()
3705 if (cmd->offset == (u32)GL_HIBA(i)) in ixgbe_validate_nvm_rw_reg()
3713 * ixgbe_nvm_access_read - Handle an NVM read request
3730 memset(&data->regval, 0, cmd->data_size); in ixgbe_nvm_access_read()
3737 DEBUGOUT1("NVM access: reading register %08x\n", cmd->offset); in ixgbe_nvm_access_read()
3740 data->regval = IXGBE_READ_REG(hw, cmd->offset); in ixgbe_nvm_access_read()
3746 * ixgbe_nvm_access_write - Handle an NVM write request
3767 /* Reject requests to write to read-only registers */ in ixgbe_nvm_access_write()
3768 switch (cmd->offset) { in ixgbe_nvm_access_write()
3776 cmd->offset, data->regval); in ixgbe_nvm_access_write()
3779 IXGBE_WRITE_REG(hw, cmd->offset, data->regval); in ixgbe_nvm_access_write()
3785 * ixgbe_handle_nvm_access - Handle an NVM access request
3804 switch (cmd->command) { in ixgbe_handle_nvm_access()
3815 * ixgbe_aci_set_health_status_config - Configure FW health events
3820 * PF using ACI command (0xFF20). The supported event types are: PF-specific,
3835 cmd->event_source = event_source; in ixgbe_aci_set_health_status_config()
3841 * ixgbe_init_ops_E610 - Inits func ptrs and MAC type
3851 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_ops_E610()
3852 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_ops_E610()
3853 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_ops_E610()
3859 mac->ops.reset_hw = ixgbe_reset_hw_E610; in ixgbe_init_ops_E610()
3860 mac->ops.start_hw = ixgbe_start_hw_E610; in ixgbe_init_ops_E610()
3861 mac->ops.get_media_type = ixgbe_get_media_type_E610; in ixgbe_init_ops_E610()
3862 mac->ops.get_supported_physical_layer = in ixgbe_init_ops_E610()
3864 mac->ops.get_san_mac_addr = NULL; in ixgbe_init_ops_E610()
3865 mac->ops.set_san_mac_addr = NULL; in ixgbe_init_ops_E610()
3866 mac->ops.get_wwn_prefix = NULL; in ixgbe_init_ops_E610()
3867 mac->ops.setup_link = ixgbe_setup_link_E610; in ixgbe_init_ops_E610()
3868 mac->ops.check_link = ixgbe_check_link_E610; in ixgbe_init_ops_E610()
3869 mac->ops.get_link_capabilities = ixgbe_get_link_capabilities_E610; in ixgbe_init_ops_E610()
3870 mac->ops.setup_fc = ixgbe_setup_fc_E610; in ixgbe_init_ops_E610()
3871 mac->ops.fc_autoneg = ixgbe_fc_autoneg_E610; in ixgbe_init_ops_E610()
3872 mac->ops.set_fw_drv_ver = ixgbe_set_fw_drv_ver_E610; in ixgbe_init_ops_E610()
3873 mac->ops.disable_rx = ixgbe_disable_rx_E610; in ixgbe_init_ops_E610()
3874 mac->ops.setup_eee = ixgbe_setup_eee_E610; in ixgbe_init_ops_E610()
3875 mac->ops.fw_recovery_mode = ixgbe_fw_recovery_mode_E610; in ixgbe_init_ops_E610()
3876 mac->ops.fw_rollback_mode = ixgbe_fw_rollback_mode_E610; in ixgbe_init_ops_E610()
3877 mac->ops.get_fw_tsam_mode = ixgbe_get_fw_tsam_mode_E610; in ixgbe_init_ops_E610()
3878 mac->ops.get_fw_version = ixgbe_aci_get_fw_ver; in ixgbe_init_ops_E610()
3879 mac->ops.get_nvm_version = ixgbe_get_active_nvm_ver; in ixgbe_init_ops_E610()
3880 mac->ops.get_thermal_sensor_data = NULL; in ixgbe_init_ops_E610()
3881 mac->ops.init_thermal_sensor_thresh = NULL; in ixgbe_init_ops_E610()
3884 phy->ops.init = ixgbe_init_phy_ops_E610; in ixgbe_init_ops_E610()
3885 phy->ops.identify = ixgbe_identify_phy_E610; in ixgbe_init_ops_E610()
3886 phy->eee_speeds_supported = IXGBE_LINK_SPEED_10_FULL | in ixgbe_init_ops_E610()
3889 phy->eee_speeds_advertised = phy->eee_speeds_supported; in ixgbe_init_ops_E610()
3892 eeprom->ops.init_params = ixgbe_init_eeprom_params_E610; in ixgbe_init_ops_E610()
3893 eeprom->ops.read = ixgbe_read_ee_aci_E610; in ixgbe_init_ops_E610()
3894 eeprom->ops.read_buffer = ixgbe_read_ee_aci_buffer_E610; in ixgbe_init_ops_E610()
3895 eeprom->ops.write = ixgbe_write_ee_aci_E610; in ixgbe_init_ops_E610()
3896 eeprom->ops.write_buffer = ixgbe_write_ee_aci_buffer_E610; in ixgbe_init_ops_E610()
3897 eeprom->ops.calc_checksum = ixgbe_calc_eeprom_checksum_E610; in ixgbe_init_ops_E610()
3898 eeprom->ops.update_checksum = ixgbe_update_eeprom_checksum_E610; in ixgbe_init_ops_E610()
3899 eeprom->ops.validate_checksum = ixgbe_validate_eeprom_checksum_E610; in ixgbe_init_ops_E610()
3900 eeprom->ops.read_pba_string = ixgbe_read_pba_string_E610; in ixgbe_init_ops_E610()
3903 hw->mac.ops.set_lan_id(hw); in ixgbe_init_ops_E610()
3909 * ixgbe_reset_hw_E610 - Perform hardware reset
3919 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_reset_hw_E610()
3926 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_E610()
3933 status = hw->phy.ops.init(hw); in ixgbe_reset_hw_E610()
3938 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_E610()
3948 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_E610()
3950 /* Poll for reset bit to self-clear indicating reset is complete */ in ixgbe_reset_hw_E610()
3970 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_E610()
3971 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_E610()
3979 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_E610()
3983 * clear the multicast table. Also reset num_rar_entries to 128, in ixgbe_reset_hw_E610()
3986 hw->mac.num_rar_entries = 128; in ixgbe_reset_hw_E610()
3987 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_E610()
3994 * ixgbe_start_hw_E610 - Prepare hardware for Tx/Rx
4000 * Then performs revision-specific operations, if any.
4006 ret_val = hw->mac.ops.get_fw_version(hw); in ixgbe_start_hw_E610()
4021 * ixgbe_get_media_type_E610 - Gets media type
4048 if (!(hw->link.link_info.link_info & IXGBE_ACI_LINK_UP) && in ixgbe_get_media_type_E610()
4049 (hw->link.link_info.link_info & IXGBE_ACI_MEDIA_AVAILABLE)) { in ixgbe_get_media_type_E610()
4059 for (i = 64; i > 0; i--) { in ixgbe_get_media_type_E610()
4060 phy_mask = (u64)((u64)1 << (i - 1)); in ixgbe_get_media_type_E610()
4063 hw->link.link_info.phy_type_high = phy_mask; in ixgbe_get_media_type_E610()
4064 hw->link.link_info.phy_type_low = 0; in ixgbe_get_media_type_E610()
4072 for (i = 64; i > 0; i--) { in ixgbe_get_media_type_E610()
4073 phy_mask = (u64)((u64)1 << (i - 1)); in ixgbe_get_media_type_E610()
4076 hw->link.link_info.phy_type_high = 0; in ixgbe_get_media_type_E610()
4077 hw->link.link_info.phy_type_low = phy_mask; in ixgbe_get_media_type_E610()
4086 hw->phy.media_type = ixgbe_get_media_type_from_phy_type(hw); in ixgbe_get_media_type_E610()
4088 return hw->phy.media_type; in ixgbe_get_media_type_E610()
4092 * ixgbe_get_supported_physical_layer_E610 - Returns physical layer type
4143 * ixgbe_setup_link_E610 - Set up link
4156 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_link_E610()
4160 * ixgbe_check_link_E610 - Determine link and speed status
4183 hw->link.get_link_info = true; in ixgbe_check_link_E610()
4192 for (i = 0; i < hw->mac.max_link_up_time; i++) { in ixgbe_check_link_E610()
4194 hw->link.get_link_info = true; in ixgbe_check_link_E610()
4208 switch (hw->link.link_info.link_speed) { in ixgbe_check_link_E610()
4239 * ixgbe_get_link_capabilities_E610 - Determine link capabilities
4256 *speed = hw->phy.speeds_supported; in ixgbe_get_link_capabilities_E610()
4262 * ixgbe_cfg_phy_fc - Configure PHY Flow Control (FC) data based on FC mode
4299 pause_mask |= pcaps->caps & IXGBE_ACI_PHY_EN_TX_LINK_PAUSE; in ixgbe_cfg_phy_fc()
4300 pause_mask |= pcaps->caps & IXGBE_ACI_PHY_EN_RX_LINK_PAUSE; in ixgbe_cfg_phy_fc()
4319 cfg->caps &= ~(IXGBE_ACI_PHY_EN_TX_LINK_PAUSE | in ixgbe_cfg_phy_fc()
4323 cfg->caps |= pause_mask; in ixgbe_cfg_phy_fc()
4332 * ixgbe_setup_fc_E610 - Set up flow control
4354 status = ixgbe_cfg_phy_fc(hw, &cfg, hw->fc.requested_mode); in ixgbe_setup_fc_E610()
4371 * ixgbe_fc_autoneg_E610 - Configure flow control
4388 if (!(hw->link.link_info.link_info & IXGBE_ACI_LINK_UP)) { in ixgbe_fc_autoneg_E610()
4393 /* Check if auto-negotiation has completed */ in ixgbe_fc_autoneg_E610()
4394 if (!(hw->link.link_info.an_info & IXGBE_ACI_AN_COMPLETED)) { in ixgbe_fc_autoneg_E610()
4401 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_E610()
4403 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_E610()
4404 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_E610()
4409 * ixgbe_set_fw_drv_ver_E610 - Send driver version to FW
4421 * IXGBE_SUCCESS - OK
4422 * IXGBE_ERR_PARAM - incorrect parameters were given
4423 * IXGBE_ERR_ACI_ERROR - encountered an error during sending the command
4424 * IXGBE_ERR_ACI_TIMEOUT - a timeout occurred
4425 * IXGBE_ERR_OUT_OF_MEM - ran out of memory
4450 * ixgbe_disable_rx_E610 - Disable RX unit
4472 hw->mac.set_lben = true; in ixgbe_disable_rx_E610()
4474 hw->mac.set_lben = false; in ixgbe_disable_rx_E610()
4479 /* If we fail - disable RX using register write */ in ixgbe_disable_rx_E610()
4491 * ixgbe_setup_eee_E610 - Enable/disable EEE support
4540 * ixgbe_fw_recovery_mode_E610 - Check FW NVM recovery mode
4556 * ixgbe_fw_rollback_mode_E610 - Check FW NVM Rollback
4572 * ixgbe_get_fw_tsam_mode_E610 - Check FW NVM Thermal Sensor Autonomous Mode
4588 * ixgbe_init_phy_ops_E610 - PHY specific init
4598 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_phy_ops_E610()
4599 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_phy_ops_E610()
4602 phy->ops.identify_sfp = ixgbe_identify_module_E610; in ixgbe_init_phy_ops_E610()
4603 phy->ops.read_reg = NULL; /* PHY reg access is not required */ in ixgbe_init_phy_ops_E610()
4604 phy->ops.write_reg = NULL; in ixgbe_init_phy_ops_E610()
4605 phy->ops.read_reg_mdi = NULL; in ixgbe_init_phy_ops_E610()
4606 phy->ops.write_reg_mdi = NULL; in ixgbe_init_phy_ops_E610()
4607 phy->ops.setup_link = ixgbe_setup_phy_link_E610; in ixgbe_init_phy_ops_E610()
4608 phy->ops.get_firmware_version = ixgbe_get_phy_firmware_version_E610; in ixgbe_init_phy_ops_E610()
4609 phy->ops.read_i2c_byte = NULL; /* disabled for E610 */ in ixgbe_init_phy_ops_E610()
4610 phy->ops.write_i2c_byte = NULL; /* disabled for E610 */ in ixgbe_init_phy_ops_E610()
4611 phy->ops.read_i2c_sff8472 = ixgbe_read_i2c_sff8472_E610; in ixgbe_init_phy_ops_E610()
4612 phy->ops.read_i2c_eeprom = ixgbe_read_i2c_eeprom_E610; in ixgbe_init_phy_ops_E610()
4613 phy->ops.write_i2c_eeprom = ixgbe_write_i2c_eeprom_E610; in ixgbe_init_phy_ops_E610()
4614 phy->ops.i2c_bus_clear = NULL; /* do not use generic implementation */ in ixgbe_init_phy_ops_E610()
4615 phy->ops.check_overtemp = ixgbe_check_overtemp_E610; in ixgbe_init_phy_ops_E610()
4616 if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) in ixgbe_init_phy_ops_E610()
4617 phy->ops.set_phy_power = ixgbe_set_phy_power_E610; in ixgbe_init_phy_ops_E610()
4619 phy->ops.set_phy_power = NULL; in ixgbe_init_phy_ops_E610()
4620 phy->ops.enter_lplu = ixgbe_enter_lplu_E610; in ixgbe_init_phy_ops_E610()
4621 phy->ops.handle_lasi = NULL; /* no implementation for E610 */ in ixgbe_init_phy_ops_E610()
4622 phy->ops.read_i2c_byte_unlocked = NULL; /* disabled for E610 */ in ixgbe_init_phy_ops_E610()
4623 phy->ops.write_i2c_byte_unlocked = NULL; /* disabled for E610 */ in ixgbe_init_phy_ops_E610()
4628 ret_val = phy->ops.identify(hw); in ixgbe_init_phy_ops_E610()
4638 * ixgbe_identify_phy_E610 - Identify PHY
4651 hw->phy.type = ixgbe_phy_fw; in ixgbe_identify_phy_E610()
4669 hw->phy.speeds_supported = IXGBE_LINK_SPEED_UNKNOWN; in ixgbe_identify_phy_E610()
4673 hw->phy.speeds_supported |= IXGBE_LINK_SPEED_10_FULL; in ixgbe_identify_phy_E610()
4677 hw->phy.speeds_supported |= IXGBE_LINK_SPEED_100_FULL; in ixgbe_identify_phy_E610()
4684 hw->phy.speeds_supported |= IXGBE_LINK_SPEED_1GB_FULL; in ixgbe_identify_phy_E610()
4693 hw->phy.speeds_supported |= IXGBE_LINK_SPEED_10GB_FULL; in ixgbe_identify_phy_E610()
4696 * auto-negotiation set used during driver initialization due to in ixgbe_identify_phy_E610()
4700 if (!hw->phy.autoneg_advertised && in ixgbe_identify_phy_E610()
4701 hw->device_id != IXGBE_DEV_ID_E610_2_5G_T) in ixgbe_identify_phy_E610()
4702 hw->phy.autoneg_advertised = hw->phy.speeds_supported; in ixgbe_identify_phy_E610()
4709 hw->phy.speeds_supported |= IXGBE_LINK_SPEED_2_5GB_FULL; in ixgbe_identify_phy_E610()
4711 if (!hw->phy.autoneg_advertised && in ixgbe_identify_phy_E610()
4712 hw->device_id == IXGBE_DEV_ID_E610_2_5G_T) in ixgbe_identify_phy_E610()
4713 hw->phy.autoneg_advertised = hw->phy.speeds_supported; in ixgbe_identify_phy_E610()
4718 hw->phy.speeds_supported |= IXGBE_LINK_SPEED_5GB_FULL; in ixgbe_identify_phy_E610()
4721 memcpy(&hw->phy.id, pcaps.phy_id_oui, sizeof(u32)); in ixgbe_identify_phy_E610()
4727 * ixgbe_identify_module_E610 - Identify SFP module type
4745 (hw->link.link_info.link_info & in ixgbe_identify_module_E610()
4749 hw->phy.sfp_type = ixgbe_sfp_type_unknown; in ixgbe_identify_module_E610()
4752 module_type = hw->link.link_info.module_type[IXGBE_ACI_MOD_TYPE_IDENT]; in ixgbe_identify_module_E610()
4756 hw->phy.sfp_type = ixgbe_sfp_type_da_cu; in ixgbe_identify_module_E610()
4758 hw->phy.sfp_type = ixgbe_sfp_type_sr; in ixgbe_identify_module_E610()
4761 hw->phy.sfp_type = ixgbe_sfp_type_lr; in ixgbe_identify_module_E610()
4765 hw->phy.sfp_type = ixgbe_sfp_type_not_present; in ixgbe_identify_module_E610()
4773 * ixgbe_setup_phy_link_E610 - Sets up firmware-controlled PHYs
4776 * Set the parameters for the firmware-controlled PHYs.
4794 if (!(hw->link.link_info.link_info & IXGBE_ACI_MEDIA_AVAILABLE)) in ixgbe_setup_phy_link_E610()
4817 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10_FULL) { in ixgbe_setup_phy_link_E610()
4821 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL) { in ixgbe_setup_phy_link_E610()
4826 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL) { in ixgbe_setup_phy_link_E610()
4834 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL) { in ixgbe_setup_phy_link_E610()
4841 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_5GB_FULL) { in ixgbe_setup_phy_link_E610()
4846 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL) { in ixgbe_setup_phy_link_E610()
4875 * ixgbe_get_phy_firmware_version_E610 - Gets the PHY Firmware Version
4899 /* TODO: determine which bytes of the 8-byte phy_fw_ver in ixgbe_get_phy_firmware_version_E610()
4900 * field should be written to the 2-byte firmware_version in ixgbe_get_phy_firmware_version_E610()
4908 * ixgbe_read_i2c_sff8472_E610 - Reads 8 bit word over I2C interface
4913 * Performs byte read operation from SFP module's SFF-8472 data over I2C.
4927 * ixgbe_read_i2c_eeprom_E610 - Reads 8 bit EEPROM word over I2C interface
4946 * ixgbe_write_i2c_eeprom_E610 - Writes 8 bit EEPROM word over I2C interface
4965 * ixgbe_check_overtemp_E610 - Check firmware-controlled PHYs for overtemp
4968 * Get the link status and check if the PHY temperature alarm detected.
4984 resp->cmd_flags = IXGBE_CPU_TO_LE16(IXGBE_ACI_LSE_NOP); in ixgbe_check_overtemp_E610()
4992 "PHY Temperature Alarm detected"); in ixgbe_check_overtemp_E610()
5000 * ixgbe_set_phy_power_E610 - Control power for copper PHY
5042 * ixgbe_enter_lplu_E610 - Transition to low power states
5046 * (from D0 to non-D0). Link is required to enter LPLU so avoid resetting the
5072 * ixgbe_init_eeprom_params_E610 - Initialize EEPROM params
5082 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_E610()
5086 if (eeprom->type == ixgbe_eeprom_uninitialized) { in ixgbe_init_eeprom_params_E610()
5087 eeprom->type = ixgbe_flash; in ixgbe_init_eeprom_params_E610()
5094 eeprom->word_size = BIT(sr_size) * IXGBE_SR_WORDS_IN_1KB; in ixgbe_init_eeprom_params_E610()
5097 eeprom->type, eeprom->word_size); in ixgbe_init_eeprom_params_E610()
5104 * ixgbe_read_ee_aci_E610 - Read EEPROM word using the admin command.
5120 if (hw->eeprom.type == ixgbe_eeprom_uninitialized) { in ixgbe_read_ee_aci_E610()
5137 * ixgbe_read_ee_aci_buffer_E610- Read EEPROM word(s) using admin commands.
5155 if (hw->eeprom.type == ixgbe_eeprom_uninitialized) { in ixgbe_read_ee_aci_buffer_E610()
5172 * ixgbe_write_ee_aci_E610 - Write EEPROM word using the admin command.
5188 if (hw->eeprom.type == ixgbe_eeprom_uninitialized) { in ixgbe_write_ee_aci_E610()
5205 * ixgbe_write_ee_aci_buffer_E610 - Write EEPROM word(s) using admin commands.
5223 if (hw->eeprom.type == ixgbe_eeprom_uninitialized) { in ixgbe_write_ee_aci_buffer_E610()
5240 * ixgbe_calc_eeprom_checksum_E610 - Calculates and returns the checksum
5244 * except the VPD and PCIe ALT Auto-load modules. The structure and size of VPD
5251 * Return: the negative error code on error, or the 16-bit checksum
5265 if (hw->eeprom.type == ixgbe_eeprom_uninitialized) { in ixgbe_calc_eeprom_checksum_E610()
5285 /* read pointer to PCIe Alt Auto-load module */ in ixgbe_calc_eeprom_checksum_E610()
5292 * except the VPD and PCIe ALT Auto-load modules in ixgbe_calc_eeprom_checksum_E610()
5294 for (i = 0; i < hw->eeprom.word_size; i++) { in ixgbe_calc_eeprom_checksum_E610()
5319 checksum = (u16)IXGBE_SR_SW_CHECKSUM_BASE - checksum_local; in ixgbe_calc_eeprom_checksum_E610()
5333 * ixgbe_update_eeprom_checksum_E610 - Updates the EEPROM checksum and flash
5349 if (hw->eeprom.type == ixgbe_eeprom_uninitialized) { in ixgbe_update_eeprom_checksum_E610()
5370 * ixgbe_validate_eeprom_checksum_E610 - Validate EEPROM checksum
5386 if (hw->eeprom.type == ixgbe_eeprom_uninitialized) { in ixgbe_validate_eeprom_checksum_E610()
5415 * ixgbe_get_pfa_module_tlv - Reads sub module TLV from NVM PFA
5479 * ixgbe_read_pba_string_E610 - Reads part number string from NVM
5515 pba_size--; in ixgbe_read_pba_string_E610()