161ae650dSJack F Vogel /****************************************************************************** 261ae650dSJack F Vogel 3b6c8f260SJack F Vogel Copyright (c) 2013-2015, Intel Corporation 461ae650dSJack F Vogel All rights reserved. 561ae650dSJack F Vogel 661ae650dSJack F Vogel Redistribution and use in source and binary forms, with or without 761ae650dSJack F Vogel modification, are permitted provided that the following conditions are met: 861ae650dSJack F Vogel 961ae650dSJack F Vogel 1. Redistributions of source code must retain the above copyright notice, 1061ae650dSJack F Vogel this list of conditions and the following disclaimer. 1161ae650dSJack F Vogel 1261ae650dSJack F Vogel 2. Redistributions in binary form must reproduce the above copyright 1361ae650dSJack F Vogel notice, this list of conditions and the following disclaimer in the 1461ae650dSJack F Vogel documentation and/or other materials provided with the distribution. 1561ae650dSJack F Vogel 1661ae650dSJack F Vogel 3. Neither the name of the Intel Corporation nor the names of its 1761ae650dSJack F Vogel contributors may be used to endorse or promote products derived from 1861ae650dSJack F Vogel this software without specific prior written permission. 1961ae650dSJack F Vogel 2061ae650dSJack F Vogel THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2161ae650dSJack F Vogel AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2261ae650dSJack F Vogel IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2361ae650dSJack F Vogel ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 2461ae650dSJack F Vogel LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2561ae650dSJack F Vogel CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2661ae650dSJack F Vogel SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2761ae650dSJack F Vogel INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2861ae650dSJack F Vogel CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2961ae650dSJack F Vogel ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3061ae650dSJack F Vogel POSSIBILITY OF SUCH DAMAGE. 3161ae650dSJack F Vogel 3261ae650dSJack F Vogel ******************************************************************************/ 3361ae650dSJack F Vogel /*$FreeBSD$*/ 3461ae650dSJack F Vogel 3561ae650dSJack F Vogel #ifndef _I40E_ADMINQ_CMD_H_ 3661ae650dSJack F Vogel #define _I40E_ADMINQ_CMD_H_ 3761ae650dSJack F Vogel 3861ae650dSJack F Vogel /* This header file defines the i40e Admin Queue commands and is shared between 3961ae650dSJack F Vogel * i40e Firmware and Software. 4061ae650dSJack F Vogel * 4161ae650dSJack F Vogel * This file needs to comply with the Linux Kernel coding style. 4261ae650dSJack F Vogel */ 4361ae650dSJack F Vogel 4461ae650dSJack F Vogel #define I40E_FW_API_VERSION_MAJOR 0x0001 45fdb6f38aSEric Joyner #define I40E_FW_API_VERSION_MINOR 0x0005 4661ae650dSJack F Vogel 4761ae650dSJack F Vogel struct i40e_aq_desc { 4861ae650dSJack F Vogel __le16 flags; 4961ae650dSJack F Vogel __le16 opcode; 5061ae650dSJack F Vogel __le16 datalen; 5161ae650dSJack F Vogel __le16 retval; 5261ae650dSJack F Vogel __le32 cookie_high; 5361ae650dSJack F Vogel __le32 cookie_low; 5461ae650dSJack F Vogel union { 5561ae650dSJack F Vogel struct { 5661ae650dSJack F Vogel __le32 param0; 5761ae650dSJack F Vogel __le32 param1; 5861ae650dSJack F Vogel __le32 param2; 5961ae650dSJack F Vogel __le32 param3; 6061ae650dSJack F Vogel } internal; 6161ae650dSJack F Vogel struct { 6261ae650dSJack F Vogel __le32 param0; 6361ae650dSJack F Vogel __le32 param1; 6461ae650dSJack F Vogel __le32 addr_high; 6561ae650dSJack F Vogel __le32 addr_low; 6661ae650dSJack F Vogel } external; 6761ae650dSJack F Vogel u8 raw[16]; 6861ae650dSJack F Vogel } params; 6961ae650dSJack F Vogel }; 7061ae650dSJack F Vogel 7161ae650dSJack F Vogel /* Flags sub-structure 7261ae650dSJack F Vogel * |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |10 |11 |12 |13 |14 |15 | 7361ae650dSJack F Vogel * |DD |CMP|ERR|VFE| * * RESERVED * * |LB |RD |VFC|BUF|SI |EI |FE | 7461ae650dSJack F Vogel */ 7561ae650dSJack F Vogel 7661ae650dSJack F Vogel /* command flags and offsets*/ 7761ae650dSJack F Vogel #define I40E_AQ_FLAG_DD_SHIFT 0 7861ae650dSJack F Vogel #define I40E_AQ_FLAG_CMP_SHIFT 1 7961ae650dSJack F Vogel #define I40E_AQ_FLAG_ERR_SHIFT 2 8061ae650dSJack F Vogel #define I40E_AQ_FLAG_VFE_SHIFT 3 8161ae650dSJack F Vogel #define I40E_AQ_FLAG_LB_SHIFT 9 8261ae650dSJack F Vogel #define I40E_AQ_FLAG_RD_SHIFT 10 8361ae650dSJack F Vogel #define I40E_AQ_FLAG_VFC_SHIFT 11 8461ae650dSJack F Vogel #define I40E_AQ_FLAG_BUF_SHIFT 12 8561ae650dSJack F Vogel #define I40E_AQ_FLAG_SI_SHIFT 13 8661ae650dSJack F Vogel #define I40E_AQ_FLAG_EI_SHIFT 14 8761ae650dSJack F Vogel #define I40E_AQ_FLAG_FE_SHIFT 15 8861ae650dSJack F Vogel 8961ae650dSJack F Vogel #define I40E_AQ_FLAG_DD (1 << I40E_AQ_FLAG_DD_SHIFT) /* 0x1 */ 9061ae650dSJack F Vogel #define I40E_AQ_FLAG_CMP (1 << I40E_AQ_FLAG_CMP_SHIFT) /* 0x2 */ 9161ae650dSJack F Vogel #define I40E_AQ_FLAG_ERR (1 << I40E_AQ_FLAG_ERR_SHIFT) /* 0x4 */ 9261ae650dSJack F Vogel #define I40E_AQ_FLAG_VFE (1 << I40E_AQ_FLAG_VFE_SHIFT) /* 0x8 */ 9361ae650dSJack F Vogel #define I40E_AQ_FLAG_LB (1 << I40E_AQ_FLAG_LB_SHIFT) /* 0x200 */ 9461ae650dSJack F Vogel #define I40E_AQ_FLAG_RD (1 << I40E_AQ_FLAG_RD_SHIFT) /* 0x400 */ 9561ae650dSJack F Vogel #define I40E_AQ_FLAG_VFC (1 << I40E_AQ_FLAG_VFC_SHIFT) /* 0x800 */ 9661ae650dSJack F Vogel #define I40E_AQ_FLAG_BUF (1 << I40E_AQ_FLAG_BUF_SHIFT) /* 0x1000 */ 9761ae650dSJack F Vogel #define I40E_AQ_FLAG_SI (1 << I40E_AQ_FLAG_SI_SHIFT) /* 0x2000 */ 9861ae650dSJack F Vogel #define I40E_AQ_FLAG_EI (1 << I40E_AQ_FLAG_EI_SHIFT) /* 0x4000 */ 9961ae650dSJack F Vogel #define I40E_AQ_FLAG_FE (1 << I40E_AQ_FLAG_FE_SHIFT) /* 0x8000 */ 10061ae650dSJack F Vogel 10161ae650dSJack F Vogel /* error codes */ 10261ae650dSJack F Vogel enum i40e_admin_queue_err { 10361ae650dSJack F Vogel I40E_AQ_RC_OK = 0, /* success */ 10461ae650dSJack F Vogel I40E_AQ_RC_EPERM = 1, /* Operation not permitted */ 10561ae650dSJack F Vogel I40E_AQ_RC_ENOENT = 2, /* No such element */ 10661ae650dSJack F Vogel I40E_AQ_RC_ESRCH = 3, /* Bad opcode */ 10761ae650dSJack F Vogel I40E_AQ_RC_EINTR = 4, /* operation interrupted */ 10861ae650dSJack F Vogel I40E_AQ_RC_EIO = 5, /* I/O error */ 10961ae650dSJack F Vogel I40E_AQ_RC_ENXIO = 6, /* No such resource */ 11061ae650dSJack F Vogel I40E_AQ_RC_E2BIG = 7, /* Arg too long */ 11161ae650dSJack F Vogel I40E_AQ_RC_EAGAIN = 8, /* Try again */ 11261ae650dSJack F Vogel I40E_AQ_RC_ENOMEM = 9, /* Out of memory */ 11361ae650dSJack F Vogel I40E_AQ_RC_EACCES = 10, /* Permission denied */ 11461ae650dSJack F Vogel I40E_AQ_RC_EFAULT = 11, /* Bad address */ 11561ae650dSJack F Vogel I40E_AQ_RC_EBUSY = 12, /* Device or resource busy */ 11661ae650dSJack F Vogel I40E_AQ_RC_EEXIST = 13, /* object already exists */ 11761ae650dSJack F Vogel I40E_AQ_RC_EINVAL = 14, /* Invalid argument */ 11861ae650dSJack F Vogel I40E_AQ_RC_ENOTTY = 15, /* Not a typewriter */ 11961ae650dSJack F Vogel I40E_AQ_RC_ENOSPC = 16, /* No space left or alloc failure */ 12061ae650dSJack F Vogel I40E_AQ_RC_ENOSYS = 17, /* Function not implemented */ 12161ae650dSJack F Vogel I40E_AQ_RC_ERANGE = 18, /* Parameter out of range */ 12261ae650dSJack F Vogel I40E_AQ_RC_EFLUSHED = 19, /* Cmd flushed due to prev cmd error */ 12361ae650dSJack F Vogel I40E_AQ_RC_BAD_ADDR = 20, /* Descriptor contains a bad pointer */ 12461ae650dSJack F Vogel I40E_AQ_RC_EMODE = 21, /* Op not allowed in current dev mode */ 12561ae650dSJack F Vogel I40E_AQ_RC_EFBIG = 22, /* File too large */ 12661ae650dSJack F Vogel }; 12761ae650dSJack F Vogel 12861ae650dSJack F Vogel /* Admin Queue command opcodes */ 12961ae650dSJack F Vogel enum i40e_admin_queue_opc { 13061ae650dSJack F Vogel /* aq commands */ 13161ae650dSJack F Vogel i40e_aqc_opc_get_version = 0x0001, 13261ae650dSJack F Vogel i40e_aqc_opc_driver_version = 0x0002, 13361ae650dSJack F Vogel i40e_aqc_opc_queue_shutdown = 0x0003, 13461ae650dSJack F Vogel i40e_aqc_opc_set_pf_context = 0x0004, 13561ae650dSJack F Vogel 13661ae650dSJack F Vogel /* resource ownership */ 13761ae650dSJack F Vogel i40e_aqc_opc_request_resource = 0x0008, 13861ae650dSJack F Vogel i40e_aqc_opc_release_resource = 0x0009, 13961ae650dSJack F Vogel 14061ae650dSJack F Vogel i40e_aqc_opc_list_func_capabilities = 0x000A, 14161ae650dSJack F Vogel i40e_aqc_opc_list_dev_capabilities = 0x000B, 14261ae650dSJack F Vogel 14361ae650dSJack F Vogel /* LAA */ 14461ae650dSJack F Vogel i40e_aqc_opc_mac_address_read = 0x0107, 14561ae650dSJack F Vogel i40e_aqc_opc_mac_address_write = 0x0108, 14661ae650dSJack F Vogel 14761ae650dSJack F Vogel /* PXE */ 14861ae650dSJack F Vogel i40e_aqc_opc_clear_pxe_mode = 0x0110, 14961ae650dSJack F Vogel 15061ae650dSJack F Vogel /* internal switch commands */ 15161ae650dSJack F Vogel i40e_aqc_opc_get_switch_config = 0x0200, 15261ae650dSJack F Vogel i40e_aqc_opc_add_statistics = 0x0201, 15361ae650dSJack F Vogel i40e_aqc_opc_remove_statistics = 0x0202, 15461ae650dSJack F Vogel i40e_aqc_opc_set_port_parameters = 0x0203, 15561ae650dSJack F Vogel i40e_aqc_opc_get_switch_resource_alloc = 0x0204, 156fdb6f38aSEric Joyner i40e_aqc_opc_set_switch_config = 0x0205, 15761ae650dSJack F Vogel 15861ae650dSJack F Vogel i40e_aqc_opc_add_vsi = 0x0210, 15961ae650dSJack F Vogel i40e_aqc_opc_update_vsi_parameters = 0x0211, 16061ae650dSJack F Vogel i40e_aqc_opc_get_vsi_parameters = 0x0212, 16161ae650dSJack F Vogel 16261ae650dSJack F Vogel i40e_aqc_opc_add_pv = 0x0220, 16361ae650dSJack F Vogel i40e_aqc_opc_update_pv_parameters = 0x0221, 16461ae650dSJack F Vogel i40e_aqc_opc_get_pv_parameters = 0x0222, 16561ae650dSJack F Vogel 16661ae650dSJack F Vogel i40e_aqc_opc_add_veb = 0x0230, 16761ae650dSJack F Vogel i40e_aqc_opc_update_veb_parameters = 0x0231, 16861ae650dSJack F Vogel i40e_aqc_opc_get_veb_parameters = 0x0232, 16961ae650dSJack F Vogel 17061ae650dSJack F Vogel i40e_aqc_opc_delete_element = 0x0243, 17161ae650dSJack F Vogel 17261ae650dSJack F Vogel i40e_aqc_opc_add_macvlan = 0x0250, 17361ae650dSJack F Vogel i40e_aqc_opc_remove_macvlan = 0x0251, 17461ae650dSJack F Vogel i40e_aqc_opc_add_vlan = 0x0252, 17561ae650dSJack F Vogel i40e_aqc_opc_remove_vlan = 0x0253, 17661ae650dSJack F Vogel i40e_aqc_opc_set_vsi_promiscuous_modes = 0x0254, 17761ae650dSJack F Vogel i40e_aqc_opc_add_tag = 0x0255, 17861ae650dSJack F Vogel i40e_aqc_opc_remove_tag = 0x0256, 17961ae650dSJack F Vogel i40e_aqc_opc_add_multicast_etag = 0x0257, 18061ae650dSJack F Vogel i40e_aqc_opc_remove_multicast_etag = 0x0258, 18161ae650dSJack F Vogel i40e_aqc_opc_update_tag = 0x0259, 18261ae650dSJack F Vogel i40e_aqc_opc_add_control_packet_filter = 0x025A, 18361ae650dSJack F Vogel i40e_aqc_opc_remove_control_packet_filter = 0x025B, 18461ae650dSJack F Vogel i40e_aqc_opc_add_cloud_filters = 0x025C, 18561ae650dSJack F Vogel i40e_aqc_opc_remove_cloud_filters = 0x025D, 18661ae650dSJack F Vogel 18761ae650dSJack F Vogel i40e_aqc_opc_add_mirror_rule = 0x0260, 18861ae650dSJack F Vogel i40e_aqc_opc_delete_mirror_rule = 0x0261, 18961ae650dSJack F Vogel 19061ae650dSJack F Vogel /* DCB commands */ 19161ae650dSJack F Vogel i40e_aqc_opc_dcb_ignore_pfc = 0x0301, 19261ae650dSJack F Vogel i40e_aqc_opc_dcb_updated = 0x0302, 19361ae650dSJack F Vogel 19461ae650dSJack F Vogel /* TX scheduler */ 19561ae650dSJack F Vogel i40e_aqc_opc_configure_vsi_bw_limit = 0x0400, 19661ae650dSJack F Vogel i40e_aqc_opc_configure_vsi_ets_sla_bw_limit = 0x0406, 19761ae650dSJack F Vogel i40e_aqc_opc_configure_vsi_tc_bw = 0x0407, 19861ae650dSJack F Vogel i40e_aqc_opc_query_vsi_bw_config = 0x0408, 19961ae650dSJack F Vogel i40e_aqc_opc_query_vsi_ets_sla_config = 0x040A, 20061ae650dSJack F Vogel i40e_aqc_opc_configure_switching_comp_bw_limit = 0x0410, 20161ae650dSJack F Vogel 20261ae650dSJack F Vogel i40e_aqc_opc_enable_switching_comp_ets = 0x0413, 20361ae650dSJack F Vogel i40e_aqc_opc_modify_switching_comp_ets = 0x0414, 20461ae650dSJack F Vogel i40e_aqc_opc_disable_switching_comp_ets = 0x0415, 20561ae650dSJack F Vogel i40e_aqc_opc_configure_switching_comp_ets_bw_limit = 0x0416, 20661ae650dSJack F Vogel i40e_aqc_opc_configure_switching_comp_bw_config = 0x0417, 20761ae650dSJack F Vogel i40e_aqc_opc_query_switching_comp_ets_config = 0x0418, 20861ae650dSJack F Vogel i40e_aqc_opc_query_port_ets_config = 0x0419, 20961ae650dSJack F Vogel i40e_aqc_opc_query_switching_comp_bw_config = 0x041A, 21061ae650dSJack F Vogel i40e_aqc_opc_suspend_port_tx = 0x041B, 21161ae650dSJack F Vogel i40e_aqc_opc_resume_port_tx = 0x041C, 21261ae650dSJack F Vogel i40e_aqc_opc_configure_partition_bw = 0x041D, 21361ae650dSJack F Vogel 21461ae650dSJack F Vogel /* hmc */ 21561ae650dSJack F Vogel i40e_aqc_opc_query_hmc_resource_profile = 0x0500, 21661ae650dSJack F Vogel i40e_aqc_opc_set_hmc_resource_profile = 0x0501, 21761ae650dSJack F Vogel 21861ae650dSJack F Vogel /* phy commands*/ 21961ae650dSJack F Vogel i40e_aqc_opc_get_phy_abilities = 0x0600, 22061ae650dSJack F Vogel i40e_aqc_opc_set_phy_config = 0x0601, 22161ae650dSJack F Vogel i40e_aqc_opc_set_mac_config = 0x0603, 22261ae650dSJack F Vogel i40e_aqc_opc_set_link_restart_an = 0x0605, 22361ae650dSJack F Vogel i40e_aqc_opc_get_link_status = 0x0607, 22461ae650dSJack F Vogel i40e_aqc_opc_set_phy_int_mask = 0x0613, 22561ae650dSJack F Vogel i40e_aqc_opc_get_local_advt_reg = 0x0614, 22661ae650dSJack F Vogel i40e_aqc_opc_set_local_advt_reg = 0x0615, 22761ae650dSJack F Vogel i40e_aqc_opc_get_partner_advt = 0x0616, 22861ae650dSJack F Vogel i40e_aqc_opc_set_lb_modes = 0x0618, 22961ae650dSJack F Vogel i40e_aqc_opc_get_phy_wol_caps = 0x0621, 23061ae650dSJack F Vogel i40e_aqc_opc_set_phy_debug = 0x0622, 23161ae650dSJack F Vogel i40e_aqc_opc_upload_ext_phy_fm = 0x0625, 232fdb6f38aSEric Joyner i40e_aqc_opc_run_phy_activity = 0x0626, 23361ae650dSJack F Vogel 23461ae650dSJack F Vogel /* NVM commands */ 23561ae650dSJack F Vogel i40e_aqc_opc_nvm_read = 0x0701, 23661ae650dSJack F Vogel i40e_aqc_opc_nvm_erase = 0x0702, 23761ae650dSJack F Vogel i40e_aqc_opc_nvm_update = 0x0703, 23861ae650dSJack F Vogel i40e_aqc_opc_nvm_config_read = 0x0704, 23961ae650dSJack F Vogel i40e_aqc_opc_nvm_config_write = 0x0705, 240be771cdaSJack F Vogel i40e_aqc_opc_oem_post_update = 0x0720, 241fdb6f38aSEric Joyner i40e_aqc_opc_thermal_sensor = 0x0721, 24261ae650dSJack F Vogel 24361ae650dSJack F Vogel /* virtualization commands */ 24461ae650dSJack F Vogel i40e_aqc_opc_send_msg_to_pf = 0x0801, 24561ae650dSJack F Vogel i40e_aqc_opc_send_msg_to_vf = 0x0802, 24661ae650dSJack F Vogel i40e_aqc_opc_send_msg_to_peer = 0x0803, 24761ae650dSJack F Vogel 24861ae650dSJack F Vogel /* alternate structure */ 24961ae650dSJack F Vogel i40e_aqc_opc_alternate_write = 0x0900, 25061ae650dSJack F Vogel i40e_aqc_opc_alternate_write_indirect = 0x0901, 25161ae650dSJack F Vogel i40e_aqc_opc_alternate_read = 0x0902, 25261ae650dSJack F Vogel i40e_aqc_opc_alternate_read_indirect = 0x0903, 25361ae650dSJack F Vogel i40e_aqc_opc_alternate_write_done = 0x0904, 25461ae650dSJack F Vogel i40e_aqc_opc_alternate_set_mode = 0x0905, 25561ae650dSJack F Vogel i40e_aqc_opc_alternate_clear_port = 0x0906, 25661ae650dSJack F Vogel 25761ae650dSJack F Vogel /* LLDP commands */ 25861ae650dSJack F Vogel i40e_aqc_opc_lldp_get_mib = 0x0A00, 25961ae650dSJack F Vogel i40e_aqc_opc_lldp_update_mib = 0x0A01, 26061ae650dSJack F Vogel i40e_aqc_opc_lldp_add_tlv = 0x0A02, 26161ae650dSJack F Vogel i40e_aqc_opc_lldp_update_tlv = 0x0A03, 26261ae650dSJack F Vogel i40e_aqc_opc_lldp_delete_tlv = 0x0A04, 26361ae650dSJack F Vogel i40e_aqc_opc_lldp_stop = 0x0A05, 26461ae650dSJack F Vogel i40e_aqc_opc_lldp_start = 0x0A06, 265f247dc25SJack F Vogel i40e_aqc_opc_get_cee_dcb_cfg = 0x0A07, 266f247dc25SJack F Vogel i40e_aqc_opc_lldp_set_local_mib = 0x0A08, 267f247dc25SJack F Vogel i40e_aqc_opc_lldp_stop_start_spec_agent = 0x0A09, 26861ae650dSJack F Vogel 26961ae650dSJack F Vogel /* Tunnel commands */ 27061ae650dSJack F Vogel i40e_aqc_opc_add_udp_tunnel = 0x0B00, 27161ae650dSJack F Vogel i40e_aqc_opc_del_udp_tunnel = 0x0B01, 27261ae650dSJack F Vogel 27361ae650dSJack F Vogel /* Async Events */ 27461ae650dSJack F Vogel i40e_aqc_opc_event_lan_overflow = 0x1001, 27561ae650dSJack F Vogel 27661ae650dSJack F Vogel /* OEM commands */ 27761ae650dSJack F Vogel i40e_aqc_opc_oem_parameter_change = 0xFE00, 27861ae650dSJack F Vogel i40e_aqc_opc_oem_device_status_change = 0xFE01, 279f247dc25SJack F Vogel i40e_aqc_opc_oem_ocsd_initialize = 0xFE02, 280f247dc25SJack F Vogel i40e_aqc_opc_oem_ocbb_initialize = 0xFE03, 28161ae650dSJack F Vogel 28261ae650dSJack F Vogel /* debug commands */ 28361ae650dSJack F Vogel i40e_aqc_opc_debug_read_reg = 0xFF03, 28461ae650dSJack F Vogel i40e_aqc_opc_debug_write_reg = 0xFF04, 28561ae650dSJack F Vogel i40e_aqc_opc_debug_modify_reg = 0xFF07, 28661ae650dSJack F Vogel i40e_aqc_opc_debug_dump_internals = 0xFF08, 28761ae650dSJack F Vogel }; 28861ae650dSJack F Vogel 28961ae650dSJack F Vogel /* command structures and indirect data structures */ 29061ae650dSJack F Vogel 29161ae650dSJack F Vogel /* Structure naming conventions: 29261ae650dSJack F Vogel * - no suffix for direct command descriptor structures 29361ae650dSJack F Vogel * - _data for indirect sent data 29461ae650dSJack F Vogel * - _resp for indirect return data (data which is both will use _data) 29561ae650dSJack F Vogel * - _completion for direct return data 29661ae650dSJack F Vogel * - _element_ for repeated elements (may also be _data or _resp) 29761ae650dSJack F Vogel * 29861ae650dSJack F Vogel * Command structures are expected to overlay the params.raw member of the basic 29961ae650dSJack F Vogel * descriptor, and as such cannot exceed 16 bytes in length. 30061ae650dSJack F Vogel */ 30161ae650dSJack F Vogel 30261ae650dSJack F Vogel /* This macro is used to generate a compilation error if a structure 30361ae650dSJack F Vogel * is not exactly the correct length. It gives a divide by zero error if the 30461ae650dSJack F Vogel * structure is not of the correct size, otherwise it creates an enum that is 30561ae650dSJack F Vogel * never used. 30661ae650dSJack F Vogel */ 30761ae650dSJack F Vogel #define I40E_CHECK_STRUCT_LEN(n, X) enum i40e_static_assert_enum_##X \ 30861ae650dSJack F Vogel { i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } 30961ae650dSJack F Vogel 31061ae650dSJack F Vogel /* This macro is used extensively to ensure that command structures are 16 31161ae650dSJack F Vogel * bytes in length as they have to map to the raw array of that size. 31261ae650dSJack F Vogel */ 31361ae650dSJack F Vogel #define I40E_CHECK_CMD_LENGTH(X) I40E_CHECK_STRUCT_LEN(16, X) 31461ae650dSJack F Vogel 31561ae650dSJack F Vogel /* internal (0x00XX) commands */ 31661ae650dSJack F Vogel 31761ae650dSJack F Vogel /* Get version (direct 0x0001) */ 31861ae650dSJack F Vogel struct i40e_aqc_get_version { 31961ae650dSJack F Vogel __le32 rom_ver; 32061ae650dSJack F Vogel __le32 fw_build; 32161ae650dSJack F Vogel __le16 fw_major; 32261ae650dSJack F Vogel __le16 fw_minor; 32361ae650dSJack F Vogel __le16 api_major; 32461ae650dSJack F Vogel __le16 api_minor; 32561ae650dSJack F Vogel }; 32661ae650dSJack F Vogel 32761ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_version); 32861ae650dSJack F Vogel 32961ae650dSJack F Vogel /* Send driver version (indirect 0x0002) */ 33061ae650dSJack F Vogel struct i40e_aqc_driver_version { 33161ae650dSJack F Vogel u8 driver_major_ver; 33261ae650dSJack F Vogel u8 driver_minor_ver; 33361ae650dSJack F Vogel u8 driver_build_ver; 33461ae650dSJack F Vogel u8 driver_subbuild_ver; 33561ae650dSJack F Vogel u8 reserved[4]; 33661ae650dSJack F Vogel __le32 address_high; 33761ae650dSJack F Vogel __le32 address_low; 33861ae650dSJack F Vogel }; 33961ae650dSJack F Vogel 34061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_driver_version); 34161ae650dSJack F Vogel 34261ae650dSJack F Vogel /* Queue Shutdown (direct 0x0003) */ 34361ae650dSJack F Vogel struct i40e_aqc_queue_shutdown { 34461ae650dSJack F Vogel __le32 driver_unloading; 34561ae650dSJack F Vogel #define I40E_AQ_DRIVER_UNLOADING 0x1 34661ae650dSJack F Vogel u8 reserved[12]; 34761ae650dSJack F Vogel }; 34861ae650dSJack F Vogel 34961ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_queue_shutdown); 35061ae650dSJack F Vogel 35161ae650dSJack F Vogel /* Set PF context (0x0004, direct) */ 35261ae650dSJack F Vogel struct i40e_aqc_set_pf_context { 35361ae650dSJack F Vogel u8 pf_id; 35461ae650dSJack F Vogel u8 reserved[15]; 35561ae650dSJack F Vogel }; 35661ae650dSJack F Vogel 35761ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_pf_context); 35861ae650dSJack F Vogel 35961ae650dSJack F Vogel /* Request resource ownership (direct 0x0008) 36061ae650dSJack F Vogel * Release resource ownership (direct 0x0009) 36161ae650dSJack F Vogel */ 36261ae650dSJack F Vogel #define I40E_AQ_RESOURCE_NVM 1 36361ae650dSJack F Vogel #define I40E_AQ_RESOURCE_SDP 2 36461ae650dSJack F Vogel #define I40E_AQ_RESOURCE_ACCESS_READ 1 36561ae650dSJack F Vogel #define I40E_AQ_RESOURCE_ACCESS_WRITE 2 36661ae650dSJack F Vogel #define I40E_AQ_RESOURCE_NVM_READ_TIMEOUT 3000 36761ae650dSJack F Vogel #define I40E_AQ_RESOURCE_NVM_WRITE_TIMEOUT 180000 36861ae650dSJack F Vogel 36961ae650dSJack F Vogel struct i40e_aqc_request_resource { 37061ae650dSJack F Vogel __le16 resource_id; 37161ae650dSJack F Vogel __le16 access_type; 37261ae650dSJack F Vogel __le32 timeout; 37361ae650dSJack F Vogel __le32 resource_number; 37461ae650dSJack F Vogel u8 reserved[4]; 37561ae650dSJack F Vogel }; 37661ae650dSJack F Vogel 37761ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_request_resource); 37861ae650dSJack F Vogel 37961ae650dSJack F Vogel /* Get function capabilities (indirect 0x000A) 38061ae650dSJack F Vogel * Get device capabilities (indirect 0x000B) 38161ae650dSJack F Vogel */ 38261ae650dSJack F Vogel struct i40e_aqc_list_capabilites { 38361ae650dSJack F Vogel u8 command_flags; 38461ae650dSJack F Vogel #define I40E_AQ_LIST_CAP_PF_INDEX_EN 1 38561ae650dSJack F Vogel u8 pf_index; 38661ae650dSJack F Vogel u8 reserved[2]; 38761ae650dSJack F Vogel __le32 count; 38861ae650dSJack F Vogel __le32 addr_high; 38961ae650dSJack F Vogel __le32 addr_low; 39061ae650dSJack F Vogel }; 39161ae650dSJack F Vogel 39261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_list_capabilites); 39361ae650dSJack F Vogel 39461ae650dSJack F Vogel struct i40e_aqc_list_capabilities_element_resp { 39561ae650dSJack F Vogel __le16 id; 39661ae650dSJack F Vogel u8 major_rev; 39761ae650dSJack F Vogel u8 minor_rev; 39861ae650dSJack F Vogel __le32 number; 39961ae650dSJack F Vogel __le32 logical_id; 40061ae650dSJack F Vogel __le32 phys_id; 40161ae650dSJack F Vogel u8 reserved[16]; 40261ae650dSJack F Vogel }; 40361ae650dSJack F Vogel 40461ae650dSJack F Vogel /* list of caps */ 40561ae650dSJack F Vogel 40661ae650dSJack F Vogel #define I40E_AQ_CAP_ID_SWITCH_MODE 0x0001 40761ae650dSJack F Vogel #define I40E_AQ_CAP_ID_MNG_MODE 0x0002 40861ae650dSJack F Vogel #define I40E_AQ_CAP_ID_NPAR_ACTIVE 0x0003 40961ae650dSJack F Vogel #define I40E_AQ_CAP_ID_OS2BMC_CAP 0x0004 41061ae650dSJack F Vogel #define I40E_AQ_CAP_ID_FUNCTIONS_VALID 0x0005 41161ae650dSJack F Vogel #define I40E_AQ_CAP_ID_ALTERNATE_RAM 0x0006 4127f70bec6SEric Joyner #define I40E_AQ_CAP_ID_WOL_AND_PROXY 0x0008 41361ae650dSJack F Vogel #define I40E_AQ_CAP_ID_SRIOV 0x0012 41461ae650dSJack F Vogel #define I40E_AQ_CAP_ID_VF 0x0013 41561ae650dSJack F Vogel #define I40E_AQ_CAP_ID_VMDQ 0x0014 41661ae650dSJack F Vogel #define I40E_AQ_CAP_ID_8021QBG 0x0015 41761ae650dSJack F Vogel #define I40E_AQ_CAP_ID_8021QBR 0x0016 41861ae650dSJack F Vogel #define I40E_AQ_CAP_ID_VSI 0x0017 41961ae650dSJack F Vogel #define I40E_AQ_CAP_ID_DCB 0x0018 42061ae650dSJack F Vogel #define I40E_AQ_CAP_ID_FCOE 0x0021 421f247dc25SJack F Vogel #define I40E_AQ_CAP_ID_ISCSI 0x0022 42261ae650dSJack F Vogel #define I40E_AQ_CAP_ID_RSS 0x0040 42361ae650dSJack F Vogel #define I40E_AQ_CAP_ID_RXQ 0x0041 42461ae650dSJack F Vogel #define I40E_AQ_CAP_ID_TXQ 0x0042 42561ae650dSJack F Vogel #define I40E_AQ_CAP_ID_MSIX 0x0043 42661ae650dSJack F Vogel #define I40E_AQ_CAP_ID_VF_MSIX 0x0044 42761ae650dSJack F Vogel #define I40E_AQ_CAP_ID_FLOW_DIRECTOR 0x0045 42861ae650dSJack F Vogel #define I40E_AQ_CAP_ID_1588 0x0046 42961ae650dSJack F Vogel #define I40E_AQ_CAP_ID_IWARP 0x0051 43061ae650dSJack F Vogel #define I40E_AQ_CAP_ID_LED 0x0061 43161ae650dSJack F Vogel #define I40E_AQ_CAP_ID_SDP 0x0062 43261ae650dSJack F Vogel #define I40E_AQ_CAP_ID_MDIO 0x0063 4337f70bec6SEric Joyner #define I40E_AQ_CAP_ID_WSR_PROT 0x0064 43461ae650dSJack F Vogel #define I40E_AQ_CAP_ID_FLEX10 0x00F1 43561ae650dSJack F Vogel #define I40E_AQ_CAP_ID_CEM 0x00F2 43661ae650dSJack F Vogel 43761ae650dSJack F Vogel /* Set CPPM Configuration (direct 0x0103) */ 43861ae650dSJack F Vogel struct i40e_aqc_cppm_configuration { 43961ae650dSJack F Vogel __le16 command_flags; 44061ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_LTRC 0x0800 44161ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_DMCTH 0x1000 44261ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_DMCTLX 0x2000 44361ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_HPTC 0x4000 44461ae650dSJack F Vogel #define I40E_AQ_CPPM_EN_DMARC 0x8000 44561ae650dSJack F Vogel __le16 ttlx; 44661ae650dSJack F Vogel __le32 dmacr; 44761ae650dSJack F Vogel __le16 dmcth; 44861ae650dSJack F Vogel u8 hptc; 44961ae650dSJack F Vogel u8 reserved; 45061ae650dSJack F Vogel __le32 pfltrc; 45161ae650dSJack F Vogel }; 45261ae650dSJack F Vogel 45361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration); 45461ae650dSJack F Vogel 45561ae650dSJack F Vogel /* Set ARP Proxy command / response (indirect 0x0104) */ 45661ae650dSJack F Vogel struct i40e_aqc_arp_proxy_data { 45761ae650dSJack F Vogel __le16 command_flags; 45861ae650dSJack F Vogel #define I40E_AQ_ARP_INIT_IPV4 0x0008 45961ae650dSJack F Vogel #define I40E_AQ_ARP_UNSUP_CTL 0x0010 46061ae650dSJack F Vogel #define I40E_AQ_ARP_ENA 0x0020 46161ae650dSJack F Vogel #define I40E_AQ_ARP_ADD_IPV4 0x0040 46261ae650dSJack F Vogel #define I40E_AQ_ARP_DEL_IPV4 0x0080 46361ae650dSJack F Vogel __le16 table_id; 46461ae650dSJack F Vogel __le32 pfpm_proxyfc; 46561ae650dSJack F Vogel __le32 ip_addr; 46661ae650dSJack F Vogel u8 mac_addr[6]; 467f247dc25SJack F Vogel u8 reserved[2]; 46861ae650dSJack F Vogel }; 46961ae650dSJack F Vogel 470f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x14, i40e_aqc_arp_proxy_data); 471f247dc25SJack F Vogel 47261ae650dSJack F Vogel /* Set NS Proxy Table Entry Command (indirect 0x0105) */ 47361ae650dSJack F Vogel struct i40e_aqc_ns_proxy_data { 47461ae650dSJack F Vogel __le16 table_idx_mac_addr_0; 47561ae650dSJack F Vogel __le16 table_idx_mac_addr_1; 47661ae650dSJack F Vogel __le16 table_idx_ipv6_0; 47761ae650dSJack F Vogel __le16 table_idx_ipv6_1; 47861ae650dSJack F Vogel __le16 control; 47961ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_ADD_0 0x0100 48061ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_DEL_0 0x0200 48161ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_ADD_1 0x0400 48261ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_DEL_1 0x0800 48361ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_ADD_IPV6_0 0x1000 48461ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_DEL_IPV6_0 0x2000 48561ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_ADD_IPV6_1 0x4000 48661ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_DEL_IPV6_1 0x8000 48761ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_COMMAND_SEQ 0x0001 48861ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_INIT_IPV6_TBL 0x0002 48961ae650dSJack F Vogel #define I40E_AQ_NS_PROXY_INIT_MAC_TBL 0x0004 49061ae650dSJack F Vogel u8 mac_addr_0[6]; 49161ae650dSJack F Vogel u8 mac_addr_1[6]; 49261ae650dSJack F Vogel u8 local_mac_addr[6]; 49361ae650dSJack F Vogel u8 ipv6_addr_0[16]; /* Warning! spec specifies BE byte order */ 49461ae650dSJack F Vogel u8 ipv6_addr_1[16]; 49561ae650dSJack F Vogel }; 49661ae650dSJack F Vogel 497f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x3c, i40e_aqc_ns_proxy_data); 498f247dc25SJack F Vogel 49961ae650dSJack F Vogel /* Manage LAA Command (0x0106) - obsolete */ 50061ae650dSJack F Vogel struct i40e_aqc_mng_laa { 50161ae650dSJack F Vogel __le16 command_flags; 50261ae650dSJack F Vogel #define I40E_AQ_LAA_FLAG_WR 0x8000 50361ae650dSJack F Vogel u8 reserved[2]; 50461ae650dSJack F Vogel __le32 sal; 50561ae650dSJack F Vogel __le16 sah; 50661ae650dSJack F Vogel u8 reserved2[6]; 50761ae650dSJack F Vogel }; 50861ae650dSJack F Vogel 509f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_mng_laa); 510f247dc25SJack F Vogel 51161ae650dSJack F Vogel /* Manage MAC Address Read Command (indirect 0x0107) */ 51261ae650dSJack F Vogel struct i40e_aqc_mac_address_read { 51361ae650dSJack F Vogel __le16 command_flags; 51461ae650dSJack F Vogel #define I40E_AQC_LAN_ADDR_VALID 0x10 51561ae650dSJack F Vogel #define I40E_AQC_SAN_ADDR_VALID 0x20 51661ae650dSJack F Vogel #define I40E_AQC_PORT_ADDR_VALID 0x40 51761ae650dSJack F Vogel #define I40E_AQC_WOL_ADDR_VALID 0x80 518be771cdaSJack F Vogel #define I40E_AQC_MC_MAG_EN_VALID 0x100 519be771cdaSJack F Vogel #define I40E_AQC_ADDR_VALID_MASK 0x1F0 52061ae650dSJack F Vogel u8 reserved[6]; 52161ae650dSJack F Vogel __le32 addr_high; 52261ae650dSJack F Vogel __le32 addr_low; 52361ae650dSJack F Vogel }; 52461ae650dSJack F Vogel 52561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_mac_address_read); 52661ae650dSJack F Vogel 52761ae650dSJack F Vogel struct i40e_aqc_mac_address_read_data { 52861ae650dSJack F Vogel u8 pf_lan_mac[6]; 52961ae650dSJack F Vogel u8 pf_san_mac[6]; 53061ae650dSJack F Vogel u8 port_mac[6]; 53161ae650dSJack F Vogel u8 pf_wol_mac[6]; 53261ae650dSJack F Vogel }; 53361ae650dSJack F Vogel 53461ae650dSJack F Vogel I40E_CHECK_STRUCT_LEN(24, i40e_aqc_mac_address_read_data); 53561ae650dSJack F Vogel 53661ae650dSJack F Vogel /* Manage MAC Address Write Command (0x0108) */ 53761ae650dSJack F Vogel struct i40e_aqc_mac_address_write { 53861ae650dSJack F Vogel __le16 command_flags; 53961ae650dSJack F Vogel #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000 54061ae650dSJack F Vogel #define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000 54161ae650dSJack F Vogel #define I40E_AQC_WRITE_TYPE_PORT 0x8000 542be771cdaSJack F Vogel #define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000 543be771cdaSJack F Vogel #define I40E_AQC_WRITE_TYPE_MASK 0xC000 544be771cdaSJack F Vogel 54561ae650dSJack F Vogel __le16 mac_sah; 54661ae650dSJack F Vogel __le32 mac_sal; 54761ae650dSJack F Vogel u8 reserved[8]; 54861ae650dSJack F Vogel }; 54961ae650dSJack F Vogel 55061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_mac_address_write); 55161ae650dSJack F Vogel 55261ae650dSJack F Vogel /* PXE commands (0x011x) */ 55361ae650dSJack F Vogel 55461ae650dSJack F Vogel /* Clear PXE Command and response (direct 0x0110) */ 55561ae650dSJack F Vogel struct i40e_aqc_clear_pxe { 55661ae650dSJack F Vogel u8 rx_cnt; 55761ae650dSJack F Vogel u8 reserved[15]; 55861ae650dSJack F Vogel }; 55961ae650dSJack F Vogel 56061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_clear_pxe); 56161ae650dSJack F Vogel 56261ae650dSJack F Vogel /* Switch configuration commands (0x02xx) */ 56361ae650dSJack F Vogel 56461ae650dSJack F Vogel /* Used by many indirect commands that only pass an seid and a buffer in the 56561ae650dSJack F Vogel * command 56661ae650dSJack F Vogel */ 56761ae650dSJack F Vogel struct i40e_aqc_switch_seid { 56861ae650dSJack F Vogel __le16 seid; 56961ae650dSJack F Vogel u8 reserved[6]; 57061ae650dSJack F Vogel __le32 addr_high; 57161ae650dSJack F Vogel __le32 addr_low; 57261ae650dSJack F Vogel }; 57361ae650dSJack F Vogel 57461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_switch_seid); 57561ae650dSJack F Vogel 57661ae650dSJack F Vogel /* Get Switch Configuration command (indirect 0x0200) 57761ae650dSJack F Vogel * uses i40e_aqc_switch_seid for the descriptor 57861ae650dSJack F Vogel */ 57961ae650dSJack F Vogel struct i40e_aqc_get_switch_config_header_resp { 58061ae650dSJack F Vogel __le16 num_reported; 58161ae650dSJack F Vogel __le16 num_total; 58261ae650dSJack F Vogel u8 reserved[12]; 58361ae650dSJack F Vogel }; 58461ae650dSJack F Vogel 585f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_switch_config_header_resp); 586f247dc25SJack F Vogel 58761ae650dSJack F Vogel struct i40e_aqc_switch_config_element_resp { 58861ae650dSJack F Vogel u8 element_type; 58961ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_MAC 1 59061ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_PF 2 59161ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_VF 3 59261ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_EMP 4 59361ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_BMC 5 59461ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_PV 16 59561ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_VEB 17 59661ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_PA 18 59761ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_TYPE_VSI 19 59861ae650dSJack F Vogel u8 revision; 59961ae650dSJack F Vogel #define I40E_AQ_SW_ELEM_REV_1 1 60061ae650dSJack F Vogel __le16 seid; 60161ae650dSJack F Vogel __le16 uplink_seid; 60261ae650dSJack F Vogel __le16 downlink_seid; 60361ae650dSJack F Vogel u8 reserved[3]; 60461ae650dSJack F Vogel u8 connection_type; 60561ae650dSJack F Vogel #define I40E_AQ_CONN_TYPE_REGULAR 0x1 60661ae650dSJack F Vogel #define I40E_AQ_CONN_TYPE_DEFAULT 0x2 60761ae650dSJack F Vogel #define I40E_AQ_CONN_TYPE_CASCADED 0x3 60861ae650dSJack F Vogel __le16 scheduler_id; 60961ae650dSJack F Vogel __le16 element_info; 61061ae650dSJack F Vogel }; 61161ae650dSJack F Vogel 612f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_config_element_resp); 613f247dc25SJack F Vogel 61461ae650dSJack F Vogel /* Get Switch Configuration (indirect 0x0200) 61561ae650dSJack F Vogel * an array of elements are returned in the response buffer 61661ae650dSJack F Vogel * the first in the array is the header, remainder are elements 61761ae650dSJack F Vogel */ 61861ae650dSJack F Vogel struct i40e_aqc_get_switch_config_resp { 61961ae650dSJack F Vogel struct i40e_aqc_get_switch_config_header_resp header; 62061ae650dSJack F Vogel struct i40e_aqc_switch_config_element_resp element[1]; 62161ae650dSJack F Vogel }; 62261ae650dSJack F Vogel 623f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_switch_config_resp); 624f247dc25SJack F Vogel 62561ae650dSJack F Vogel /* Add Statistics (direct 0x0201) 62661ae650dSJack F Vogel * Remove Statistics (direct 0x0202) 62761ae650dSJack F Vogel */ 62861ae650dSJack F Vogel struct i40e_aqc_add_remove_statistics { 62961ae650dSJack F Vogel __le16 seid; 63061ae650dSJack F Vogel __le16 vlan; 63161ae650dSJack F Vogel __le16 stat_index; 63261ae650dSJack F Vogel u8 reserved[10]; 63361ae650dSJack F Vogel }; 63461ae650dSJack F Vogel 63561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_statistics); 63661ae650dSJack F Vogel 63761ae650dSJack F Vogel /* Set Port Parameters command (direct 0x0203) */ 63861ae650dSJack F Vogel struct i40e_aqc_set_port_parameters { 63961ae650dSJack F Vogel __le16 command_flags; 64061ae650dSJack F Vogel #define I40E_AQ_SET_P_PARAMS_SAVE_BAD_PACKETS 1 64161ae650dSJack F Vogel #define I40E_AQ_SET_P_PARAMS_PAD_SHORT_PACKETS 2 /* must set! */ 64261ae650dSJack F Vogel #define I40E_AQ_SET_P_PARAMS_DOUBLE_VLAN_ENA 4 64361ae650dSJack F Vogel __le16 bad_frame_vsi; 64461ae650dSJack F Vogel __le16 default_seid; /* reserved for command */ 64561ae650dSJack F Vogel u8 reserved[10]; 64661ae650dSJack F Vogel }; 64761ae650dSJack F Vogel 64861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_port_parameters); 64961ae650dSJack F Vogel 65061ae650dSJack F Vogel /* Get Switch Resource Allocation (indirect 0x0204) */ 65161ae650dSJack F Vogel struct i40e_aqc_get_switch_resource_alloc { 65261ae650dSJack F Vogel u8 num_entries; /* reserved for command */ 65361ae650dSJack F Vogel u8 reserved[7]; 65461ae650dSJack F Vogel __le32 addr_high; 65561ae650dSJack F Vogel __le32 addr_low; 65661ae650dSJack F Vogel }; 65761ae650dSJack F Vogel 65861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_switch_resource_alloc); 65961ae650dSJack F Vogel 66061ae650dSJack F Vogel /* expect an array of these structs in the response buffer */ 66161ae650dSJack F Vogel struct i40e_aqc_switch_resource_alloc_element_resp { 66261ae650dSJack F Vogel u8 resource_type; 66361ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VEB 0x0 66461ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VSI 0x1 66561ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_MACADDR 0x2 66661ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_STAG 0x3 66761ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_ETAG 0x4 66861ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_MULTICAST_HASH 0x5 66961ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_UNICAST_HASH 0x6 67061ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VLAN 0x7 67161ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VSI_LIST_ENTRY 0x8 67261ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_ETAG_LIST_ENTRY 0x9 67361ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VLAN_STAT_POOL 0xA 67461ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_MIRROR_RULE 0xB 67561ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_QUEUE_SETS 0xC 67661ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VLAN_FILTERS 0xD 67761ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_INNER_MAC_FILTERS 0xF 67861ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_IP_FILTERS 0x10 67961ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_GRE_VN_KEYS 0x11 68061ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_VN2_KEYS 0x12 68161ae650dSJack F Vogel #define I40E_AQ_RESOURCE_TYPE_TUNNEL_PORTS 0x13 68261ae650dSJack F Vogel u8 reserved1; 68361ae650dSJack F Vogel __le16 guaranteed; 68461ae650dSJack F Vogel __le16 total; 68561ae650dSJack F Vogel __le16 used; 68661ae650dSJack F Vogel __le16 total_unalloced; 68761ae650dSJack F Vogel u8 reserved2[6]; 68861ae650dSJack F Vogel }; 68961ae650dSJack F Vogel 690f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_resource_alloc_element_resp); 691f247dc25SJack F Vogel 692fdb6f38aSEric Joyner /* Set Switch Configuration (direct 0x0205) */ 693fdb6f38aSEric Joyner struct i40e_aqc_set_switch_config { 694fdb6f38aSEric Joyner __le16 flags; 695fdb6f38aSEric Joyner #define I40E_AQ_SET_SWITCH_CFG_PROMISC 0x0001 696fdb6f38aSEric Joyner #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER 0x0002 697fdb6f38aSEric Joyner __le16 valid_flags; 698fdb6f38aSEric Joyner u8 reserved[12]; 699fdb6f38aSEric Joyner }; 700fdb6f38aSEric Joyner 701fdb6f38aSEric Joyner I40E_CHECK_CMD_LENGTH(i40e_aqc_set_switch_config); 702fdb6f38aSEric Joyner 70361ae650dSJack F Vogel /* Add VSI (indirect 0x0210) 70461ae650dSJack F Vogel * this indirect command uses struct i40e_aqc_vsi_properties_data 70561ae650dSJack F Vogel * as the indirect buffer (128 bytes) 70661ae650dSJack F Vogel * 70761ae650dSJack F Vogel * Update VSI (indirect 0x211) 70861ae650dSJack F Vogel * uses the same data structure as Add VSI 70961ae650dSJack F Vogel * 71061ae650dSJack F Vogel * Get VSI (indirect 0x0212) 71161ae650dSJack F Vogel * uses the same completion and data structure as Add VSI 71261ae650dSJack F Vogel */ 71361ae650dSJack F Vogel struct i40e_aqc_add_get_update_vsi { 71461ae650dSJack F Vogel __le16 uplink_seid; 71561ae650dSJack F Vogel u8 connection_type; 71661ae650dSJack F Vogel #define I40E_AQ_VSI_CONN_TYPE_NORMAL 0x1 71761ae650dSJack F Vogel #define I40E_AQ_VSI_CONN_TYPE_DEFAULT 0x2 71861ae650dSJack F Vogel #define I40E_AQ_VSI_CONN_TYPE_CASCADED 0x3 71961ae650dSJack F Vogel u8 reserved1; 72061ae650dSJack F Vogel u8 vf_id; 72161ae650dSJack F Vogel u8 reserved2; 72261ae650dSJack F Vogel __le16 vsi_flags; 72361ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_SHIFT 0x0 72461ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_MASK (0x3 << I40E_AQ_VSI_TYPE_SHIFT) 72561ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_VF 0x0 72661ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_VMDQ2 0x1 72761ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_PF 0x2 72861ae650dSJack F Vogel #define I40E_AQ_VSI_TYPE_EMP_MNG 0x3 72961ae650dSJack F Vogel #define I40E_AQ_VSI_FLAG_CASCADED_PV 0x4 73061ae650dSJack F Vogel __le32 addr_high; 73161ae650dSJack F Vogel __le32 addr_low; 73261ae650dSJack F Vogel }; 73361ae650dSJack F Vogel 73461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_get_update_vsi); 73561ae650dSJack F Vogel 73661ae650dSJack F Vogel struct i40e_aqc_add_get_update_vsi_completion { 73761ae650dSJack F Vogel __le16 seid; 73861ae650dSJack F Vogel __le16 vsi_number; 73961ae650dSJack F Vogel __le16 vsi_used; 74061ae650dSJack F Vogel __le16 vsi_free; 74161ae650dSJack F Vogel __le32 addr_high; 74261ae650dSJack F Vogel __le32 addr_low; 74361ae650dSJack F Vogel }; 74461ae650dSJack F Vogel 74561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_get_update_vsi_completion); 74661ae650dSJack F Vogel 74761ae650dSJack F Vogel struct i40e_aqc_vsi_properties_data { 74861ae650dSJack F Vogel /* first 96 byte are written by SW */ 74961ae650dSJack F Vogel __le16 valid_sections; 75061ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_SWITCH_VALID 0x0001 75161ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_SECURITY_VALID 0x0002 75261ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_VLAN_VALID 0x0004 75361ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_CAS_PV_VALID 0x0008 75461ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_INGRESS_UP_VALID 0x0010 75561ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_EGRESS_UP_VALID 0x0020 75661ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_QUEUE_MAP_VALID 0x0040 75761ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_QUEUE_OPT_VALID 0x0080 75861ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_OUTER_UP_VALID 0x0100 75961ae650dSJack F Vogel #define I40E_AQ_VSI_PROP_SCHED_VALID 0x0200 76061ae650dSJack F Vogel /* switch section */ 76161ae650dSJack F Vogel __le16 switch_id; /* 12bit id combined with flags below */ 76261ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_SHIFT 0x0000 76361ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_MASK (0xFFF << I40E_AQ_VSI_SW_ID_SHIFT) 76461ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_FLAG_NOT_STAG 0x1000 76561ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB 0x2000 76661ae650dSJack F Vogel #define I40E_AQ_VSI_SW_ID_FLAG_LOCAL_LB 0x4000 76761ae650dSJack F Vogel u8 sw_reserved[2]; 76861ae650dSJack F Vogel /* security section */ 76961ae650dSJack F Vogel u8 sec_flags; 77061ae650dSJack F Vogel #define I40E_AQ_VSI_SEC_FLAG_ALLOW_DEST_OVRD 0x01 77161ae650dSJack F Vogel #define I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK 0x02 77261ae650dSJack F Vogel #define I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK 0x04 77361ae650dSJack F Vogel u8 sec_reserved; 77461ae650dSJack F Vogel /* VLAN section */ 77561ae650dSJack F Vogel __le16 pvid; /* VLANS include priority bits */ 77661ae650dSJack F Vogel __le16 fcoe_pvid; 77761ae650dSJack F Vogel u8 port_vlan_flags; 77861ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_SHIFT 0x00 77961ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_MASK (0x03 << \ 78061ae650dSJack F Vogel I40E_AQ_VSI_PVLAN_MODE_SHIFT) 78161ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_TAGGED 0x01 78261ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_UNTAGGED 0x02 78361ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_MODE_ALL 0x03 78461ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_INSERT_PVID 0x04 78561ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_SHIFT 0x03 78661ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_MASK (0x3 << \ 78761ae650dSJack F Vogel I40E_AQ_VSI_PVLAN_EMOD_SHIFT) 78861ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH 0x0 78961ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP 0x08 79061ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_STR 0x10 79161ae650dSJack F Vogel #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING 0x18 79261ae650dSJack F Vogel u8 pvlan_reserved[3]; 79361ae650dSJack F Vogel /* ingress egress up sections */ 79461ae650dSJack F Vogel __le32 ingress_table; /* bitmap, 3 bits per up */ 79561ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT 0 79661ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP0_MASK (0x7 << \ 79761ae650dSJack F Vogel I40E_AQ_VSI_UP_TABLE_UP0_SHIFT) 79861ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP1_SHIFT 3 79961ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP1_MASK (0x7 << \ 80061ae650dSJack F Vogel I40E_AQ_VSI_UP_TABLE_UP1_SHIFT) 80161ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP2_SHIFT 6 80261ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP2_MASK (0x7 << \ 80361ae650dSJack F Vogel I40E_AQ_VSI_UP_TABLE_UP2_SHIFT) 80461ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP3_SHIFT 9 80561ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP3_MASK (0x7 << \ 80661ae650dSJack F Vogel I40E_AQ_VSI_UP_TABLE_UP3_SHIFT) 80761ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP4_SHIFT 12 80861ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP4_MASK (0x7 << \ 80961ae650dSJack F Vogel I40E_AQ_VSI_UP_TABLE_UP4_SHIFT) 81061ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP5_SHIFT 15 81161ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP5_MASK (0x7 << \ 81261ae650dSJack F Vogel I40E_AQ_VSI_UP_TABLE_UP5_SHIFT) 81361ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP6_SHIFT 18 81461ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP6_MASK (0x7 << \ 81561ae650dSJack F Vogel I40E_AQ_VSI_UP_TABLE_UP6_SHIFT) 81661ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP7_SHIFT 21 81761ae650dSJack F Vogel #define I40E_AQ_VSI_UP_TABLE_UP7_MASK (0x7 << \ 81861ae650dSJack F Vogel I40E_AQ_VSI_UP_TABLE_UP7_SHIFT) 81961ae650dSJack F Vogel __le32 egress_table; /* same defines as for ingress table */ 82061ae650dSJack F Vogel /* cascaded PV section */ 82161ae650dSJack F Vogel __le16 cas_pv_tag; 82261ae650dSJack F Vogel u8 cas_pv_flags; 82361ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_SHIFT 0x00 82461ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_MASK (0x03 << \ 82561ae650dSJack F Vogel I40E_AQ_VSI_CAS_PV_TAGX_SHIFT) 82661ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_LEAVE 0x00 82761ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_REMOVE 0x01 82861ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_TAGX_COPY 0x02 82961ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_INSERT_TAG 0x10 83061ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_ETAG_PRUNE 0x20 83161ae650dSJack F Vogel #define I40E_AQ_VSI_CAS_PV_ACCEPT_HOST_TAG 0x40 83261ae650dSJack F Vogel u8 cas_pv_reserved; 83361ae650dSJack F Vogel /* queue mapping section */ 83461ae650dSJack F Vogel __le16 mapping_flags; 83561ae650dSJack F Vogel #define I40E_AQ_VSI_QUE_MAP_CONTIG 0x0 83661ae650dSJack F Vogel #define I40E_AQ_VSI_QUE_MAP_NONCONTIG 0x1 83761ae650dSJack F Vogel __le16 queue_mapping[16]; 83861ae650dSJack F Vogel #define I40E_AQ_VSI_QUEUE_SHIFT 0x0 83961ae650dSJack F Vogel #define I40E_AQ_VSI_QUEUE_MASK (0x7FF << I40E_AQ_VSI_QUEUE_SHIFT) 84061ae650dSJack F Vogel __le16 tc_mapping[8]; 84161ae650dSJack F Vogel #define I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT 0 84261ae650dSJack F Vogel #define I40E_AQ_VSI_TC_QUE_OFFSET_MASK (0x1FF << \ 84361ae650dSJack F Vogel I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT) 84461ae650dSJack F Vogel #define I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT 9 84561ae650dSJack F Vogel #define I40E_AQ_VSI_TC_QUE_NUMBER_MASK (0x7 << \ 84661ae650dSJack F Vogel I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT) 84761ae650dSJack F Vogel /* queueing option section */ 84861ae650dSJack F Vogel u8 queueing_opt_flags; 84961ae650dSJack F Vogel #define I40E_AQ_VSI_QUE_OPT_TCP_ENA 0x10 85061ae650dSJack F Vogel #define I40E_AQ_VSI_QUE_OPT_FCOE_ENA 0x20 85161ae650dSJack F Vogel u8 queueing_opt_reserved[3]; 85261ae650dSJack F Vogel /* scheduler section */ 85361ae650dSJack F Vogel u8 up_enable_bits; 85461ae650dSJack F Vogel u8 sched_reserved; 85561ae650dSJack F Vogel /* outer up section */ 85661ae650dSJack F Vogel __le32 outer_up_table; /* same structure and defines as ingress table */ 85761ae650dSJack F Vogel u8 cmd_reserved[8]; 85861ae650dSJack F Vogel /* last 32 bytes are written by FW */ 85961ae650dSJack F Vogel __le16 qs_handle[8]; 86061ae650dSJack F Vogel #define I40E_AQ_VSI_QS_HANDLE_INVALID 0xFFFF 86161ae650dSJack F Vogel __le16 stat_counter_idx; 86261ae650dSJack F Vogel __le16 sched_id; 86361ae650dSJack F Vogel u8 resp_reserved[12]; 86461ae650dSJack F Vogel }; 86561ae650dSJack F Vogel 86661ae650dSJack F Vogel I40E_CHECK_STRUCT_LEN(128, i40e_aqc_vsi_properties_data); 86761ae650dSJack F Vogel 86861ae650dSJack F Vogel /* Add Port Virtualizer (direct 0x0220) 86961ae650dSJack F Vogel * also used for update PV (direct 0x0221) but only flags are used 87061ae650dSJack F Vogel * (IS_CTRL_PORT only works on add PV) 87161ae650dSJack F Vogel */ 87261ae650dSJack F Vogel struct i40e_aqc_add_update_pv { 87361ae650dSJack F Vogel __le16 command_flags; 87461ae650dSJack F Vogel #define I40E_AQC_PV_FLAG_PV_TYPE 0x1 87561ae650dSJack F Vogel #define I40E_AQC_PV_FLAG_FWD_UNKNOWN_STAG_EN 0x2 87661ae650dSJack F Vogel #define I40E_AQC_PV_FLAG_FWD_UNKNOWN_ETAG_EN 0x4 87761ae650dSJack F Vogel #define I40E_AQC_PV_FLAG_IS_CTRL_PORT 0x8 87861ae650dSJack F Vogel __le16 uplink_seid; 87961ae650dSJack F Vogel __le16 connected_seid; 88061ae650dSJack F Vogel u8 reserved[10]; 88161ae650dSJack F Vogel }; 88261ae650dSJack F Vogel 88361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_update_pv); 88461ae650dSJack F Vogel 88561ae650dSJack F Vogel struct i40e_aqc_add_update_pv_completion { 88661ae650dSJack F Vogel /* reserved for update; for add also encodes error if rc == ENOSPC */ 88761ae650dSJack F Vogel __le16 pv_seid; 88861ae650dSJack F Vogel #define I40E_AQC_PV_ERR_FLAG_NO_PV 0x1 88961ae650dSJack F Vogel #define I40E_AQC_PV_ERR_FLAG_NO_SCHED 0x2 89061ae650dSJack F Vogel #define I40E_AQC_PV_ERR_FLAG_NO_COUNTER 0x4 89161ae650dSJack F Vogel #define I40E_AQC_PV_ERR_FLAG_NO_ENTRY 0x8 89261ae650dSJack F Vogel u8 reserved[14]; 89361ae650dSJack F Vogel }; 89461ae650dSJack F Vogel 89561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_update_pv_completion); 89661ae650dSJack F Vogel 89761ae650dSJack F Vogel /* Get PV Params (direct 0x0222) 89861ae650dSJack F Vogel * uses i40e_aqc_switch_seid for the descriptor 89961ae650dSJack F Vogel */ 90061ae650dSJack F Vogel 90161ae650dSJack F Vogel struct i40e_aqc_get_pv_params_completion { 90261ae650dSJack F Vogel __le16 seid; 90361ae650dSJack F Vogel __le16 default_stag; 90461ae650dSJack F Vogel __le16 pv_flags; /* same flags as add_pv */ 90561ae650dSJack F Vogel #define I40E_AQC_GET_PV_PV_TYPE 0x1 90661ae650dSJack F Vogel #define I40E_AQC_GET_PV_FRWD_UNKNOWN_STAG 0x2 90761ae650dSJack F Vogel #define I40E_AQC_GET_PV_FRWD_UNKNOWN_ETAG 0x4 90861ae650dSJack F Vogel u8 reserved[8]; 90961ae650dSJack F Vogel __le16 default_port_seid; 91061ae650dSJack F Vogel }; 91161ae650dSJack F Vogel 91261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_pv_params_completion); 91361ae650dSJack F Vogel 91461ae650dSJack F Vogel /* Add VEB (direct 0x0230) */ 91561ae650dSJack F Vogel struct i40e_aqc_add_veb { 91661ae650dSJack F Vogel __le16 uplink_seid; 91761ae650dSJack F Vogel __le16 downlink_seid; 91861ae650dSJack F Vogel __le16 veb_flags; 91961ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_FLOATING 0x1 92061ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_PORT_TYPE_SHIFT 1 92161ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_PORT_TYPE_MASK (0x3 << \ 92261ae650dSJack F Vogel I40E_AQC_ADD_VEB_PORT_TYPE_SHIFT) 92361ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_PORT_TYPE_DEFAULT 0x2 92461ae650dSJack F Vogel #define I40E_AQC_ADD_VEB_PORT_TYPE_DATA 0x4 925fdb6f38aSEric Joyner #define I40E_AQC_ADD_VEB_ENABLE_L2_FILTER 0x8 /* deprecated */ 926fdb6f38aSEric Joyner #define I40E_AQC_ADD_VEB_ENABLE_DISABLE_STATS 0x10 92761ae650dSJack F Vogel u8 enable_tcs; 92861ae650dSJack F Vogel u8 reserved[9]; 92961ae650dSJack F Vogel }; 93061ae650dSJack F Vogel 93161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_veb); 93261ae650dSJack F Vogel 93361ae650dSJack F Vogel struct i40e_aqc_add_veb_completion { 93461ae650dSJack F Vogel u8 reserved[6]; 93561ae650dSJack F Vogel __le16 switch_seid; 93661ae650dSJack F Vogel /* also encodes error if rc == ENOSPC; codes are the same as add_pv */ 93761ae650dSJack F Vogel __le16 veb_seid; 93861ae650dSJack F Vogel #define I40E_AQC_VEB_ERR_FLAG_NO_VEB 0x1 93961ae650dSJack F Vogel #define I40E_AQC_VEB_ERR_FLAG_NO_SCHED 0x2 94061ae650dSJack F Vogel #define I40E_AQC_VEB_ERR_FLAG_NO_COUNTER 0x4 94161ae650dSJack F Vogel #define I40E_AQC_VEB_ERR_FLAG_NO_ENTRY 0x8 94261ae650dSJack F Vogel __le16 statistic_index; 94361ae650dSJack F Vogel __le16 vebs_used; 94461ae650dSJack F Vogel __le16 vebs_free; 94561ae650dSJack F Vogel }; 94661ae650dSJack F Vogel 94761ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_veb_completion); 94861ae650dSJack F Vogel 94961ae650dSJack F Vogel /* Get VEB Parameters (direct 0x0232) 95061ae650dSJack F Vogel * uses i40e_aqc_switch_seid for the descriptor 95161ae650dSJack F Vogel */ 95261ae650dSJack F Vogel struct i40e_aqc_get_veb_parameters_completion { 95361ae650dSJack F Vogel __le16 seid; 95461ae650dSJack F Vogel __le16 switch_id; 95561ae650dSJack F Vogel __le16 veb_flags; /* only the first/last flags from 0x0230 is valid */ 95661ae650dSJack F Vogel __le16 statistic_index; 95761ae650dSJack F Vogel __le16 vebs_used; 95861ae650dSJack F Vogel __le16 vebs_free; 95961ae650dSJack F Vogel u8 reserved[4]; 96061ae650dSJack F Vogel }; 96161ae650dSJack F Vogel 96261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_veb_parameters_completion); 96361ae650dSJack F Vogel 96461ae650dSJack F Vogel /* Delete Element (direct 0x0243) 96561ae650dSJack F Vogel * uses the generic i40e_aqc_switch_seid 96661ae650dSJack F Vogel */ 96761ae650dSJack F Vogel 96861ae650dSJack F Vogel /* Add MAC-VLAN (indirect 0x0250) */ 96961ae650dSJack F Vogel 97061ae650dSJack F Vogel /* used for the command for most vlan commands */ 97161ae650dSJack F Vogel struct i40e_aqc_macvlan { 97261ae650dSJack F Vogel __le16 num_addresses; 97361ae650dSJack F Vogel __le16 seid[3]; 97461ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_SEID_NUM_SHIFT 0 97561ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_SEID_NUM_MASK (0x3FF << \ 97661ae650dSJack F Vogel I40E_AQC_MACVLAN_CMD_SEID_NUM_SHIFT) 97761ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_SEID_VALID 0x8000 97861ae650dSJack F Vogel __le32 addr_high; 97961ae650dSJack F Vogel __le32 addr_low; 98061ae650dSJack F Vogel }; 98161ae650dSJack F Vogel 98261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_macvlan); 98361ae650dSJack F Vogel 98461ae650dSJack F Vogel /* indirect data for command and response */ 98561ae650dSJack F Vogel struct i40e_aqc_add_macvlan_element_data { 98661ae650dSJack F Vogel u8 mac_addr[6]; 98761ae650dSJack F Vogel __le16 vlan_tag; 98861ae650dSJack F Vogel __le16 flags; 98961ae650dSJack F Vogel #define I40E_AQC_MACVLAN_ADD_PERFECT_MATCH 0x0001 99061ae650dSJack F Vogel #define I40E_AQC_MACVLAN_ADD_HASH_MATCH 0x0002 99161ae650dSJack F Vogel #define I40E_AQC_MACVLAN_ADD_IGNORE_VLAN 0x0004 99261ae650dSJack F Vogel #define I40E_AQC_MACVLAN_ADD_TO_QUEUE 0x0008 993fdb6f38aSEric Joyner #define I40E_AQC_MACVLAN_ADD_USE_SHARED_MAC 0x0010 99461ae650dSJack F Vogel __le16 queue_number; 99561ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_QUEUE_SHIFT 0 99661ae650dSJack F Vogel #define I40E_AQC_MACVLAN_CMD_QUEUE_MASK (0x7FF << \ 99761ae650dSJack F Vogel I40E_AQC_MACVLAN_CMD_SEID_NUM_SHIFT) 99861ae650dSJack F Vogel /* response section */ 99961ae650dSJack F Vogel u8 match_method; 100061ae650dSJack F Vogel #define I40E_AQC_MM_PERFECT_MATCH 0x01 100161ae650dSJack F Vogel #define I40E_AQC_MM_HASH_MATCH 0x02 100261ae650dSJack F Vogel #define I40E_AQC_MM_ERR_NO_RES 0xFF 100361ae650dSJack F Vogel u8 reserved1[3]; 100461ae650dSJack F Vogel }; 100561ae650dSJack F Vogel 100661ae650dSJack F Vogel struct i40e_aqc_add_remove_macvlan_completion { 100761ae650dSJack F Vogel __le16 perfect_mac_used; 100861ae650dSJack F Vogel __le16 perfect_mac_free; 100961ae650dSJack F Vogel __le16 unicast_hash_free; 101061ae650dSJack F Vogel __le16 multicast_hash_free; 101161ae650dSJack F Vogel __le32 addr_high; 101261ae650dSJack F Vogel __le32 addr_low; 101361ae650dSJack F Vogel }; 101461ae650dSJack F Vogel 101561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_macvlan_completion); 101661ae650dSJack F Vogel 101761ae650dSJack F Vogel /* Remove MAC-VLAN (indirect 0x0251) 101861ae650dSJack F Vogel * uses i40e_aqc_macvlan for the descriptor 101961ae650dSJack F Vogel * data points to an array of num_addresses of elements 102061ae650dSJack F Vogel */ 102161ae650dSJack F Vogel 102261ae650dSJack F Vogel struct i40e_aqc_remove_macvlan_element_data { 102361ae650dSJack F Vogel u8 mac_addr[6]; 102461ae650dSJack F Vogel __le16 vlan_tag; 102561ae650dSJack F Vogel u8 flags; 102661ae650dSJack F Vogel #define I40E_AQC_MACVLAN_DEL_PERFECT_MATCH 0x01 102761ae650dSJack F Vogel #define I40E_AQC_MACVLAN_DEL_HASH_MATCH 0x02 102861ae650dSJack F Vogel #define I40E_AQC_MACVLAN_DEL_IGNORE_VLAN 0x08 102961ae650dSJack F Vogel #define I40E_AQC_MACVLAN_DEL_ALL_VSIS 0x10 103061ae650dSJack F Vogel u8 reserved[3]; 103161ae650dSJack F Vogel /* reply section */ 103261ae650dSJack F Vogel u8 error_code; 103361ae650dSJack F Vogel #define I40E_AQC_REMOVE_MACVLAN_SUCCESS 0x0 103461ae650dSJack F Vogel #define I40E_AQC_REMOVE_MACVLAN_FAIL 0xFF 103561ae650dSJack F Vogel u8 reply_reserved[3]; 103661ae650dSJack F Vogel }; 103761ae650dSJack F Vogel 103861ae650dSJack F Vogel /* Add VLAN (indirect 0x0252) 103961ae650dSJack F Vogel * Remove VLAN (indirect 0x0253) 104061ae650dSJack F Vogel * use the generic i40e_aqc_macvlan for the command 104161ae650dSJack F Vogel */ 104261ae650dSJack F Vogel struct i40e_aqc_add_remove_vlan_element_data { 104361ae650dSJack F Vogel __le16 vlan_tag; 104461ae650dSJack F Vogel u8 vlan_flags; 104561ae650dSJack F Vogel /* flags for add VLAN */ 104661ae650dSJack F Vogel #define I40E_AQC_ADD_VLAN_LOCAL 0x1 104761ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_SHIFT 1 104861ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_MASK (0x3 << I40E_AQC_ADD_PVLAN_TYPE_SHIFT) 104961ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_REGULAR 0x0 105061ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_PRIMARY 0x2 105161ae650dSJack F Vogel #define I40E_AQC_ADD_PVLAN_TYPE_SECONDARY 0x4 105261ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_SHIFT 3 105361ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_MASK (0x3 << I40E_AQC_VLAN_PTYPE_SHIFT) 105461ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_REGULAR_VSI 0x0 105561ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_PROMISC_VSI 0x8 105661ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_COMMUNITY_VSI 0x10 105761ae650dSJack F Vogel #define I40E_AQC_VLAN_PTYPE_ISOLATED_VSI 0x18 105861ae650dSJack F Vogel /* flags for remove VLAN */ 105961ae650dSJack F Vogel #define I40E_AQC_REMOVE_VLAN_ALL 0x1 106061ae650dSJack F Vogel u8 reserved; 106161ae650dSJack F Vogel u8 result; 106261ae650dSJack F Vogel /* flags for add VLAN */ 106361ae650dSJack F Vogel #define I40E_AQC_ADD_VLAN_SUCCESS 0x0 106461ae650dSJack F Vogel #define I40E_AQC_ADD_VLAN_FAIL_REQUEST 0xFE 106561ae650dSJack F Vogel #define I40E_AQC_ADD_VLAN_FAIL_RESOURCE 0xFF 106661ae650dSJack F Vogel /* flags for remove VLAN */ 106761ae650dSJack F Vogel #define I40E_AQC_REMOVE_VLAN_SUCCESS 0x0 106861ae650dSJack F Vogel #define I40E_AQC_REMOVE_VLAN_FAIL 0xFF 106961ae650dSJack F Vogel u8 reserved1[3]; 107061ae650dSJack F Vogel }; 107161ae650dSJack F Vogel 107261ae650dSJack F Vogel struct i40e_aqc_add_remove_vlan_completion { 107361ae650dSJack F Vogel u8 reserved[4]; 107461ae650dSJack F Vogel __le16 vlans_used; 107561ae650dSJack F Vogel __le16 vlans_free; 107661ae650dSJack F Vogel __le32 addr_high; 107761ae650dSJack F Vogel __le32 addr_low; 107861ae650dSJack F Vogel }; 107961ae650dSJack F Vogel 108061ae650dSJack F Vogel /* Set VSI Promiscuous Modes (direct 0x0254) */ 108161ae650dSJack F Vogel struct i40e_aqc_set_vsi_promiscuous_modes { 108261ae650dSJack F Vogel __le16 promiscuous_flags; 108361ae650dSJack F Vogel __le16 valid_flags; 108461ae650dSJack F Vogel /* flags used for both fields above */ 108561ae650dSJack F Vogel #define I40E_AQC_SET_VSI_PROMISC_UNICAST 0x01 108661ae650dSJack F Vogel #define I40E_AQC_SET_VSI_PROMISC_MULTICAST 0x02 108761ae650dSJack F Vogel #define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04 108861ae650dSJack F Vogel #define I40E_AQC_SET_VSI_DEFAULT 0x08 108961ae650dSJack F Vogel #define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 1090*6d011ad5SEric Joyner #define I40E_AQC_SET_VSI_PROMISC_TX 0x8000 109161ae650dSJack F Vogel __le16 seid; 109261ae650dSJack F Vogel #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF 109361ae650dSJack F Vogel __le16 vlan_tag; 1094be771cdaSJack F Vogel #define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF 109561ae650dSJack F Vogel #define I40E_AQC_SET_VSI_VLAN_VALID 0x8000 109661ae650dSJack F Vogel u8 reserved[8]; 109761ae650dSJack F Vogel }; 109861ae650dSJack F Vogel 109961ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_vsi_promiscuous_modes); 110061ae650dSJack F Vogel 110161ae650dSJack F Vogel /* Add S/E-tag command (direct 0x0255) 110261ae650dSJack F Vogel * Uses generic i40e_aqc_add_remove_tag_completion for completion 110361ae650dSJack F Vogel */ 110461ae650dSJack F Vogel struct i40e_aqc_add_tag { 110561ae650dSJack F Vogel __le16 flags; 110661ae650dSJack F Vogel #define I40E_AQC_ADD_TAG_FLAG_TO_QUEUE 0x0001 110761ae650dSJack F Vogel __le16 seid; 110861ae650dSJack F Vogel #define I40E_AQC_ADD_TAG_CMD_SEID_NUM_SHIFT 0 110961ae650dSJack F Vogel #define I40E_AQC_ADD_TAG_CMD_SEID_NUM_MASK (0x3FF << \ 111061ae650dSJack F Vogel I40E_AQC_ADD_TAG_CMD_SEID_NUM_SHIFT) 111161ae650dSJack F Vogel __le16 tag; 111261ae650dSJack F Vogel __le16 queue_number; 111361ae650dSJack F Vogel u8 reserved[8]; 111461ae650dSJack F Vogel }; 111561ae650dSJack F Vogel 111661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_tag); 111761ae650dSJack F Vogel 111861ae650dSJack F Vogel struct i40e_aqc_add_remove_tag_completion { 111961ae650dSJack F Vogel u8 reserved[12]; 112061ae650dSJack F Vogel __le16 tags_used; 112161ae650dSJack F Vogel __le16 tags_free; 112261ae650dSJack F Vogel }; 112361ae650dSJack F Vogel 112461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_tag_completion); 112561ae650dSJack F Vogel 112661ae650dSJack F Vogel /* Remove S/E-tag command (direct 0x0256) 112761ae650dSJack F Vogel * Uses generic i40e_aqc_add_remove_tag_completion for completion 112861ae650dSJack F Vogel */ 112961ae650dSJack F Vogel struct i40e_aqc_remove_tag { 113061ae650dSJack F Vogel __le16 seid; 113161ae650dSJack F Vogel #define I40E_AQC_REMOVE_TAG_CMD_SEID_NUM_SHIFT 0 113261ae650dSJack F Vogel #define I40E_AQC_REMOVE_TAG_CMD_SEID_NUM_MASK (0x3FF << \ 113361ae650dSJack F Vogel I40E_AQC_REMOVE_TAG_CMD_SEID_NUM_SHIFT) 113461ae650dSJack F Vogel __le16 tag; 113561ae650dSJack F Vogel u8 reserved[12]; 113661ae650dSJack F Vogel }; 113761ae650dSJack F Vogel 1138f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_tag); 1139f247dc25SJack F Vogel 114061ae650dSJack F Vogel /* Add multicast E-Tag (direct 0x0257) 114161ae650dSJack F Vogel * del multicast E-Tag (direct 0x0258) only uses pv_seid and etag fields 114261ae650dSJack F Vogel * and no external data 114361ae650dSJack F Vogel */ 114461ae650dSJack F Vogel struct i40e_aqc_add_remove_mcast_etag { 114561ae650dSJack F Vogel __le16 pv_seid; 114661ae650dSJack F Vogel __le16 etag; 114761ae650dSJack F Vogel u8 num_unicast_etags; 114861ae650dSJack F Vogel u8 reserved[3]; 114961ae650dSJack F Vogel __le32 addr_high; /* address of array of 2-byte s-tags */ 115061ae650dSJack F Vogel __le32 addr_low; 115161ae650dSJack F Vogel }; 115261ae650dSJack F Vogel 115361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_mcast_etag); 115461ae650dSJack F Vogel 115561ae650dSJack F Vogel struct i40e_aqc_add_remove_mcast_etag_completion { 115661ae650dSJack F Vogel u8 reserved[4]; 115761ae650dSJack F Vogel __le16 mcast_etags_used; 115861ae650dSJack F Vogel __le16 mcast_etags_free; 115961ae650dSJack F Vogel __le32 addr_high; 116061ae650dSJack F Vogel __le32 addr_low; 116161ae650dSJack F Vogel 116261ae650dSJack F Vogel }; 116361ae650dSJack F Vogel 116461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_mcast_etag_completion); 116561ae650dSJack F Vogel 116661ae650dSJack F Vogel /* Update S/E-Tag (direct 0x0259) */ 116761ae650dSJack F Vogel struct i40e_aqc_update_tag { 116861ae650dSJack F Vogel __le16 seid; 116961ae650dSJack F Vogel #define I40E_AQC_UPDATE_TAG_CMD_SEID_NUM_SHIFT 0 117061ae650dSJack F Vogel #define I40E_AQC_UPDATE_TAG_CMD_SEID_NUM_MASK (0x3FF << \ 117161ae650dSJack F Vogel I40E_AQC_UPDATE_TAG_CMD_SEID_NUM_SHIFT) 117261ae650dSJack F Vogel __le16 old_tag; 117361ae650dSJack F Vogel __le16 new_tag; 117461ae650dSJack F Vogel u8 reserved[10]; 117561ae650dSJack F Vogel }; 117661ae650dSJack F Vogel 117761ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_update_tag); 117861ae650dSJack F Vogel 117961ae650dSJack F Vogel struct i40e_aqc_update_tag_completion { 118061ae650dSJack F Vogel u8 reserved[12]; 118161ae650dSJack F Vogel __le16 tags_used; 118261ae650dSJack F Vogel __le16 tags_free; 118361ae650dSJack F Vogel }; 118461ae650dSJack F Vogel 118561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_update_tag_completion); 118661ae650dSJack F Vogel 118761ae650dSJack F Vogel /* Add Control Packet filter (direct 0x025A) 118861ae650dSJack F Vogel * Remove Control Packet filter (direct 0x025B) 118961ae650dSJack F Vogel * uses the i40e_aqc_add_oveb_cloud, 119061ae650dSJack F Vogel * and the generic direct completion structure 119161ae650dSJack F Vogel */ 119261ae650dSJack F Vogel struct i40e_aqc_add_remove_control_packet_filter { 119361ae650dSJack F Vogel u8 mac[6]; 119461ae650dSJack F Vogel __le16 etype; 119561ae650dSJack F Vogel __le16 flags; 119661ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC 0x0001 119761ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP 0x0002 119861ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TO_QUEUE 0x0004 119961ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX 0x0008 120061ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_RX 0x0000 120161ae650dSJack F Vogel __le16 seid; 120261ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_CMD_SEID_NUM_SHIFT 0 120361ae650dSJack F Vogel #define I40E_AQC_ADD_CONTROL_PACKET_CMD_SEID_NUM_MASK (0x3FF << \ 120461ae650dSJack F Vogel I40E_AQC_ADD_CONTROL_PACKET_CMD_SEID_NUM_SHIFT) 120561ae650dSJack F Vogel __le16 queue; 120661ae650dSJack F Vogel u8 reserved[2]; 120761ae650dSJack F Vogel }; 120861ae650dSJack F Vogel 120961ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_control_packet_filter); 121061ae650dSJack F Vogel 121161ae650dSJack F Vogel struct i40e_aqc_add_remove_control_packet_filter_completion { 121261ae650dSJack F Vogel __le16 mac_etype_used; 121361ae650dSJack F Vogel __le16 etype_used; 121461ae650dSJack F Vogel __le16 mac_etype_free; 121561ae650dSJack F Vogel __le16 etype_free; 121661ae650dSJack F Vogel u8 reserved[8]; 121761ae650dSJack F Vogel }; 121861ae650dSJack F Vogel 121961ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_control_packet_filter_completion); 122061ae650dSJack F Vogel 122161ae650dSJack F Vogel /* Add Cloud filters (indirect 0x025C) 122261ae650dSJack F Vogel * Remove Cloud filters (indirect 0x025D) 122361ae650dSJack F Vogel * uses the i40e_aqc_add_remove_cloud_filters, 122461ae650dSJack F Vogel * and the generic indirect completion structure 122561ae650dSJack F Vogel */ 122661ae650dSJack F Vogel struct i40e_aqc_add_remove_cloud_filters { 122761ae650dSJack F Vogel u8 num_filters; 122861ae650dSJack F Vogel u8 reserved; 122961ae650dSJack F Vogel __le16 seid; 123061ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT 0 123161ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK (0x3FF << \ 123261ae650dSJack F Vogel I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT) 123361ae650dSJack F Vogel u8 reserved2[4]; 123461ae650dSJack F Vogel __le32 addr_high; 123561ae650dSJack F Vogel __le32 addr_low; 123661ae650dSJack F Vogel }; 123761ae650dSJack F Vogel 123861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_cloud_filters); 123961ae650dSJack F Vogel 124061ae650dSJack F Vogel struct i40e_aqc_add_remove_cloud_filters_element_data { 124161ae650dSJack F Vogel u8 outer_mac[6]; 124261ae650dSJack F Vogel u8 inner_mac[6]; 124361ae650dSJack F Vogel __le16 inner_vlan; 124461ae650dSJack F Vogel union { 124561ae650dSJack F Vogel struct { 124661ae650dSJack F Vogel u8 reserved[12]; 124761ae650dSJack F Vogel u8 data[4]; 124861ae650dSJack F Vogel } v4; 124961ae650dSJack F Vogel struct { 125061ae650dSJack F Vogel u8 data[16]; 125161ae650dSJack F Vogel } v6; 125261ae650dSJack F Vogel } ipaddr; 125361ae650dSJack F Vogel __le16 flags; 125461ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_SHIFT 0 125561ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_MASK (0x3F << \ 125661ae650dSJack F Vogel I40E_AQC_ADD_CLOUD_FILTER_SHIFT) 125761ae650dSJack F Vogel /* 0x0000 reserved */ 125861ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_OIP 0x0001 125961ae650dSJack F Vogel /* 0x0002 reserved */ 126061ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN 0x0003 126161ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN_TEN_ID 0x0004 126261ae650dSJack F Vogel /* 0x0005 reserved */ 126361ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_TEN_ID 0x0006 126461ae650dSJack F Vogel /* 0x0007 reserved */ 126561ae650dSJack F Vogel /* 0x0008 reserved */ 126661ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_OMAC 0x0009 126761ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A 126861ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B 126961ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C 127061ae650dSJack F Vogel 127161ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE 0x0080 127261ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_VNK_SHIFT 6 127361ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_VNK_MASK 0x00C0 127461ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FLAGS_IPV4 0 127561ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FLAGS_IPV6 0x0100 127661ae650dSJack F Vogel 127761ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT 9 127861ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_MASK 0x1E00 1279fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_TNL_TYPE_VXLAN 0 128061ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC 1 1281fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_TNL_TYPE_GENEVE 2 128261ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_TNL_TYPE_IP 3 1283fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_TNL_TYPE_RESERVED 4 1284fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_TNL_TYPE_VXLAN_GPE 5 1285fdb6f38aSEric Joyner 1286fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_FLAGS_SHARED_OUTER_MAC 0x2000 1287fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_FLAGS_SHARED_INNER_MAC 0x4000 1288fdb6f38aSEric Joyner #define I40E_AQC_ADD_CLOUD_FLAGS_SHARED_OUTER_IP 0x8000 128961ae650dSJack F Vogel 129061ae650dSJack F Vogel __le32 tenant_id; 129161ae650dSJack F Vogel u8 reserved[4]; 129261ae650dSJack F Vogel __le16 queue_number; 129361ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_QUEUE_SHIFT 0 1294f247dc25SJack F Vogel #define I40E_AQC_ADD_CLOUD_QUEUE_MASK (0x7FF << \ 129561ae650dSJack F Vogel I40E_AQC_ADD_CLOUD_QUEUE_SHIFT) 129661ae650dSJack F Vogel u8 reserved2[14]; 129761ae650dSJack F Vogel /* response section */ 129861ae650dSJack F Vogel u8 allocation_result; 129961ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_SUCCESS 0x0 130061ae650dSJack F Vogel #define I40E_AQC_ADD_CLOUD_FILTER_FAIL 0xFF 130161ae650dSJack F Vogel u8 response_reserved[7]; 130261ae650dSJack F Vogel }; 130361ae650dSJack F Vogel 130461ae650dSJack F Vogel struct i40e_aqc_remove_cloud_filters_completion { 130561ae650dSJack F Vogel __le16 perfect_ovlan_used; 130661ae650dSJack F Vogel __le16 perfect_ovlan_free; 130761ae650dSJack F Vogel __le16 vlan_used; 130861ae650dSJack F Vogel __le16 vlan_free; 130961ae650dSJack F Vogel __le32 addr_high; 131061ae650dSJack F Vogel __le32 addr_low; 131161ae650dSJack F Vogel }; 131261ae650dSJack F Vogel 131361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion); 131461ae650dSJack F Vogel 131561ae650dSJack F Vogel /* Add Mirror Rule (indirect or direct 0x0260) 131661ae650dSJack F Vogel * Delete Mirror Rule (indirect or direct 0x0261) 131761ae650dSJack F Vogel * note: some rule types (4,5) do not use an external buffer. 131861ae650dSJack F Vogel * take care to set the flags correctly. 131961ae650dSJack F Vogel */ 132061ae650dSJack F Vogel struct i40e_aqc_add_delete_mirror_rule { 132161ae650dSJack F Vogel __le16 seid; 132261ae650dSJack F Vogel __le16 rule_type; 132361ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_SHIFT 0 132461ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_MASK (0x7 << \ 132561ae650dSJack F Vogel I40E_AQC_MIRROR_RULE_TYPE_SHIFT) 132661ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_VPORT_INGRESS 1 132761ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_VPORT_EGRESS 2 132861ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_VLAN 3 132961ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_ALL_INGRESS 4 133061ae650dSJack F Vogel #define I40E_AQC_MIRROR_RULE_TYPE_ALL_EGRESS 5 133161ae650dSJack F Vogel __le16 num_entries; 133261ae650dSJack F Vogel __le16 destination; /* VSI for add, rule id for delete */ 133361ae650dSJack F Vogel __le32 addr_high; /* address of array of 2-byte VSI or VLAN ids */ 133461ae650dSJack F Vogel __le32 addr_low; 133561ae650dSJack F Vogel }; 133661ae650dSJack F Vogel 133761ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_delete_mirror_rule); 133861ae650dSJack F Vogel 133961ae650dSJack F Vogel struct i40e_aqc_add_delete_mirror_rule_completion { 134061ae650dSJack F Vogel u8 reserved[2]; 134161ae650dSJack F Vogel __le16 rule_id; /* only used on add */ 134261ae650dSJack F Vogel __le16 mirror_rules_used; 134361ae650dSJack F Vogel __le16 mirror_rules_free; 134461ae650dSJack F Vogel __le32 addr_high; 134561ae650dSJack F Vogel __le32 addr_low; 134661ae650dSJack F Vogel }; 134761ae650dSJack F Vogel 134861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_delete_mirror_rule_completion); 134961ae650dSJack F Vogel 135061ae650dSJack F Vogel /* DCB 0x03xx*/ 135161ae650dSJack F Vogel 135261ae650dSJack F Vogel /* PFC Ignore (direct 0x0301) 135361ae650dSJack F Vogel * the command and response use the same descriptor structure 135461ae650dSJack F Vogel */ 135561ae650dSJack F Vogel struct i40e_aqc_pfc_ignore { 135661ae650dSJack F Vogel u8 tc_bitmap; 135761ae650dSJack F Vogel u8 command_flags; /* unused on response */ 135861ae650dSJack F Vogel #define I40E_AQC_PFC_IGNORE_SET 0x80 135961ae650dSJack F Vogel #define I40E_AQC_PFC_IGNORE_CLEAR 0x0 136061ae650dSJack F Vogel u8 reserved[14]; 136161ae650dSJack F Vogel }; 136261ae650dSJack F Vogel 136361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_pfc_ignore); 136461ae650dSJack F Vogel 136561ae650dSJack F Vogel /* DCB Update (direct 0x0302) uses the i40e_aq_desc structure 136661ae650dSJack F Vogel * with no parameters 136761ae650dSJack F Vogel */ 136861ae650dSJack F Vogel 136961ae650dSJack F Vogel /* TX scheduler 0x04xx */ 137061ae650dSJack F Vogel 137161ae650dSJack F Vogel /* Almost all the indirect commands use 137261ae650dSJack F Vogel * this generic struct to pass the SEID in param0 137361ae650dSJack F Vogel */ 137461ae650dSJack F Vogel struct i40e_aqc_tx_sched_ind { 137561ae650dSJack F Vogel __le16 vsi_seid; 137661ae650dSJack F Vogel u8 reserved[6]; 137761ae650dSJack F Vogel __le32 addr_high; 137861ae650dSJack F Vogel __le32 addr_low; 137961ae650dSJack F Vogel }; 138061ae650dSJack F Vogel 138161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_tx_sched_ind); 138261ae650dSJack F Vogel 138361ae650dSJack F Vogel /* Several commands respond with a set of queue set handles */ 138461ae650dSJack F Vogel struct i40e_aqc_qs_handles_resp { 138561ae650dSJack F Vogel __le16 qs_handles[8]; 138661ae650dSJack F Vogel }; 138761ae650dSJack F Vogel 138861ae650dSJack F Vogel /* Configure VSI BW limits (direct 0x0400) */ 138961ae650dSJack F Vogel struct i40e_aqc_configure_vsi_bw_limit { 139061ae650dSJack F Vogel __le16 vsi_seid; 139161ae650dSJack F Vogel u8 reserved[2]; 139261ae650dSJack F Vogel __le16 credit; 139361ae650dSJack F Vogel u8 reserved1[2]; 139461ae650dSJack F Vogel u8 max_credit; /* 0-3, limit = 2^max */ 139561ae650dSJack F Vogel u8 reserved2[7]; 139661ae650dSJack F Vogel }; 139761ae650dSJack F Vogel 139861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_configure_vsi_bw_limit); 139961ae650dSJack F Vogel 140061ae650dSJack F Vogel /* Configure VSI Bandwidth Limit per Traffic Type (indirect 0x0406) 140161ae650dSJack F Vogel * responds with i40e_aqc_qs_handles_resp 140261ae650dSJack F Vogel */ 140361ae650dSJack F Vogel struct i40e_aqc_configure_vsi_ets_sla_bw_data { 140461ae650dSJack F Vogel u8 tc_valid_bits; 140561ae650dSJack F Vogel u8 reserved[15]; 140661ae650dSJack F Vogel __le16 tc_bw_credits[8]; /* FW writesback QS handles here */ 140761ae650dSJack F Vogel 140861ae650dSJack F Vogel /* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */ 140961ae650dSJack F Vogel __le16 tc_bw_max[2]; 141061ae650dSJack F Vogel u8 reserved1[28]; 141161ae650dSJack F Vogel }; 141261ae650dSJack F Vogel 1413f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_configure_vsi_ets_sla_bw_data); 1414f247dc25SJack F Vogel 141561ae650dSJack F Vogel /* Configure VSI Bandwidth Allocation per Traffic Type (indirect 0x0407) 141661ae650dSJack F Vogel * responds with i40e_aqc_qs_handles_resp 141761ae650dSJack F Vogel */ 141861ae650dSJack F Vogel struct i40e_aqc_configure_vsi_tc_bw_data { 141961ae650dSJack F Vogel u8 tc_valid_bits; 142061ae650dSJack F Vogel u8 reserved[3]; 142161ae650dSJack F Vogel u8 tc_bw_credits[8]; 142261ae650dSJack F Vogel u8 reserved1[4]; 142361ae650dSJack F Vogel __le16 qs_handles[8]; 142461ae650dSJack F Vogel }; 142561ae650dSJack F Vogel 1426f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_configure_vsi_tc_bw_data); 1427f247dc25SJack F Vogel 142861ae650dSJack F Vogel /* Query vsi bw configuration (indirect 0x0408) */ 142961ae650dSJack F Vogel struct i40e_aqc_query_vsi_bw_config_resp { 143061ae650dSJack F Vogel u8 tc_valid_bits; 143161ae650dSJack F Vogel u8 tc_suspended_bits; 143261ae650dSJack F Vogel u8 reserved[14]; 143361ae650dSJack F Vogel __le16 qs_handles[8]; 143461ae650dSJack F Vogel u8 reserved1[4]; 143561ae650dSJack F Vogel __le16 port_bw_limit; 143661ae650dSJack F Vogel u8 reserved2[2]; 143761ae650dSJack F Vogel u8 max_bw; /* 0-3, limit = 2^max */ 143861ae650dSJack F Vogel u8 reserved3[23]; 143961ae650dSJack F Vogel }; 144061ae650dSJack F Vogel 1441f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_query_vsi_bw_config_resp); 1442f247dc25SJack F Vogel 144361ae650dSJack F Vogel /* Query VSI Bandwidth Allocation per Traffic Type (indirect 0x040A) */ 144461ae650dSJack F Vogel struct i40e_aqc_query_vsi_ets_sla_config_resp { 144561ae650dSJack F Vogel u8 tc_valid_bits; 144661ae650dSJack F Vogel u8 reserved[3]; 144761ae650dSJack F Vogel u8 share_credits[8]; 144861ae650dSJack F Vogel __le16 credits[8]; 144961ae650dSJack F Vogel 145061ae650dSJack F Vogel /* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */ 145161ae650dSJack F Vogel __le16 tc_bw_max[2]; 145261ae650dSJack F Vogel }; 145361ae650dSJack F Vogel 1454f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_query_vsi_ets_sla_config_resp); 1455f247dc25SJack F Vogel 145661ae650dSJack F Vogel /* Configure Switching Component Bandwidth Limit (direct 0x0410) */ 145761ae650dSJack F Vogel struct i40e_aqc_configure_switching_comp_bw_limit { 145861ae650dSJack F Vogel __le16 seid; 145961ae650dSJack F Vogel u8 reserved[2]; 146061ae650dSJack F Vogel __le16 credit; 146161ae650dSJack F Vogel u8 reserved1[2]; 146261ae650dSJack F Vogel u8 max_bw; /* 0-3, limit = 2^max */ 146361ae650dSJack F Vogel u8 reserved2[7]; 146461ae650dSJack F Vogel }; 146561ae650dSJack F Vogel 146661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_configure_switching_comp_bw_limit); 146761ae650dSJack F Vogel 146861ae650dSJack F Vogel /* Enable Physical Port ETS (indirect 0x0413) 146961ae650dSJack F Vogel * Modify Physical Port ETS (indirect 0x0414) 147061ae650dSJack F Vogel * Disable Physical Port ETS (indirect 0x0415) 147161ae650dSJack F Vogel */ 147261ae650dSJack F Vogel struct i40e_aqc_configure_switching_comp_ets_data { 147361ae650dSJack F Vogel u8 reserved[4]; 147461ae650dSJack F Vogel u8 tc_valid_bits; 147561ae650dSJack F Vogel u8 seepage; 147661ae650dSJack F Vogel #define I40E_AQ_ETS_SEEPAGE_EN_MASK 0x1 147761ae650dSJack F Vogel u8 tc_strict_priority_flags; 147861ae650dSJack F Vogel u8 reserved1[17]; 147961ae650dSJack F Vogel u8 tc_bw_share_credits[8]; 148061ae650dSJack F Vogel u8 reserved2[96]; 148161ae650dSJack F Vogel }; 148261ae650dSJack F Vogel 1483f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_configure_switching_comp_ets_data); 1484f247dc25SJack F Vogel 148561ae650dSJack F Vogel /* Configure Switching Component Bandwidth Limits per Tc (indirect 0x0416) */ 148661ae650dSJack F Vogel struct i40e_aqc_configure_switching_comp_ets_bw_limit_data { 148761ae650dSJack F Vogel u8 tc_valid_bits; 148861ae650dSJack F Vogel u8 reserved[15]; 148961ae650dSJack F Vogel __le16 tc_bw_credit[8]; 149061ae650dSJack F Vogel 149161ae650dSJack F Vogel /* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */ 149261ae650dSJack F Vogel __le16 tc_bw_max[2]; 149361ae650dSJack F Vogel u8 reserved1[28]; 149461ae650dSJack F Vogel }; 149561ae650dSJack F Vogel 1496f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_configure_switching_comp_ets_bw_limit_data); 1497f247dc25SJack F Vogel 149861ae650dSJack F Vogel /* Configure Switching Component Bandwidth Allocation per Tc 149961ae650dSJack F Vogel * (indirect 0x0417) 150061ae650dSJack F Vogel */ 150161ae650dSJack F Vogel struct i40e_aqc_configure_switching_comp_bw_config_data { 150261ae650dSJack F Vogel u8 tc_valid_bits; 150361ae650dSJack F Vogel u8 reserved[2]; 150461ae650dSJack F Vogel u8 absolute_credits; /* bool */ 150561ae650dSJack F Vogel u8 tc_bw_share_credits[8]; 150661ae650dSJack F Vogel u8 reserved1[20]; 150761ae650dSJack F Vogel }; 150861ae650dSJack F Vogel 1509f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_configure_switching_comp_bw_config_data); 1510f247dc25SJack F Vogel 151161ae650dSJack F Vogel /* Query Switching Component Configuration (indirect 0x0418) */ 151261ae650dSJack F Vogel struct i40e_aqc_query_switching_comp_ets_config_resp { 151361ae650dSJack F Vogel u8 tc_valid_bits; 151461ae650dSJack F Vogel u8 reserved[35]; 151561ae650dSJack F Vogel __le16 port_bw_limit; 151661ae650dSJack F Vogel u8 reserved1[2]; 151761ae650dSJack F Vogel u8 tc_bw_max; /* 0-3, limit = 2^max */ 151861ae650dSJack F Vogel u8 reserved2[23]; 151961ae650dSJack F Vogel }; 152061ae650dSJack F Vogel 1521f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_query_switching_comp_ets_config_resp); 1522f247dc25SJack F Vogel 152361ae650dSJack F Vogel /* Query PhysicalPort ETS Configuration (indirect 0x0419) */ 152461ae650dSJack F Vogel struct i40e_aqc_query_port_ets_config_resp { 152561ae650dSJack F Vogel u8 reserved[4]; 152661ae650dSJack F Vogel u8 tc_valid_bits; 152761ae650dSJack F Vogel u8 reserved1; 152861ae650dSJack F Vogel u8 tc_strict_priority_bits; 152961ae650dSJack F Vogel u8 reserved2; 153061ae650dSJack F Vogel u8 tc_bw_share_credits[8]; 153161ae650dSJack F Vogel __le16 tc_bw_limits[8]; 153261ae650dSJack F Vogel 153361ae650dSJack F Vogel /* 4 bits per tc 0-7, 4th bit reserved, limit = 2^max */ 153461ae650dSJack F Vogel __le16 tc_bw_max[2]; 153561ae650dSJack F Vogel u8 reserved3[32]; 153661ae650dSJack F Vogel }; 153761ae650dSJack F Vogel 1538f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x44, i40e_aqc_query_port_ets_config_resp); 1539f247dc25SJack F Vogel 154061ae650dSJack F Vogel /* Query Switching Component Bandwidth Allocation per Traffic Type 154161ae650dSJack F Vogel * (indirect 0x041A) 154261ae650dSJack F Vogel */ 154361ae650dSJack F Vogel struct i40e_aqc_query_switching_comp_bw_config_resp { 154461ae650dSJack F Vogel u8 tc_valid_bits; 154561ae650dSJack F Vogel u8 reserved[2]; 154661ae650dSJack F Vogel u8 absolute_credits_enable; /* bool */ 154761ae650dSJack F Vogel u8 tc_bw_share_credits[8]; 154861ae650dSJack F Vogel __le16 tc_bw_limits[8]; 154961ae650dSJack F Vogel 155061ae650dSJack F Vogel /* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */ 155161ae650dSJack F Vogel __le16 tc_bw_max[2]; 155261ae650dSJack F Vogel }; 155361ae650dSJack F Vogel 1554f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_query_switching_comp_bw_config_resp); 1555f247dc25SJack F Vogel 155661ae650dSJack F Vogel /* Suspend/resume port TX traffic 155761ae650dSJack F Vogel * (direct 0x041B and 0x041C) uses the generic SEID struct 155861ae650dSJack F Vogel */ 155961ae650dSJack F Vogel 156061ae650dSJack F Vogel /* Configure partition BW 156161ae650dSJack F Vogel * (indirect 0x041D) 156261ae650dSJack F Vogel */ 156361ae650dSJack F Vogel struct i40e_aqc_configure_partition_bw_data { 156461ae650dSJack F Vogel __le16 pf_valid_bits; 156561ae650dSJack F Vogel u8 min_bw[16]; /* guaranteed bandwidth */ 156661ae650dSJack F Vogel u8 max_bw[16]; /* bandwidth limit */ 156761ae650dSJack F Vogel }; 156861ae650dSJack F Vogel 1569f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x22, i40e_aqc_configure_partition_bw_data); 1570f247dc25SJack F Vogel 157161ae650dSJack F Vogel /* Get and set the active HMC resource profile and status. 157261ae650dSJack F Vogel * (direct 0x0500) and (direct 0x0501) 157361ae650dSJack F Vogel */ 157461ae650dSJack F Vogel struct i40e_aq_get_set_hmc_resource_profile { 157561ae650dSJack F Vogel u8 pm_profile; 157661ae650dSJack F Vogel u8 pe_vf_enabled; 157761ae650dSJack F Vogel u8 reserved[14]; 157861ae650dSJack F Vogel }; 157961ae650dSJack F Vogel 158061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aq_get_set_hmc_resource_profile); 158161ae650dSJack F Vogel 158261ae650dSJack F Vogel enum i40e_aq_hmc_profile { 158361ae650dSJack F Vogel /* I40E_HMC_PROFILE_NO_CHANGE = 0, reserved */ 158461ae650dSJack F Vogel I40E_HMC_PROFILE_DEFAULT = 1, 158561ae650dSJack F Vogel I40E_HMC_PROFILE_FAVOR_VF = 2, 158661ae650dSJack F Vogel I40E_HMC_PROFILE_EQUAL = 3, 158761ae650dSJack F Vogel }; 158861ae650dSJack F Vogel 158961ae650dSJack F Vogel #define I40E_AQ_GET_HMC_RESOURCE_PROFILE_PM_MASK 0xF 159061ae650dSJack F Vogel #define I40E_AQ_GET_HMC_RESOURCE_PROFILE_COUNT_MASK 0x3F 159161ae650dSJack F Vogel 159261ae650dSJack F Vogel /* Get PHY Abilities (indirect 0x0600) uses the generic indirect struct */ 159361ae650dSJack F Vogel 159461ae650dSJack F Vogel /* set in param0 for get phy abilities to report qualified modules */ 159561ae650dSJack F Vogel #define I40E_AQ_PHY_REPORT_QUALIFIED_MODULES 0x0001 159661ae650dSJack F Vogel #define I40E_AQ_PHY_REPORT_INITIAL_VALUES 0x0002 159761ae650dSJack F Vogel 159861ae650dSJack F Vogel enum i40e_aq_phy_type { 159961ae650dSJack F Vogel I40E_PHY_TYPE_SGMII = 0x0, 160061ae650dSJack F Vogel I40E_PHY_TYPE_1000BASE_KX = 0x1, 160161ae650dSJack F Vogel I40E_PHY_TYPE_10GBASE_KX4 = 0x2, 160261ae650dSJack F Vogel I40E_PHY_TYPE_10GBASE_KR = 0x3, 160361ae650dSJack F Vogel I40E_PHY_TYPE_40GBASE_KR4 = 0x4, 160461ae650dSJack F Vogel I40E_PHY_TYPE_XAUI = 0x5, 160561ae650dSJack F Vogel I40E_PHY_TYPE_XFI = 0x6, 160661ae650dSJack F Vogel I40E_PHY_TYPE_SFI = 0x7, 160761ae650dSJack F Vogel I40E_PHY_TYPE_XLAUI = 0x8, 160861ae650dSJack F Vogel I40E_PHY_TYPE_XLPPI = 0x9, 160961ae650dSJack F Vogel I40E_PHY_TYPE_40GBASE_CR4_CU = 0xA, 161061ae650dSJack F Vogel I40E_PHY_TYPE_10GBASE_CR1_CU = 0xB, 161161ae650dSJack F Vogel I40E_PHY_TYPE_10GBASE_AOC = 0xC, 161261ae650dSJack F Vogel I40E_PHY_TYPE_40GBASE_AOC = 0xD, 161361ae650dSJack F Vogel I40E_PHY_TYPE_100BASE_TX = 0x11, 161461ae650dSJack F Vogel I40E_PHY_TYPE_1000BASE_T = 0x12, 161561ae650dSJack F Vogel I40E_PHY_TYPE_10GBASE_T = 0x13, 161661ae650dSJack F Vogel I40E_PHY_TYPE_10GBASE_SR = 0x14, 161761ae650dSJack F Vogel I40E_PHY_TYPE_10GBASE_LR = 0x15, 161861ae650dSJack F Vogel I40E_PHY_TYPE_10GBASE_SFPP_CU = 0x16, 161961ae650dSJack F Vogel I40E_PHY_TYPE_10GBASE_CR1 = 0x17, 162061ae650dSJack F Vogel I40E_PHY_TYPE_40GBASE_CR4 = 0x18, 162161ae650dSJack F Vogel I40E_PHY_TYPE_40GBASE_SR4 = 0x19, 162261ae650dSJack F Vogel I40E_PHY_TYPE_40GBASE_LR4 = 0x1A, 162361ae650dSJack F Vogel I40E_PHY_TYPE_1000BASE_SX = 0x1B, 162461ae650dSJack F Vogel I40E_PHY_TYPE_1000BASE_LX = 0x1C, 162561ae650dSJack F Vogel I40E_PHY_TYPE_1000BASE_T_OPTICAL = 0x1D, 162661ae650dSJack F Vogel I40E_PHY_TYPE_20GBASE_KR2 = 0x1E, 162761ae650dSJack F Vogel I40E_PHY_TYPE_MAX 162861ae650dSJack F Vogel }; 162961ae650dSJack F Vogel 163061ae650dSJack F Vogel #define I40E_LINK_SPEED_100MB_SHIFT 0x1 163161ae650dSJack F Vogel #define I40E_LINK_SPEED_1000MB_SHIFT 0x2 163261ae650dSJack F Vogel #define I40E_LINK_SPEED_10GB_SHIFT 0x3 163361ae650dSJack F Vogel #define I40E_LINK_SPEED_40GB_SHIFT 0x4 163461ae650dSJack F Vogel #define I40E_LINK_SPEED_20GB_SHIFT 0x5 163561ae650dSJack F Vogel 163661ae650dSJack F Vogel enum i40e_aq_link_speed { 163761ae650dSJack F Vogel I40E_LINK_SPEED_UNKNOWN = 0, 163861ae650dSJack F Vogel I40E_LINK_SPEED_100MB = (1 << I40E_LINK_SPEED_100MB_SHIFT), 163961ae650dSJack F Vogel I40E_LINK_SPEED_1GB = (1 << I40E_LINK_SPEED_1000MB_SHIFT), 164061ae650dSJack F Vogel I40E_LINK_SPEED_10GB = (1 << I40E_LINK_SPEED_10GB_SHIFT), 164161ae650dSJack F Vogel I40E_LINK_SPEED_40GB = (1 << I40E_LINK_SPEED_40GB_SHIFT), 164261ae650dSJack F Vogel I40E_LINK_SPEED_20GB = (1 << I40E_LINK_SPEED_20GB_SHIFT) 164361ae650dSJack F Vogel }; 164461ae650dSJack F Vogel 164561ae650dSJack F Vogel struct i40e_aqc_module_desc { 164661ae650dSJack F Vogel u8 oui[3]; 164761ae650dSJack F Vogel u8 reserved1; 164861ae650dSJack F Vogel u8 part_number[16]; 164961ae650dSJack F Vogel u8 revision[4]; 165061ae650dSJack F Vogel u8 reserved2[8]; 165161ae650dSJack F Vogel }; 165261ae650dSJack F Vogel 1653f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_module_desc); 1654f247dc25SJack F Vogel 165561ae650dSJack F Vogel struct i40e_aq_get_phy_abilities_resp { 165661ae650dSJack F Vogel __le32 phy_type; /* bitmap using the above enum for offsets */ 165761ae650dSJack F Vogel u8 link_speed; /* bitmap using the above enum bit patterns */ 165861ae650dSJack F Vogel u8 abilities; 165961ae650dSJack F Vogel #define I40E_AQ_PHY_FLAG_PAUSE_TX 0x01 166061ae650dSJack F Vogel #define I40E_AQ_PHY_FLAG_PAUSE_RX 0x02 166161ae650dSJack F Vogel #define I40E_AQ_PHY_FLAG_LOW_POWER 0x04 166261ae650dSJack F Vogel #define I40E_AQ_PHY_LINK_ENABLED 0x08 166361ae650dSJack F Vogel #define I40E_AQ_PHY_AN_ENABLED 0x10 166461ae650dSJack F Vogel #define I40E_AQ_PHY_FLAG_MODULE_QUAL 0x20 166561ae650dSJack F Vogel __le16 eee_capability; 166661ae650dSJack F Vogel #define I40E_AQ_EEE_100BASE_TX 0x0002 166761ae650dSJack F Vogel #define I40E_AQ_EEE_1000BASE_T 0x0004 166861ae650dSJack F Vogel #define I40E_AQ_EEE_10GBASE_T 0x0008 166961ae650dSJack F Vogel #define I40E_AQ_EEE_1000BASE_KX 0x0010 167061ae650dSJack F Vogel #define I40E_AQ_EEE_10GBASE_KX4 0x0020 167161ae650dSJack F Vogel #define I40E_AQ_EEE_10GBASE_KR 0x0040 167261ae650dSJack F Vogel __le32 eeer_val; 167361ae650dSJack F Vogel u8 d3_lpan; 167461ae650dSJack F Vogel #define I40E_AQ_SET_PHY_D3_LPAN_ENA 0x01 167561ae650dSJack F Vogel u8 reserved[3]; 167661ae650dSJack F Vogel u8 phy_id[4]; 167761ae650dSJack F Vogel u8 module_type[3]; 167861ae650dSJack F Vogel u8 qualified_module_count; 167961ae650dSJack F Vogel #define I40E_AQ_PHY_MAX_QMS 16 168061ae650dSJack F Vogel struct i40e_aqc_module_desc qualified_module[I40E_AQ_PHY_MAX_QMS]; 168161ae650dSJack F Vogel }; 168261ae650dSJack F Vogel 1683f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x218, i40e_aq_get_phy_abilities_resp); 1684f247dc25SJack F Vogel 168561ae650dSJack F Vogel /* Set PHY Config (direct 0x0601) */ 168661ae650dSJack F Vogel struct i40e_aq_set_phy_config { /* same bits as above in all */ 168761ae650dSJack F Vogel __le32 phy_type; 168861ae650dSJack F Vogel u8 link_speed; 168961ae650dSJack F Vogel u8 abilities; 169061ae650dSJack F Vogel /* bits 0-2 use the values from get_phy_abilities_resp */ 169161ae650dSJack F Vogel #define I40E_AQ_PHY_ENABLE_LINK 0x08 169261ae650dSJack F Vogel #define I40E_AQ_PHY_ENABLE_AN 0x10 169361ae650dSJack F Vogel #define I40E_AQ_PHY_ENABLE_ATOMIC_LINK 0x20 169461ae650dSJack F Vogel __le16 eee_capability; 169561ae650dSJack F Vogel __le32 eeer; 169661ae650dSJack F Vogel u8 low_power_ctrl; 169761ae650dSJack F Vogel u8 reserved[3]; 169861ae650dSJack F Vogel }; 169961ae650dSJack F Vogel 170061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config); 170161ae650dSJack F Vogel 170261ae650dSJack F Vogel /* Set MAC Config command data structure (direct 0x0603) */ 170361ae650dSJack F Vogel struct i40e_aq_set_mac_config { 170461ae650dSJack F Vogel __le16 max_frame_size; 170561ae650dSJack F Vogel u8 params; 170661ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_CRC_EN 0x04 170761ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_MASK 0x78 170861ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_SHIFT 3 170961ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_NONE 0x0 171061ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_1B_13TX 0xF 171161ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_9TX 0x9 171261ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_4TX 0x8 171361ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_7TX 0x7 171461ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_2DW_3TX 0x6 171561ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_1TX 0x5 171661ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_2TX 0x4 171761ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_7DW_3TX 0x3 171861ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_4DW_1TX 0x2 171961ae650dSJack F Vogel #define I40E_AQ_SET_MAC_CONFIG_PACING_9DW_1TX 0x1 172061ae650dSJack F Vogel u8 tx_timer_priority; /* bitmap */ 172161ae650dSJack F Vogel __le16 tx_timer_value; 172261ae650dSJack F Vogel __le16 fc_refresh_threshold; 172361ae650dSJack F Vogel u8 reserved[8]; 172461ae650dSJack F Vogel }; 172561ae650dSJack F Vogel 172661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aq_set_mac_config); 172761ae650dSJack F Vogel 172861ae650dSJack F Vogel /* Restart Auto-Negotiation (direct 0x605) */ 172961ae650dSJack F Vogel struct i40e_aqc_set_link_restart_an { 173061ae650dSJack F Vogel u8 command; 173161ae650dSJack F Vogel #define I40E_AQ_PHY_RESTART_AN 0x02 173261ae650dSJack F Vogel #define I40E_AQ_PHY_LINK_ENABLE 0x04 173361ae650dSJack F Vogel u8 reserved[15]; 173461ae650dSJack F Vogel }; 173561ae650dSJack F Vogel 173661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_link_restart_an); 173761ae650dSJack F Vogel 173861ae650dSJack F Vogel /* Get Link Status cmd & response data structure (direct 0x0607) */ 173961ae650dSJack F Vogel struct i40e_aqc_get_link_status { 174061ae650dSJack F Vogel __le16 command_flags; /* only field set on command */ 174161ae650dSJack F Vogel #define I40E_AQ_LSE_MASK 0x3 174261ae650dSJack F Vogel #define I40E_AQ_LSE_NOP 0x0 174361ae650dSJack F Vogel #define I40E_AQ_LSE_DISABLE 0x2 174461ae650dSJack F Vogel #define I40E_AQ_LSE_ENABLE 0x3 174561ae650dSJack F Vogel /* only response uses this flag */ 174661ae650dSJack F Vogel #define I40E_AQ_LSE_IS_ENABLED 0x1 174761ae650dSJack F Vogel u8 phy_type; /* i40e_aq_phy_type */ 174861ae650dSJack F Vogel u8 link_speed; /* i40e_aq_link_speed */ 174961ae650dSJack F Vogel u8 link_info; 1750be771cdaSJack F Vogel #define I40E_AQ_LINK_UP 0x01 /* obsolete */ 1751be771cdaSJack F Vogel #define I40E_AQ_LINK_UP_FUNCTION 0x01 175261ae650dSJack F Vogel #define I40E_AQ_LINK_FAULT 0x02 175361ae650dSJack F Vogel #define I40E_AQ_LINK_FAULT_TX 0x04 175461ae650dSJack F Vogel #define I40E_AQ_LINK_FAULT_RX 0x08 175561ae650dSJack F Vogel #define I40E_AQ_LINK_FAULT_REMOTE 0x10 1756be771cdaSJack F Vogel #define I40E_AQ_LINK_UP_PORT 0x20 175761ae650dSJack F Vogel #define I40E_AQ_MEDIA_AVAILABLE 0x40 175861ae650dSJack F Vogel #define I40E_AQ_SIGNAL_DETECT 0x80 175961ae650dSJack F Vogel u8 an_info; 176061ae650dSJack F Vogel #define I40E_AQ_AN_COMPLETED 0x01 176161ae650dSJack F Vogel #define I40E_AQ_LP_AN_ABILITY 0x02 176261ae650dSJack F Vogel #define I40E_AQ_PD_FAULT 0x04 176361ae650dSJack F Vogel #define I40E_AQ_FEC_EN 0x08 176461ae650dSJack F Vogel #define I40E_AQ_PHY_LOW_POWER 0x10 176561ae650dSJack F Vogel #define I40E_AQ_LINK_PAUSE_TX 0x20 176661ae650dSJack F Vogel #define I40E_AQ_LINK_PAUSE_RX 0x40 176761ae650dSJack F Vogel #define I40E_AQ_QUALIFIED_MODULE 0x80 176861ae650dSJack F Vogel u8 ext_info; 176961ae650dSJack F Vogel #define I40E_AQ_LINK_PHY_TEMP_ALARM 0x01 177061ae650dSJack F Vogel #define I40E_AQ_LINK_XCESSIVE_ERRORS 0x02 177161ae650dSJack F Vogel #define I40E_AQ_LINK_TX_SHIFT 0x02 177261ae650dSJack F Vogel #define I40E_AQ_LINK_TX_MASK (0x03 << I40E_AQ_LINK_TX_SHIFT) 177361ae650dSJack F Vogel #define I40E_AQ_LINK_TX_ACTIVE 0x00 177461ae650dSJack F Vogel #define I40E_AQ_LINK_TX_DRAINED 0x01 177561ae650dSJack F Vogel #define I40E_AQ_LINK_TX_FLUSHED 0x03 177661ae650dSJack F Vogel #define I40E_AQ_LINK_FORCED_40G 0x10 177761ae650dSJack F Vogel u8 loopback; /* use defines from i40e_aqc_set_lb_mode */ 177861ae650dSJack F Vogel __le16 max_frame_size; 177961ae650dSJack F Vogel u8 config; 178061ae650dSJack F Vogel #define I40E_AQ_CONFIG_CRC_ENA 0x04 178161ae650dSJack F Vogel #define I40E_AQ_CONFIG_PACING_MASK 0x78 1782fdb6f38aSEric Joyner u8 external_power_ability; 1783fdb6f38aSEric Joyner #define I40E_AQ_LINK_POWER_CLASS_1 0x00 1784fdb6f38aSEric Joyner #define I40E_AQ_LINK_POWER_CLASS_2 0x01 1785fdb6f38aSEric Joyner #define I40E_AQ_LINK_POWER_CLASS_3 0x02 1786fdb6f38aSEric Joyner #define I40E_AQ_LINK_POWER_CLASS_4 0x03 1787fdb6f38aSEric Joyner u8 reserved[4]; 178861ae650dSJack F Vogel }; 178961ae650dSJack F Vogel 179061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_get_link_status); 179161ae650dSJack F Vogel 179261ae650dSJack F Vogel /* Set event mask command (direct 0x613) */ 179361ae650dSJack F Vogel struct i40e_aqc_set_phy_int_mask { 179461ae650dSJack F Vogel u8 reserved[8]; 179561ae650dSJack F Vogel __le16 event_mask; 179661ae650dSJack F Vogel #define I40E_AQ_EVENT_LINK_UPDOWN 0x0002 179761ae650dSJack F Vogel #define I40E_AQ_EVENT_MEDIA_NA 0x0004 179861ae650dSJack F Vogel #define I40E_AQ_EVENT_LINK_FAULT 0x0008 179961ae650dSJack F Vogel #define I40E_AQ_EVENT_PHY_TEMP_ALARM 0x0010 180061ae650dSJack F Vogel #define I40E_AQ_EVENT_EXCESSIVE_ERRORS 0x0020 180161ae650dSJack F Vogel #define I40E_AQ_EVENT_SIGNAL_DETECT 0x0040 180261ae650dSJack F Vogel #define I40E_AQ_EVENT_AN_COMPLETED 0x0080 180361ae650dSJack F Vogel #define I40E_AQ_EVENT_MODULE_QUAL_FAIL 0x0100 180461ae650dSJack F Vogel #define I40E_AQ_EVENT_PORT_TX_SUSPENDED 0x0200 180561ae650dSJack F Vogel u8 reserved1[6]; 180661ae650dSJack F Vogel }; 180761ae650dSJack F Vogel 180861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_phy_int_mask); 180961ae650dSJack F Vogel 181061ae650dSJack F Vogel /* Get Local AN advt register (direct 0x0614) 181161ae650dSJack F Vogel * Set Local AN advt register (direct 0x0615) 181261ae650dSJack F Vogel * Get Link Partner AN advt register (direct 0x0616) 181361ae650dSJack F Vogel */ 181461ae650dSJack F Vogel struct i40e_aqc_an_advt_reg { 181561ae650dSJack F Vogel __le32 local_an_reg0; 181661ae650dSJack F Vogel __le16 local_an_reg1; 181761ae650dSJack F Vogel u8 reserved[10]; 181861ae650dSJack F Vogel }; 181961ae650dSJack F Vogel 182061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_an_advt_reg); 182161ae650dSJack F Vogel 182261ae650dSJack F Vogel /* Set Loopback mode (0x0618) */ 182361ae650dSJack F Vogel struct i40e_aqc_set_lb_mode { 182461ae650dSJack F Vogel __le16 lb_mode; 182561ae650dSJack F Vogel #define I40E_AQ_LB_PHY_LOCAL 0x01 182661ae650dSJack F Vogel #define I40E_AQ_LB_PHY_REMOTE 0x02 182761ae650dSJack F Vogel #define I40E_AQ_LB_MAC_LOCAL 0x04 182861ae650dSJack F Vogel u8 reserved[14]; 182961ae650dSJack F Vogel }; 183061ae650dSJack F Vogel 183161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_lb_mode); 183261ae650dSJack F Vogel 183361ae650dSJack F Vogel /* Set PHY Debug command (0x0622) */ 183461ae650dSJack F Vogel struct i40e_aqc_set_phy_debug { 183561ae650dSJack F Vogel u8 command_flags; 183661ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_INTERNAL 0x02 183761ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SHIFT 2 183861ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_MASK (0x03 << \ 183961ae650dSJack F Vogel I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SHIFT) 184061ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_NONE 0x00 184161ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_HARD 0x01 184261ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_RESET_EXTERNAL_SOFT 0x02 184361ae650dSJack F Vogel #define I40E_AQ_PHY_DEBUG_DISABLE_LINK_FW 0x10 184461ae650dSJack F Vogel u8 reserved[15]; 184561ae650dSJack F Vogel }; 184661ae650dSJack F Vogel 184761ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_set_phy_debug); 184861ae650dSJack F Vogel 184961ae650dSJack F Vogel enum i40e_aq_phy_reg_type { 185061ae650dSJack F Vogel I40E_AQC_PHY_REG_INTERNAL = 0x1, 185161ae650dSJack F Vogel I40E_AQC_PHY_REG_EXERNAL_BASET = 0x2, 185261ae650dSJack F Vogel I40E_AQC_PHY_REG_EXERNAL_MODULE = 0x3 185361ae650dSJack F Vogel }; 185461ae650dSJack F Vogel 1855fdb6f38aSEric Joyner /* Run PHY Activity (0x0626) */ 1856fdb6f38aSEric Joyner struct i40e_aqc_run_phy_activity { 1857fdb6f38aSEric Joyner __le16 activity_id; 1858fdb6f38aSEric Joyner u8 flags; 1859fdb6f38aSEric Joyner u8 reserved1; 1860fdb6f38aSEric Joyner __le32 control; 1861fdb6f38aSEric Joyner __le32 data; 1862fdb6f38aSEric Joyner u8 reserved2[4]; 1863fdb6f38aSEric Joyner }; 1864fdb6f38aSEric Joyner 1865fdb6f38aSEric Joyner I40E_CHECK_CMD_LENGTH(i40e_aqc_run_phy_activity); 1866fdb6f38aSEric Joyner 186761ae650dSJack F Vogel /* NVM Read command (indirect 0x0701) 186861ae650dSJack F Vogel * NVM Erase commands (direct 0x0702) 186961ae650dSJack F Vogel * NVM Update commands (indirect 0x0703) 187061ae650dSJack F Vogel */ 187161ae650dSJack F Vogel struct i40e_aqc_nvm_update { 187261ae650dSJack F Vogel u8 command_flags; 187361ae650dSJack F Vogel #define I40E_AQ_NVM_LAST_CMD 0x01 187461ae650dSJack F Vogel #define I40E_AQ_NVM_FLASH_ONLY 0x80 187561ae650dSJack F Vogel u8 module_pointer; 187661ae650dSJack F Vogel __le16 length; 187761ae650dSJack F Vogel __le32 offset; 187861ae650dSJack F Vogel __le32 addr_high; 187961ae650dSJack F Vogel __le32 addr_low; 188061ae650dSJack F Vogel }; 188161ae650dSJack F Vogel 188261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update); 188361ae650dSJack F Vogel 188461ae650dSJack F Vogel /* NVM Config Read (indirect 0x0704) */ 188561ae650dSJack F Vogel struct i40e_aqc_nvm_config_read { 188661ae650dSJack F Vogel __le16 cmd_flags; 1887f247dc25SJack F Vogel #define I40E_AQ_ANVM_SINGLE_OR_MULTIPLE_FEATURES_MASK 1 1888f247dc25SJack F Vogel #define I40E_AQ_ANVM_READ_SINGLE_FEATURE 0 1889f247dc25SJack F Vogel #define I40E_AQ_ANVM_READ_MULTIPLE_FEATURES 1 189061ae650dSJack F Vogel __le16 element_count; 189161ae650dSJack F Vogel __le16 element_id; /* Feature/field ID */ 1892f247dc25SJack F Vogel __le16 element_id_msw; /* MSWord of field ID */ 189361ae650dSJack F Vogel __le32 address_high; 189461ae650dSJack F Vogel __le32 address_low; 189561ae650dSJack F Vogel }; 189661ae650dSJack F Vogel 189761ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_read); 189861ae650dSJack F Vogel 189961ae650dSJack F Vogel /* NVM Config Write (indirect 0x0705) */ 190061ae650dSJack F Vogel struct i40e_aqc_nvm_config_write { 190161ae650dSJack F Vogel __le16 cmd_flags; 190261ae650dSJack F Vogel __le16 element_count; 190361ae650dSJack F Vogel u8 reserved[4]; 190461ae650dSJack F Vogel __le32 address_high; 190561ae650dSJack F Vogel __le32 address_low; 190661ae650dSJack F Vogel }; 190761ae650dSJack F Vogel 190861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_write); 190961ae650dSJack F Vogel 1910f247dc25SJack F Vogel /* Used for 0x0704 as well as for 0x0705 commands */ 1911f247dc25SJack F Vogel #define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT 1 1912f247dc25SJack F Vogel #define I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_MASK (1 << I40E_AQ_ANVM_FEATURE_OR_IMMEDIATE_SHIFT) 1913f247dc25SJack F Vogel #define I40E_AQ_ANVM_FEATURE 0 1914f247dc25SJack F Vogel #define I40E_AQ_ANVM_IMMEDIATE_FIELD (1 << FEATURE_OR_IMMEDIATE_SHIFT) 191561ae650dSJack F Vogel struct i40e_aqc_nvm_config_data_feature { 191661ae650dSJack F Vogel __le16 feature_id; 1917f247dc25SJack F Vogel #define I40E_AQ_ANVM_FEATURE_OPTION_OEM_ONLY 0x01 1918f247dc25SJack F Vogel #define I40E_AQ_ANVM_FEATURE_OPTION_DWORD_MAP 0x08 1919f247dc25SJack F Vogel #define I40E_AQ_ANVM_FEATURE_OPTION_POR_CSR 0x10 192061ae650dSJack F Vogel __le16 feature_options; 192161ae650dSJack F Vogel __le16 feature_selection; 192261ae650dSJack F Vogel }; 192361ae650dSJack F Vogel 1924f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature); 1925f247dc25SJack F Vogel 192661ae650dSJack F Vogel struct i40e_aqc_nvm_config_data_immediate_field { 1927f247dc25SJack F Vogel __le32 field_id; 1928f247dc25SJack F Vogel __le32 field_value; 192961ae650dSJack F Vogel __le16 field_options; 1930f247dc25SJack F Vogel __le16 reserved; 193161ae650dSJack F Vogel }; 193261ae650dSJack F Vogel 1933f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field); 1934f247dc25SJack F Vogel 1935be771cdaSJack F Vogel /* OEM Post Update (indirect 0x0720) 1936be771cdaSJack F Vogel * no command data struct used 1937be771cdaSJack F Vogel */ 1938be771cdaSJack F Vogel struct i40e_aqc_nvm_oem_post_update { 1939be771cdaSJack F Vogel #define I40E_AQ_NVM_OEM_POST_UPDATE_EXTERNAL_DATA 0x01 1940be771cdaSJack F Vogel u8 sel_data; 1941be771cdaSJack F Vogel u8 reserved[7]; 1942be771cdaSJack F Vogel }; 1943be771cdaSJack F Vogel 1944be771cdaSJack F Vogel I40E_CHECK_STRUCT_LEN(0x8, i40e_aqc_nvm_oem_post_update); 1945be771cdaSJack F Vogel 1946be771cdaSJack F Vogel struct i40e_aqc_nvm_oem_post_update_buffer { 1947be771cdaSJack F Vogel u8 str_len; 1948be771cdaSJack F Vogel u8 dev_addr; 1949be771cdaSJack F Vogel __le16 eeprom_addr; 1950be771cdaSJack F Vogel u8 data[36]; 1951be771cdaSJack F Vogel }; 1952be771cdaSJack F Vogel 1953be771cdaSJack F Vogel I40E_CHECK_STRUCT_LEN(0x28, i40e_aqc_nvm_oem_post_update_buffer); 1954be771cdaSJack F Vogel 1955fdb6f38aSEric Joyner /* Thermal Sensor (indirect 0x0721) 1956fdb6f38aSEric Joyner * read or set thermal sensor configs and values 1957fdb6f38aSEric Joyner * takes a sensor and command specific data buffer, not detailed here 1958fdb6f38aSEric Joyner */ 1959fdb6f38aSEric Joyner struct i40e_aqc_thermal_sensor { 1960fdb6f38aSEric Joyner u8 sensor_action; 1961fdb6f38aSEric Joyner #define I40E_AQ_THERMAL_SENSOR_READ_CONFIG 0 1962fdb6f38aSEric Joyner #define I40E_AQ_THERMAL_SENSOR_SET_CONFIG 1 1963fdb6f38aSEric Joyner #define I40E_AQ_THERMAL_SENSOR_READ_TEMP 2 1964fdb6f38aSEric Joyner u8 reserved[7]; 1965fdb6f38aSEric Joyner __le32 addr_high; 1966fdb6f38aSEric Joyner __le32 addr_low; 1967fdb6f38aSEric Joyner }; 1968fdb6f38aSEric Joyner 1969fdb6f38aSEric Joyner I40E_CHECK_CMD_LENGTH(i40e_aqc_thermal_sensor); 1970fdb6f38aSEric Joyner 197161ae650dSJack F Vogel /* Send to PF command (indirect 0x0801) id is only used by PF 197261ae650dSJack F Vogel * Send to VF command (indirect 0x0802) id is only used by PF 197361ae650dSJack F Vogel * Send to Peer PF command (indirect 0x0803) 197461ae650dSJack F Vogel */ 197561ae650dSJack F Vogel struct i40e_aqc_pf_vf_message { 197661ae650dSJack F Vogel __le32 id; 197761ae650dSJack F Vogel u8 reserved[4]; 197861ae650dSJack F Vogel __le32 addr_high; 197961ae650dSJack F Vogel __le32 addr_low; 198061ae650dSJack F Vogel }; 198161ae650dSJack F Vogel 198261ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_pf_vf_message); 198361ae650dSJack F Vogel 198461ae650dSJack F Vogel /* Alternate structure */ 198561ae650dSJack F Vogel 198661ae650dSJack F Vogel /* Direct write (direct 0x0900) 198761ae650dSJack F Vogel * Direct read (direct 0x0902) 198861ae650dSJack F Vogel */ 198961ae650dSJack F Vogel struct i40e_aqc_alternate_write { 199061ae650dSJack F Vogel __le32 address0; 199161ae650dSJack F Vogel __le32 data0; 199261ae650dSJack F Vogel __le32 address1; 199361ae650dSJack F Vogel __le32 data1; 199461ae650dSJack F Vogel }; 199561ae650dSJack F Vogel 199661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_write); 199761ae650dSJack F Vogel 199861ae650dSJack F Vogel /* Indirect write (indirect 0x0901) 199961ae650dSJack F Vogel * Indirect read (indirect 0x0903) 200061ae650dSJack F Vogel */ 200161ae650dSJack F Vogel 200261ae650dSJack F Vogel struct i40e_aqc_alternate_ind_write { 200361ae650dSJack F Vogel __le32 address; 200461ae650dSJack F Vogel __le32 length; 200561ae650dSJack F Vogel __le32 addr_high; 200661ae650dSJack F Vogel __le32 addr_low; 200761ae650dSJack F Vogel }; 200861ae650dSJack F Vogel 200961ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_ind_write); 201061ae650dSJack F Vogel 201161ae650dSJack F Vogel /* Done alternate write (direct 0x0904) 201261ae650dSJack F Vogel * uses i40e_aq_desc 201361ae650dSJack F Vogel */ 201461ae650dSJack F Vogel struct i40e_aqc_alternate_write_done { 201561ae650dSJack F Vogel __le16 cmd_flags; 201661ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_BIOS_MASK 1 201761ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_BIOS_LEGACY 0 201861ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_BIOS_UEFI 1 201961ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_RESET_NEEDED 2 202061ae650dSJack F Vogel u8 reserved[14]; 202161ae650dSJack F Vogel }; 202261ae650dSJack F Vogel 202361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_write_done); 202461ae650dSJack F Vogel 202561ae650dSJack F Vogel /* Set OEM mode (direct 0x0905) */ 202661ae650dSJack F Vogel struct i40e_aqc_alternate_set_mode { 202761ae650dSJack F Vogel __le32 mode; 202861ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_NONE 0 202961ae650dSJack F Vogel #define I40E_AQ_ALTERNATE_MODE_OEM 1 203061ae650dSJack F Vogel u8 reserved[12]; 203161ae650dSJack F Vogel }; 203261ae650dSJack F Vogel 203361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_set_mode); 203461ae650dSJack F Vogel 203561ae650dSJack F Vogel /* Clear port Alternate RAM (direct 0x0906) uses i40e_aq_desc */ 203661ae650dSJack F Vogel 203761ae650dSJack F Vogel /* async events 0x10xx */ 203861ae650dSJack F Vogel 203961ae650dSJack F Vogel /* Lan Queue Overflow Event (direct, 0x1001) */ 204061ae650dSJack F Vogel struct i40e_aqc_lan_overflow { 204161ae650dSJack F Vogel __le32 prtdcb_rupto; 204261ae650dSJack F Vogel __le32 otx_ctl; 204361ae650dSJack F Vogel u8 reserved[8]; 204461ae650dSJack F Vogel }; 204561ae650dSJack F Vogel 204661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lan_overflow); 204761ae650dSJack F Vogel 204861ae650dSJack F Vogel /* Get LLDP MIB (indirect 0x0A00) */ 204961ae650dSJack F Vogel struct i40e_aqc_lldp_get_mib { 205061ae650dSJack F Vogel u8 type; 205161ae650dSJack F Vogel u8 reserved1; 205261ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_TYPE_MASK 0x3 205361ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_LOCAL 0x0 205461ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_REMOTE 0x1 205561ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_LOCAL_AND_REMOTE 0x2 205661ae650dSJack F Vogel #define I40E_AQ_LLDP_BRIDGE_TYPE_MASK 0xC 205761ae650dSJack F Vogel #define I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT 0x2 205861ae650dSJack F Vogel #define I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE 0x0 205961ae650dSJack F Vogel #define I40E_AQ_LLDP_BRIDGE_TYPE_NON_TPMR 0x1 206061ae650dSJack F Vogel #define I40E_AQ_LLDP_TX_SHIFT 0x4 206161ae650dSJack F Vogel #define I40E_AQ_LLDP_TX_MASK (0x03 << I40E_AQ_LLDP_TX_SHIFT) 206261ae650dSJack F Vogel /* TX pause flags use I40E_AQ_LINK_TX_* above */ 206361ae650dSJack F Vogel __le16 local_len; 206461ae650dSJack F Vogel __le16 remote_len; 206561ae650dSJack F Vogel u8 reserved2[2]; 206661ae650dSJack F Vogel __le32 addr_high; 206761ae650dSJack F Vogel __le32 addr_low; 206861ae650dSJack F Vogel }; 206961ae650dSJack F Vogel 207061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_get_mib); 207161ae650dSJack F Vogel 207261ae650dSJack F Vogel /* Configure LLDP MIB Change Event (direct 0x0A01) 207361ae650dSJack F Vogel * also used for the event (with type in the command field) 207461ae650dSJack F Vogel */ 207561ae650dSJack F Vogel struct i40e_aqc_lldp_update_mib { 207661ae650dSJack F Vogel u8 command; 207761ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_UPDATE_ENABLE 0x0 207861ae650dSJack F Vogel #define I40E_AQ_LLDP_MIB_UPDATE_DISABLE 0x1 207961ae650dSJack F Vogel u8 reserved[7]; 208061ae650dSJack F Vogel __le32 addr_high; 208161ae650dSJack F Vogel __le32 addr_low; 208261ae650dSJack F Vogel }; 208361ae650dSJack F Vogel 208461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_mib); 208561ae650dSJack F Vogel 208661ae650dSJack F Vogel /* Add LLDP TLV (indirect 0x0A02) 208761ae650dSJack F Vogel * Delete LLDP TLV (indirect 0x0A04) 208861ae650dSJack F Vogel */ 208961ae650dSJack F Vogel struct i40e_aqc_lldp_add_tlv { 209061ae650dSJack F Vogel u8 type; /* only nearest bridge and non-TPMR from 0x0A00 */ 209161ae650dSJack F Vogel u8 reserved1[1]; 209261ae650dSJack F Vogel __le16 len; 209361ae650dSJack F Vogel u8 reserved2[4]; 209461ae650dSJack F Vogel __le32 addr_high; 209561ae650dSJack F Vogel __le32 addr_low; 209661ae650dSJack F Vogel }; 209761ae650dSJack F Vogel 209861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_add_tlv); 209961ae650dSJack F Vogel 210061ae650dSJack F Vogel /* Update LLDP TLV (indirect 0x0A03) */ 210161ae650dSJack F Vogel struct i40e_aqc_lldp_update_tlv { 210261ae650dSJack F Vogel u8 type; /* only nearest bridge and non-TPMR from 0x0A00 */ 210361ae650dSJack F Vogel u8 reserved; 210461ae650dSJack F Vogel __le16 old_len; 210561ae650dSJack F Vogel __le16 new_offset; 210661ae650dSJack F Vogel __le16 new_len; 210761ae650dSJack F Vogel __le32 addr_high; 210861ae650dSJack F Vogel __le32 addr_low; 210961ae650dSJack F Vogel }; 211061ae650dSJack F Vogel 211161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_tlv); 211261ae650dSJack F Vogel 211361ae650dSJack F Vogel /* Stop LLDP (direct 0x0A05) */ 211461ae650dSJack F Vogel struct i40e_aqc_lldp_stop { 211561ae650dSJack F Vogel u8 command; 211661ae650dSJack F Vogel #define I40E_AQ_LLDP_AGENT_STOP 0x0 211761ae650dSJack F Vogel #define I40E_AQ_LLDP_AGENT_SHUTDOWN 0x1 211861ae650dSJack F Vogel u8 reserved[15]; 211961ae650dSJack F Vogel }; 212061ae650dSJack F Vogel 212161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop); 212261ae650dSJack F Vogel 212361ae650dSJack F Vogel /* Start LLDP (direct 0x0A06) */ 212461ae650dSJack F Vogel 212561ae650dSJack F Vogel struct i40e_aqc_lldp_start { 212661ae650dSJack F Vogel u8 command; 212761ae650dSJack F Vogel #define I40E_AQ_LLDP_AGENT_START 0x1 212861ae650dSJack F Vogel u8 reserved[15]; 212961ae650dSJack F Vogel }; 213061ae650dSJack F Vogel 213161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start); 213261ae650dSJack F Vogel 2133f247dc25SJack F Vogel /* Get CEE DCBX Oper Config (0x0A07) 2134f247dc25SJack F Vogel * uses the generic descriptor struct 2135f247dc25SJack F Vogel * returns below as indirect response 213661ae650dSJack F Vogel */ 213761ae650dSJack F Vogel 2138f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_FCOE_SHIFT 0x0 2139f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_FCOE_MASK (0x7 << I40E_AQC_CEE_APP_FCOE_SHIFT) 2140f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_ISCSI_SHIFT 0x3 2141f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_ISCSI_MASK (0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT) 2142f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_FIP_SHIFT 0x8 2143f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_FIP_MASK (0x7 << I40E_AQC_CEE_APP_FIP_SHIFT) 2144be771cdaSJack F Vogel 2145f247dc25SJack F Vogel #define I40E_AQC_CEE_PG_STATUS_SHIFT 0x0 2146f247dc25SJack F Vogel #define I40E_AQC_CEE_PG_STATUS_MASK (0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT) 2147f247dc25SJack F Vogel #define I40E_AQC_CEE_PFC_STATUS_SHIFT 0x3 2148f247dc25SJack F Vogel #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT) 2149f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 2150f247dc25SJack F Vogel #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT) 2151be771cdaSJack F Vogel #define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8 2152be771cdaSJack F Vogel #define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT) 2153be771cdaSJack F Vogel #define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xB 2154be771cdaSJack F Vogel #define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT) 2155be771cdaSJack F Vogel #define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10 2156be771cdaSJack F Vogel #define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT) 2157be771cdaSJack F Vogel 2158be771cdaSJack F Vogel /* struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with 2159be771cdaSJack F Vogel * word boundary layout issues, which the Linux compilers silently deal 2160be771cdaSJack F Vogel * with by adding padding, making the actual struct larger than designed. 2161be771cdaSJack F Vogel * However, the FW compiler for the NIC is less lenient and complains 2162be771cdaSJack F Vogel * about the struct. Hence, the struct defined here has an extra byte in 2163be771cdaSJack F Vogel * fields reserved3 and reserved4 to directly acknowledge that padding, 2164be771cdaSJack F Vogel * and the new length is used in the length check macro. 2165be771cdaSJack F Vogel */ 2166f247dc25SJack F Vogel struct i40e_aqc_get_cee_dcb_cfg_v1_resp { 2167f247dc25SJack F Vogel u8 reserved1; 2168f247dc25SJack F Vogel u8 oper_num_tc; 2169f247dc25SJack F Vogel u8 oper_prio_tc[4]; 2170f247dc25SJack F Vogel u8 reserved2; 2171f247dc25SJack F Vogel u8 oper_tc_bw[8]; 2172f247dc25SJack F Vogel u8 oper_pfc_en; 2173be771cdaSJack F Vogel u8 reserved3[2]; 2174f247dc25SJack F Vogel __le16 oper_app_prio; 2175be771cdaSJack F Vogel u8 reserved4[2]; 2176f247dc25SJack F Vogel __le16 tlv_status; 2177f247dc25SJack F Vogel }; 2178f247dc25SJack F Vogel 2179f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x18, i40e_aqc_get_cee_dcb_cfg_v1_resp); 2180f247dc25SJack F Vogel 2181f247dc25SJack F Vogel struct i40e_aqc_get_cee_dcb_cfg_resp { 2182f247dc25SJack F Vogel u8 oper_num_tc; 2183f247dc25SJack F Vogel u8 oper_prio_tc[4]; 2184f247dc25SJack F Vogel u8 oper_tc_bw[8]; 2185f247dc25SJack F Vogel u8 oper_pfc_en; 2186f247dc25SJack F Vogel __le16 oper_app_prio; 2187f247dc25SJack F Vogel __le32 tlv_status; 2188f247dc25SJack F Vogel u8 reserved[12]; 2189f247dc25SJack F Vogel }; 2190f247dc25SJack F Vogel 2191f247dc25SJack F Vogel I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_cee_dcb_cfg_resp); 2192f247dc25SJack F Vogel 2193f247dc25SJack F Vogel /* Set Local LLDP MIB (indirect 0x0A08) 2194f247dc25SJack F Vogel * Used to replace the local MIB of a given LLDP agent. e.g. DCBx 2195f247dc25SJack F Vogel */ 2196f247dc25SJack F Vogel struct i40e_aqc_lldp_set_local_mib { 2197f247dc25SJack F Vogel #define SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT 0 2198ac83ea83SEric Joyner #define SET_LOCAL_MIB_AC_TYPE_DCBX_MASK (1 << \ 2199ac83ea83SEric Joyner SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT) 2200ac83ea83SEric Joyner #define SET_LOCAL_MIB_AC_TYPE_LOCAL_MIB 0x0 2201ac83ea83SEric Joyner #define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT (1) 2202ac83ea83SEric Joyner #define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_MASK (1 << \ 2203ac83ea83SEric Joyner SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT) 2204ac83ea83SEric Joyner #define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS 0x1 2205f247dc25SJack F Vogel u8 type; 2206f247dc25SJack F Vogel u8 reserved0; 2207f247dc25SJack F Vogel __le16 length; 2208f247dc25SJack F Vogel u8 reserved1[4]; 2209f247dc25SJack F Vogel __le32 address_high; 2210f247dc25SJack F Vogel __le32 address_low; 2211f247dc25SJack F Vogel }; 2212f247dc25SJack F Vogel 2213f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_set_local_mib); 2214f247dc25SJack F Vogel 2215223d846dSEric Joyner struct i40e_aqc_lldp_set_local_mib_resp { 2216223d846dSEric Joyner #define SET_LOCAL_MIB_RESP_EVENT_TRIGGERED_MASK 0x01 2217223d846dSEric Joyner u8 status; 2218223d846dSEric Joyner u8 reserved[15]; 2219223d846dSEric Joyner }; 2220223d846dSEric Joyner 2221223d846dSEric Joyner I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_lldp_set_local_mib_resp); 2222223d846dSEric Joyner 2223f247dc25SJack F Vogel /* Stop/Start LLDP Agent (direct 0x0A09) 2224f247dc25SJack F Vogel * Used for stopping/starting specific LLDP agent. e.g. DCBx 2225f247dc25SJack F Vogel */ 2226f247dc25SJack F Vogel struct i40e_aqc_lldp_stop_start_specific_agent { 2227f247dc25SJack F Vogel #define I40E_AQC_START_SPECIFIC_AGENT_SHIFT 0 2228f247dc25SJack F Vogel #define I40E_AQC_START_SPECIFIC_AGENT_MASK (1 << I40E_AQC_START_SPECIFIC_AGENT_SHIFT) 2229f247dc25SJack F Vogel u8 command; 2230f247dc25SJack F Vogel u8 reserved[15]; 2231f247dc25SJack F Vogel }; 2232f247dc25SJack F Vogel 2233f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop_start_specific_agent); 2234f247dc25SJack F Vogel 223561ae650dSJack F Vogel /* Add Udp Tunnel command and completion (direct 0x0B00) */ 223661ae650dSJack F Vogel struct i40e_aqc_add_udp_tunnel { 223761ae650dSJack F Vogel __le16 udp_port; 223861ae650dSJack F Vogel u8 reserved0[3]; 223961ae650dSJack F Vogel u8 protocol_type; 224061ae650dSJack F Vogel #define I40E_AQC_TUNNEL_TYPE_VXLAN 0x00 224161ae650dSJack F Vogel #define I40E_AQC_TUNNEL_TYPE_NGE 0x01 224261ae650dSJack F Vogel #define I40E_AQC_TUNNEL_TYPE_TEREDO 0x10 2243fdb6f38aSEric Joyner #define I40E_AQC_TUNNEL_TYPE_VXLAN_GPE 0x11 224461ae650dSJack F Vogel u8 reserved1[10]; 224561ae650dSJack F Vogel }; 224661ae650dSJack F Vogel 224761ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel); 224861ae650dSJack F Vogel 224961ae650dSJack F Vogel struct i40e_aqc_add_udp_tunnel_completion { 225061ae650dSJack F Vogel __le16 udp_port; 225161ae650dSJack F Vogel u8 filter_entry_index; 225261ae650dSJack F Vogel u8 multiple_pfs; 225361ae650dSJack F Vogel #define I40E_AQC_SINGLE_PF 0x0 225461ae650dSJack F Vogel #define I40E_AQC_MULTIPLE_PFS 0x1 225561ae650dSJack F Vogel u8 total_filters; 225661ae650dSJack F Vogel u8 reserved[11]; 225761ae650dSJack F Vogel }; 225861ae650dSJack F Vogel 225961ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel_completion); 226061ae650dSJack F Vogel 226161ae650dSJack F Vogel /* remove UDP Tunnel command (0x0B01) */ 226261ae650dSJack F Vogel struct i40e_aqc_remove_udp_tunnel { 226361ae650dSJack F Vogel u8 reserved[2]; 226461ae650dSJack F Vogel u8 index; /* 0 to 15 */ 226561ae650dSJack F Vogel u8 reserved2[13]; 226661ae650dSJack F Vogel }; 226761ae650dSJack F Vogel 226861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_udp_tunnel); 226961ae650dSJack F Vogel 227061ae650dSJack F Vogel struct i40e_aqc_del_udp_tunnel_completion { 227161ae650dSJack F Vogel __le16 udp_port; 227261ae650dSJack F Vogel u8 index; /* 0 to 15 */ 227361ae650dSJack F Vogel u8 multiple_pfs; 227461ae650dSJack F Vogel u8 total_filters_used; 227561ae650dSJack F Vogel u8 reserved1[11]; 227661ae650dSJack F Vogel }; 227761ae650dSJack F Vogel 227861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion); 227961ae650dSJack F Vogel 228061ae650dSJack F Vogel /* tunnel key structure 0x0B10 */ 228161ae650dSJack F Vogel 228261ae650dSJack F Vogel struct i40e_aqc_tunnel_key_structure { 228361ae650dSJack F Vogel u8 key1_off; 228461ae650dSJack F Vogel u8 key2_off; 228561ae650dSJack F Vogel u8 key1_len; /* 0 to 15 */ 228661ae650dSJack F Vogel u8 key2_len; /* 0 to 15 */ 228761ae650dSJack F Vogel u8 flags; 228861ae650dSJack F Vogel #define I40E_AQC_TUNNEL_KEY_STRUCT_OVERRIDE 0x01 228961ae650dSJack F Vogel /* response flags */ 229061ae650dSJack F Vogel #define I40E_AQC_TUNNEL_KEY_STRUCT_SUCCESS 0x01 229161ae650dSJack F Vogel #define I40E_AQC_TUNNEL_KEY_STRUCT_MODIFIED 0x02 229261ae650dSJack F Vogel #define I40E_AQC_TUNNEL_KEY_STRUCT_OVERRIDDEN 0x03 229361ae650dSJack F Vogel u8 network_key_index; 229461ae650dSJack F Vogel #define I40E_AQC_NETWORK_KEY_INDEX_VXLAN 0x0 229561ae650dSJack F Vogel #define I40E_AQC_NETWORK_KEY_INDEX_NGE 0x1 229661ae650dSJack F Vogel #define I40E_AQC_NETWORK_KEY_INDEX_FLEX_MAC_IN_UDP 0x2 229761ae650dSJack F Vogel #define I40E_AQC_NETWORK_KEY_INDEX_GRE 0x3 229861ae650dSJack F Vogel u8 reserved[10]; 229961ae650dSJack F Vogel }; 230061ae650dSJack F Vogel 230161ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_tunnel_key_structure); 230261ae650dSJack F Vogel 230361ae650dSJack F Vogel /* OEM mode commands (direct 0xFE0x) */ 230461ae650dSJack F Vogel struct i40e_aqc_oem_param_change { 230561ae650dSJack F Vogel __le32 param_type; 230661ae650dSJack F Vogel #define I40E_AQ_OEM_PARAM_TYPE_PF_CTL 0 230761ae650dSJack F Vogel #define I40E_AQ_OEM_PARAM_TYPE_BW_CTL 1 230861ae650dSJack F Vogel #define I40E_AQ_OEM_PARAM_MAC 2 230961ae650dSJack F Vogel __le32 param_value1; 2310f247dc25SJack F Vogel __le16 param_value2; 2311f247dc25SJack F Vogel u8 reserved[6]; 231261ae650dSJack F Vogel }; 231361ae650dSJack F Vogel 231461ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_oem_param_change); 231561ae650dSJack F Vogel 231661ae650dSJack F Vogel struct i40e_aqc_oem_state_change { 231761ae650dSJack F Vogel __le32 state; 231861ae650dSJack F Vogel #define I40E_AQ_OEM_STATE_LINK_DOWN 0x0 231961ae650dSJack F Vogel #define I40E_AQ_OEM_STATE_LINK_UP 0x1 232061ae650dSJack F Vogel u8 reserved[12]; 232161ae650dSJack F Vogel }; 232261ae650dSJack F Vogel 232361ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_oem_state_change); 232461ae650dSJack F Vogel 2325f247dc25SJack F Vogel /* Initialize OCSD (0xFE02, direct) */ 2326f247dc25SJack F Vogel struct i40e_aqc_opc_oem_ocsd_initialize { 2327f247dc25SJack F Vogel u8 type_status; 2328f247dc25SJack F Vogel u8 reserved1[3]; 2329f247dc25SJack F Vogel __le32 ocsd_memory_block_addr_high; 2330f247dc25SJack F Vogel __le32 ocsd_memory_block_addr_low; 2331f247dc25SJack F Vogel __le32 requested_update_interval; 2332f247dc25SJack F Vogel }; 2333f247dc25SJack F Vogel 2334f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_opc_oem_ocsd_initialize); 2335f247dc25SJack F Vogel 2336f247dc25SJack F Vogel /* Initialize OCBB (0xFE03, direct) */ 2337f247dc25SJack F Vogel struct i40e_aqc_opc_oem_ocbb_initialize { 2338f247dc25SJack F Vogel u8 type_status; 2339f247dc25SJack F Vogel u8 reserved1[3]; 2340f247dc25SJack F Vogel __le32 ocbb_memory_block_addr_high; 2341f247dc25SJack F Vogel __le32 ocbb_memory_block_addr_low; 2342f247dc25SJack F Vogel u8 reserved2[4]; 2343f247dc25SJack F Vogel }; 2344f247dc25SJack F Vogel 2345f247dc25SJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_opc_oem_ocbb_initialize); 2346f247dc25SJack F Vogel 234761ae650dSJack F Vogel /* debug commands */ 234861ae650dSJack F Vogel 234961ae650dSJack F Vogel /* get device id (0xFF00) uses the generic structure */ 235061ae650dSJack F Vogel 235161ae650dSJack F Vogel /* set test more (0xFF01, internal) */ 235261ae650dSJack F Vogel 235361ae650dSJack F Vogel struct i40e_acq_set_test_mode { 235461ae650dSJack F Vogel u8 mode; 235561ae650dSJack F Vogel #define I40E_AQ_TEST_PARTIAL 0 235661ae650dSJack F Vogel #define I40E_AQ_TEST_FULL 1 235761ae650dSJack F Vogel #define I40E_AQ_TEST_NVM 2 235861ae650dSJack F Vogel u8 reserved[3]; 235961ae650dSJack F Vogel u8 command; 236061ae650dSJack F Vogel #define I40E_AQ_TEST_OPEN 0 236161ae650dSJack F Vogel #define I40E_AQ_TEST_CLOSE 1 236261ae650dSJack F Vogel #define I40E_AQ_TEST_INC 2 236361ae650dSJack F Vogel u8 reserved2[3]; 236461ae650dSJack F Vogel __le32 address_high; 236561ae650dSJack F Vogel __le32 address_low; 236661ae650dSJack F Vogel }; 236761ae650dSJack F Vogel 236861ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_acq_set_test_mode); 236961ae650dSJack F Vogel 237061ae650dSJack F Vogel /* Debug Read Register command (0xFF03) 237161ae650dSJack F Vogel * Debug Write Register command (0xFF04) 237261ae650dSJack F Vogel */ 237361ae650dSJack F Vogel struct i40e_aqc_debug_reg_read_write { 237461ae650dSJack F Vogel __le32 reserved; 237561ae650dSJack F Vogel __le32 address; 237661ae650dSJack F Vogel __le32 value_high; 237761ae650dSJack F Vogel __le32 value_low; 237861ae650dSJack F Vogel }; 237961ae650dSJack F Vogel 238061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_reg_read_write); 238161ae650dSJack F Vogel 238261ae650dSJack F Vogel /* Scatter/gather Reg Read (indirect 0xFF05) 238361ae650dSJack F Vogel * Scatter/gather Reg Write (indirect 0xFF06) 238461ae650dSJack F Vogel */ 238561ae650dSJack F Vogel 238661ae650dSJack F Vogel /* i40e_aq_desc is used for the command */ 238761ae650dSJack F Vogel struct i40e_aqc_debug_reg_sg_element_data { 238861ae650dSJack F Vogel __le32 address; 238961ae650dSJack F Vogel __le32 value; 239061ae650dSJack F Vogel }; 239161ae650dSJack F Vogel 239261ae650dSJack F Vogel /* Debug Modify register (direct 0xFF07) */ 239361ae650dSJack F Vogel struct i40e_aqc_debug_modify_reg { 239461ae650dSJack F Vogel __le32 address; 239561ae650dSJack F Vogel __le32 value; 239661ae650dSJack F Vogel __le32 clear_mask; 239761ae650dSJack F Vogel __le32 set_mask; 239861ae650dSJack F Vogel }; 239961ae650dSJack F Vogel 240061ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_reg); 240161ae650dSJack F Vogel 240261ae650dSJack F Vogel /* dump internal data (0xFF08, indirect) */ 240361ae650dSJack F Vogel 240461ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_AUX 0 240561ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_SWITCH_FLU 1 240661ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_TXSCHED 2 240761ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_HMC 3 240861ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_MAC0 4 240961ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_MAC1 5 241061ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_MAC2 6 241161ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_MAC3 7 241261ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_DCB 8 241361ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_EMP_MEM 9 241461ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_PKT_BUF 10 241561ae650dSJack F Vogel #define I40E_AQ_CLUSTER_ID_ALTRAM 11 241661ae650dSJack F Vogel 241761ae650dSJack F Vogel struct i40e_aqc_debug_dump_internals { 241861ae650dSJack F Vogel u8 cluster_id; 241961ae650dSJack F Vogel u8 table_id; 242061ae650dSJack F Vogel __le16 data_size; 242161ae650dSJack F Vogel __le32 idx; 242261ae650dSJack F Vogel __le32 address_high; 242361ae650dSJack F Vogel __le32 address_low; 242461ae650dSJack F Vogel }; 242561ae650dSJack F Vogel 242661ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_dump_internals); 242761ae650dSJack F Vogel 242861ae650dSJack F Vogel struct i40e_aqc_debug_modify_internals { 242961ae650dSJack F Vogel u8 cluster_id; 243061ae650dSJack F Vogel u8 cluster_specific_params[7]; 243161ae650dSJack F Vogel __le32 address_high; 243261ae650dSJack F Vogel __le32 address_low; 243361ae650dSJack F Vogel }; 243461ae650dSJack F Vogel 243561ae650dSJack F Vogel I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_internals); 243661ae650dSJack F Vogel 2437223d846dSEric Joyner #endif /* _I40E_ADMINQ_CMD_H_ */ 2438