Lines Matching +full:touch +full:- +full:hold +full:- +full:ms

3   Copyright (c) 2013-2018, Intel Corporation
41 * i40e_set_mac_type - Sets MAC type
53 if (hw->vendor_id == I40E_INTEL_VENDOR_ID) { in i40e_set_mac_type()
54 switch (hw->device_id) { in i40e_set_mac_type()
75 hw->mac.type = I40E_MAC_XL710; in i40e_set_mac_type()
83 hw->mac.type = I40E_MAC_X722; in i40e_set_mac_type()
86 hw->mac.type = I40E_MAC_X722_VF; in i40e_set_mac_type()
91 hw->mac.type = I40E_MAC_VF; in i40e_set_mac_type()
94 hw->mac.type = I40E_MAC_GENERIC; in i40e_set_mac_type()
102 hw->mac.type, status); in i40e_set_mac_type()
107 * i40e_aq_str - convert AQ err code to a string
162 snprintf(hw->err_str, sizeof(hw->err_str), "%d", aq_err); in i40e_aq_str()
163 return hw->err_str; in i40e_aq_str()
167 * i40e_stat_str - convert status err code to a string
310 snprintf(hw->err_str, sizeof(hw->err_str), "%d", stat_err); in i40e_stat_str()
311 return hw->err_str; in i40e_stat_str()
328 u32 effective_mask = hw->debug_mask & mask; in i40e_debug_aq()
336 len = LE16_TO_CPU(aq_desc->datalen); in i40e_debug_aq()
340 LE16_TO_CPU(aq_desc->opcode), in i40e_debug_aq()
341 LE16_TO_CPU(aq_desc->flags), in i40e_debug_aq()
342 LE16_TO_CPU(aq_desc->datalen), in i40e_debug_aq()
343 LE16_TO_CPU(aq_desc->retval)); in i40e_debug_aq()
346 LE32_TO_CPU(aq_desc->cookie_high), in i40e_debug_aq()
347 LE32_TO_CPU(aq_desc->cookie_low)); in i40e_debug_aq()
350 LE32_TO_CPU(aq_desc->params.internal.param0), in i40e_debug_aq()
351 LE32_TO_CPU(aq_desc->params.internal.param1)); in i40e_debug_aq()
354 LE32_TO_CPU(aq_desc->params.external.addr_high), in i40e_debug_aq()
355 LE32_TO_CPU(aq_desc->params.external.addr_low)); in i40e_debug_aq()
362 /* write the full 16-byte chunks */ in i40e_debug_aq()
363 for (i = 0; i < (len - 16); i += 16) in i40e_debug_aq()
397 if (hw->aq.asq.len) { in i40e_check_asq_alive()
399 return !!(rd32(hw, hw->aq.asq.len) & in i40e_check_asq_alive()
402 return !!(rd32(hw, hw->aq.asq.len) & in i40e_check_asq_alive()
428 cmd->driver_unloading = CPU_TO_LE32(I40E_AQ_DRIVER_UNLOADING); in i40e_aq_queue_shutdown()
466 cmd_resp->vsi_id = in i40e_aq_get_set_rss_lut()
470 cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_LUT_VSI_VALID); in i40e_aq_get_set_rss_lut()
473 cmd_resp->flags |= CPU_TO_LE16((u16) in i40e_aq_get_set_rss_lut()
478 cmd_resp->flags |= CPU_TO_LE16((u16) in i40e_aq_get_set_rss_lut()
552 cmd_resp->vsi_id = in i40e_aq_get_set_rss_key()
556 cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_KEY_VSI_VALID); in i40e_aq_get_set_rss_key()
592 /* The i40e_ptype_lookup table is used to convert from the 8-bit ptype in the
593 * hardware to a bit-field that can be used by SW to more easily determine the
599 * We store the PTYPE in the top byte of the bit field - this is just so that
671 /* IPv4 --> IPv4 */
680 /* IPv4 --> IPv6 */
689 /* IPv4 --> GRE/NAT */
692 /* IPv4 --> GRE/NAT --> IPv4 */
701 /* IPv4 --> GRE/NAT --> IPv6 */
710 /* IPv4 --> GRE/NAT --> MAC */
713 /* IPv4 --> GRE/NAT --> MAC --> IPv4 */
722 /* IPv4 --> GRE/NAT -> MAC --> IPv6 */
731 /* IPv4 --> GRE/NAT --> MAC/VLAN */
734 /* IPv4 ---> GRE/NAT -> MAC/VLAN --> IPv4 */
743 /* IPv4 -> GRE/NAT -> MAC/VLAN --> IPv6 */
761 /* IPv6 --> IPv4 */
770 /* IPv6 --> IPv6 */
779 /* IPv6 --> GRE/NAT */
782 /* IPv6 --> GRE/NAT -> IPv4 */
791 /* IPv6 --> GRE/NAT -> IPv6 */
800 /* IPv6 --> GRE/NAT -> MAC */
803 /* IPv6 --> GRE/NAT -> MAC -> IPv4 */
812 /* IPv6 --> GRE/NAT -> MAC -> IPv6 */
821 /* IPv6 --> GRE/NAT -> MAC/VLAN */
824 /* IPv6 --> GRE/NAT -> MAC/VLAN --> IPv4 */
833 /* IPv6 --> GRE/NAT -> MAC/VLAN --> IPv6 */
959 * i40e_validate_mac_addr - Validate unicast MAC address
983 * i40e_init_shared_code - Initialize the shared code
987 * Does not touch the hardware. This function must be called prior to any
1003 switch (hw->mac.type) { in i40e_init_shared_code()
1011 hw->phy.get_link_info = TRUE; in i40e_init_shared_code()
1016 hw->port = (u8)port; in i40e_init_shared_code()
1021 hw->pf_id = (u8)(func_rid & 0xff); in i40e_init_shared_code()
1023 hw->pf_id = (u8)(func_rid & 0x7); in i40e_init_shared_code()
1026 hw->nvmupd_features.major = I40E_NVMUPD_FEATURES_API_VER_MAJOR; in i40e_init_shared_code()
1027 hw->nvmupd_features.minor = I40E_NVMUPD_FEATURES_API_VER_MINOR; in i40e_init_shared_code()
1028 hw->nvmupd_features.size = sizeof(hw->nvmupd_features); in i40e_init_shared_code()
1029 i40e_memset(hw->nvmupd_features.features, 0x0, in i40e_init_shared_code()
1031 sizeof(*hw->nvmupd_features.features), in i40e_init_shared_code()
1035 hw->nvmupd_features.features[0] = 0; in i40e_init_shared_code()
1042 * i40e_aq_mac_address_read - Retrieve the MAC addresses
1063 *flags = LE16_TO_CPU(cmd_data->command_flags); in i40e_aq_mac_address_read()
1069 * i40e_aq_mac_address_write - Change the MAC addresses
1086 cmd_data->command_flags = CPU_TO_LE16(flags); in i40e_aq_mac_address_write()
1087 cmd_data->mac_sah = CPU_TO_LE16((u16)mac_addr[0] << 8 | mac_addr[1]); in i40e_aq_mac_address_write()
1088 cmd_data->mac_sal = CPU_TO_LE32(((u32)mac_addr[2] << 24) | in i40e_aq_mac_address_write()
1099 * i40e_get_mac_addr - get MAC address
1121 * i40e_get_port_mac_addr - get Port MAC address
1147 * i40e_pre_tx_queue_cfg - pre tx queue configure
1157 u32 abs_queue_idx = hw->func_caps.base_queue + queue; in i40e_pre_tx_queue_cfg()
1179 * i40e_read_pba_string - Reads part number string from EEPROM
1216 pba_size--; in i40e_read_pba_string()
1238 * i40e_get_media_type - Gets media type
1245 switch (hw->phy.link_info.phy_type) { in i40e_get_media_type()
1297 * i40e_poll_globr - Poll for Global Reset completion
1321 * i40e_pf_reset - Reset the PF
1335 * The grst delay value is in 100ms units, and we'll wait a in i40e_pf_reset()
1408 * i40e_clear_hw - clear out any left over hw state
1438 num_queues = (j - base_queue) + 1; in i40e_clear_hw()
1448 num_vfs = (j - i) + 1; in i40e_clear_hw()
1455 for (i = 0; i < num_pf_int - 2; i++) in i40e_clear_hw()
1461 for (i = 0; i < num_pf_int - 2; i++) in i40e_clear_hw()
1466 for (i = 0; i < num_vf_int - 2; i++) in i40e_clear_hw()
1501 * i40e_clear_pxe_mode - clear pxe operations mode
1505 * like descriptor fetch/write-back mode.
1514 * i40e_led_is_mine - helper to find matching led
1525 if (!I40E_IS_X710TL_DEVICE(hw->device_id) && in i40e_led_is_mine()
1526 !hw->func_caps.led[idx]) in i40e_led_is_mine()
1536 (port != hw->port)) in i40e_led_is_mine()
1556 * i40e_led_get - return current on/off mode
1569 /* as per the documentation GPIO 22-29 are the LED in i40e_led_get()
1588 * i40e_led_set - set new on/off mode
1605 /* as per the documentation GPIO 22-29 are the LED in i40e_led_set()
1615 if (I40E_IS_X710TL_DEVICE(hw->device_id)) { in i40e_led_set()
1687 switch (hw->aq.asq_last_status) { in i40e_aq_get_phy_capabilities()
1701 } while ((hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN) && in i40e_aq_get_phy_capabilities()
1708 if (hw->mac.type == I40E_MAC_XL710 && in i40e_aq_get_phy_capabilities()
1709 hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR && in i40e_aq_get_phy_capabilities()
1710 hw->aq.api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710) { in i40e_aq_get_phy_capabilities()
1713 hw->phy.phy_types = LE32_TO_CPU(abilities->phy_type); in i40e_aq_get_phy_capabilities()
1714 hw->phy.phy_types |= in i40e_aq_get_phy_capabilities()
1715 ((u64)abilities->phy_type_ext << 32); in i40e_aq_get_phy_capabilities()
1767 enum i40e_fc_mode fc_mode = hw->fc.requested_mode; in i40e_set_fc()
1868 cmd->max_frame_size = CPU_TO_LE16(max_frame_size); in i40e_aq_set_mac_config()
1869 cmd->params = ((u8)pacing & 0x0F) << 3; in i40e_aq_set_mac_config()
1871 cmd->params |= I40E_AQ_SET_MAC_CONFIG_CRC_EN; in i40e_aq_set_mac_config()
1874 if (hw->flags & I40E_HW_FLAG_DROP_MODE) in i40e_aq_set_mac_config()
1875 cmd->params |= in i40e_aq_set_mac_config()
1883 cmd->fc_refresh_threshold = in i40e_aq_set_mac_config()
1909 cmd->rx_cnt = 0x2; in i40e_aq_clear_pxe_mode()
1924 * Sets up the link and restarts the Auto-Negotiation over the link.
1937 cmd->command = I40E_AQ_PHY_RESTART_AN; in i40e_aq_set_link_restart_an()
1939 cmd->command |= I40E_AQ_PHY_LINK_ENABLE; in i40e_aq_set_link_restart_an()
1941 cmd->command &= ~I40E_AQ_PHY_LINK_ENABLE; in i40e_aq_set_link_restart_an()
1952 * @link: pointer to link status structure - optional
1964 struct i40e_link_status *hw_link_info = &hw->phy.link_info; in i40e_aq_get_link_info()
1975 resp->command_flags = CPU_TO_LE16(command_flags); in i40e_aq_get_link_info()
1983 i40e_memcpy(&hw->phy.link_info_old, hw_link_info, in i40e_aq_get_link_info()
1987 hw_link_info->phy_type = (enum i40e_aq_phy_type)resp->phy_type; in i40e_aq_get_link_info()
1988 hw->phy.media_type = i40e_get_media_type(hw); in i40e_aq_get_link_info()
1989 hw_link_info->link_speed = (enum i40e_aq_link_speed)resp->link_speed; in i40e_aq_get_link_info()
1990 hw_link_info->link_info = resp->link_info; in i40e_aq_get_link_info()
1991 hw_link_info->an_info = resp->an_info; in i40e_aq_get_link_info()
1992 hw_link_info->fec_info = resp->config & (I40E_AQ_CONFIG_FEC_KR_ENA | in i40e_aq_get_link_info()
1994 hw_link_info->ext_info = resp->ext_info; in i40e_aq_get_link_info()
1995 hw_link_info->loopback = resp->loopback & I40E_AQ_LOOPBACK_MASK; in i40e_aq_get_link_info()
1996 hw_link_info->max_frame_size = LE16_TO_CPU(resp->max_frame_size); in i40e_aq_get_link_info()
1997 hw_link_info->pacing = resp->config & I40E_AQ_CONFIG_PACING_MASK; in i40e_aq_get_link_info()
2000 tx_pause = !!(resp->an_info & I40E_AQ_LINK_PAUSE_TX); in i40e_aq_get_link_info()
2001 rx_pause = !!(resp->an_info & I40E_AQ_LINK_PAUSE_RX); in i40e_aq_get_link_info()
2003 hw->fc.current_mode = I40E_FC_FULL; in i40e_aq_get_link_info()
2005 hw->fc.current_mode = I40E_FC_TX_PAUSE; in i40e_aq_get_link_info()
2007 hw->fc.current_mode = I40E_FC_RX_PAUSE; in i40e_aq_get_link_info()
2009 hw->fc.current_mode = I40E_FC_NONE; in i40e_aq_get_link_info()
2011 if (resp->config & I40E_AQ_CONFIG_CRC_ENA) in i40e_aq_get_link_info()
2012 hw_link_info->crc_enable = TRUE; in i40e_aq_get_link_info()
2014 hw_link_info->crc_enable = FALSE; in i40e_aq_get_link_info()
2016 if (resp->command_flags & CPU_TO_LE16(I40E_AQ_LSE_IS_ENABLED)) in i40e_aq_get_link_info()
2017 hw_link_info->lse_enable = TRUE; in i40e_aq_get_link_info()
2019 hw_link_info->lse_enable = FALSE; in i40e_aq_get_link_info()
2021 if ((hw->mac.type == I40E_MAC_XL710) && in i40e_aq_get_link_info()
2022 (hw->aq.fw_maj_ver < 4 || (hw->aq.fw_maj_ver == 4 && in i40e_aq_get_link_info()
2023 hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE) in i40e_aq_get_link_info()
2024 hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU; in i40e_aq_get_link_info()
2029 if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE && in i40e_aq_get_link_info()
2030 hw->mac.type != I40E_MAC_X722) { in i40e_aq_get_link_info()
2033 i40e_memcpy(&tmp, resp->link_type, sizeof(tmp), in i40e_aq_get_link_info()
2035 hw->phy.phy_types = LE32_TO_CPU(tmp); in i40e_aq_get_link_info()
2036 hw->phy.phy_types |= ((u64)resp->link_type_ext << 32); in i40e_aq_get_link_info()
2045 hw->phy.get_link_info = FALSE; in i40e_aq_get_link_info()
2071 cmd->event_mask = CPU_TO_LE16(mask); in i40e_aq_set_phy_int_mask()
2103 *advt_reg = (u64)(LE16_TO_CPU(resp->local_an_reg1)) << 32; in i40e_aq_get_local_advt_reg()
2104 *advt_reg |= LE32_TO_CPU(resp->local_an_reg0); in i40e_aq_get_local_advt_reg()
2130 cmd->local_an_reg0 = CPU_TO_LE32(I40E_LO_DWORD(advt_reg)); in i40e_aq_set_local_advt_reg()
2131 cmd->local_an_reg1 = CPU_TO_LE16(I40E_HI_DWORD(advt_reg)); in i40e_aq_set_local_advt_reg()
2163 *advt_reg = (u64)(LE16_TO_CPU(resp->local_an_reg1)) << 32; in i40e_aq_get_partner_advt()
2164 *advt_reg |= LE32_TO_CPU(resp->local_an_reg0); in i40e_aq_get_partner_advt()
2190 cmd->lb_level = lb_level; in i40e_aq_set_lb_modes()
2191 cmd->lb_type = lb_type; in i40e_aq_set_lb_modes()
2192 cmd->speed = speed; in i40e_aq_set_lb_modes()
2194 cmd->force_speed = 1; in i40e_aq_set_lb_modes()
2220 cmd->command_flags = cmd_flags; in i40e_aq_set_phy_debug()
2237 if (hw->aq.api_maj_ver > maj || in i40e_hw_ver_ge()
2238 (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min)) in i40e_hw_ver_ge()
2266 cmd->uplink_seid = CPU_TO_LE16(vsi_ctx->uplink_seid); in i40e_aq_add_vsi()
2267 cmd->connection_type = vsi_ctx->connection_type; in i40e_aq_add_vsi()
2268 cmd->vf_id = vsi_ctx->vf_num; in i40e_aq_add_vsi()
2269 cmd->vsi_flags = CPU_TO_LE16(vsi_ctx->flags); in i40e_aq_add_vsi()
2273 status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info, in i40e_aq_add_vsi()
2274 sizeof(vsi_ctx->info), cmd_details); in i40e_aq_add_vsi()
2279 vsi_ctx->seid = LE16_TO_CPU(resp->seid); in i40e_aq_add_vsi()
2280 vsi_ctx->vsi_number = LE16_TO_CPU(resp->vsi_number); in i40e_aq_add_vsi()
2281 vsi_ctx->vsis_allocated = LE16_TO_CPU(resp->vsi_used); in i40e_aq_add_vsi()
2282 vsi_ctx->vsis_unallocated = LE16_TO_CPU(resp->vsi_free); in i40e_aq_add_vsi()
2307 cmd->promiscuous_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_DEFAULT); in i40e_aq_set_default_vsi()
2308 cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_DEFAULT); in i40e_aq_set_default_vsi()
2309 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_set_default_vsi()
2335 cmd->promiscuous_flags = CPU_TO_LE16(0); in i40e_aq_clear_default_vsi()
2336 cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_DEFAULT); in i40e_aq_clear_default_vsi()
2337 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_clear_default_vsi()
2372 cmd->promiscuous_flags = CPU_TO_LE16(flags); in i40e_aq_set_vsi_unicast_promiscuous()
2374 cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); in i40e_aq_set_vsi_unicast_promiscuous()
2376 cmd->valid_flags |= in i40e_aq_set_vsi_unicast_promiscuous()
2379 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_set_vsi_unicast_promiscuous()
2407 cmd->promiscuous_flags = CPU_TO_LE16(flags); in i40e_aq_set_vsi_multicast_promiscuous()
2409 cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_MULTICAST); in i40e_aq_set_vsi_multicast_promiscuous()
2411 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_set_vsi_multicast_promiscuous()
2442 cmd->promiscuous_flags = CPU_TO_LE16(flags); in i40e_aq_set_vsi_full_promiscuous()
2444 cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST | in i40e_aq_set_vsi_full_promiscuous()
2448 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_set_vsi_full_promiscuous()
2459 * @vid: The VLAN tag filter - capture any multicast packet with this VLAN tag
2478 cmd->promiscuous_flags = CPU_TO_LE16(flags); in i40e_aq_set_vsi_mc_promisc_on_vlan()
2479 cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_MULTICAST); in i40e_aq_set_vsi_mc_promisc_on_vlan()
2480 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_set_vsi_mc_promisc_on_vlan()
2481 cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); in i40e_aq_set_vsi_mc_promisc_on_vlan()
2493 * @vid: The VLAN tag filter - capture any unicast packet with this VLAN tag
2515 cmd->promiscuous_flags = CPU_TO_LE16(flags); in i40e_aq_set_vsi_uc_promisc_on_vlan()
2516 cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); in i40e_aq_set_vsi_uc_promisc_on_vlan()
2518 cmd->valid_flags |= in i40e_aq_set_vsi_uc_promisc_on_vlan()
2520 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_set_vsi_uc_promisc_on_vlan()
2521 cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); in i40e_aq_set_vsi_uc_promisc_on_vlan()
2533 * @vid: The VLAN tag filter - capture any broadcast packet with this VLAN tag
2552 cmd->promiscuous_flags = CPU_TO_LE16(flags); in i40e_aq_set_vsi_bc_promisc_on_vlan()
2553 cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_BROADCAST); in i40e_aq_set_vsi_bc_promisc_on_vlan()
2554 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_set_vsi_bc_promisc_on_vlan()
2555 cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); in i40e_aq_set_vsi_bc_promisc_on_vlan()
2584 cmd->promiscuous_flags in i40e_aq_set_vsi_broadcast()
2587 cmd->promiscuous_flags in i40e_aq_set_vsi_broadcast()
2590 cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_BROADCAST); in i40e_aq_set_vsi_broadcast()
2591 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_set_vsi_broadcast()
2598 * i40e_aq_set_vsi_vlan_promisc - control the VLAN promiscuous setting
2619 cmd->promiscuous_flags = CPU_TO_LE16(flags); in i40e_aq_set_vsi_vlan_promisc()
2620 cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_VLAN); in i40e_aq_set_vsi_vlan_promisc()
2621 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_set_vsi_vlan_promisc()
2629 * i40e_aq_get_vsi_params - get VSI configuration info
2649 cmd->uplink_seid = CPU_TO_LE16(vsi_ctx->seid); in i40e_aq_get_vsi_params()
2653 status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info, in i40e_aq_get_vsi_params()
2654 sizeof(vsi_ctx->info), NULL); in i40e_aq_get_vsi_params()
2659 vsi_ctx->seid = LE16_TO_CPU(resp->seid); in i40e_aq_get_vsi_params()
2660 vsi_ctx->vsi_number = LE16_TO_CPU(resp->vsi_number); in i40e_aq_get_vsi_params()
2661 vsi_ctx->vsis_allocated = LE16_TO_CPU(resp->vsi_used); in i40e_aq_get_vsi_params()
2662 vsi_ctx->vsis_unallocated = LE16_TO_CPU(resp->vsi_free); in i40e_aq_get_vsi_params()
2690 cmd->uplink_seid = CPU_TO_LE16(vsi_ctx->seid); in i40e_aq_update_vsi_params()
2694 status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info, in i40e_aq_update_vsi_params()
2695 sizeof(vsi_ctx->info), cmd_details); in i40e_aq_update_vsi_params()
2697 vsi_ctx->vsis_allocated = LE16_TO_CPU(resp->vsi_used); in i40e_aq_update_vsi_params()
2698 vsi_ctx->vsis_unallocated = LE16_TO_CPU(resp->vsi_free); in i40e_aq_update_vsi_params()
2728 scfg->seid = CPU_TO_LE16(*start_seid); in i40e_aq_get_switch_config()
2731 *start_seid = LE16_TO_CPU(scfg->seid); in i40e_aq_get_switch_config()
2757 scfg->flags = CPU_TO_LE16(flags); in i40e_aq_set_switch_config()
2758 scfg->valid_flags = CPU_TO_LE16(valid_flags); in i40e_aq_set_switch_config()
2759 scfg->mode = mode; in i40e_aq_set_switch_config()
2760 if (hw->flags & I40E_HW_FLAG_802_1AD_CAPABLE) { in i40e_aq_set_switch_config()
2761 scfg->switch_tag = CPU_TO_LE16(hw->switch_tag); in i40e_aq_set_switch_config()
2762 scfg->first_tag = CPU_TO_LE16(hw->first_tag); in i40e_aq_set_switch_config()
2763 scfg->second_tag = CPU_TO_LE16(hw->second_tag); in i40e_aq_set_switch_config()
2799 *fw_major_version = LE16_TO_CPU(resp->fw_major); in i40e_aq_get_firmware_version()
2801 *fw_minor_version = LE16_TO_CPU(resp->fw_minor); in i40e_aq_get_firmware_version()
2803 *fw_build = LE32_TO_CPU(resp->fw_build); in i40e_aq_get_firmware_version()
2805 *api_major_version = LE16_TO_CPU(resp->api_major); in i40e_aq_get_firmware_version()
2807 *api_minor_version = LE16_TO_CPU(resp->api_minor); in i40e_aq_get_firmware_version()
2845 cmd->driver_major_ver = dv->major_version; in i40e_aq_send_driver_version()
2846 cmd->driver_minor_ver = dv->minor_version; in i40e_aq_send_driver_version()
2847 cmd->driver_build_ver = dv->build_version; in i40e_aq_send_driver_version()
2848 cmd->driver_subbuild_ver = dv->subbuild_version; in i40e_aq_send_driver_version()
2851 while (len < sizeof(dv->driver_string) && in i40e_aq_send_driver_version()
2852 (dv->driver_string[len] < 0x80) && in i40e_aq_send_driver_version()
2853 dv->driver_string[len]) in i40e_aq_send_driver_version()
2855 status = i40e_asq_send_command(hw, &desc, dv->driver_string, in i40e_aq_send_driver_version()
2862 * i40e_get_link_status - get status of the HW network link
2875 if (hw->phy.get_link_info) { in i40e_get_link_status()
2883 *link_up = hw->phy.link_info.link_info & I40E_AQ_LINK_UP; in i40e_get_link_status()
2889 * i40e_update_link_info - update status of the HW network link
2902 if (((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) && in i40e_update_link_info()
2903 ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) || in i40e_update_link_info()
2904 !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) || in i40e_update_link_info()
2905 hw->mac.type == I40E_MAC_X722) { in i40e_update_link_info()
2907 hw->mac.type == in i40e_update_link_info()
2915 hw->phy.link_info.req_fec_info = in i40e_update_link_info()
2919 hw->phy.link_info.req_fec_info = in i40e_update_link_info()
2924 i40e_memcpy(hw->phy.link_info.module_type, &abilities.module_type, in i40e_update_link_info()
2925 sizeof(hw->phy.link_info.module_type), I40E_NONDMA_TO_NONDMA); in i40e_update_link_info()
2942 if (hw->phy.get_link_info) { in i40e_get_link_speed()
2949 speed = hw->phy.link_info.link_speed; in i40e_get_link_speed()
2956 * i40e_aq_add_veb - Insert a VEB between the VSI and the MAC
2989 cmd->uplink_seid = CPU_TO_LE16(uplink_seid); in i40e_aq_add_veb()
2990 cmd->downlink_seid = CPU_TO_LE16(downlink_seid); in i40e_aq_add_veb()
2991 cmd->enable_tcs = enabled_tc; in i40e_aq_add_veb()
3003 cmd->veb_flags = CPU_TO_LE16(veb_flags); in i40e_aq_add_veb()
3008 *veb_seid = LE16_TO_CPU(resp->veb_seid); in i40e_aq_add_veb()
3014 * i40e_aq_get_veb_parameters - Retrieve VEB parameters
3044 cmd_resp->seid = CPU_TO_LE16(veb_seid); in i40e_aq_get_veb_parameters()
3051 *switch_id = LE16_TO_CPU(cmd_resp->switch_id); in i40e_aq_get_veb_parameters()
3053 *statistic_index = LE16_TO_CPU(cmd_resp->statistic_index); in i40e_aq_get_veb_parameters()
3055 *vebs_used = LE16_TO_CPU(cmd_resp->vebs_used); in i40e_aq_get_veb_parameters()
3057 *vebs_free = LE16_TO_CPU(cmd_resp->vebs_free); in i40e_aq_get_veb_parameters()
3059 u16 flags = LE16_TO_CPU(cmd_resp->veb_flags); in i40e_aq_get_veb_parameters()
3099 cmd->num_addresses = CPU_TO_LE16(count); in i40e_aq_add_macvlan()
3100 cmd->seid[0] = CPU_TO_LE16(I40E_AQC_MACVLAN_CMD_SEID_VALID | seid); in i40e_aq_add_macvlan()
3101 cmd->seid[1] = 0; in i40e_aq_add_macvlan()
3102 cmd->seid[2] = 0; in i40e_aq_add_macvlan()
3146 cmd->num_addresses = CPU_TO_LE16(count); in i40e_aq_remove_macvlan()
3147 cmd->seid[0] = CPU_TO_LE16(I40E_AQC_MACVLAN_CMD_SEID_VALID | seid); in i40e_aq_remove_macvlan()
3148 cmd->seid[1] = 0; in i40e_aq_remove_macvlan()
3149 cmd->seid[2] = 0; in i40e_aq_remove_macvlan()
3162 * i40e_mirrorrule_op - Internal helper function to add/delete mirror rule
3196 cmd->seid = CPU_TO_LE16(sw_seid); in i40e_mirrorrule_op()
3197 cmd->rule_type = CPU_TO_LE16(rule_type & in i40e_mirrorrule_op()
3199 cmd->num_entries = CPU_TO_LE16(count); in i40e_mirrorrule_op()
3201 cmd->destination = CPU_TO_LE16(id); in i40e_mirrorrule_op()
3212 hw->aq.asq_last_status == I40E_AQ_RC_ENOSPC) { in i40e_mirrorrule_op()
3214 *rule_id = LE16_TO_CPU(resp->rule_id); in i40e_mirrorrule_op()
3216 *rules_used = LE16_TO_CPU(resp->mirror_rules_used); in i40e_mirrorrule_op()
3218 *rules_free = LE16_TO_CPU(resp->mirror_rules_free); in i40e_mirrorrule_op()
3224 * i40e_aq_add_mirrorrule - add a mirror rule
3255 * i40e_aq_delete_mirrorrule - delete a mirror rule
3290 * i40e_aq_add_vlan - Add VLAN ids to the HW filtering
3314 cmd->num_addresses = CPU_TO_LE16(count); in i40e_aq_add_vlan()
3315 cmd->seid[0] = CPU_TO_LE16(seid | I40E_AQC_MACVLAN_CMD_SEID_VALID); in i40e_aq_add_vlan()
3316 cmd->seid[1] = 0; in i40e_aq_add_vlan()
3317 cmd->seid[2] = 0; in i40e_aq_add_vlan()
3330 * i40e_aq_remove_vlan - Remove VLANs from the HW filtering
3354 cmd->num_addresses = CPU_TO_LE16(count); in i40e_aq_remove_vlan()
3355 cmd->seid[0] = CPU_TO_LE16(seid | I40E_AQC_MACVLAN_CMD_SEID_VALID); in i40e_aq_remove_vlan()
3356 cmd->seid[1] = 0; in i40e_aq_remove_vlan()
3357 cmd->seid[2] = 0; in i40e_aq_remove_vlan()
3373 * @v_opcode: opcodes for VF-PF communication
3391 cmd->id = CPU_TO_LE32(vfid); in i40e_aq_send_msg_to_vf()
3430 cmd_resp->address = CPU_TO_LE32(reg_addr); in i40e_aq_debug_read_register()
3435 *reg_val = ((u64)LE32_TO_CPU(cmd_resp->value_high) << 32) | in i40e_aq_debug_read_register()
3436 (u64)LE32_TO_CPU(cmd_resp->value_low); in i40e_aq_debug_read_register()
3462 cmd->address = CPU_TO_LE32(reg_addr); in i40e_aq_debug_write_register()
3463 cmd->value_high = CPU_TO_LE32((u32)(reg_val >> 32)); in i40e_aq_debug_write_register()
3464 cmd->value_low = CPU_TO_LE32((u32)(reg_val & 0xFFFFFFFF)); in i40e_aq_debug_write_register()
3477 * @timeout: the maximum time in ms that the driver may hold the resource
3497 cmd_resp->resource_id = CPU_TO_LE16(resource); in i40e_aq_request_resource()
3498 cmd_resp->access_type = CPU_TO_LE16(access); in i40e_aq_request_resource()
3499 cmd_resp->resource_number = CPU_TO_LE32(sdp_number); in i40e_aq_request_resource()
3502 /* The completion specifies the maximum time in ms that the driver in i40e_aq_request_resource()
3503 * may hold the resource in the Timeout field. in i40e_aq_request_resource()
3508 if (status == I40E_SUCCESS || hw->aq.asq_last_status == I40E_AQ_RC_EBUSY) in i40e_aq_request_resource()
3509 *timeout = LE32_TO_CPU(cmd_resp->timeout); in i40e_aq_request_resource()
3537 cmd->resource_id = CPU_TO_LE16(resource); in i40e_aq_release_resource()
3538 cmd->resource_number = CPU_TO_LE32(sdp_number); in i40e_aq_release_resource()
3579 cmd->command_flags |= I40E_AQ_NVM_LAST_CMD; in i40e_aq_read_nvm()
3580 cmd->module_pointer = module_pointer; in i40e_aq_read_nvm()
3581 cmd->offset = CPU_TO_LE32(offset); in i40e_aq_read_nvm()
3582 cmd->length = CPU_TO_LE16(length); in i40e_aq_read_nvm()
3595 * i40e_aq_read_nvm_config - read an nvm config block
3619 cmd->cmd_flags = CPU_TO_LE16(cmd_flags); in i40e_aq_read_nvm_config()
3620 cmd->element_id = CPU_TO_LE16((u16)(0xffff & field_id)); in i40e_aq_read_nvm_config()
3622 cmd->element_id_msw = CPU_TO_LE16((u16)(field_id >> 16)); in i40e_aq_read_nvm_config()
3624 cmd->element_id_msw = 0; in i40e_aq_read_nvm_config()
3629 *element_count = LE16_TO_CPU(cmd->element_count); in i40e_aq_read_nvm_config()
3635 * i40e_aq_write_nvm_config - write an nvm config block
3658 cmd->element_count = CPU_TO_LE16(element_count); in i40e_aq_write_nvm_config()
3659 cmd->cmd_flags = CPU_TO_LE16(cmd_flags); in i40e_aq_write_nvm_config()
3685 cmd->command = I40E_AQ_UPDATE_FLOW_END; in i40e_aq_nvm_update_in_process()
3688 cmd->command |= I40E_AQ_UPDATE_FLOW_START; in i40e_aq_nvm_update_in_process()
3696 * i40e_aq_min_rollback_rev_update - triggers an ow after update
3698 * @mode: opt-in mode, 1b for single module update, 0b for bulk update
3714 cmd->optin_mode = mode; in i40e_aq_min_rollback_rev_update()
3715 cmd->module_selected = module; in i40e_aq_min_rollback_rev_update()
3716 cmd->min_rrev = min_rrev; in i40e_aq_min_rollback_rev_update()
3724 * i40e_aq_oem_post_update - triggers an OEM specific flow after update
3778 cmd->command_flags |= I40E_AQ_NVM_LAST_CMD; in i40e_aq_erase_nvm()
3779 cmd->module_pointer = module_pointer; in i40e_aq_erase_nvm()
3780 cmd->offset = CPU_TO_LE32(offset); in i40e_aq_erase_nvm()
3781 cmd->length = CPU_TO_LE16(length); in i40e_aq_erase_nvm()
3814 p = (struct i40e_hw_capabilities *)&hw->dev_caps; in i40e_parse_discover_capabilities()
3816 p = (struct i40e_hw_capabilities *)&hw->func_caps; in i40e_parse_discover_capabilities()
3821 id = LE16_TO_CPU(cap->id); in i40e_parse_discover_capabilities()
3822 number = LE32_TO_CPU(cap->number); in i40e_parse_discover_capabilities()
3823 logical_id = LE32_TO_CPU(cap->logical_id); in i40e_parse_discover_capabilities()
3824 phys_id = LE32_TO_CPU(cap->phys_id); in i40e_parse_discover_capabilities()
3825 major_rev = cap->major_rev; in i40e_parse_discover_capabilities()
3829 p->switch_mode = number; in i40e_parse_discover_capabilities()
3832 p->switch_mode); in i40e_parse_discover_capabilities()
3835 p->management_mode = number; in i40e_parse_discover_capabilities()
3837 p->mng_protocols_over_mctp = logical_id; in i40e_parse_discover_capabilities()
3840 p->mng_protocols_over_mctp); in i40e_parse_discover_capabilities()
3842 p->mng_protocols_over_mctp = 0; in i40e_parse_discover_capabilities()
3846 p->management_mode); in i40e_parse_discover_capabilities()
3849 p->npar_enable = number; in i40e_parse_discover_capabilities()
3852 p->npar_enable); in i40e_parse_discover_capabilities()
3855 p->os2bmc = number; in i40e_parse_discover_capabilities()
3857 "HW Capability: OS2BMC = %d\n", p->os2bmc); in i40e_parse_discover_capabilities()
3860 p->valid_functions = number; in i40e_parse_discover_capabilities()
3863 p->valid_functions); in i40e_parse_discover_capabilities()
3867 p->sr_iov_1_1 = TRUE; in i40e_parse_discover_capabilities()
3869 "HW Capability: SR-IOV = %d\n", in i40e_parse_discover_capabilities()
3870 p->sr_iov_1_1); in i40e_parse_discover_capabilities()
3873 p->num_vfs = number; in i40e_parse_discover_capabilities()
3874 p->vf_base_id = logical_id; in i40e_parse_discover_capabilities()
3877 p->num_vfs); in i40e_parse_discover_capabilities()
3880 p->vf_base_id); in i40e_parse_discover_capabilities()
3884 p->vmdq = TRUE; in i40e_parse_discover_capabilities()
3886 "HW Capability: VMDQ = %d\n", p->vmdq); in i40e_parse_discover_capabilities()
3890 p->evb_802_1_qbg = TRUE; in i40e_parse_discover_capabilities()
3896 p->evb_802_1_qbh = TRUE; in i40e_parse_discover_capabilities()
3901 p->num_vsis = number; in i40e_parse_discover_capabilities()
3904 p->num_vsis); in i40e_parse_discover_capabilities()
3908 p->dcb = TRUE; in i40e_parse_discover_capabilities()
3909 p->enabled_tcmap = logical_id; in i40e_parse_discover_capabilities()
3910 p->maxtc = phys_id; in i40e_parse_discover_capabilities()
3913 "HW Capability: DCB = %d\n", p->dcb); in i40e_parse_discover_capabilities()
3918 "HW Capability: TC Max = %d\n", p->maxtc); in i40e_parse_discover_capabilities()
3922 p->fcoe = TRUE; in i40e_parse_discover_capabilities()
3924 "HW Capability: FCOE = %d\n", p->fcoe); in i40e_parse_discover_capabilities()
3928 p->iscsi = TRUE; in i40e_parse_discover_capabilities()
3930 "HW Capability: iSCSI = %d\n", p->iscsi); in i40e_parse_discover_capabilities()
3933 p->rss = TRUE; in i40e_parse_discover_capabilities()
3934 p->rss_table_size = number; in i40e_parse_discover_capabilities()
3935 p->rss_table_entry_width = logical_id; in i40e_parse_discover_capabilities()
3937 "HW Capability: RSS = %d\n", p->rss); in i40e_parse_discover_capabilities()
3940 p->rss_table_size); in i40e_parse_discover_capabilities()
3943 p->rss_table_entry_width); in i40e_parse_discover_capabilities()
3946 p->num_rx_qp = number; in i40e_parse_discover_capabilities()
3947 p->base_queue = phys_id; in i40e_parse_discover_capabilities()
3952 p->base_queue); in i40e_parse_discover_capabilities()
3955 p->num_tx_qp = number; in i40e_parse_discover_capabilities()
3956 p->base_queue = phys_id; in i40e_parse_discover_capabilities()
3961 p->base_queue); in i40e_parse_discover_capabilities()
3964 p->num_msix_vectors = number; in i40e_parse_discover_capabilities()
3967 p->num_msix_vectors); in i40e_parse_discover_capabilities()
3970 p->num_msix_vectors_vf = number; in i40e_parse_discover_capabilities()
3973 p->num_msix_vectors_vf); in i40e_parse_discover_capabilities()
3978 p->flex10_enable = TRUE; in i40e_parse_discover_capabilities()
3979 p->flex10_capable = TRUE; in i40e_parse_discover_capabilities()
3984 p->flex10_enable = TRUE; in i40e_parse_discover_capabilities()
3986 p->flex10_capable = TRUE; in i40e_parse_discover_capabilities()
3988 p->flex10_mode = logical_id; in i40e_parse_discover_capabilities()
3989 p->flex10_status = phys_id; in i40e_parse_discover_capabilities()
3992 p->flex10_mode); in i40e_parse_discover_capabilities()
3995 p->flex10_status); in i40e_parse_discover_capabilities()
3999 p->mgmt_cem = TRUE; in i40e_parse_discover_capabilities()
4001 "HW Capability: CEM = %d\n", p->mgmt_cem); in i40e_parse_discover_capabilities()
4005 p->iwarp = TRUE; in i40e_parse_discover_capabilities()
4007 "HW Capability: iWARP = %d\n", p->iwarp); in i40e_parse_discover_capabilities()
4011 p->led[phys_id] = TRUE; in i40e_parse_discover_capabilities()
4013 "HW Capability: LED - PIN %d\n", phys_id); in i40e_parse_discover_capabilities()
4017 p->sdp[phys_id] = TRUE; in i40e_parse_discover_capabilities()
4019 "HW Capability: SDP - PIN %d\n", phys_id); in i40e_parse_discover_capabilities()
4023 p->mdio_port_num = phys_id; in i40e_parse_discover_capabilities()
4024 p->mdio_port_mode = logical_id; in i40e_parse_discover_capabilities()
4028 p->mdio_port_num); in i40e_parse_discover_capabilities()
4031 p->mdio_port_mode); in i40e_parse_discover_capabilities()
4035 p->ieee_1588 = TRUE; in i40e_parse_discover_capabilities()
4038 p->ieee_1588); in i40e_parse_discover_capabilities()
4041 p->fd = TRUE; in i40e_parse_discover_capabilities()
4042 p->fd_filters_guaranteed = number; in i40e_parse_discover_capabilities()
4043 p->fd_filters_best_effort = logical_id; in i40e_parse_discover_capabilities()
4048 p->fd_filters_guaranteed); in i40e_parse_discover_capabilities()
4051 p->wr_csr_prot = (u64)number; in i40e_parse_discover_capabilities()
4052 p->wr_csr_prot |= (u64)logical_id << 32; in i40e_parse_discover_capabilities()
4055 (unsigned long long)(p->wr_csr_prot & 0xffff)); in i40e_parse_discover_capabilities()
4058 p->dis_unused_ports = (bool)number; in i40e_parse_discover_capabilities()
4061 p->dis_unused_ports); in i40e_parse_discover_capabilities()
4065 p->sec_rev_disabled = TRUE; in i40e_parse_discover_capabilities()
4067 p->update_disabled = TRUE; in i40e_parse_discover_capabilities()
4070 hw->num_wol_proxy_filters = (u16)number; in i40e_parse_discover_capabilities()
4071 hw->wol_proxy_vsi_seid = (u16)logical_id; in i40e_parse_discover_capabilities()
4072 p->apm_wol_support = phys_id & I40E_WOL_SUPPORT_MASK; in i40e_parse_discover_capabilities()
4074 p->acpi_prog_method = I40E_ACPI_PROGRAMMING_METHOD_AQC_FPK; in i40e_parse_discover_capabilities()
4076 p->acpi_prog_method = I40E_ACPI_PROGRAMMING_METHOD_HW_FVL; in i40e_parse_discover_capabilities()
4077 p->proxy_support = (phys_id & I40E_PROXY_SUPPORT_MASK) ? 1 : 0; in i40e_parse_discover_capabilities()
4080 hw->num_wol_proxy_filters); in i40e_parse_discover_capabilities()
4087 if (p->fcoe) in i40e_parse_discover_capabilities()
4091 p->fcoe = FALSE; in i40e_parse_discover_capabilities()
4094 hw->num_ports = 0; in i40e_parse_discover_capabilities()
4104 hw->num_ports++; in i40e_parse_discover_capabilities()
4114 if (hw->mac.type == I40E_MAC_X722) { in i40e_parse_discover_capabilities()
4122 hw->num_ports = 4; in i40e_parse_discover_capabilities()
4127 valid_functions = p->valid_functions; in i40e_parse_discover_capabilities()
4135 /* partition id is 1-based, and functions are evenly spread in i40e_parse_discover_capabilities()
4138 if (hw->num_ports != 0) { in i40e_parse_discover_capabilities()
4139 hw->partition_id = (hw->pf_id / hw->num_ports) + 1; in i40e_parse_discover_capabilities()
4140 hw->num_partitions = num_functions / hw->num_ports; in i40e_parse_discover_capabilities()
4146 p->rx_buf_chain_len = I40E_MAX_CHAINED_RX_BUFFERS; in i40e_parse_discover_capabilities()
4152 * @buff: a virtual buffer to hold the capabilities
4155 * @list_type_opc: capabilities type to discover - pass in the command opcode
4189 i40e_parse_discover_capabilities(hw, buff, LE32_TO_CPU(cmd->count), in i40e_aq_discover_capabilities()
4231 cmd->command_flags |= I40E_AQ_NVM_LAST_CMD; in i40e_aq_update_nvm()
4232 if (hw->mac.type == I40E_MAC_X722) { in i40e_aq_update_nvm()
4234 cmd->command_flags |= in i40e_aq_update_nvm()
4238 cmd->command_flags |= in i40e_aq_update_nvm()
4242 cmd->module_pointer = module_pointer; in i40e_aq_update_nvm()
4243 cmd->offset = CPU_TO_LE32(offset); in i40e_aq_update_nvm()
4244 cmd->length = CPU_TO_LE16(length); in i40e_aq_update_nvm()
4288 cmd->type = mib_type & I40E_AQ_LLDP_MIB_TYPE_MASK; in i40e_aq_get_lldp_mib()
4289 cmd->type |= ((bridge_type << I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) & in i40e_aq_get_lldp_mib()
4301 *local_len = LE16_TO_CPU(resp->local_len); in i40e_aq_get_lldp_mib()
4303 *remote_len = LE16_TO_CPU(resp->remote_len); in i40e_aq_get_lldp_mib()
4310 * i40e_aq_set_lldp_mib - Set the LLDP MIB
4339 cmd->type = mib_type; in i40e_aq_set_lldp_mib()
4340 cmd->length = CPU_TO_LE16(buff_size); in i40e_aq_set_lldp_mib()
4341 cmd->address_high = CPU_TO_LE32(I40E_HI_DWORD((u64)buff)); in i40e_aq_set_lldp_mib()
4342 cmd->address_low = CPU_TO_LE32(I40E_LO_DWORD((u64)buff)); in i40e_aq_set_lldp_mib()
4369 cmd->command |= I40E_AQ_LLDP_MIB_UPDATE_DISABLE; in i40e_aq_cfg_lldp_mib_change_event()
4395 if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT)) { in i40e_aq_restore_lldp()
4404 cmd->command |= I40E_AQ_LLDP_AGENT_RESTORE; in i40e_aq_restore_lldp()
4409 *setting = cmd->command & 1; in i40e_aq_restore_lldp()
4435 cmd->command |= I40E_AQ_LLDP_AGENT_SHUTDOWN; in i40e_aq_stop_lldp()
4438 if (hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT) in i40e_aq_stop_lldp()
4439 cmd->command |= I40E_AQ_LLDP_AGENT_STOP_PERSIST; in i40e_aq_stop_lldp()
4469 cmd->command = I40E_AQ_LLDP_AGENT_START; in i40e_aq_start_lldp()
4472 if (hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT) in i40e_aq_start_lldp()
4473 cmd->command |= I40E_AQ_LLDP_AGENT_START_PERSIST; in i40e_aq_start_lldp()
4500 if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE)) in i40e_aq_set_dcb_parameters()
4507 cmd->valid_flags = I40E_DCB_VALID; in i40e_aq_set_dcb_parameters()
4508 cmd->command = I40E_AQ_DCB_SET_AGENT; in i40e_aq_set_dcb_parameters()
4544 * i40e_aq_start_stop_dcbx - Start/Stop DCBx service in FW
4566 cmd->command = I40E_AQC_START_SPECIFIC_AGENT_MASK; in i40e_aq_start_stop_dcbx()
4599 cmd->udp_port = CPU_TO_LE16(udp_port); in i40e_aq_add_udp_tunnel()
4600 cmd->protocol_type = protocol_index; in i40e_aq_add_udp_tunnel()
4605 *filter_index = resp->index; in i40e_aq_add_udp_tunnel()
4626 cmd->index = index; in i40e_aq_del_udp_tunnel()
4634 * i40e_aq_get_switch_resource_alloc - command (0x0204) to get allocations
4667 *num_entries = cmd_resp->num_entries; in i40e_aq_get_switch_resource_alloc()
4673 * i40e_aq_delete_element - Delete switch element
4693 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_delete_element()
4700 * i40e_aq_add_pvirt - Instantiate a Port Virtualizer on a port
4709 * 802.1Qbr port virtualizer or a 802.1Qbg S-component.
4726 cmd->command_flags = CPU_TO_LE16(flags); in i40e_aq_add_pvirt()
4727 cmd->uplink_seid = CPU_TO_LE16(mac_seid); in i40e_aq_add_pvirt()
4728 cmd->connected_seid = CPU_TO_LE16(vsi_seid); in i40e_aq_add_pvirt()
4732 *ret_seid = LE16_TO_CPU(resp->pv_seid); in i40e_aq_add_pvirt()
4738 * i40e_aq_add_tag - Add an S/E-tag
4740 * @direct_to_queue: should s-tag direct flow to a specific queue
4748 * This associates an S- or E-tag to a VSI in the switch complex. It returns
4769 cmd->seid = CPU_TO_LE16(vsi_seid); in i40e_aq_add_tag()
4770 cmd->tag = CPU_TO_LE16(tag); in i40e_aq_add_tag()
4772 cmd->flags = CPU_TO_LE16(I40E_AQC_ADD_TAG_FLAG_TO_QUEUE); in i40e_aq_add_tag()
4773 cmd->queue_number = CPU_TO_LE16(queue_num); in i40e_aq_add_tag()
4780 *tags_used = LE16_TO_CPU(resp->tags_used); in i40e_aq_add_tag()
4782 *tags_free = LE16_TO_CPU(resp->tags_free); in i40e_aq_add_tag()
4789 * i40e_aq_remove_tag - Remove an S- or E-tag
4792 * @tag: value of the S-tag to delete
4797 * This deletes an S- or E-tag from a VSI in the switch complex. It returns
4817 cmd->seid = CPU_TO_LE16(vsi_seid); in i40e_aq_remove_tag()
4818 cmd->tag = CPU_TO_LE16(tag); in i40e_aq_remove_tag()
4824 *tags_used = LE16_TO_CPU(resp->tags_used); in i40e_aq_remove_tag()
4826 *tags_free = LE16_TO_CPU(resp->tags_free); in i40e_aq_remove_tag()
4833 * i40e_aq_add_mcast_etag - Add a multicast E-tag
4835 * @pv_seid: Port Virtualizer of this SEID to associate E-tag with
4836 * @etag: value of E-tag to add
4837 * @num_tags_in_buf: number of unicast E-tags in indirect buffer
4839 * @tags_used: return value, number of E-tags in use by this port
4840 * @tags_free: return value, number of unallocated M-tags
4843 * This associates a multicast E-tag to a port virtualizer. It will return
4847 * The indirect buffer pointed to by buf is a list of 2-byte E-tags,
4869 cmd->pv_seid = CPU_TO_LE16(pv_seid); in i40e_aq_add_mcast_etag()
4870 cmd->etag = CPU_TO_LE16(etag); in i40e_aq_add_mcast_etag()
4871 cmd->num_unicast_etags = num_tags_in_buf; in i40e_aq_add_mcast_etag()
4879 *tags_used = LE16_TO_CPU(resp->mcast_etags_used); in i40e_aq_add_mcast_etag()
4881 *tags_free = LE16_TO_CPU(resp->mcast_etags_free); in i40e_aq_add_mcast_etag()
4888 * i40e_aq_remove_mcast_etag - Remove a multicast E-tag
4890 * @pv_seid: Port Virtualizer SEID this M-tag is associated with
4891 * @etag: value of the E-tag to remove
4896 * This deletes an E-tag from the port virtualizer. It will return
4918 cmd->pv_seid = CPU_TO_LE16(pv_seid); in i40e_aq_remove_mcast_etag()
4919 cmd->etag = CPU_TO_LE16(etag); in i40e_aq_remove_mcast_etag()
4925 *tags_used = LE16_TO_CPU(resp->mcast_etags_used); in i40e_aq_remove_mcast_etag()
4927 *tags_free = LE16_TO_CPU(resp->mcast_etags_free); in i40e_aq_remove_mcast_etag()
4934 * i40e_aq_update_tag - Update an S/E-tag
4936 * @vsi_seid: VSI SEID using this S-tag
4964 cmd->seid = CPU_TO_LE16(vsi_seid); in i40e_aq_update_tag()
4965 cmd->old_tag = CPU_TO_LE16(old_tag); in i40e_aq_update_tag()
4966 cmd->new_tag = CPU_TO_LE16(new_tag); in i40e_aq_update_tag()
4972 *tags_used = LE16_TO_CPU(resp->tags_used); in i40e_aq_update_tag()
4974 *tags_free = LE16_TO_CPU(resp->tags_free); in i40e_aq_update_tag()
4981 * i40e_aq_dcb_ignore_pfc - Ignore PFC for given TCs
5003 cmd_resp->command_flags = I40E_AQC_PFC_IGNORE_SET; in i40e_aq_dcb_ignore_pfc()
5005 cmd_resp->tc_bitmap = tcmap; in i40e_aq_dcb_ignore_pfc()
5011 *tcmap_ret = cmd_resp->tc_bitmap; in i40e_aq_dcb_ignore_pfc()
5018 * i40e_aq_dcb_updated - DCB Updated Command
5027 * - PFCLinkDelayAllowance in PRTDCB_GENC.PFCLDA
5028 * - PCIRTT in PRTDCB_GENC.PCIRTT
5029 * - Maximum Frame Size for non-FCoE TCs set by PRTDCB_TDPUC.MAX_TXFRAME.
5048 * i40e_aq_add_statistics - Add a statistics block to a VLAN in a switch.
5073 cmd_resp->seid = CPU_TO_LE16(seid); in i40e_aq_add_statistics()
5074 cmd_resp->vlan = CPU_TO_LE16(vlan_id); in i40e_aq_add_statistics()
5079 *stat_index = LE16_TO_CPU(cmd_resp->stat_index); in i40e_aq_add_statistics()
5085 * i40e_aq_remove_statistics - Remove a statistics block to a VLAN in a switch.
5111 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_remove_statistics()
5112 cmd->vlan = CPU_TO_LE16(vlan_id); in i40e_aq_remove_statistics()
5113 cmd->stat_index = CPU_TO_LE16(stat_index); in i40e_aq_remove_statistics()
5121 * i40e_aq_set_port_parameters - set physical port parameters.
5144 cmd->bad_frame_vsi = CPU_TO_LE16(bad_frame_vsi); in i40e_aq_set_port_parameters()
5151 cmd->command_flags = CPU_TO_LE16(command_flags); in i40e_aq_set_port_parameters()
5159 * i40e_aq_tx_sched_cmd - generic Tx scheduler AQ command handler
5162 * @buff: Indirect buffer to hold data parameters and response
5212 cmd->vsi_seid = CPU_TO_LE16(seid); in i40e_aq_tx_sched_cmd()
5220 * i40e_aq_config_vsi_bw_limit - Configure VSI BW Limit
5239 cmd->vsi_seid = CPU_TO_LE16(seid); in i40e_aq_config_vsi_bw_limit()
5240 cmd->credit = CPU_TO_LE16(credit); in i40e_aq_config_vsi_bw_limit()
5241 cmd->max_credit = max_credit; in i40e_aq_config_vsi_bw_limit()
5249 * i40e_aq_config_switch_comp_bw_limit - Configure Switching component BW Limit
5268 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_config_switch_comp_bw_limit()
5269 cmd->credit = CPU_TO_LE16(credit); in i40e_aq_config_switch_comp_bw_limit()
5270 cmd->max_bw = max_bw; in i40e_aq_config_switch_comp_bw_limit()
5278 * i40e_aq_config_vsi_ets_sla_bw_limit - Config VSI BW Limit per TC
5295 * i40e_aq_config_vsi_tc_bw - Config VSI BW Allocation per TC
5312 * i40e_aq_config_switch_comp_ets_bw_limit - Config Switch comp BW Limit per TC
5329 * i40e_aq_query_vsi_bw_config - Query VSI BW configuration
5332 * @bw_data: Buffer to hold VSI BW configuration
5346 * i40e_aq_query_vsi_ets_sla_config - Query VSI BW configuration per TC
5349 * @bw_data: Buffer to hold VSI BW configuration per TC
5363 * i40e_aq_query_switch_comp_ets_config - Query Switch comp BW config per TC
5366 * @bw_data: Buffer to hold switching component's per TC BW config
5380 * i40e_aq_query_port_ets_config - Query Physical Port ETS configuration
5383 * @bw_data: Buffer to hold current ETS configuration for the Physical Port
5397 * i40e_aq_query_switch_comp_bw_config - Query Switch comp BW configuration
5400 * @bw_data: Buffer to hold switching component's BW configuration
5434 switch (settings->fcoe_filt_num) { in i40e_validate_filter_settings()
5442 fcoe_filt_size <<= (u32)settings->fcoe_filt_num; in i40e_validate_filter_settings()
5448 switch (settings->fcoe_cntx_num) { in i40e_validate_filter_settings()
5454 fcoe_cntx_size <<= (u32)settings->fcoe_cntx_num; in i40e_validate_filter_settings()
5461 switch (settings->pe_filt_num) { in i40e_validate_filter_settings()
5478 switch (settings->pe_cntx_num) { in i40e_validate_filter_settings()
5533 val |= ((u32)settings->pe_filt_num << I40E_PFQF_CTL_0_PEHSIZE_SHIFT) & in i40e_set_filter_control()
5537 val |= ((u32)settings->pe_cntx_num << I40E_PFQF_CTL_0_PEDSIZE_SHIFT) & in i40e_set_filter_control()
5542 val |= ((u32)settings->fcoe_filt_num << in i40e_set_filter_control()
5547 val |= ((u32)settings->fcoe_cntx_num << in i40e_set_filter_control()
5553 if (settings->hash_lut_size == I40E_HASH_LUT_SIZE_512) in i40e_set_filter_control()
5559 if (settings->enable_fdir) in i40e_set_filter_control()
5561 if (settings->enable_ethtype) in i40e_set_filter_control()
5563 if (settings->enable_macvlan) in i40e_set_filter_control()
5572 * i40e_aq_add_rem_control_packet_filter - Add or Remove Control Packet Filter
5580 * @stats: Structure to hold information on control filter counts
5608 cmd->queue = CPU_TO_LE16(queue); in i40e_aq_add_rem_control_packet_filter()
5615 i40e_memcpy(cmd->mac, mac_addr, ETH_ALEN, in i40e_aq_add_rem_control_packet_filter()
5618 cmd->etype = CPU_TO_LE16(ethtype); in i40e_aq_add_rem_control_packet_filter()
5619 cmd->flags = CPU_TO_LE16(flags); in i40e_aq_add_rem_control_packet_filter()
5620 cmd->seid = CPU_TO_LE16(vsi_seid); in i40e_aq_add_rem_control_packet_filter()
5625 stats->mac_etype_used = LE16_TO_CPU(resp->mac_etype_used); in i40e_aq_add_rem_control_packet_filter()
5626 stats->etype_used = LE16_TO_CPU(resp->etype_used); in i40e_aq_add_rem_control_packet_filter()
5627 stats->mac_etype_free = LE16_TO_CPU(resp->mac_etype_free); in i40e_aq_add_rem_control_packet_filter()
5628 stats->etype_free = LE16_TO_CPU(resp->etype_free); in i40e_aq_add_rem_control_packet_filter()
5635 * i40e_add_filter_to_drop_tx_flow_control_frames- filter to drop flow control
5657 * i40e_fix_up_geneve_vni - adjust Geneve VNI for HW issue
5714 cmd->num_filters = filter_count; in i40e_aq_add_cloud_filters()
5715 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_add_cloud_filters()
5754 cmd->num_filters = filter_count; in i40e_aq_add_cloud_filters_bb()
5755 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_add_cloud_filters_bb()
5756 cmd->big_buffer_flag = I40E_AQC_ADD_CLOUD_CMD_BB; in i40e_aq_add_cloud_filters_bb()
5810 cmd->num_filters = filter_count; in i40e_aq_rem_cloud_filters()
5811 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_rem_cloud_filters()
5850 cmd->num_filters = filter_count; in i40e_aq_rem_cloud_filters_bb()
5851 cmd->seid = CPU_TO_LE16(seid); in i40e_aq_rem_cloud_filters_bb()
5852 cmd->big_buffer_flag = I40E_AQC_ADD_CLOUD_CMD_BB; in i40e_aq_rem_cloud_filters_bb()
5878 * i40e_aq_replace_cloud_filters - Replace cloud filter command
5896 if (hw->mac.type == I40E_MAC_X722) in i40e_aq_replace_cloud_filters()
5900 if (hw->aq.fw_maj_ver < 6) in i40e_aq_replace_cloud_filters()
5908 cmd->old_filter_type = filters->old_filter_type; in i40e_aq_replace_cloud_filters()
5909 cmd->new_filter_type = filters->new_filter_type; in i40e_aq_replace_cloud_filters()
5910 cmd->valid_flags = filters->valid_flags; in i40e_aq_replace_cloud_filters()
5911 cmd->tr_bit = filters->tr_bit; in i40e_aq_replace_cloud_filters()
5912 cmd->tr_bit2 = filters->tr_bit2; in i40e_aq_replace_cloud_filters()
5919 cmd_buf->filters[i / 4].filter_type = cmd_buf->data[i]; in i40e_aq_replace_cloud_filters()
5920 cmd_buf->filters[i / 4].input[0] = cmd_buf->data[i + 1]; in i40e_aq_replace_cloud_filters()
5921 cmd_buf->filters[i / 4].input[1] = cmd_buf->data[i + 2]; in i40e_aq_replace_cloud_filters()
5922 cmd_buf->filters[i / 4].input[2] = cmd_buf->data[i + 3]; in i40e_aq_replace_cloud_filters()
5951 cmd_resp->address0 = CPU_TO_LE32(reg_addr0); in i40e_aq_alternate_write()
5952 cmd_resp->address1 = CPU_TO_LE32(reg_addr1); in i40e_aq_alternate_write()
5953 cmd_resp->data0 = CPU_TO_LE32(reg_val0); in i40e_aq_alternate_write()
5954 cmd_resp->data1 = CPU_TO_LE32(reg_val1); in i40e_aq_alternate_write()
5992 cmd_resp->address = CPU_TO_LE32(addr); in i40e_aq_alternate_write_indirect()
5993 cmd_resp->length = CPU_TO_LE32(dw_count); in i40e_aq_alternate_write_indirect()
6027 cmd_resp->address0 = CPU_TO_LE32(reg_addr0); in i40e_aq_alternate_read()
6028 cmd_resp->address1 = CPU_TO_LE32(reg_addr1); in i40e_aq_alternate_read()
6033 *reg_val0 = LE32_TO_CPU(cmd_resp->data0); in i40e_aq_alternate_read()
6036 *reg_val1 = LE32_TO_CPU(cmd_resp->data1); in i40e_aq_alternate_read()
6073 cmd_resp->address = CPU_TO_LE32(addr); in i40e_aq_alternate_read_indirect()
6074 cmd_resp->length = CPU_TO_LE32(dw_count); in i40e_aq_alternate_read_indirect()
6126 cmd->cmd_flags = CPU_TO_LE16(bios_mode); in i40e_aq_alternate_write_done()
6130 *reset_needed = ((LE16_TO_CPU(cmd->cmd_flags) & in i40e_aq_alternate_write_done()
6156 cmd->cmd_flags = CPU_TO_LE16(oem_mode); in i40e_aq_set_oem_mode()
6184 * i40e_set_pci_config_data - store PCI bus info
6192 hw->bus.type = i40e_bus_type_pci_express; in i40e_set_pci_config_data()
6196 hw->bus.width = i40e_bus_width_pcie_x1; in i40e_set_pci_config_data()
6199 hw->bus.width = i40e_bus_width_pcie_x2; in i40e_set_pci_config_data()
6202 hw->bus.width = i40e_bus_width_pcie_x4; in i40e_set_pci_config_data()
6205 hw->bus.width = i40e_bus_width_pcie_x8; in i40e_set_pci_config_data()
6208 hw->bus.width = i40e_bus_width_unknown; in i40e_set_pci_config_data()
6214 hw->bus.speed = i40e_bus_speed_2500; in i40e_set_pci_config_data()
6217 hw->bus.speed = i40e_bus_speed_5000; in i40e_set_pci_config_data()
6220 hw->bus.speed = i40e_bus_speed_8000; in i40e_set_pci_config_data()
6223 hw->bus.speed = i40e_bus_speed_unknown; in i40e_set_pci_config_data()
6267 cmd->cluster_id = cluster_id; in i40e_aq_debug_dump()
6268 cmd->table_id = table_id; in i40e_aq_debug_dump()
6269 cmd->idx = CPU_TO_LE32(start_index); in i40e_aq_debug_dump()
6278 *ret_next_table = resp->table_id; in i40e_aq_debug_dump()
6280 *ret_next_index = LE32_TO_CPU(resp->idx); in i40e_aq_debug_dump()
6371 (I40E_ALT_STRUCT_DWORDS_PER_PF * hw->pf_id); in i40e_read_bw_from_alt_ram()
6374 (I40E_ALT_STRUCT_DWORDS_PER_PF * hw->pf_id); in i40e_read_bw_from_alt_ram()
6436 u8 port_num = (u8)hw->func_caps.mdio_port_num; in i40e_read_phy_register_clause22()
6453 retry--; in i40e_read_phy_register_clause22()
6481 u8 port_num = (u8)hw->func_caps.mdio_port_num; in i40e_write_phy_register_clause22()
6502 retry--; in i40e_write_phy_register_clause22()
6524 u8 port_num = (u8)hw->func_caps.mdio_port_num; in i40e_read_phy_register_clause45()
6541 retry--; in i40e_read_phy_register_clause45()
6566 retry--; in i40e_read_phy_register_clause45()
6598 u8 port_num = (u8)hw->func_caps.mdio_port_num; in i40e_write_phy_register_clause45()
6615 retry--; in i40e_write_phy_register_clause45()
6642 retry--; in i40e_write_phy_register_clause45()
6664 switch (hw->device_id) { in i40e_write_phy_register()
6703 switch (hw->device_id) { in i40e_read_phy_register()
6736 u8 port_num = (u8)hw->func_caps.mdio_port_num; in i40e_get_phy_address()
6817 * i40e_led_get_reg - read LED register
6829 if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) { in i40e_led_get_reg()
6836 phy_addr = i40e_get_phy_address(hw, hw->port); in i40e_led_get_reg()
6846 * i40e_led_set_reg - write LED register
6857 if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) { in i40e_led_set_reg()
6864 phy_addr = i40e_get_phy_address(hw, hw->port); in i40e_led_set_reg()
6875 * i40e_led_get_phy - return current on/off mode
6891 if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) { in i40e_led_get_phy()
6902 phy_addr = i40e_get_phy_address(hw, hw->port); in i40e_led_get_phy()
6969 * i40e_get_phy_lpi_status - read LPI status from PHY or MAC register
6984 stat->rx_lpi_status = 0; in i40e_get_phy_lpi_status()
6985 stat->tx_lpi_status = 0; in i40e_get_phy_lpi_status()
6988 (hw->device_id == I40E_DEV_ID_10G_BASE_T_BC || in i40e_get_phy_lpi_status()
6989 hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) && in i40e_get_phy_lpi_status()
6990 (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB || in i40e_get_phy_lpi_status()
6991 hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB); in i40e_get_phy_lpi_status()
6993 hw->device_id == I40E_DEV_ID_1G_BASE_T_X722; in i40e_get_phy_lpi_status()
7007 stat->rx_lpi_status = !!(val & I40E_BCM_PHY_PCS_STATUS1_RX_LPI); in i40e_get_phy_lpi_status()
7008 stat->tx_lpi_status = !!(val & I40E_BCM_PHY_PCS_STATUS1_TX_LPI); in i40e_get_phy_lpi_status()
7014 stat->rx_lpi_status = (val & I40E_PRTPM_EEE_STAT_RX_LPI_STATUS_MASK) >> in i40e_get_phy_lpi_status()
7016 stat->tx_lpi_status = (val & I40E_PRTPM_EEE_STAT_TX_LPI_STATUS_MASK) >> in i40e_get_phy_lpi_status()
7023 * i40e_get_lpi_counters - read LPI counters from EEE statistics
7036 /* only X710-T*L requires special handling of counters in i40e_get_lpi_counters()
7039 if ((hw->device_id == I40E_DEV_ID_10G_BASE_T_BC || in i40e_get_lpi_counters()
7040 hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) && in i40e_get_lpi_counters()
7041 hw->phy.link_info.link_speed != I40E_LINK_SPEED_1GB) { in i40e_get_lpi_counters()
7065 * i40e_get_lpi_duration - read LPI time duration from EEE statistics
7082 if (hw->device_id != I40E_DEV_ID_10G_BASE_T_BC && in i40e_get_lpi_duration()
7083 hw->device_id != I40E_DEV_ID_5G_BASE_T_BC) in i40e_get_lpi_duration()
7097 if (hw->phy.link_info.link_speed == I40E_LINK_SPEED_1GB && in i40e_get_lpi_duration()
7099 stat->tx_lpi_status && stat->rx_lpi_status) { in i40e_get_lpi_duration()
7122 * i40e_lpi_stat_update - update LPI counters with values relative to offset
7156 (u32)(tx_counter - *tx_offset) : in i40e_lpi_stat_update()
7157 (u32)((tx_counter + BIT_ULL(32)) - *tx_offset); in i40e_lpi_stat_update()
7159 (u32)(rx_counter - *rx_offset) : in i40e_lpi_stat_update()
7160 (u32)((rx_counter + BIT_ULL(32)) - *rx_offset); in i40e_lpi_stat_update()
7167 * i40e_aq_rx_ctl_read_register - use FW to read from an Rx control register
7190 cmd_resp->address = CPU_TO_LE32(reg_addr); in i40e_aq_rx_ctl_read_register()
7195 *reg_val = LE32_TO_CPU(cmd_resp->value); in i40e_aq_rx_ctl_read_register()
7201 * i40e_read_rx_ctl - read from an Rx control register
7212 use_register = (((hw->aq.api_maj_ver == 1) && in i40e_read_rx_ctl()
7213 (hw->aq.api_min_ver < 5)) || in i40e_read_rx_ctl()
7214 (hw->mac.type == I40E_MAC_X722)); in i40e_read_rx_ctl()
7218 if (hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN && retry) { in i40e_read_rx_ctl()
7220 retry--; in i40e_read_rx_ctl()
7225 /* if the AQ access failed, try the old-fashioned way */ in i40e_read_rx_ctl()
7253 cmd->address = CPU_TO_LE32(reg_addr); in i40e_aq_rx_ctl_write_register()
7254 cmd->value = CPU_TO_LE32(reg_val); in i40e_aq_rx_ctl_write_register()
7262 * i40e_write_rx_ctl - write to an Rx control register
7273 use_register = (((hw->aq.api_maj_ver == 1) && in i40e_write_rx_ctl()
7274 (hw->aq.api_min_ver < 5)) || in i40e_write_rx_ctl()
7275 (hw->mac.type == I40E_MAC_X722)); in i40e_write_rx_ctl()
7280 if (hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN && retry) { in i40e_write_rx_ctl()
7282 retry--; in i40e_write_rx_ctl()
7287 /* if the AQ access failed, try the old-fashioned way */ in i40e_write_rx_ctl()
7293 * i40e_mdio_if_number_selection - MDIO I/F number selection
7303 if (set_mdio && cmd->phy_interface == I40E_AQ_PHY_REG_ACCESS_EXTERNAL) { in i40e_mdio_if_number_selection()
7304 if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_EXTENDED) in i40e_mdio_if_number_selection()
7305 cmd->cmd_flags |= in i40e_mdio_if_number_selection()
7347 cmd->phy_interface = phy_select; in i40e_aq_set_phy_register_ext()
7348 cmd->dev_addres = dev_addr; in i40e_aq_set_phy_register_ext()
7349 cmd->reg_address = CPU_TO_LE32(reg_addr); in i40e_aq_set_phy_register_ext()
7350 cmd->reg_value = CPU_TO_LE32(reg_val); in i40e_aq_set_phy_register_ext()
7353 cmd->cmd_flags = I40E_AQ_PHY_REG_ACCESS_DONT_CHANGE_QSFP_PAGE; in i40e_aq_set_phy_register_ext()
7393 cmd->phy_interface = phy_select; in i40e_aq_get_phy_register_ext()
7394 cmd->dev_addres = dev_addr; in i40e_aq_get_phy_register_ext()
7395 cmd->reg_address = CPU_TO_LE32(reg_addr); in i40e_aq_get_phy_register_ext()
7398 cmd->cmd_flags = I40E_AQ_PHY_REG_ACCESS_DONT_CHANGE_QSFP_PAGE; in i40e_aq_get_phy_register_ext()
7404 *reg_val = LE32_TO_CPU(cmd->reg_value); in i40e_aq_get_phy_register_ext()
7440 cmd->activity_id = CPU_TO_LE16(activity_id); in i40e_aq_run_phy_activity()
7441 cmd->params.cmd.dnl_opcode = CPU_TO_LE32(dnl_opcode); in i40e_aq_run_phy_activity()
7447 *cmd_status = LE32_TO_CPU(cmd->params.resp.cmd_status); in i40e_aq_run_phy_activity()
7448 *data0 = LE32_TO_CPU(cmd->params.resp.data0); in i40e_aq_run_phy_activity()
7449 *data1 = LE32_TO_CPU(cmd->params.resp.data1); in i40e_aq_run_phy_activity()
7458 * @v_opcode: opcodes for VF-PF communication
7513 vsi_res = &msg->vsi_res[0]; in i40e_vf_parse_hw_config()
7515 hw->dev_caps.num_vsis = msg->num_vsis; in i40e_vf_parse_hw_config()
7516 hw->dev_caps.num_rx_qp = msg->num_queue_pairs; in i40e_vf_parse_hw_config()
7517 hw->dev_caps.num_tx_qp = msg->num_queue_pairs; in i40e_vf_parse_hw_config()
7518 hw->dev_caps.num_msix_vectors_vf = msg->max_vectors; in i40e_vf_parse_hw_config()
7519 hw->dev_caps.dcb = msg->vf_cap_flags & in i40e_vf_parse_hw_config()
7521 hw->dev_caps.iwarp = (msg->vf_cap_flags & in i40e_vf_parse_hw_config()
7523 for (i = 0; i < msg->num_vsis; i++) { in i40e_vf_parse_hw_config()
7524 if (vsi_res->vsi_type == VIRTCHNL_VSI_SRIOV) { in i40e_vf_parse_hw_config()
7525 i40e_memcpy(hw->mac.perm_addr, in i40e_vf_parse_hw_config()
7526 vsi_res->default_mac_addr, in i40e_vf_parse_hw_config()
7529 i40e_memcpy(hw->mac.addr, vsi_res->default_mac_addr, in i40e_vf_parse_hw_config()
7557 * Set ARP offload parameters from pre-populated
7594 * from pre-populated i40e_aqc_ns_proxy_data struct
7627 * @filter_index: index of filter to modify (0-7)
7630 * @no_wol_tco: if TRUE, pass through packets cannot cause wake-up
7631 * if FALSE, pass through packets may cause wake-up
7657 cmd->filter_index = CPU_TO_LE16(filter_index); in i40e_aq_set_clear_wol_filter()
7669 cmd->cmd_flags = CPU_TO_LE16(cmd_flags); in i40e_aq_set_clear_wol_filter()
7675 cmd->valid_flags = CPU_TO_LE16(valid_flags); in i40e_aq_set_clear_wol_filter()
7683 cmd->address_high = CPU_TO_LE32(I40E_HI_DWORD((u64)filter)); in i40e_aq_set_clear_wol_filter()
7684 cmd->address_low = CPU_TO_LE32(I40E_LO_DWORD((u64)filter)); in i40e_aq_set_clear_wol_filter()
7714 *wake_reason = LE16_TO_CPU(resp->wake_reason); in i40e_aq_get_wake_event_reason()