Lines Matching +full:bank +full:- +full:number
1 // SPDX-License-Identifier: GPL-2.0
13 * ixgbe_should_retry_aci_send_cmd_execute - decide if ACI command should
37 * ixgbe_aci_send_cmd_execute - execute sending FW Admin Command to FW Admin
48 * * - 0 - success.
49 * * - -EIO - CSR mechanism is not enabled.
50 * * - -EBUSY - CSR mechanism is busy.
51 * * - -EINVAL - buf_size is too big or
53 * * - -ETIME - Admin Command X command timeout.
54 * * - -EIO - Admin Command X invalid state of HICR register or
67 hw->aci.last_status = LIBIE_AQ_RC_OK; in ixgbe_aci_send_cmd_execute()
73 return -EIO; in ixgbe_aci_send_cmd_execute()
76 hw->aci.last_status = LIBIE_AQ_RC_EBUSY; in ixgbe_aci_send_cmd_execute()
77 return -EBUSY; in ixgbe_aci_send_cmd_execute()
80 opcode = le16_to_cpu(desc->opcode); in ixgbe_aci_send_cmd_execute()
83 return -EINVAL; in ixgbe_aci_send_cmd_execute()
86 desc->flags |= cpu_to_le16(LIBIE_AQ_FLAG_BUF); in ixgbe_aci_send_cmd_execute()
88 if (desc->flags & cpu_to_le16(LIBIE_AQ_FLAG_BUF)) { in ixgbe_aci_send_cmd_execute()
91 return -EINVAL; in ixgbe_aci_send_cmd_execute()
98 memcpy(&buf_tail, buf + buf_size - buf_tail_size, in ixgbe_aci_send_cmd_execute()
102 desc->flags |= cpu_to_le16(LIBIE_AQ_FLAG_LB); in ixgbe_aci_send_cmd_execute()
104 desc->datalen = cpu_to_le16(buf_size); in ixgbe_aci_send_cmd_execute()
106 if (desc->flags & cpu_to_le16(LIBIE_AQ_FLAG_RD)) { in ixgbe_aci_send_cmd_execute()
162 return -ETIME; in ixgbe_aci_send_cmd_execute()
165 return -EIO; in ixgbe_aci_send_cmd_execute()
172 if (desc->opcode != cpu_to_le16(opcode) && in ixgbe_aci_send_cmd_execute()
174 return -EIO; in ixgbe_aci_send_cmd_execute()
176 if (desc->retval) { in ixgbe_aci_send_cmd_execute()
177 hw->aci.last_status = (enum libie_aq_err) in ixgbe_aci_send_cmd_execute()
178 le16_to_cpu(desc->retval); in ixgbe_aci_send_cmd_execute()
179 return -EIO; in ixgbe_aci_send_cmd_execute()
188 memcpy(buf + buf_size - buf_tail_size, &buf_tail, in ixgbe_aci_send_cmd_execute()
197 * ixgbe_aci_send_cmd - send FW Admin Command to FW Admin Command Interface
213 u16 opcode = le16_to_cpu(desc->opcode); in ixgbe_aci_send_cmd()
226 return -ENOMEM; in ixgbe_aci_send_cmd()
234 mutex_lock(&hw->aci.lock); in ixgbe_aci_send_cmd()
236 last_status = hw->aci.last_status; in ixgbe_aci_send_cmd()
237 mutex_unlock(&hw->aci.lock); in ixgbe_aci_send_cmd()
257 * ixgbe_aci_check_event_pending - check if there are any pending events
267 u32 ep_bit_mask = hw->bus.func ? GL_FWSTS_EP_PF1 : GL_FWSTS_EP_PF0; in ixgbe_aci_check_event_pending()
274 * ixgbe_aci_get_event - get an event from ACI
292 if (!e || (!e->msg_buf && e->buf_len)) in ixgbe_aci_get_event()
293 return -EINVAL; in ixgbe_aci_get_event()
295 mutex_lock(&hw->aci.lock); in ixgbe_aci_get_event()
299 err = -ENOENT; in ixgbe_aci_get_event()
305 err = ixgbe_aci_send_cmd_execute(hw, &desc, e->msg_buf, e->buf_len); in ixgbe_aci_get_event()
311 err = -ENOENT; in ixgbe_aci_get_event()
316 e->msg_len = min_t(u16, le16_to_cpu(desc.datalen), e->buf_len); in ixgbe_aci_get_event()
318 memcpy(&e->desc, &desc, sizeof(e->desc)); in ixgbe_aci_get_event()
325 mutex_unlock(&hw->aci.lock); in ixgbe_aci_get_event()
331 * ixgbe_fill_dflt_direct_cmd_desc - fill ACI descriptor with default values.
342 desc->opcode = cpu_to_le16(opcode); in ixgbe_fill_dflt_direct_cmd_desc()
343 desc->flags = cpu_to_le16(LIBIE_AQ_FLAG_SI); in ixgbe_fill_dflt_direct_cmd_desc()
347 * ixgbe_aci_get_fw_ver - Get the firmware version
366 hw->fw_branch = resp->fw_branch; in ixgbe_aci_get_fw_ver()
367 hw->fw_maj_ver = resp->fw_major; in ixgbe_aci_get_fw_ver()
368 hw->fw_min_ver = resp->fw_minor; in ixgbe_aci_get_fw_ver()
369 hw->fw_patch = resp->fw_patch; in ixgbe_aci_get_fw_ver()
370 hw->fw_build = le32_to_cpu(resp->fw_build); in ixgbe_aci_get_fw_ver()
371 hw->api_branch = resp->api_branch; in ixgbe_aci_get_fw_ver()
372 hw->api_maj_ver = resp->api_major; in ixgbe_aci_get_fw_ver()
373 hw->api_min_ver = resp->api_minor; in ixgbe_aci_get_fw_ver()
374 hw->api_patch = resp->api_patch; in ixgbe_aci_get_fw_ver()
381 * ixgbe_aci_req_res - request a common resource
385 * @sdp_number: resource number
408 cmd_resp->res_id = cpu_to_le16(res); in ixgbe_aci_req_res()
409 cmd_resp->access_type = cpu_to_le16(access); in ixgbe_aci_req_res()
410 cmd_resp->res_number = cpu_to_le32(sdp_number); in ixgbe_aci_req_res()
411 cmd_resp->timeout = cpu_to_le32(*timeout); in ixgbe_aci_req_res()
420 if (!err || hw->aci.last_status == LIBIE_AQ_RC_EBUSY) in ixgbe_aci_req_res()
421 *timeout = le32_to_cpu(cmd_resp->timeout); in ixgbe_aci_req_res()
427 * ixgbe_aci_release_res - release a common resource using ACI
430 * @sdp_number: resource number
446 cmd->res_id = cpu_to_le16(res); in ixgbe_aci_release_res()
447 cmd->res_number = cpu_to_le32(sdp_number); in ixgbe_aci_release_res()
453 * ixgbe_acquire_res - acquire the ownership of a resource
462 * performed any necessary updates, the -EALREADY is returned,
479 /* A return code of -EALREADY means that another driver has in ixgbe_acquire_res()
484 if (err == -EALREADY) in ixgbe_acquire_res()
497 retry_timeout - delay : 0; in ixgbe_acquire_res()
500 /* Success - lock acquired. in ixgbe_acquire_res()
501 * -EALREADY - lock free, no work to do. in ixgbe_acquire_res()
503 if (!err || err == -EALREADY) in ixgbe_acquire_res()
511 * ixgbe_release_res - release a common resource
527 while (err == -ETIME && in ixgbe_release_res()
536 * ixgbe_parse_e610_caps - Parse common device/function capabilities
553 u32 logical_id = le32_to_cpu(elem->logical_id); in ixgbe_parse_e610_caps()
554 u32 phys_id = le32_to_cpu(elem->phys_id); in ixgbe_parse_e610_caps()
555 u32 number = le32_to_cpu(elem->number); in ixgbe_parse_e610_caps() local
556 u16 cap = le16_to_cpu(elem->cap); in ixgbe_parse_e610_caps()
560 caps->valid_functions = number; in ixgbe_parse_e610_caps()
563 caps->sr_iov_1_1 = (number == 1); in ixgbe_parse_e610_caps()
566 caps->vmdq = (number == 1); in ixgbe_parse_e610_caps()
569 caps->dcb = (number == 1); in ixgbe_parse_e610_caps()
570 caps->active_tc_bitmap = logical_id; in ixgbe_parse_e610_caps()
571 caps->maxtc = phys_id; in ixgbe_parse_e610_caps()
574 caps->rss_table_size = number; in ixgbe_parse_e610_caps()
575 caps->rss_table_entry_width = logical_id; in ixgbe_parse_e610_caps()
578 caps->num_rxq = number; in ixgbe_parse_e610_caps()
579 caps->rxq_first_id = phys_id; in ixgbe_parse_e610_caps()
582 caps->num_txq = number; in ixgbe_parse_e610_caps()
583 caps->txq_first_id = phys_id; in ixgbe_parse_e610_caps()
586 caps->num_msix_vectors = number; in ixgbe_parse_e610_caps()
587 caps->msix_vector_first_id = phys_id; in ixgbe_parse_e610_caps()
592 caps->nvm_update_pending_nvm = true; in ixgbe_parse_e610_caps()
595 caps->nvm_update_pending_orom = true; in ixgbe_parse_e610_caps()
598 caps->nvm_update_pending_netlist = true; in ixgbe_parse_e610_caps()
601 caps->nvm_unified_update = in ixgbe_parse_e610_caps()
602 (number & IXGBE_NVM_MGMT_UNIFIED_UPD_SUPPORT) ? in ixgbe_parse_e610_caps()
606 caps->max_mtu = number; in ixgbe_parse_e610_caps()
609 caps->pcie_reset_avoidance = (number > 0); in ixgbe_parse_e610_caps()
612 caps->reset_restrict_support = (number == 1); in ixgbe_parse_e610_caps()
619 u8 index = cap - LIBIE_AQC_CAPS_EXT_TOPO_DEV_IMG0; in ixgbe_parse_e610_caps()
621 caps->ext_topo_dev_img_ver_high[index] = number; in ixgbe_parse_e610_caps()
622 caps->ext_topo_dev_img_ver_low[index] = logical_id; in ixgbe_parse_e610_caps()
623 caps->ext_topo_dev_img_part_num[index] = in ixgbe_parse_e610_caps()
625 caps->ext_topo_dev_img_load_en[index] = in ixgbe_parse_e610_caps()
627 caps->ext_topo_dev_img_prog_en[index] = in ixgbe_parse_e610_caps()
640 * ixgbe_parse_valid_functions_cap - Parse LIBIE_AQC_CAPS_VALID_FUNCTIONS caps
652 dev_p->num_funcs = hweight32(le32_to_cpu(cap->number)); in ixgbe_parse_valid_functions_cap()
656 * ixgbe_parse_vf_dev_caps - Parse LIBIE_AQC_CAPS_VF device caps
667 dev_p->num_vfs_exposed = le32_to_cpu(cap->number); in ixgbe_parse_vf_dev_caps()
671 * ixgbe_parse_vsi_dev_caps - Parse LIBIE_AQC_CAPS_VSI device caps
682 dev_p->num_vsi_allocd_to_host = le32_to_cpu(cap->number); in ixgbe_parse_vsi_dev_caps()
686 * ixgbe_parse_fdir_dev_caps - Parse LIBIE_AQC_CAPS_FD device caps
697 dev_p->num_flow_director_fltr = le32_to_cpu(cap->number); in ixgbe_parse_fdir_dev_caps()
701 * ixgbe_parse_dev_caps - Parse device capabilities
705 * @cap_count: the number of capabilities
728 ixgbe_parse_e610_caps(hw, &dev_p->common_cap, &cap_resp[i], in ixgbe_parse_dev_caps()
753 * ixgbe_parse_vf_func_caps - Parse LIBIE_AQC_CAPS_VF function caps
764 func_p->num_allocd_vfs = le32_to_cpu(cap->number); in ixgbe_parse_vf_func_caps()
765 func_p->vf_base_id = le32_to_cpu(cap->logical_id); in ixgbe_parse_vf_func_caps()
769 * ixgbe_get_num_per_func - determine number of resources per PF
773 * Determine the number of valid functions by going through the bitmap returned
774 * from parsing capabilities and use this to calculate the number of resources
777 * Return: the number of resources per PF or 0, if no PFs are available.
782 u8 funcs = hweight8(hw->dev_caps.common_cap.valid_functions & in ixgbe_get_num_per_func()
789 * ixgbe_parse_vsi_func_caps - Parse LIBIE_AQC_CAPS_VSI function caps
800 func_p->guar_num_vsi = ixgbe_get_num_per_func(hw, IXGBE_MAX_VSI); in ixgbe_parse_vsi_func_caps()
804 * ixgbe_parse_func_caps - Parse function capabilities
808 * @cap_count: the number of capabilities
831 ixgbe_parse_e610_caps(hw, &func_p->common_cap, in ixgbe_parse_func_caps()
849 * ixgbe_aci_list_caps - query function/device capabilities
853 * @cap_count: if not NULL, set to the number of capabilities reported
859 * If the cap_count pointer is not NULL, then it is set to the number of
861 * small, it is possible the command will return -ENOMEM. The
867 * Exit code of -ENOMEM means the buffer size is too small.
880 return -EINVAL; in ixgbe_aci_list_caps()
886 *cap_count = le32_to_cpu(cmd->count); in ixgbe_aci_list_caps()
892 * ixgbe_discover_dev_caps - Read and extract device capabilities
910 return -ENOMEM; in ixgbe_discover_dev_caps()
912 /* Although the driver doesn't know the number of capabilities the in ixgbe_discover_dev_caps()
931 * ixgbe_discover_func_caps - Read and extract function capabilities
949 return -ENOMEM; in ixgbe_discover_func_caps()
951 /* Although the driver doesn't know the number of capabilities the in ixgbe_discover_func_caps()
970 * ixgbe_get_caps - get info about the HW
981 err = ixgbe_discover_dev_caps(hw, &hw->dev_caps); in ixgbe_get_caps()
985 return ixgbe_discover_func_caps(hw, &hw->func_caps); in ixgbe_get_caps()
989 * ixgbe_aci_disable_rxen - disable RX
1005 cmd->lport_num = hw->bus.func; in ixgbe_aci_disable_rxen()
1011 * ixgbe_aci_get_phy_caps - returns PHY capabilities
1033 return -EINVAL; in ixgbe_aci_get_phy_caps()
1038 cmd->param0 |= cpu_to_le16(IXGBE_ACI_GET_PHY_RQM); in ixgbe_aci_get_phy_caps()
1040 cmd->param0 |= cpu_to_le16(report_mode); in ixgbe_aci_get_phy_caps()
1043 hw->phy.phy_type_low = le64_to_cpu(pcaps->phy_type_low); in ixgbe_aci_get_phy_caps()
1044 hw->phy.phy_type_high = le64_to_cpu(pcaps->phy_type_high); in ixgbe_aci_get_phy_caps()
1045 memcpy(hw->link.link_info.module_type, &pcaps->module_type, in ixgbe_aci_get_phy_caps()
1046 sizeof(hw->link.link_info.module_type)); in ixgbe_aci_get_phy_caps()
1053 * ixgbe_copy_phy_caps_to_cfg - Copy PHY ability data to configuration data
1067 cfg->phy_type_low = caps->phy_type_low; in ixgbe_copy_phy_caps_to_cfg()
1068 cfg->phy_type_high = caps->phy_type_high; in ixgbe_copy_phy_caps_to_cfg()
1069 cfg->caps = caps->caps; in ixgbe_copy_phy_caps_to_cfg()
1070 cfg->low_power_ctrl_an = caps->low_power_ctrl_an; in ixgbe_copy_phy_caps_to_cfg()
1071 cfg->eee_cap = caps->eee_cap; in ixgbe_copy_phy_caps_to_cfg()
1072 cfg->eeer_value = caps->eeer_value; in ixgbe_copy_phy_caps_to_cfg()
1073 cfg->link_fec_opt = caps->link_fec_options; in ixgbe_copy_phy_caps_to_cfg()
1074 cfg->module_compliance_enforcement = in ixgbe_copy_phy_caps_to_cfg()
1075 caps->module_compliance_enforcement; in ixgbe_copy_phy_caps_to_cfg()
1079 * ixgbe_aci_set_phy_cfg - set PHY configuration
1099 return -EINVAL; in ixgbe_aci_set_phy_cfg()
1102 /* Ensure that only valid bits of cfg->caps can be turned on. */ in ixgbe_aci_set_phy_cfg()
1103 cfg->caps &= IXGBE_ACI_PHY_ENA_VALID_MASK; in ixgbe_aci_set_phy_cfg()
1106 cmd->lport_num = hw->bus.func; in ixgbe_aci_set_phy_cfg()
1111 hw->phy.curr_user_phy_cfg = *cfg; in ixgbe_aci_set_phy_cfg()
1117 * ixgbe_aci_set_link_restart_an - set up link and restart AN
1121 * Function sets up the link and restarts the Auto-Negotiation over the link.
1134 cmd->cmd_flags = IXGBE_ACI_RESTART_AN_LINK_RESTART; in ixgbe_aci_set_link_restart_an()
1135 cmd->lport_num = hw->bus.func; in ixgbe_aci_set_link_restart_an()
1137 cmd->cmd_flags |= IXGBE_ACI_RESTART_AN_LINK_ENABLE; in ixgbe_aci_set_link_restart_an()
1139 cmd->cmd_flags &= ~IXGBE_ACI_RESTART_AN_LINK_ENABLE; in ixgbe_aci_set_link_restart_an()
1145 * ixgbe_is_media_cage_present - check if media cage is present
1151 * media type is backplane or BASE-T.
1162 cmd->addr.topo_params.node_type_ctx = in ixgbe_is_media_cage_present()
1167 cmd->addr.topo_params.node_type_ctx |= in ixgbe_is_media_cage_present()
1173 * connection type is backplane or BASE-T. in ixgbe_is_media_cage_present()
1179 * ixgbe_get_media_type_from_phy_type - Gets media type based on phy type
1197 hw_link_info = &hw->link.link_info; in ixgbe_get_media_type_from_phy_type()
1198 if (hw_link_info->phy_type_low && hw_link_info->phy_type_high) in ixgbe_get_media_type_from_phy_type()
1202 if (hw_link_info->phy_type_low) { in ixgbe_get_media_type_from_phy_type()
1208 if (hw_link_info->phy_type_low == IXGBE_PHY_TYPE_LOW_1G_SGMII && in ixgbe_get_media_type_from_phy_type()
1209 (hw_link_info->module_type[IXGBE_ACI_MOD_TYPE_IDENT] == in ixgbe_get_media_type_from_phy_type()
1211 hw_link_info->module_type[IXGBE_ACI_MOD_TYPE_IDENT] == in ixgbe_get_media_type_from_phy_type()
1215 switch (hw_link_info->phy_type_low) { in ixgbe_get_media_type_from_phy_type()
1254 switch (hw_link_info->phy_type_high) { in ixgbe_get_media_type_from_phy_type()
1263 * ixgbe_update_link_info - update status of the HW network link
1277 return -EINVAL; in ixgbe_update_link_info()
1279 li = &hw->link.link_info; in ixgbe_update_link_info()
1285 if (!(li->link_info & IXGBE_ACI_MEDIA_AVAILABLE)) in ixgbe_update_link_info()
1290 return -ENOMEM; in ixgbe_update_link_info()
1296 memcpy(li->module_type, &pcaps->module_type, in ixgbe_update_link_info()
1297 sizeof(li->module_type)); in ixgbe_update_link_info()
1305 * ixgbe_get_link_status - get status of the HW network link
1318 return -EINVAL; in ixgbe_get_link_status()
1320 if (hw->link.get_link_info) { in ixgbe_get_link_status()
1327 *link_up = hw->link.link_info.link_info & IXGBE_ACI_LINK_UP; in ixgbe_get_link_status()
1333 * ixgbe_aci_get_link_info - get the link status
1336 * @link: pointer to link status structure - optional
1357 return -EINVAL; in ixgbe_aci_get_link_info()
1359 li_old = &hw->link.link_info_old; in ixgbe_aci_get_link_info()
1360 li = &hw->link.link_info; in ixgbe_aci_get_link_info()
1361 hw_fc_info = &hw->fc; in ixgbe_aci_get_link_info()
1366 resp->cmd_flags = cpu_to_le16(cmd_flags); in ixgbe_aci_get_link_info()
1367 resp->lport_num = hw->bus.func; in ixgbe_aci_get_link_info()
1377 li->link_speed = le16_to_cpu(link_data.link_speed); in ixgbe_aci_get_link_info()
1378 li->phy_type_low = le64_to_cpu(link_data.phy_type_low); in ixgbe_aci_get_link_info()
1379 li->phy_type_high = le64_to_cpu(link_data.phy_type_high); in ixgbe_aci_get_link_info()
1380 li->link_info = link_data.link_info; in ixgbe_aci_get_link_info()
1381 li->link_cfg_err = link_data.link_cfg_err; in ixgbe_aci_get_link_info()
1382 li->an_info = link_data.an_info; in ixgbe_aci_get_link_info()
1383 li->ext_info = link_data.ext_info; in ixgbe_aci_get_link_info()
1384 li->max_frame_size = le16_to_cpu(link_data.max_frame_size); in ixgbe_aci_get_link_info()
1385 li->fec_info = link_data.cfg & IXGBE_ACI_FEC_MASK; in ixgbe_aci_get_link_info()
1386 li->topo_media_conflict = link_data.topo_media_conflict; in ixgbe_aci_get_link_info()
1387 li->pacing = link_data.cfg & (IXGBE_ACI_CFG_PACING_M | in ixgbe_aci_get_link_info()
1394 hw_fc_info->current_mode = ixgbe_fc_full; in ixgbe_aci_get_link_info()
1396 hw_fc_info->current_mode = ixgbe_fc_tx_pause; in ixgbe_aci_get_link_info()
1398 hw_fc_info->current_mode = ixgbe_fc_rx_pause; in ixgbe_aci_get_link_info()
1400 hw_fc_info->current_mode = ixgbe_fc_none; in ixgbe_aci_get_link_info()
1402 li->lse_ena = !!(le16_to_cpu(resp->cmd_flags) & in ixgbe_aci_get_link_info()
1410 hw->link.get_link_info = false; in ixgbe_aci_get_link_info()
1416 * ixgbe_aci_set_event_mask - set event mask
1418 * @port_num: port number of the physical function
1434 cmd->lport_num = port_num; in ixgbe_aci_set_event_mask()
1436 cmd->event_mask = cpu_to_le16(mask); in ixgbe_aci_set_event_mask()
1441 * ixgbe_configure_lse - enable/disable link status events
1455 err = ixgbe_aci_set_event_mask(hw, (u8)hw->bus.func, mask); in ixgbe_configure_lse()
1464 * ixgbe_start_hw_e610 - Prepare hardware for Tx/Rx
1490 * ixgbe_aci_set_port_id_led - set LED value for the given port
1507 cmd->lport_num = (u8)hw->bus.func; in ixgbe_aci_set_port_id_led()
1508 cmd->lport_num_valid = IXGBE_ACI_PORT_ID_PORT_NUM_VALID; in ixgbe_aci_set_port_id_led()
1511 cmd->ident_mode = IXGBE_ACI_PORT_IDENT_LED_ORIG; in ixgbe_aci_set_port_id_led()
1513 cmd->ident_mode = IXGBE_ACI_PORT_IDENT_LED_BLINK; in ixgbe_aci_set_port_id_led()
1519 * ixgbe_get_media_type_e610 - Gets media type
1543 if (!(hw->link.link_info.link_info & IXGBE_ACI_LINK_UP) && in ixgbe_get_media_type_e610()
1544 (hw->link.link_info.link_info & IXGBE_ACI_MEDIA_AVAILABLE)) { in ixgbe_get_media_type_e610()
1556 hw->link.link_info.phy_type_high = in ixgbe_get_media_type_e610()
1557 BIT_ULL(highest_bit - 1); in ixgbe_get_media_type_e610()
1558 hw->link.link_info.phy_type_low = 0; in ixgbe_get_media_type_e610()
1562 hw->link.link_info.phy_type_low = in ixgbe_get_media_type_e610()
1563 BIT_ULL(highest_bit - 1); in ixgbe_get_media_type_e610()
1564 hw->link.link_info.phy_type_high = 0; in ixgbe_get_media_type_e610()
1570 hw->phy.media_type = ixgbe_get_media_type_from_phy_type(hw); in ixgbe_get_media_type_e610()
1572 return hw->phy.media_type; in ixgbe_get_media_type_e610()
1576 * ixgbe_setup_link_e610 - Set up link
1589 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_link_e610()
1593 * ixgbe_check_link_e610 - Determine link and speed status
1611 return -EINVAL; in ixgbe_check_link_e610()
1617 hw->link.get_link_info = true; in ixgbe_check_link_e610()
1626 for (i = 0; i < hw->mac.max_link_up_time; i++) { in ixgbe_check_link_e610()
1628 hw->link.get_link_info = true; in ixgbe_check_link_e610()
1643 switch (hw->link.link_info.link_speed) { in ixgbe_check_link_e610()
1674 * ixgbe_get_link_capabilities_e610 - Determine link capabilities
1688 return -EINVAL; in ixgbe_get_link_capabilities_e610()
1691 *speed = hw->phy.speeds_supported; in ixgbe_get_link_capabilities_e610()
1697 * ixgbe_cfg_phy_fc - Configure PHY Flow Control (FC) data based on FC mode
1713 return -EINVAL; in ixgbe_cfg_phy_fc()
1731 cfg->caps &= ~(IXGBE_ACI_PHY_EN_TX_LINK_PAUSE | in ixgbe_cfg_phy_fc()
1735 cfg->caps |= pause_mask; in ixgbe_cfg_phy_fc()
1741 * ixgbe_setup_fc_e610 - Set up flow control
1763 err = ixgbe_cfg_phy_fc(hw, &cfg, hw->fc.requested_mode); in ixgbe_setup_fc_e610()
1780 * ixgbe_fc_autoneg_e610 - Configure flow control
1797 if (!(hw->link.link_info.link_info & IXGBE_ACI_LINK_UP)) in ixgbe_fc_autoneg_e610()
1800 /* Check if auto-negotiation has completed */ in ixgbe_fc_autoneg_e610()
1801 if (!(hw->link.link_info.an_info & IXGBE_ACI_AN_COMPLETED)) in ixgbe_fc_autoneg_e610()
1804 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_e610()
1808 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_e610()
1809 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_e610()
1813 * ixgbe_disable_rx_e610 - Disable RX unit
1833 hw->mac.set_lben = true; in ixgbe_disable_rx_e610()
1835 hw->mac.set_lben = false; in ixgbe_disable_rx_e610()
1840 /* If we fail - disable RX using register write */ in ixgbe_disable_rx_e610()
1851 * ixgbe_fw_recovery_mode_e610 - Check FW NVM recovery mode
1867 * ixgbe_fw_rollback_mode_e610 - Check FW NVM rollback mode
1883 * ixgbe_init_phy_ops_e610 - PHY specific init
1893 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_phy_ops_e610()
1894 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_phy_ops_e610()
1896 if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) in ixgbe_init_phy_ops_e610()
1897 phy->ops.set_phy_power = ixgbe_set_phy_power_e610; in ixgbe_init_phy_ops_e610()
1899 phy->ops.set_phy_power = NULL; in ixgbe_init_phy_ops_e610()
1902 return phy->ops.identify(hw); in ixgbe_init_phy_ops_e610()
1906 * ixgbe_identify_phy_e610 - Identify PHY
1920 hw->phy.type = ixgbe_phy_fw; in ixgbe_identify_phy_e610()
1938 hw->phy.speeds_supported = IXGBE_LINK_SPEED_UNKNOWN; in ixgbe_identify_phy_e610()
1944 hw->phy.speeds_supported |= IXGBE_LINK_SPEED_10_FULL; in ixgbe_identify_phy_e610()
1948 hw->phy.speeds_supported |= IXGBE_LINK_SPEED_100_FULL; in ixgbe_identify_phy_e610()
1955 hw->phy.speeds_supported |= IXGBE_LINK_SPEED_1GB_FULL; in ixgbe_identify_phy_e610()
1961 hw->phy.speeds_supported |= IXGBE_LINK_SPEED_2_5GB_FULL; in ixgbe_identify_phy_e610()
1965 hw->phy.speeds_supported |= IXGBE_LINK_SPEED_5GB_FULL; in ixgbe_identify_phy_e610()
1974 hw->phy.speeds_supported |= IXGBE_LINK_SPEED_10GB_FULL; in ixgbe_identify_phy_e610()
1977 if (!hw->phy.autoneg_advertised) in ixgbe_identify_phy_e610()
1978 hw->phy.autoneg_advertised = hw->phy.speeds_supported; in ixgbe_identify_phy_e610()
1981 memcpy(&hw->phy.id, pcaps.phy_id_oui, sizeof(u32)); in ixgbe_identify_phy_e610()
1983 hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_10_FULL | in ixgbe_identify_phy_e610()
1986 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported; in ixgbe_identify_phy_e610()
1992 * ixgbe_identify_module_e610 - Identify SFP module type
2010 (hw->link.link_info.link_info & IXGBE_ACI_MEDIA_AVAILABLE); in ixgbe_identify_module_e610()
2013 hw->phy.sfp_type = ixgbe_sfp_type_unknown; in ixgbe_identify_module_e610()
2018 module_type = hw->link.link_info.module_type[IXGBE_ACI_MOD_TYPE_IDENT]; in ixgbe_identify_module_e610()
2022 hw->phy.sfp_type = ixgbe_sfp_type_da_cu; in ixgbe_identify_module_e610()
2024 hw->phy.sfp_type = ixgbe_sfp_type_sr; in ixgbe_identify_module_e610()
2027 hw->phy.sfp_type = ixgbe_sfp_type_lr; in ixgbe_identify_module_e610()
2030 hw->phy.sfp_type = ixgbe_sfp_type_not_present; in ixgbe_identify_module_e610()
2031 return -ENOENT; in ixgbe_identify_module_e610()
2038 * ixgbe_setup_phy_link_e610 - Sets up firmware-controlled PHYs
2041 * Set the parameters for the firmware-controlled PHYs.
2059 if (!(hw->link.link_info.link_info & IXGBE_ACI_MEDIA_AVAILABLE)) in ixgbe_setup_phy_link_e610()
2077 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10_FULL) { in ixgbe_setup_phy_link_e610()
2081 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL) { in ixgbe_setup_phy_link_e610()
2086 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL) { in ixgbe_setup_phy_link_e610()
2094 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL) { in ixgbe_setup_phy_link_e610()
2101 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_5GB_FULL) { in ixgbe_setup_phy_link_e610()
2106 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL) { in ixgbe_setup_phy_link_e610()
2138 * ixgbe_set_phy_power_e610 - Control power for copper PHY
2178 * ixgbe_enter_lplu_e610 - Transition to low power states
2182 * (from D0 to non-D0). Link is required to enter LPLU so avoid resetting the
2207 * ixgbe_init_eeprom_params_e610 - Initialize EEPROM params
2217 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_e610()
2221 if (eeprom->type != ixgbe_eeprom_uninitialized) in ixgbe_init_eeprom_params_e610()
2224 eeprom->type = ixgbe_flash; in ixgbe_init_eeprom_params_e610()
2230 eeprom->word_size = BIT(sr_size) * IXGBE_SR_WORDS_IN_1KB; in ixgbe_init_eeprom_params_e610()
2232 hw_dbg(hw, "Eeprom params: type = %d, size = %d\n", eeprom->type, in ixgbe_init_eeprom_params_e610()
2233 eeprom->word_size); in ixgbe_init_eeprom_params_e610()
2239 * ixgbe_aci_get_netlist_node - get a node handle
2242 * @node_part_number: output node part number if node found
2262 return -EOPNOTSUPP; in ixgbe_aci_get_netlist_node()
2265 *node_handle = le16_to_cpu(resp->addr.handle); in ixgbe_aci_get_netlist_node()
2267 *node_part_number = resp->node_part_num; in ixgbe_aci_get_netlist_node()
2273 * ixgbe_acquire_nvm - Generic request for acquiring the NVM ownership
2295 * ixgbe_release_nvm - Generic request for releasing the NVM ownership
2313 * ixgbe_aci_read_nvm - read NVM
2334 return -EINVAL; in ixgbe_aci_read_nvm()
2341 cmd->cmd_flags |= IXGBE_ACI_NVM_FLASH_ONLY; in ixgbe_aci_read_nvm()
2345 cmd->cmd_flags |= IXGBE_ACI_NVM_LAST_CMD; in ixgbe_aci_read_nvm()
2346 cmd->module_typeid = cpu_to_le16(module_typeid); in ixgbe_aci_read_nvm()
2347 cmd->offset_low = cpu_to_le16(offset & 0xFFFF); in ixgbe_aci_read_nvm()
2348 cmd->offset_high = (offset >> 16) & 0xFF; in ixgbe_aci_read_nvm()
2349 cmd->length = cpu_to_le16(length); in ixgbe_aci_read_nvm()
2355 * ixgbe_aci_erase_nvm - erase NVM sector
2383 cmd->module_typeid = cpu_to_le16(module_typeid); in ixgbe_aci_erase_nvm()
2384 cmd->length = len; in ixgbe_aci_erase_nvm()
2385 cmd->offset_low = 0; in ixgbe_aci_erase_nvm()
2386 cmd->offset_high = 0; in ixgbe_aci_erase_nvm()
2392 * ixgbe_aci_update_nvm - update NVM
2416 return -EINVAL; in ixgbe_aci_update_nvm()
2420 cmd->cmd_flags |= command_flags; in ixgbe_aci_update_nvm()
2424 cmd->cmd_flags |= IXGBE_ACI_NVM_LAST_CMD; in ixgbe_aci_update_nvm()
2425 cmd->module_typeid = cpu_to_le16(module_typeid); in ixgbe_aci_update_nvm()
2426 cmd->offset_low = cpu_to_le16(offset & 0xFFFF); in ixgbe_aci_update_nvm()
2427 cmd->offset_high = FIELD_GET(IXGBE_ACI_NVM_OFFSET_HI_U_MASK, offset); in ixgbe_aci_update_nvm()
2428 cmd->length = cpu_to_le16(length); in ixgbe_aci_update_nvm()
2436 * ixgbe_nvm_write_activate - NVM activate write
2445 * when activating the NVM bank, and whether an EMP reset is required for
2468 cmd->cmd_flags = (u8)(cmd_flags & 0xFF); in ixgbe_nvm_write_activate()
2469 cmd->offset_high = (u8)FIELD_GET(IXGBE_ACI_NVM_OFFSET_HI_A_MASK, in ixgbe_nvm_write_activate()
2474 *response_flags = cmd->cmd_flags; in ixgbe_nvm_write_activate()
2480 * ixgbe_nvm_validate_checksum - validate checksum
2502 cmd->flags = IXGBE_ACI_NVM_CHECKSUM_VERIFY; in ixgbe_nvm_validate_checksum()
2508 if (!err && cmd->checksum != in ixgbe_nvm_validate_checksum()
2513 err = -EIO; in ixgbe_nvm_validate_checksum()
2514 netdev_err(adapter->netdev, "Invalid Shadow Ram checksum"); in ixgbe_nvm_validate_checksum()
2521 * ixgbe_discover_flash_size - Discover the available flash size
2539 while ((max_size - min_size) > 1) { in ixgbe_discover_flash_size()
2545 if (err == -EIO && in ixgbe_discover_flash_size()
2546 hw->aci.last_status == LIBIE_AQ_RC_EINVAL) { in ixgbe_discover_flash_size()
2557 hw->flash.flash_size = max_size; in ixgbe_discover_flash_size()
2566 * ixgbe_read_sr_base_address - Read the value of a Shadow RAM pointer word
2601 * ixgbe_read_sr_area_size - Read an area size from a Shadow RAM word
2631 * ixgbe_determine_active_flash_banks - Discover active bank for each module
2644 struct ixgbe_bank_info *banks = &hw->flash.banks; in ixgbe_determine_active_flash_banks()
2655 return -ENODATA; in ixgbe_determine_active_flash_banks()
2658 banks->nvm_bank = IXGBE_1ST_FLASH_BANK; in ixgbe_determine_active_flash_banks()
2660 banks->nvm_bank = IXGBE_2ND_FLASH_BANK; in ixgbe_determine_active_flash_banks()
2663 banks->orom_bank = IXGBE_1ST_FLASH_BANK; in ixgbe_determine_active_flash_banks()
2665 banks->orom_bank = IXGBE_2ND_FLASH_BANK; in ixgbe_determine_active_flash_banks()
2668 banks->netlist_bank = IXGBE_1ST_FLASH_BANK; in ixgbe_determine_active_flash_banks()
2670 banks->netlist_bank = IXGBE_2ND_FLASH_BANK; in ixgbe_determine_active_flash_banks()
2673 &banks->nvm_ptr); in ixgbe_determine_active_flash_banks()
2678 &banks->nvm_size); in ixgbe_determine_active_flash_banks()
2683 &banks->orom_ptr); in ixgbe_determine_active_flash_banks()
2688 &banks->orom_size); in ixgbe_determine_active_flash_banks()
2693 &banks->netlist_ptr); in ixgbe_determine_active_flash_banks()
2698 &banks->netlist_size); in ixgbe_determine_active_flash_banks()
2704 * ixgbe_get_flash_bank_offset - Get offset into requested flash bank
2706 * @bank: whether to read from the active or inactive flash bank
2716 enum ixgbe_bank_select bank, in ixgbe_get_flash_bank_offset() argument
2719 struct ixgbe_bank_info *banks = &hw->flash.banks; in ixgbe_get_flash_bank_offset()
2726 offset = banks->nvm_ptr; in ixgbe_get_flash_bank_offset()
2727 size = banks->nvm_size; in ixgbe_get_flash_bank_offset()
2728 active_bank = banks->nvm_bank; in ixgbe_get_flash_bank_offset()
2731 offset = banks->orom_ptr; in ixgbe_get_flash_bank_offset()
2732 size = banks->orom_size; in ixgbe_get_flash_bank_offset()
2733 active_bank = banks->orom_bank; in ixgbe_get_flash_bank_offset()
2736 offset = banks->netlist_ptr; in ixgbe_get_flash_bank_offset()
2737 size = banks->netlist_size; in ixgbe_get_flash_bank_offset()
2738 active_bank = banks->netlist_bank; in ixgbe_get_flash_bank_offset()
2755 /* The second flash bank is stored immediately following the first in ixgbe_get_flash_bank_offset()
2756 * bank. Based on whether the 1st or 2nd bank is active, and whether in ixgbe_get_flash_bank_offset()
2757 * we want the active or inactive bank, calculate the desired offset. in ixgbe_get_flash_bank_offset()
2759 switch (bank) { in ixgbe_get_flash_bank_offset()
2770 * ixgbe_read_flash_module - Read a word from one of the main NVM modules
2772 * @bank: which bank of the module to read
2778 * Read data from the specified flash module. The bank parameter indicates
2779 * whether or not to read from the active bank or the inactive bank of that
2783 * hw->flash.banks data being setup by ixgbe_determine_active_flash_banks()
2789 enum ixgbe_bank_select bank, in ixgbe_read_flash_module() argument
2795 start = ixgbe_get_flash_bank_offset(hw, bank, module); in ixgbe_read_flash_module()
2797 return -EINVAL; in ixgbe_read_flash_module()
2811 * ixgbe_read_nvm_module - Read from the active main NVM module
2813 * @bank: whether to read from active or inactive NVM module
2823 enum ixgbe_bank_select bank, in ixgbe_read_nvm_module() argument
2829 err = ixgbe_read_flash_module(hw, bank, IXGBE_E610_SR_1ST_NVM_BANK_PTR, in ixgbe_read_nvm_module()
2840 * ixgbe_read_netlist_module - Read data from the netlist module area
2842 * @bank: whether to read from the active or inactive module
2846 * Read a word from the specified netlist bank.
2851 enum ixgbe_bank_select bank, in ixgbe_read_netlist_module() argument
2857 err = ixgbe_read_flash_module(hw, bank, IXGBE_E610_SR_NETLIST_BANK_PTR, in ixgbe_read_netlist_module()
2867 * ixgbe_read_orom_module - Read from the active Option ROM module
2869 * @bank: whether to read from active or inactive OROM module
2880 enum ixgbe_bank_select bank, in ixgbe_read_orom_module() argument
2886 err = ixgbe_read_flash_module(hw, bank, IXGBE_E610_SR_1ST_OROM_BANK_PTR, in ixgbe_read_orom_module()
2896 * ixgbe_get_nvm_css_hdr_len - Read the CSS header length
2898 * @bank: whether to read from the active or inactive flash bank
2907 enum ixgbe_bank_select bank, in ixgbe_get_nvm_css_hdr_len() argument
2914 err = ixgbe_read_nvm_module(hw, bank, IXGBE_NVM_CSS_HDR_LEN_L, in ixgbe_get_nvm_css_hdr_len()
2919 err = ixgbe_read_nvm_module(hw, bank, IXGBE_NVM_CSS_HDR_LEN_H, in ixgbe_get_nvm_css_hdr_len()
2934 * ixgbe_read_nvm_sr_copy - Read a word from the Shadow RAM copy
2936 * @bank: whether to read from the active or inactive NVM module
2946 enum ixgbe_bank_select bank, in ixgbe_read_nvm_sr_copy() argument
2952 err = ixgbe_get_nvm_css_hdr_len(hw, bank, &hdr_len); in ixgbe_read_nvm_sr_copy()
2958 return ixgbe_read_nvm_module(hw, bank, hdr_len + offset, data); in ixgbe_read_nvm_sr_copy()
2962 * ixgbe_get_nvm_srev - Read the security revision from the NVM CSS header
2964 * @bank: whether to read from the active or inactive flash bank
2968 * bank.
2973 enum ixgbe_bank_select bank, u32 *srev) in ixgbe_get_nvm_srev() argument
2978 err = ixgbe_read_nvm_module(hw, bank, IXGBE_NVM_CSS_SREV_L, &srev_l); in ixgbe_get_nvm_srev()
2982 err = ixgbe_read_nvm_module(hw, bank, IXGBE_NVM_CSS_SREV_H, &srev_h); in ixgbe_get_nvm_srev()
2992 * ixgbe_get_orom_civd_data - Get the combo version information from Option ROM
2994 * @bank: whether to read from the active or inactive flash module
3000 * Return: -ENOMEM when cannot allocate memory, -EDOM for checksum violation,
3001 * -ENODATA when cannot find proper data, -EIO for faulty read or
3007 ixgbe_get_orom_civd_data(struct ixgbe_hw *hw, enum ixgbe_bank_select bank, in ixgbe_get_orom_civd_data() argument
3010 u32 orom_size = hw->flash.banks.orom_size; in ixgbe_get_orom_civd_data()
3017 return -ENOMEM; in ixgbe_get_orom_civd_data()
3019 err = ixgbe_read_flash_module(hw, bank, in ixgbe_get_orom_civd_data()
3023 err = -EIO; in ixgbe_get_orom_civd_data()
3042 if (memcmp(IXGBE_OROM_CIV_SIGNATURE, tmp->signature, in ixgbe_get_orom_civd_data()
3043 sizeof(tmp->signature))) in ixgbe_get_orom_civd_data()
3051 err = -EDOM; in ixgbe_get_orom_civd_data()
3061 err = -ENODATA; in ixgbe_get_orom_civd_data()
3068 * ixgbe_get_orom_srev - Read the security revision from the OROM CSS header
3070 * @bank: whether to read from active or inactive flash module
3074 * bank.
3079 enum ixgbe_bank_select bank, in ixgbe_get_orom_srev() argument
3082 u32 orom_size_word = hw->flash.banks.orom_size / 2; in ixgbe_get_orom_srev()
3087 err = ixgbe_get_nvm_css_hdr_len(hw, bank, &hdr_len); in ixgbe_get_orom_srev()
3092 return -EINVAL; in ixgbe_get_orom_srev()
3097 css_start = orom_size_word - hdr_len; in ixgbe_get_orom_srev()
3098 err = ixgbe_read_orom_module(hw, bank, in ixgbe_get_orom_srev()
3104 err = ixgbe_read_orom_module(hw, bank, in ixgbe_get_orom_srev()
3116 * ixgbe_get_orom_ver_info - Read Option ROM version information
3118 * @bank: whether to read from the active or inactive flash module
3127 enum ixgbe_bank_select bank, in ixgbe_get_orom_ver_info() argument
3134 err = ixgbe_get_orom_civd_data(hw, bank, &civd); in ixgbe_get_orom_ver_info()
3140 orom->major = (u8)FIELD_GET(IXGBE_OROM_VER_MASK, combo_ver); in ixgbe_get_orom_ver_info()
3141 orom->patch = (u8)FIELD_GET(IXGBE_OROM_VER_PATCH_MASK, combo_ver); in ixgbe_get_orom_ver_info()
3142 orom->build = (u16)FIELD_GET(IXGBE_OROM_VER_BUILD_MASK, combo_ver); in ixgbe_get_orom_ver_info()
3144 return ixgbe_get_orom_srev(hw, bank, &orom->srev); in ixgbe_get_orom_ver_info()
3148 * ixgbe_get_inactive_orom_ver - Read Option ROM version from the inactive bank
3165 * ixgbe_get_nvm_ver_info - Read NVM version information
3167 * @bank: whether to read from the active or inactive flash bank
3170 * Read the NVM EETRACK ID and map version of the main NVM image bank, filling
3176 enum ixgbe_bank_select bank, in ixgbe_get_nvm_ver_info() argument
3182 err = ixgbe_read_nvm_sr_copy(hw, bank, in ixgbe_get_nvm_ver_info()
3187 nvm->major = FIELD_GET(IXGBE_E610_NVM_VER_HI_MASK, ver); in ixgbe_get_nvm_ver_info()
3188 nvm->minor = FIELD_GET(IXGBE_E610_NVM_VER_LO_MASK, ver); in ixgbe_get_nvm_ver_info()
3190 err = ixgbe_read_nvm_sr_copy(hw, bank, IXGBE_E610_SR_NVM_EETRACK_LO, in ixgbe_get_nvm_ver_info()
3195 err = ixgbe_read_nvm_sr_copy(hw, bank, IXGBE_E610_SR_NVM_EETRACK_HI, in ixgbe_get_nvm_ver_info()
3200 nvm->eetrack = (eetrack_hi << 16) | eetrack_lo; in ixgbe_get_nvm_ver_info()
3202 ixgbe_get_nvm_srev(hw, bank, &nvm->srev); in ixgbe_get_nvm_ver_info()
3208 * ixgbe_get_inactive_nvm_ver - Read Option ROM version from the inactive bank
3213 * inactive NVM bank. Used to access version data for a pending update that
3224 * ixgbe_get_active_nvm_ver - Read Option ROM version from the active bank
3229 * active NVM bank.
3240 * ixgbe_get_netlist_info - Read the netlist version information
3242 * @bank: whether to read from the active or inactive flash bank
3245 * Get the netlist version information from the requested bank. Reads the Link
3252 enum ixgbe_bank_select bank, in ixgbe_get_netlist_info() argument
3259 err = ixgbe_read_netlist_module(hw, bank, IXGBE_NETLIST_TYPE_OFFSET, in ixgbe_get_netlist_info()
3265 return -EIO; in ixgbe_get_netlist_info()
3267 err = ixgbe_read_netlist_module(hw, bank, IXGBE_LINK_TOPO_MODULE_LEN, in ixgbe_get_netlist_info()
3276 return -EIO; in ixgbe_get_netlist_info()
3278 err = ixgbe_read_netlist_module(hw, bank, IXGBE_LINK_TOPO_NODE_COUNT, in ixgbe_get_netlist_info()
3287 return -ENOMEM; in ixgbe_get_netlist_info()
3290 err = ixgbe_read_flash_module(hw, bank, IXGBE_E610_SR_NETLIST_BANK_PTR, in ixgbe_get_netlist_info()
3301 netlist->major = id_blk[IXGBE_NETLIST_ID_BLK_MAJOR_VER_HIGH] << 16 | in ixgbe_get_netlist_info()
3303 netlist->minor = id_blk[IXGBE_NETLIST_ID_BLK_MINOR_VER_HIGH] << 16 | in ixgbe_get_netlist_info()
3305 netlist->type = id_blk[IXGBE_NETLIST_ID_BLK_TYPE_HIGH] << 16 | in ixgbe_get_netlist_info()
3307 netlist->rev = id_blk[IXGBE_NETLIST_ID_BLK_REV_HIGH] << 16 | in ixgbe_get_netlist_info()
3309 netlist->cust_ver = id_blk[IXGBE_NETLIST_ID_BLK_CUST_VER]; in ixgbe_get_netlist_info()
3311 netlist->hash = id_blk[IXGBE_NETLIST_ID_BLK_SHA_HASH_WORD(15)] << 16 | in ixgbe_get_netlist_info()
3320 * ixgbe_get_inactive_netlist_ver - Read netlist version from the inactive bank
3324 * Read the netlist version data from the inactive netlist bank. Used to
3337 * ixgbe_get_flash_data - get flash data
3347 struct ixgbe_flash_info *flash = &hw->flash; in ixgbe_get_flash_data()
3359 flash->sr_words = BIT(sr_size) * (SZ_1K / sizeof(u16)); in ixgbe_get_flash_data()
3364 flash->blank_nvm_mode = false; in ixgbe_get_flash_data()
3366 flash->blank_nvm_mode = true; in ixgbe_get_flash_data()
3367 return -EIO; in ixgbe_get_flash_data()
3379 &flash->nvm); in ixgbe_get_flash_data()
3384 &flash->orom); in ixgbe_get_flash_data()
3389 &flash->netlist); in ixgbe_get_flash_data()
3394 * ixgbe_aci_nvm_update_empr - update NVM using EMPR
3411 /* ixgbe_nvm_set_pkg_data - NVM set package data
3433 return -EINVAL; in ixgbe_nvm_set_pkg_data()
3441 cmd->cmd_flags |= IXGBE_ACI_NVM_PKG_DELETE; in ixgbe_nvm_set_pkg_data()
3446 /* ixgbe_nvm_pass_component_tbl - NVM pass component table
3472 return -EINVAL; in ixgbe_nvm_pass_component_tbl()
3480 cmd->transfer_flag = transfer_flag; in ixgbe_nvm_pass_component_tbl()
3483 *comp_response = cmd->component_response; in ixgbe_nvm_pass_component_tbl()
3484 *comp_response_code = cmd->component_response_code; in ixgbe_nvm_pass_component_tbl()
3491 * ixgbe_read_sr_word_aci - Reads Shadow RAM via ACI
3493 * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF)
3516 * ixgbe_read_flat_nvm - Read portion of NVM by flat offset
3519 * @length: (in) number of bytes to read; (out) number of bytes actually read
3543 (hw->eeprom.word_size * 2u))) in ixgbe_read_flat_nvm()
3544 return -EINVAL; in ixgbe_read_flat_nvm()
3555 IXGBE_ACI_MAX_BUFFER_SIZE - sector_offset, in ixgbe_read_flat_nvm()
3556 inlen - bytes_read); in ixgbe_read_flat_nvm()
3580 * ixgbe_read_sr_buf_aci - Read Shadow RAM buffer via ACI
3582 * @offset: offset of the Shadow RAM words to read (0x000000 - 0x001FFF)
3583 * @words: (in) number of words to read; (out) number of words actually read
3610 * ixgbe_read_ee_aci_e610 - Read EEPROM word using the admin command.
3626 if (hw->eeprom.type == ixgbe_eeprom_uninitialized) { in ixgbe_read_ee_aci_e610()
3627 err = hw->eeprom.ops.init_params(hw); in ixgbe_read_ee_aci_e610()
3643 * ixgbe_read_ee_aci_buffer_e610 - Read EEPROM words via ACI
3646 * @words: number of words to read
3659 if (hw->eeprom.type == ixgbe_eeprom_uninitialized) { in ixgbe_read_ee_aci_buffer_e610()
3660 err = hw->eeprom.ops.init_params(hw); in ixgbe_read_ee_aci_buffer_e610()
3676 * ixgbe_validate_eeprom_checksum_e610 - Validate EEPROM checksum
3692 if (hw->eeprom.type == ixgbe_eeprom_uninitialized) { in ixgbe_validate_eeprom_checksum_e610()
3693 err = hw->eeprom.ops.init_params(hw); in ixgbe_validate_eeprom_checksum_e610()
3721 * ixgbe_reset_hw_e610 - Perform hardware reset
3731 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_reset_hw_e610()
3736 err = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_e610()
3743 hw->phy.ops.init(hw); in ixgbe_reset_hw_e610()
3745 err = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_e610()
3747 return -EBUSY; in ixgbe_reset_hw_e610()
3752 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_e610()
3754 /* Poll for reset bit to self-clear indicating reset is complete */ in ixgbe_reset_hw_e610()
3766 err = -EIO; in ixgbe_reset_hw_e610()
3767 netdev_err(adapter->netdev, "Reset polling failed to complete."); in ixgbe_reset_hw_e610()
3775 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_e610()
3776 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_e610()
3784 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_e610()
3786 /* Maximum number of Receive Address Registers. */ in ixgbe_reset_hw_e610()
3791 * maximum number of Receive Address Registers, since we modify this in ixgbe_reset_hw_e610()
3794 hw->mac.num_rar_entries = IXGBE_MAX_NUM_RAR; in ixgbe_reset_hw_e610()
3795 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_e610()
3797 /* Initialize bus function number */ in ixgbe_reset_hw_e610()
3798 hw->mac.ops.set_lan_id(hw); in ixgbe_reset_hw_e610()
3805 * ixgbe_get_pfa_module_tlv - Read sub module TLV from NVM PFA
3857 return -EIO; in ixgbe_get_pfa_module_tlv()
3865 return -ENODATA; in ixgbe_get_pfa_module_tlv()
3869 * ixgbe_read_pba_string_e610 - Read PBA string from NVM
3871 * @pba_num: stores the part number string from the NVM
3872 * @pba_num_size: part number string buffer length
3874 * Read the part number string from the NVM.
3898 return -EINVAL; in ixgbe_read_pba_string_e610()
3903 pba_size--; in ixgbe_read_pba_string_e610()
3906 return -EINVAL; in ixgbe_read_pba_string_e610()
3934 struct ixgbe_adapter *adapter = hw->back; in ixgbe_fwlog_init()
3936 .pdev = adapter->pdev, in ixgbe_fwlog_init()
3938 .debugfs_root = adapter->ixgbe_dbg_adapter, in ixgbe_fwlog_init()
3942 if (hw->mac.type != ixgbe_mac_e610) in ixgbe_fwlog_init()
3943 return -EOPNOTSUPP; in ixgbe_fwlog_init()
3945 return libie_fwlog_init(&hw->fwlog, &api); in ixgbe_fwlog_init()
3950 if (hw->mac.type != ixgbe_mac_e610) in ixgbe_fwlog_deinit()
3953 libie_fwlog_deinit(&hw->fwlog); in ixgbe_fwlog_deinit()