1ae06c70bSJeff Kirsher /* SPDX-License-Identifier: GPL-2.0 */ 290bc8e00SArkadiusz Kubalewski /* Copyright(c) 2013 - 2021 Intel Corporation. */ 356a62fc8SJesse Brandeburg 456a62fc8SJesse Brandeburg #ifndef _I40E_ADMINQ_CMD_H_ 556a62fc8SJesse Brandeburg #define _I40E_ADMINQ_CMD_H_ 656a62fc8SJesse Brandeburg 7e77220eeSIvan Vecera #include <linux/bits.h> 8*1fe83044STony Nguyen #include <linux/types.h> 9e77220eeSIvan Vecera 1056a62fc8SJesse Brandeburg /* This header file defines the i40e Admin Queue commands and is shared between 1156a62fc8SJesse Brandeburg * i40e Firmware and Software. 1256a62fc8SJesse Brandeburg * 1356a62fc8SJesse Brandeburg * This file needs to comply with the Linux Kernel coding style. 1456a62fc8SJesse Brandeburg */ 1556a62fc8SJesse Brandeburg 1656a62fc8SJesse Brandeburg #define I40E_FW_API_VERSION_MAJOR 0x0001 179c83ca8aSMateusz Palczewski #define I40E_FW_API_VERSION_MINOR_X722 0x000C 189c83ca8aSMateusz Palczewski #define I40E_FW_API_VERSION_MINOR_X710 0x000F 1922b96551SMitch Williams 2022b96551SMitch Williams #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ 2122b96551SMitch Williams I40E_FW_API_VERSION_MINOR_X710 : \ 2222b96551SMitch Williams I40E_FW_API_VERSION_MINOR_X722) 2322b96551SMitch Williams 2422b96551SMitch Williams /* API version 1.7 implements additional link and PHY-specific APIs */ 2522b96551SMitch Williams #define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007 266acab13bSJacob Keller /* API version 1.9 for X722 implements additional link and PHY-specific APIs */ 276acab13bSJacob Keller #define I40E_MINOR_VER_GET_LINK_INFO_X722 0x0009 28de10933eSKrzysztof Galazka /* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */ 29de10933eSKrzysztof Galazka #define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006 3030cf856aSJaroslaw Gawin /* API version 1.10 for X722 devices adds ability to request FEC encoding */ 3130cf856aSJaroslaw Gawin #define I40E_MINOR_VER_FW_REQUEST_FEC_X722 0x000A 3256a62fc8SJesse Brandeburg 3356a62fc8SJesse Brandeburg struct i40e_aq_desc { 3456a62fc8SJesse Brandeburg __le16 flags; 3556a62fc8SJesse Brandeburg __le16 opcode; 3656a62fc8SJesse Brandeburg __le16 datalen; 3756a62fc8SJesse Brandeburg __le16 retval; 3856a62fc8SJesse Brandeburg __le32 cookie_high; 3956a62fc8SJesse Brandeburg __le32 cookie_low; 4056a62fc8SJesse Brandeburg union { 4156a62fc8SJesse Brandeburg struct { 4256a62fc8SJesse Brandeburg __le32 param0; 4356a62fc8SJesse Brandeburg __le32 param1; 4456a62fc8SJesse Brandeburg __le32 param2; 4556a62fc8SJesse Brandeburg __le32 param3; 4656a62fc8SJesse Brandeburg } internal; 4756a62fc8SJesse Brandeburg struct { 4856a62fc8SJesse Brandeburg __le32 param0; 4956a62fc8SJesse Brandeburg __le32 param1; 5056a62fc8SJesse Brandeburg __le32 addr_high; 5156a62fc8SJesse Brandeburg __le32 addr_low; 5256a62fc8SJesse Brandeburg } external; 5356a62fc8SJesse Brandeburg u8 raw[16]; 5456a62fc8SJesse Brandeburg } params; 5556a62fc8SJesse Brandeburg }; 5656a62fc8SJesse Brandeburg 5756a62fc8SJesse Brandeburg /* Flags sub-structure 5856a62fc8SJesse Brandeburg * |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |10 |11 |12 |13 |14 |15 | 5956a62fc8SJesse Brandeburg * |DD |CMP|ERR|VFE| * * RESERVED * * |LB |RD |VFC|BUF|SI |EI |FE | 6056a62fc8SJesse Brandeburg */ 6156a62fc8SJesse Brandeburg 6256a62fc8SJesse Brandeburg /* command flags and offsets*/ 6356a62fc8SJesse Brandeburg #define I40E_AQ_FLAG_ERR_SHIFT 2 6456a62fc8SJesse Brandeburg #define I40E_AQ_FLAG_LB_SHIFT 9 6556a62fc8SJesse Brandeburg #define I40E_AQ_FLAG_RD_SHIFT 10 6656a62fc8SJesse Brandeburg #define I40E_AQ_FLAG_BUF_SHIFT 12 6756a62fc8SJesse Brandeburg #define I40E_AQ_FLAG_SI_SHIFT 13 6856a62fc8SJesse Brandeburg 692101bac2SJacob Keller #define I40E_AQ_FLAG_ERR BIT(I40E_AQ_FLAG_ERR_SHIFT) /* 0x4 */ 702101bac2SJacob Keller #define I40E_AQ_FLAG_LB BIT(I40E_AQ_FLAG_LB_SHIFT) /* 0x200 */ 712101bac2SJacob Keller #define I40E_AQ_FLAG_RD BIT(I40E_AQ_FLAG_RD_SHIFT) /* 0x400 */ 722101bac2SJacob Keller #define I40E_AQ_FLAG_BUF BIT(I40E_AQ_FLAG_BUF_SHIFT) /* 0x1000 */ 732101bac2SJacob Keller #define I40E_AQ_FLAG_SI BIT(I40E_AQ_FLAG_SI_SHIFT) /* 0x2000 */ 7456a62fc8SJesse Brandeburg 7556a62fc8SJesse Brandeburg /* error codes */ 7656a62fc8SJesse Brandeburg enum i40e_admin_queue_err { 7756a62fc8SJesse Brandeburg I40E_AQ_RC_OK = 0, /* success */ 7856a62fc8SJesse Brandeburg I40E_AQ_RC_EPERM = 1, /* Operation not permitted */ 7956a62fc8SJesse Brandeburg I40E_AQ_RC_ENOENT = 2, /* No such element */ 8056a62fc8SJesse Brandeburg I40E_AQ_RC_ESRCH = 3, /* Bad opcode */ 8156a62fc8SJesse Brandeburg I40E_AQ_RC_EINTR = 4, /* operation interrupted */ 8256a62fc8SJesse Brandeburg I40E_AQ_RC_EIO = 5, /* I/O error */ 8356a62fc8SJesse Brandeburg I40E_AQ_RC_ENXIO = 6, /* No such resource */ 8456a62fc8SJesse Brandeburg I40E_AQ_RC_E2BIG = 7, /* Arg too long */ 8556a62fc8SJesse Brandeburg I40E_AQ_RC_EAGAIN = 8, /* Try again */ 8656a62fc8SJesse Brandeburg I40E_AQ_RC_ENOMEM = 9, /* Out of memory */ 8756a62fc8SJesse Brandeburg I40E_AQ_RC_EACCES = 10, /* Permission denied */ 8856a62fc8SJesse Brandeburg I40E_AQ_RC_EFAULT = 11, /* Bad address */ 8956a62fc8SJesse Brandeburg I40E_AQ_RC_EBUSY = 12, /* Device or resource busy */ 9056a62fc8SJesse Brandeburg I40E_AQ_RC_EEXIST = 13, /* object already exists */ 9156a62fc8SJesse Brandeburg I40E_AQ_RC_EINVAL = 14, /* Invalid argument */ 9256a62fc8SJesse Brandeburg I40E_AQ_RC_ENOTTY = 15, /* Not a typewriter */ 9356a62fc8SJesse Brandeburg I40E_AQ_RC_ENOSPC = 16, /* No space left or alloc failure */ 9456a62fc8SJesse Brandeburg I40E_AQ_RC_ENOSYS = 17, /* Function not implemented */ 9556a62fc8SJesse Brandeburg I40E_AQ_RC_ERANGE = 18, /* Parameter out of range */ 968c570dccSJeff Kirsher I40E_AQ_RC_EFLUSHED = 19, /* Cmd flushed due to prev cmd error */ 9756a62fc8SJesse Brandeburg I40E_AQ_RC_BAD_ADDR = 20, /* Descriptor contains a bad pointer */ 9856a62fc8SJesse Brandeburg I40E_AQ_RC_EMODE = 21, /* Op not allowed in current dev mode */ 9956a62fc8SJesse Brandeburg I40E_AQ_RC_EFBIG = 22, /* File too large */ 10056a62fc8SJesse Brandeburg }; 10156a62fc8SJesse Brandeburg 10256a62fc8SJesse Brandeburg /* Admin Queue command opcodes */ 10356a62fc8SJesse Brandeburg enum i40e_admin_queue_opc { 10456a62fc8SJesse Brandeburg /* aq commands */ 10556a62fc8SJesse Brandeburg i40e_aqc_opc_get_version = 0x0001, 10656a62fc8SJesse Brandeburg i40e_aqc_opc_driver_version = 0x0002, 10756a62fc8SJesse Brandeburg i40e_aqc_opc_queue_shutdown = 0x0003, 108f94234eeSShannon Nelson i40e_aqc_opc_set_pf_context = 0x0004, 10956a62fc8SJesse Brandeburg 11056a62fc8SJesse Brandeburg /* resource ownership */ 11156a62fc8SJesse Brandeburg i40e_aqc_opc_request_resource = 0x0008, 11256a62fc8SJesse Brandeburg i40e_aqc_opc_release_resource = 0x0009, 11356a62fc8SJesse Brandeburg 11456a62fc8SJesse Brandeburg i40e_aqc_opc_list_func_capabilities = 0x000A, 11556a62fc8SJesse Brandeburg i40e_aqc_opc_list_dev_capabilities = 0x000B, 11656a62fc8SJesse Brandeburg 117d60be2caSShannon Nelson /* Proxy commands */ 118d60be2caSShannon Nelson i40e_aqc_opc_set_proxy_config = 0x0104, 119d60be2caSShannon Nelson i40e_aqc_opc_set_ns_proxy_table_entry = 0x0105, 120d60be2caSShannon Nelson 12156a62fc8SJesse Brandeburg /* LAA */ 12256a62fc8SJesse Brandeburg i40e_aqc_opc_mac_address_read = 0x0107, 12356a62fc8SJesse Brandeburg i40e_aqc_opc_mac_address_write = 0x0108, 12456a62fc8SJesse Brandeburg 125981b7545SShannon Nelson /* PXE */ 126981b7545SShannon Nelson i40e_aqc_opc_clear_pxe_mode = 0x0110, 127981b7545SShannon Nelson 128d60be2caSShannon Nelson /* WoL commands */ 129d60be2caSShannon Nelson i40e_aqc_opc_set_wol_filter = 0x0120, 130d60be2caSShannon Nelson i40e_aqc_opc_get_wake_reason = 0x0121, 131d60be2caSShannon Nelson 13256a62fc8SJesse Brandeburg /* internal switch commands */ 13356a62fc8SJesse Brandeburg i40e_aqc_opc_get_switch_config = 0x0200, 13456a62fc8SJesse Brandeburg i40e_aqc_opc_add_statistics = 0x0201, 13556a62fc8SJesse Brandeburg i40e_aqc_opc_remove_statistics = 0x0202, 13656a62fc8SJesse Brandeburg i40e_aqc_opc_set_port_parameters = 0x0203, 13756a62fc8SJesse Brandeburg i40e_aqc_opc_get_switch_resource_alloc = 0x0204, 138fa5623a6SShannon Nelson i40e_aqc_opc_set_switch_config = 0x0205, 13933365143SShannon Nelson i40e_aqc_opc_rx_ctl_reg_read = 0x0206, 14033365143SShannon Nelson i40e_aqc_opc_rx_ctl_reg_write = 0x0207, 14156a62fc8SJesse Brandeburg 14256a62fc8SJesse Brandeburg i40e_aqc_opc_add_vsi = 0x0210, 14356a62fc8SJesse Brandeburg i40e_aqc_opc_update_vsi_parameters = 0x0211, 14456a62fc8SJesse Brandeburg i40e_aqc_opc_get_vsi_parameters = 0x0212, 14556a62fc8SJesse Brandeburg 14656a62fc8SJesse Brandeburg i40e_aqc_opc_add_pv = 0x0220, 14756a62fc8SJesse Brandeburg i40e_aqc_opc_update_pv_parameters = 0x0221, 14856a62fc8SJesse Brandeburg i40e_aqc_opc_get_pv_parameters = 0x0222, 14956a62fc8SJesse Brandeburg 15056a62fc8SJesse Brandeburg i40e_aqc_opc_add_veb = 0x0230, 15156a62fc8SJesse Brandeburg i40e_aqc_opc_update_veb_parameters = 0x0231, 15256a62fc8SJesse Brandeburg i40e_aqc_opc_get_veb_parameters = 0x0232, 15356a62fc8SJesse Brandeburg 15456a62fc8SJesse Brandeburg i40e_aqc_opc_delete_element = 0x0243, 15556a62fc8SJesse Brandeburg 15656a62fc8SJesse Brandeburg i40e_aqc_opc_add_macvlan = 0x0250, 15756a62fc8SJesse Brandeburg i40e_aqc_opc_remove_macvlan = 0x0251, 15856a62fc8SJesse Brandeburg i40e_aqc_opc_add_vlan = 0x0252, 15956a62fc8SJesse Brandeburg i40e_aqc_opc_remove_vlan = 0x0253, 16056a62fc8SJesse Brandeburg i40e_aqc_opc_set_vsi_promiscuous_modes = 0x0254, 16156a62fc8SJesse Brandeburg i40e_aqc_opc_add_tag = 0x0255, 16256a62fc8SJesse Brandeburg i40e_aqc_opc_remove_tag = 0x0256, 16356a62fc8SJesse Brandeburg i40e_aqc_opc_add_multicast_etag = 0x0257, 16456a62fc8SJesse Brandeburg i40e_aqc_opc_remove_multicast_etag = 0x0258, 16556a62fc8SJesse Brandeburg i40e_aqc_opc_update_tag = 0x0259, 16656a62fc8SJesse Brandeburg i40e_aqc_opc_add_control_packet_filter = 0x025A, 16756a62fc8SJesse Brandeburg i40e_aqc_opc_remove_control_packet_filter = 0x025B, 16856a62fc8SJesse Brandeburg i40e_aqc_opc_add_cloud_filters = 0x025C, 16956a62fc8SJesse Brandeburg i40e_aqc_opc_remove_cloud_filters = 0x025D, 170d60be2caSShannon Nelson i40e_aqc_opc_clear_wol_switch_filters = 0x025E, 17156a62fc8SJesse Brandeburg 17256a62fc8SJesse Brandeburg i40e_aqc_opc_add_mirror_rule = 0x0260, 17356a62fc8SJesse Brandeburg i40e_aqc_opc_delete_mirror_rule = 0x0261, 17456a62fc8SJesse Brandeburg 175329e5983SJingjing Wu /* Dynamic Device Personalization */ 1761d5c960cSJingjing Wu i40e_aqc_opc_write_personalization_profile = 0x0270, 1771d5c960cSJingjing Wu i40e_aqc_opc_get_personalization_profile_list = 0x0271, 1781d5c960cSJingjing Wu 17956a62fc8SJesse Brandeburg /* DCB commands */ 18056a62fc8SJesse Brandeburg i40e_aqc_opc_dcb_ignore_pfc = 0x0301, 18156a62fc8SJesse Brandeburg i40e_aqc_opc_dcb_updated = 0x0302, 182b6a02a6fSUpasana Menon i40e_aqc_opc_set_dcb_parameters = 0x0303, 18356a62fc8SJesse Brandeburg 18456a62fc8SJesse Brandeburg /* TX scheduler */ 18556a62fc8SJesse Brandeburg i40e_aqc_opc_configure_vsi_bw_limit = 0x0400, 18656a62fc8SJesse Brandeburg i40e_aqc_opc_configure_vsi_ets_sla_bw_limit = 0x0406, 18756a62fc8SJesse Brandeburg i40e_aqc_opc_configure_vsi_tc_bw = 0x0407, 18856a62fc8SJesse Brandeburg i40e_aqc_opc_query_vsi_bw_config = 0x0408, 18956a62fc8SJesse Brandeburg i40e_aqc_opc_query_vsi_ets_sla_config = 0x040A, 19056a62fc8SJesse Brandeburg i40e_aqc_opc_configure_switching_comp_bw_limit = 0x0410, 19156a62fc8SJesse Brandeburg 19256a62fc8SJesse Brandeburg i40e_aqc_opc_enable_switching_comp_ets = 0x0413, 19356a62fc8SJesse Brandeburg i40e_aqc_opc_modify_switching_comp_ets = 0x0414, 19456a62fc8SJesse Brandeburg i40e_aqc_opc_disable_switching_comp_ets = 0x0415, 19556a62fc8SJesse Brandeburg i40e_aqc_opc_configure_switching_comp_ets_bw_limit = 0x0416, 19656a62fc8SJesse Brandeburg i40e_aqc_opc_configure_switching_comp_bw_config = 0x0417, 19756a62fc8SJesse Brandeburg i40e_aqc_opc_query_switching_comp_ets_config = 0x0418, 19856a62fc8SJesse Brandeburg i40e_aqc_opc_query_port_ets_config = 0x0419, 19956a62fc8SJesse Brandeburg i40e_aqc_opc_query_switching_comp_bw_config = 0x041A, 20056a62fc8SJesse Brandeburg i40e_aqc_opc_suspend_port_tx = 0x041B, 20156a62fc8SJesse Brandeburg i40e_aqc_opc_resume_port_tx = 0x041C, 202befc229cSShannon Nelson i40e_aqc_opc_configure_partition_bw = 0x041D, 2037d94906bSCarolyn Wyborny /* hmc */ 2047d94906bSCarolyn Wyborny i40e_aqc_opc_query_hmc_resource_profile = 0x0500, 2057d94906bSCarolyn Wyborny i40e_aqc_opc_set_hmc_resource_profile = 0x0501, 20656a62fc8SJesse Brandeburg 20756a62fc8SJesse Brandeburg /* phy commands*/ 20856a62fc8SJesse Brandeburg i40e_aqc_opc_get_phy_abilities = 0x0600, 20956a62fc8SJesse Brandeburg i40e_aqc_opc_set_phy_config = 0x0601, 21056a62fc8SJesse Brandeburg i40e_aqc_opc_set_mac_config = 0x0603, 21156a62fc8SJesse Brandeburg i40e_aqc_opc_set_link_restart_an = 0x0605, 21256a62fc8SJesse Brandeburg i40e_aqc_opc_get_link_status = 0x0607, 21356a62fc8SJesse Brandeburg i40e_aqc_opc_set_phy_int_mask = 0x0613, 21456a62fc8SJesse Brandeburg i40e_aqc_opc_get_local_advt_reg = 0x0614, 21556a62fc8SJesse Brandeburg i40e_aqc_opc_set_local_advt_reg = 0x0615, 21656a62fc8SJesse Brandeburg i40e_aqc_opc_get_partner_advt = 0x0616, 21756a62fc8SJesse Brandeburg i40e_aqc_opc_set_lb_modes = 0x0618, 21856a62fc8SJesse Brandeburg i40e_aqc_opc_get_phy_wol_caps = 0x0621, 219f94234eeSShannon Nelson i40e_aqc_opc_set_phy_debug = 0x0622, 22056a62fc8SJesse Brandeburg i40e_aqc_opc_upload_ext_phy_fm = 0x0625, 2215394f02fSShannon Nelson i40e_aqc_opc_run_phy_activity = 0x0626, 2229c0e5cafSFilip Sadowski i40e_aqc_opc_set_phy_register = 0x0628, 2239c0e5cafSFilip Sadowski i40e_aqc_opc_get_phy_register = 0x0629, 22456a62fc8SJesse Brandeburg 22556a62fc8SJesse Brandeburg /* NVM commands */ 22656a62fc8SJesse Brandeburg i40e_aqc_opc_nvm_read = 0x0701, 22756a62fc8SJesse Brandeburg i40e_aqc_opc_nvm_erase = 0x0702, 22856a62fc8SJesse Brandeburg i40e_aqc_opc_nvm_update = 0x0703, 229f94234eeSShannon Nelson i40e_aqc_opc_nvm_config_read = 0x0704, 230f94234eeSShannon Nelson i40e_aqc_opc_nvm_config_write = 0x0705, 23100ada50dSMichal Kosiarz i40e_aqc_opc_oem_post_update = 0x0720, 2326774faf9SShannon Nelson i40e_aqc_opc_thermal_sensor = 0x0721, 23356a62fc8SJesse Brandeburg 23456a62fc8SJesse Brandeburg /* virtualization commands */ 23556a62fc8SJesse Brandeburg i40e_aqc_opc_send_msg_to_pf = 0x0801, 23656a62fc8SJesse Brandeburg i40e_aqc_opc_send_msg_to_vf = 0x0802, 23756a62fc8SJesse Brandeburg i40e_aqc_opc_send_msg_to_peer = 0x0803, 23856a62fc8SJesse Brandeburg 23956a62fc8SJesse Brandeburg /* alternate structure */ 24056a62fc8SJesse Brandeburg i40e_aqc_opc_alternate_write = 0x0900, 24156a62fc8SJesse Brandeburg i40e_aqc_opc_alternate_write_indirect = 0x0901, 24256a62fc8SJesse Brandeburg i40e_aqc_opc_alternate_read = 0x0902, 24356a62fc8SJesse Brandeburg i40e_aqc_opc_alternate_read_indirect = 0x0903, 24456a62fc8SJesse Brandeburg i40e_aqc_opc_alternate_write_done = 0x0904, 24556a62fc8SJesse Brandeburg i40e_aqc_opc_alternate_set_mode = 0x0905, 24656a62fc8SJesse Brandeburg i40e_aqc_opc_alternate_clear_port = 0x0906, 24756a62fc8SJesse Brandeburg 24856a62fc8SJesse Brandeburg /* LLDP commands */ 24956a62fc8SJesse Brandeburg i40e_aqc_opc_lldp_get_mib = 0x0A00, 25056a62fc8SJesse Brandeburg i40e_aqc_opc_lldp_update_mib = 0x0A01, 25156a62fc8SJesse Brandeburg i40e_aqc_opc_lldp_add_tlv = 0x0A02, 25256a62fc8SJesse Brandeburg i40e_aqc_opc_lldp_update_tlv = 0x0A03, 25356a62fc8SJesse Brandeburg i40e_aqc_opc_lldp_delete_tlv = 0x0A04, 25456a62fc8SJesse Brandeburg i40e_aqc_opc_lldp_stop = 0x0A05, 25556a62fc8SJesse Brandeburg i40e_aqc_opc_lldp_start = 0x0A06, 2569fa61dd2SNeerav Parikh i40e_aqc_opc_get_cee_dcb_cfg = 0x0A07, 257672415c5SShannon Nelson i40e_aqc_opc_lldp_set_local_mib = 0x0A08, 258672415c5SShannon Nelson i40e_aqc_opc_lldp_stop_start_spec_agent = 0x0A09, 259c65e78f8SAleksandr Loktionov i40e_aqc_opc_lldp_restore = 0x0A0A, 26056a62fc8SJesse Brandeburg 26156a62fc8SJesse Brandeburg /* Tunnel commands */ 26256a62fc8SJesse Brandeburg i40e_aqc_opc_add_udp_tunnel = 0x0B00, 26356a62fc8SJesse Brandeburg i40e_aqc_opc_del_udp_tunnel = 0x0B01, 264e50c8d6dSAnjali Singhai Jain i40e_aqc_opc_set_rss_key = 0x0B02, 265e50c8d6dSAnjali Singhai Jain i40e_aqc_opc_set_rss_lut = 0x0B03, 266e50c8d6dSAnjali Singhai Jain i40e_aqc_opc_get_rss_key = 0x0B04, 267e50c8d6dSAnjali Singhai Jain i40e_aqc_opc_get_rss_lut = 0x0B05, 26856a62fc8SJesse Brandeburg 26956a62fc8SJesse Brandeburg /* Async Events */ 27056a62fc8SJesse Brandeburg i40e_aqc_opc_event_lan_overflow = 0x1001, 27156a62fc8SJesse Brandeburg 27256a62fc8SJesse Brandeburg /* OEM commands */ 27356a62fc8SJesse Brandeburg i40e_aqc_opc_oem_parameter_change = 0xFE00, 27456a62fc8SJesse Brandeburg i40e_aqc_opc_oem_device_status_change = 0xFE01, 275672415c5SShannon Nelson i40e_aqc_opc_oem_ocsd_initialize = 0xFE02, 276672415c5SShannon Nelson i40e_aqc_opc_oem_ocbb_initialize = 0xFE03, 27756a62fc8SJesse Brandeburg 27856a62fc8SJesse Brandeburg /* debug commands */ 27956a62fc8SJesse Brandeburg i40e_aqc_opc_debug_read_reg = 0xFF03, 28056a62fc8SJesse Brandeburg i40e_aqc_opc_debug_write_reg = 0xFF04, 28156a62fc8SJesse Brandeburg i40e_aqc_opc_debug_modify_reg = 0xFF07, 28256a62fc8SJesse Brandeburg i40e_aqc_opc_debug_dump_internals = 0xFF08, 28356a62fc8SJesse Brandeburg }; 28456a62fc8SJesse Brandeburg 28556a62fc8SJesse Brandeburg /* command structures and indirect data structures */ 28656a62fc8SJesse Brandeburg 28756a62fc8SJesse Brandeburg /* Structure naming conventions: 28856a62fc8SJesse Brandeburg * - no suffix for direct command descriptor structures 28956a62fc8SJesse Brandeburg * - _data for indirect sent data 29056a62fc8SJesse Brandeburg * - _resp for indirect return data (data which is both will use _data) 29156a62fc8SJesse Brandeburg * - _completion for direct return data 29256a62fc8SJesse Brandeburg * - _element_ for repeated elements (may also be _data or _resp) 29356a62fc8SJesse Brandeburg * 29456a62fc8SJesse Brandeburg * Command structures are expected to overlay the params.raw member of the basic 29556a62fc8SJesse Brandeburg * descriptor, and as such cannot exceed 16 bytes in length. 29656a62fc8SJesse Brandeburg */ 29756a62fc8SJesse Brandeburg 29856a62fc8SJesse Brandeburg /* This macro is used to generate a compilation error if a structure 29956a62fc8SJesse Brandeburg * is not exactly the correct length. It gives a divide by zero error if the 30056a62fc8SJesse Brandeburg * structure is not of the correct size, otherwise it creates an enum that is 30156a62fc8SJesse Brandeburg * never used. 30256a62fc8SJesse Brandeburg */ 30356a62fc8SJesse Brandeburg #define I40E_CHECK_STRUCT_LEN(n, X) enum i40e_static_assert_enum_##X \ 30456a62fc8SJesse Brandeburg { i40e_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } 30556a62fc8SJesse Brandeburg 30656a62fc8SJesse Brandeburg /* This macro is used extensively to ensure that command structures are 16 30756a62fc8SJesse Brandeburg * bytes in length as they have to map to the raw array of that size. 30856a62fc8SJesse Brandeburg */ 30956a62fc8SJesse Brandeburg #define I40E_CHECK_CMD_LENGTH(X) I40E_CHECK_STRUCT_LEN(16, X) 31056a62fc8SJesse Brandeburg 31156a62fc8SJesse Brandeburg /* internal (0x00XX) commands */ 31256a62fc8SJesse Brandeburg 31356a62fc8SJesse Brandeburg /* Get version (direct 0x0001) */ 31456a62fc8SJesse Brandeburg struct i40e_aqc_get_version { 31556a62fc8SJesse Brandeburg __le32 rom_ver; 31656a62fc8SJesse Brandeburg __le32 fw_build; 31756a62fc8SJesse Brandeburg __le16 fw_major; 31856a62fc8SJesse Brandeburg __le16 fw_minor; 31956a62fc8SJesse Brandeburg __le16 api_major; 32056a62fc8SJesse Brandeburg __le16 api_minor; 32156a62fc8SJesse Brandeburg }; 32256a62fc8SJesse Brandeburg 32356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_get_version); 32456a62fc8SJesse Brandeburg 325981b7545SShannon Nelson /* Send driver version (indirect 0x0002) */ 32656a62fc8SJesse Brandeburg struct i40e_aqc_driver_version { 32756a62fc8SJesse Brandeburg u8 driver_major_ver; 32856a62fc8SJesse Brandeburg u8 driver_minor_ver; 32956a62fc8SJesse Brandeburg u8 driver_build_ver; 33056a62fc8SJesse Brandeburg u8 driver_subbuild_ver; 331981b7545SShannon Nelson u8 reserved[4]; 332981b7545SShannon Nelson __le32 address_high; 333981b7545SShannon Nelson __le32 address_low; 33456a62fc8SJesse Brandeburg }; 33556a62fc8SJesse Brandeburg 33656a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_driver_version); 33756a62fc8SJesse Brandeburg 33856a62fc8SJesse Brandeburg /* Queue Shutdown (direct 0x0003) */ 33956a62fc8SJesse Brandeburg struct i40e_aqc_queue_shutdown { 34056a62fc8SJesse Brandeburg __le32 driver_unloading; 34156a62fc8SJesse Brandeburg #define I40E_AQ_DRIVER_UNLOADING 0x1 34256a62fc8SJesse Brandeburg u8 reserved[12]; 34356a62fc8SJesse Brandeburg }; 34456a62fc8SJesse Brandeburg 34556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_queue_shutdown); 34656a62fc8SJesse Brandeburg 347f94234eeSShannon Nelson /* Set PF context (0x0004, direct) */ 348f94234eeSShannon Nelson struct i40e_aqc_set_pf_context { 349f94234eeSShannon Nelson u8 pf_id; 350f94234eeSShannon Nelson u8 reserved[15]; 351f94234eeSShannon Nelson }; 352f94234eeSShannon Nelson 353f94234eeSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_set_pf_context); 354f94234eeSShannon Nelson 35556a62fc8SJesse Brandeburg /* Request resource ownership (direct 0x0008) 35656a62fc8SJesse Brandeburg * Release resource ownership (direct 0x0009) 35756a62fc8SJesse Brandeburg */ 35856a62fc8SJesse Brandeburg struct i40e_aqc_request_resource { 35956a62fc8SJesse Brandeburg __le16 resource_id; 36056a62fc8SJesse Brandeburg __le16 access_type; 36156a62fc8SJesse Brandeburg __le32 timeout; 36256a62fc8SJesse Brandeburg __le32 resource_number; 36356a62fc8SJesse Brandeburg u8 reserved[4]; 36456a62fc8SJesse Brandeburg }; 36556a62fc8SJesse Brandeburg 36656a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_request_resource); 36756a62fc8SJesse Brandeburg 36856a62fc8SJesse Brandeburg /* Get function capabilities (indirect 0x000A) 36956a62fc8SJesse Brandeburg * Get device capabilities (indirect 0x000B) 37056a62fc8SJesse Brandeburg */ 37156a62fc8SJesse Brandeburg struct i40e_aqc_list_capabilites { 37256a62fc8SJesse Brandeburg u8 command_flags; 37356a62fc8SJesse Brandeburg u8 pf_index; 37456a62fc8SJesse Brandeburg u8 reserved[2]; 37556a62fc8SJesse Brandeburg __le32 count; 37656a62fc8SJesse Brandeburg __le32 addr_high; 37756a62fc8SJesse Brandeburg __le32 addr_low; 37856a62fc8SJesse Brandeburg }; 37956a62fc8SJesse Brandeburg 38056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_list_capabilites); 38156a62fc8SJesse Brandeburg 38256a62fc8SJesse Brandeburg struct i40e_aqc_list_capabilities_element_resp { 38356a62fc8SJesse Brandeburg __le16 id; 38456a62fc8SJesse Brandeburg u8 major_rev; 38556a62fc8SJesse Brandeburg u8 minor_rev; 38656a62fc8SJesse Brandeburg __le32 number; 38756a62fc8SJesse Brandeburg __le32 logical_id; 38856a62fc8SJesse Brandeburg __le32 phys_id; 38956a62fc8SJesse Brandeburg u8 reserved[16]; 39056a62fc8SJesse Brandeburg }; 39156a62fc8SJesse Brandeburg 39256a62fc8SJesse Brandeburg /* list of caps */ 39356a62fc8SJesse Brandeburg 39456a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_SWITCH_MODE 0x0001 39556a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_MNG_MODE 0x0002 39656a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_NPAR_ACTIVE 0x0003 39756a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_OS2BMC_CAP 0x0004 39856a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_FUNCTIONS_VALID 0x0005 39956a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_SRIOV 0x0012 40056a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_VF 0x0013 40156a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_VMDQ 0x0014 40256a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_8021QBG 0x0015 40356a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_8021QBR 0x0016 40456a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_VSI 0x0017 40556a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_DCB 0x0018 40656a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_FCOE 0x0021 40735155fe6SShannon Nelson #define I40E_AQ_CAP_ID_ISCSI 0x0022 40856a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_RSS 0x0040 40956a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_RXQ 0x0041 41056a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_TXQ 0x0042 41156a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_MSIX 0x0043 41256a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_VF_MSIX 0x0044 41356a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_FLOW_DIRECTOR 0x0045 41456a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_1588 0x0046 41556a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_IWARP 0x0051 41656a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_LED 0x0061 41756a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_SDP 0x0062 41856a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_MDIO 0x0063 419406e734aSShannon Nelson #define I40E_AQ_CAP_ID_WSR_PROT 0x0064 42068a1c5a7SMichal Kosiarz #define I40E_AQ_CAP_ID_NVM_MGMT 0x0080 42156a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_FLEX10 0x00F1 42256a62fc8SJesse Brandeburg #define I40E_AQ_CAP_ID_CEM 0x00F2 42356a62fc8SJesse Brandeburg 42456a62fc8SJesse Brandeburg /* Set CPPM Configuration (direct 0x0103) */ 42556a62fc8SJesse Brandeburg struct i40e_aqc_cppm_configuration { 42656a62fc8SJesse Brandeburg __le16 command_flags; 42756a62fc8SJesse Brandeburg __le16 ttlx; 42856a62fc8SJesse Brandeburg __le32 dmacr; 42956a62fc8SJesse Brandeburg __le16 dmcth; 43056a62fc8SJesse Brandeburg u8 hptc; 43156a62fc8SJesse Brandeburg u8 reserved; 43256a62fc8SJesse Brandeburg __le32 pfltrc; 43356a62fc8SJesse Brandeburg }; 43456a62fc8SJesse Brandeburg 43556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration); 43656a62fc8SJesse Brandeburg 43756a62fc8SJesse Brandeburg /* Set ARP Proxy command / response (indirect 0x0104) */ 43856a62fc8SJesse Brandeburg struct i40e_aqc_arp_proxy_data { 43956a62fc8SJesse Brandeburg __le16 command_flags; 44056a62fc8SJesse Brandeburg __le16 table_id; 441b7eeef49SCarolyn Wyborny __le32 enabled_offloads; 44256a62fc8SJesse Brandeburg __le32 ip_addr; 44356a62fc8SJesse Brandeburg u8 mac_addr[6]; 444672415c5SShannon Nelson u8 reserved[2]; 44556a62fc8SJesse Brandeburg }; 44656a62fc8SJesse Brandeburg 4478d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x14, i40e_aqc_arp_proxy_data); 4488d5e33adSShannon Nelson 44956a62fc8SJesse Brandeburg /* Set NS Proxy Table Entry Command (indirect 0x0105) */ 45056a62fc8SJesse Brandeburg struct i40e_aqc_ns_proxy_data { 45156a62fc8SJesse Brandeburg __le16 table_idx_mac_addr_0; 45256a62fc8SJesse Brandeburg __le16 table_idx_mac_addr_1; 45356a62fc8SJesse Brandeburg __le16 table_idx_ipv6_0; 45456a62fc8SJesse Brandeburg __le16 table_idx_ipv6_1; 45556a62fc8SJesse Brandeburg __le16 control; 45656a62fc8SJesse Brandeburg u8 mac_addr_0[6]; 45756a62fc8SJesse Brandeburg u8 mac_addr_1[6]; 45856a62fc8SJesse Brandeburg u8 local_mac_addr[6]; 45956a62fc8SJesse Brandeburg u8 ipv6_addr_0[16]; /* Warning! spec specifies BE byte order */ 46056a62fc8SJesse Brandeburg u8 ipv6_addr_1[16]; 46156a62fc8SJesse Brandeburg }; 46256a62fc8SJesse Brandeburg 4638d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x3c, i40e_aqc_ns_proxy_data); 4648d5e33adSShannon Nelson 46556a62fc8SJesse Brandeburg /* Manage LAA Command (0x0106) - obsolete */ 46656a62fc8SJesse Brandeburg struct i40e_aqc_mng_laa { 46756a62fc8SJesse Brandeburg __le16 command_flags; 46856a62fc8SJesse Brandeburg u8 reserved[2]; 46956a62fc8SJesse Brandeburg __le32 sal; 47056a62fc8SJesse Brandeburg __le16 sah; 47156a62fc8SJesse Brandeburg u8 reserved2[6]; 47256a62fc8SJesse Brandeburg }; 47356a62fc8SJesse Brandeburg 4748d5e33adSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_mng_laa); 4758d5e33adSShannon Nelson 476981b7545SShannon Nelson /* Manage MAC Address Read Command (indirect 0x0107) */ 47756a62fc8SJesse Brandeburg struct i40e_aqc_mac_address_read { 47856a62fc8SJesse Brandeburg __le16 command_flags; 47956a62fc8SJesse Brandeburg #define I40E_AQC_LAN_ADDR_VALID 0x10 48056a62fc8SJesse Brandeburg #define I40E_AQC_PORT_ADDR_VALID 0x40 48156a62fc8SJesse Brandeburg u8 reserved[6]; 48256a62fc8SJesse Brandeburg __le32 addr_high; 48356a62fc8SJesse Brandeburg __le32 addr_low; 48456a62fc8SJesse Brandeburg }; 48556a62fc8SJesse Brandeburg 48656a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_mac_address_read); 48756a62fc8SJesse Brandeburg 48856a62fc8SJesse Brandeburg struct i40e_aqc_mac_address_read_data { 48956a62fc8SJesse Brandeburg u8 pf_lan_mac[6]; 49056a62fc8SJesse Brandeburg u8 pf_san_mac[6]; 49156a62fc8SJesse Brandeburg u8 port_mac[6]; 49256a62fc8SJesse Brandeburg u8 pf_wol_mac[6]; 49356a62fc8SJesse Brandeburg }; 49456a62fc8SJesse Brandeburg 49556a62fc8SJesse Brandeburg I40E_CHECK_STRUCT_LEN(24, i40e_aqc_mac_address_read_data); 49656a62fc8SJesse Brandeburg 49756a62fc8SJesse Brandeburg /* Manage MAC Address Write Command (0x0108) */ 49856a62fc8SJesse Brandeburg struct i40e_aqc_mac_address_write { 49956a62fc8SJesse Brandeburg __le16 command_flags; 5001d68005dSJoshua Hay #define I40E_AQC_MC_MAG_EN 0x0100 5011d68005dSJoshua Hay #define I40E_AQC_WOL_PRESERVE_ON_PFR 0x0200 50256a62fc8SJesse Brandeburg #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000 50356a62fc8SJesse Brandeburg #define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000 504cb2f65bcSGreg Rose #define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000 505cb2f65bcSGreg Rose 50656a62fc8SJesse Brandeburg __le16 mac_sah; 50756a62fc8SJesse Brandeburg __le32 mac_sal; 50856a62fc8SJesse Brandeburg u8 reserved[8]; 50956a62fc8SJesse Brandeburg }; 51056a62fc8SJesse Brandeburg 51156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_mac_address_write); 51256a62fc8SJesse Brandeburg 513981b7545SShannon Nelson /* PXE commands (0x011x) */ 514981b7545SShannon Nelson 515981b7545SShannon Nelson /* Clear PXE Command and response (direct 0x0110) */ 516981b7545SShannon Nelson struct i40e_aqc_clear_pxe { 517981b7545SShannon Nelson u8 rx_cnt; 518981b7545SShannon Nelson u8 reserved[15]; 519981b7545SShannon Nelson }; 520981b7545SShannon Nelson 521981b7545SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_clear_pxe); 522981b7545SShannon Nelson 523d60be2caSShannon Nelson /* Set WoL Filter (0x0120) */ 524d60be2caSShannon Nelson 525d60be2caSShannon Nelson struct i40e_aqc_set_wol_filter { 526d60be2caSShannon Nelson __le16 filter_index; 527d60be2caSShannon Nelson 528d60be2caSShannon Nelson __le16 cmd_flags; 529d60be2caSShannon Nelson __le16 valid_flags; 530d60be2caSShannon Nelson u8 reserved[2]; 531d60be2caSShannon Nelson __le32 address_high; 532d60be2caSShannon Nelson __le32 address_low; 533d60be2caSShannon Nelson }; 534d60be2caSShannon Nelson 535d60be2caSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_set_wol_filter); 536d60be2caSShannon Nelson 537d60be2caSShannon Nelson struct i40e_aqc_set_wol_filter_data { 538d60be2caSShannon Nelson u8 filter[128]; 539d60be2caSShannon Nelson u8 mask[16]; 540d60be2caSShannon Nelson }; 541d60be2caSShannon Nelson 542d60be2caSShannon Nelson I40E_CHECK_STRUCT_LEN(0x90, i40e_aqc_set_wol_filter_data); 543d60be2caSShannon Nelson 544d60be2caSShannon Nelson /* Get Wake Reason (0x0121) */ 545d60be2caSShannon Nelson 546d60be2caSShannon Nelson struct i40e_aqc_get_wake_reason_completion { 547d60be2caSShannon Nelson u8 reserved_1[2]; 548d60be2caSShannon Nelson __le16 wake_reason; 549d60be2caSShannon Nelson u8 reserved_2[12]; 550d60be2caSShannon Nelson }; 551d60be2caSShannon Nelson 552d60be2caSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_get_wake_reason_completion); 553d60be2caSShannon Nelson 55456a62fc8SJesse Brandeburg /* Switch configuration commands (0x02xx) */ 55556a62fc8SJesse Brandeburg 55656a62fc8SJesse Brandeburg /* Used by many indirect commands that only pass an seid and a buffer in the 55756a62fc8SJesse Brandeburg * command 55856a62fc8SJesse Brandeburg */ 55956a62fc8SJesse Brandeburg struct i40e_aqc_switch_seid { 56056a62fc8SJesse Brandeburg __le16 seid; 56156a62fc8SJesse Brandeburg u8 reserved[6]; 56256a62fc8SJesse Brandeburg __le32 addr_high; 56356a62fc8SJesse Brandeburg __le32 addr_low; 56456a62fc8SJesse Brandeburg }; 56556a62fc8SJesse Brandeburg 56656a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_switch_seid); 56756a62fc8SJesse Brandeburg 56856a62fc8SJesse Brandeburg /* Get Switch Configuration command (indirect 0x0200) 56956a62fc8SJesse Brandeburg * uses i40e_aqc_switch_seid for the descriptor 57056a62fc8SJesse Brandeburg */ 57156a62fc8SJesse Brandeburg struct i40e_aqc_get_switch_config_header_resp { 57256a62fc8SJesse Brandeburg __le16 num_reported; 57356a62fc8SJesse Brandeburg __le16 num_total; 57456a62fc8SJesse Brandeburg u8 reserved[12]; 57556a62fc8SJesse Brandeburg }; 57656a62fc8SJesse Brandeburg 5778d5e33adSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_get_switch_config_header_resp); 5788d5e33adSShannon Nelson 57956a62fc8SJesse Brandeburg struct i40e_aqc_switch_config_element_resp { 58056a62fc8SJesse Brandeburg u8 element_type; 58156a62fc8SJesse Brandeburg u8 revision; 58256a62fc8SJesse Brandeburg __le16 seid; 58356a62fc8SJesse Brandeburg __le16 uplink_seid; 58456a62fc8SJesse Brandeburg __le16 downlink_seid; 58556a62fc8SJesse Brandeburg u8 reserved[3]; 58656a62fc8SJesse Brandeburg u8 connection_type; 58756a62fc8SJesse Brandeburg __le16 scheduler_id; 58856a62fc8SJesse Brandeburg __le16 element_info; 58956a62fc8SJesse Brandeburg }; 59056a62fc8SJesse Brandeburg 5918d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_config_element_resp); 5928d5e33adSShannon Nelson 59356a62fc8SJesse Brandeburg /* Get Switch Configuration (indirect 0x0200) 59456a62fc8SJesse Brandeburg * an array of elements are returned in the response buffer 59556a62fc8SJesse Brandeburg * the first in the array is the header, remainder are elements 59656a62fc8SJesse Brandeburg */ 59756a62fc8SJesse Brandeburg struct i40e_aqc_get_switch_config_resp { 59856a62fc8SJesse Brandeburg struct i40e_aqc_get_switch_config_header_resp header; 59956a62fc8SJesse Brandeburg struct i40e_aqc_switch_config_element_resp element[1]; 60056a62fc8SJesse Brandeburg }; 60156a62fc8SJesse Brandeburg 6028d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_switch_config_resp); 6038d5e33adSShannon Nelson 60456a62fc8SJesse Brandeburg /* Add Statistics (direct 0x0201) 60556a62fc8SJesse Brandeburg * Remove Statistics (direct 0x0202) 60656a62fc8SJesse Brandeburg */ 60756a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_statistics { 60856a62fc8SJesse Brandeburg __le16 seid; 60956a62fc8SJesse Brandeburg __le16 vlan; 61056a62fc8SJesse Brandeburg __le16 stat_index; 61156a62fc8SJesse Brandeburg u8 reserved[10]; 61256a62fc8SJesse Brandeburg }; 61356a62fc8SJesse Brandeburg 61456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_statistics); 61556a62fc8SJesse Brandeburg 61656a62fc8SJesse Brandeburg /* Set Port Parameters command (direct 0x0203) */ 61756a62fc8SJesse Brandeburg struct i40e_aqc_set_port_parameters { 61856a62fc8SJesse Brandeburg __le16 command_flags; 61956a62fc8SJesse Brandeburg __le16 bad_frame_vsi; 62056a62fc8SJesse Brandeburg __le16 default_seid; /* reserved for command */ 62156a62fc8SJesse Brandeburg u8 reserved[10]; 62256a62fc8SJesse Brandeburg }; 62356a62fc8SJesse Brandeburg 62456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_set_port_parameters); 62556a62fc8SJesse Brandeburg 62656a62fc8SJesse Brandeburg /* Get Switch Resource Allocation (indirect 0x0204) */ 62756a62fc8SJesse Brandeburg struct i40e_aqc_get_switch_resource_alloc { 62856a62fc8SJesse Brandeburg u8 num_entries; /* reserved for command */ 62956a62fc8SJesse Brandeburg u8 reserved[7]; 63056a62fc8SJesse Brandeburg __le32 addr_high; 63156a62fc8SJesse Brandeburg __le32 addr_low; 63256a62fc8SJesse Brandeburg }; 63356a62fc8SJesse Brandeburg 63456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_get_switch_resource_alloc); 63556a62fc8SJesse Brandeburg 63656a62fc8SJesse Brandeburg /* expect an array of these structs in the response buffer */ 63756a62fc8SJesse Brandeburg struct i40e_aqc_switch_resource_alloc_element_resp { 63856a62fc8SJesse Brandeburg u8 resource_type; 63956a62fc8SJesse Brandeburg u8 reserved1; 64056a62fc8SJesse Brandeburg __le16 guaranteed; 64156a62fc8SJesse Brandeburg __le16 total; 64256a62fc8SJesse Brandeburg __le16 used; 64356a62fc8SJesse Brandeburg __le16 total_unalloced; 64456a62fc8SJesse Brandeburg u8 reserved2[6]; 64556a62fc8SJesse Brandeburg }; 64656a62fc8SJesse Brandeburg 6478d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_resource_alloc_element_resp); 6488d5e33adSShannon Nelson 649fa5623a6SShannon Nelson /* Set Switch Configuration (direct 0x0205) */ 650fa5623a6SShannon Nelson struct i40e_aqc_set_switch_config { 651fa5623a6SShannon Nelson __le16 flags; 652d60be2caSShannon Nelson /* flags used for both fields below */ 653fa5623a6SShannon Nelson #define I40E_AQ_SET_SWITCH_CFG_PROMISC 0x0001 654fa5623a6SShannon Nelson __le16 valid_flags; 655ab243ec9SScott Peterson /* The ethertype in switch_tag is dropped on ingress and used 656ab243ec9SScott Peterson * internally by the switch. Set this to zero for the default 657ab243ec9SScott Peterson * of 0x88a8 (802.1ad). Should be zero for firmware API 658ab243ec9SScott Peterson * versions lower than 1.7. 659ab243ec9SScott Peterson */ 660ab243ec9SScott Peterson __le16 switch_tag; 661ab243ec9SScott Peterson /* The ethertypes in first_tag and second_tag are used to 662ab243ec9SScott Peterson * match the outer and inner VLAN tags (respectively) when HW 663ab243ec9SScott Peterson * double VLAN tagging is enabled via the set port parameters 664ab243ec9SScott Peterson * AQ command. Otherwise these are both ignored. Set them to 665ab243ec9SScott Peterson * zero for their defaults of 0x8100 (802.1Q). Should be zero 666ab243ec9SScott Peterson * for firmware API versions lower than 1.7. 667ab243ec9SScott Peterson */ 668ab243ec9SScott Peterson __le16 first_tag; 669ab243ec9SScott Peterson __le16 second_tag; 6705efe0c6cSAmritha Nambiar /* Next byte is split into following: 6715efe0c6cSAmritha Nambiar * Bit 7 : 0 : No action, 1: Switch to mode defined by bits 6:0 6725efe0c6cSAmritha Nambiar * Bit 6 : 0 : Destination Port, 1: source port 6735efe0c6cSAmritha Nambiar * Bit 5..4 : L4 type 6745efe0c6cSAmritha Nambiar * 0: rsvd 6755efe0c6cSAmritha Nambiar * 1: TCP 6765efe0c6cSAmritha Nambiar * 2: UDP 6775efe0c6cSAmritha Nambiar * 3: Both TCP and UDP 6785efe0c6cSAmritha Nambiar * Bits 3:0 Mode 6795efe0c6cSAmritha Nambiar * 0: default mode 6805efe0c6cSAmritha Nambiar * 1: L4 port only mode 6815efe0c6cSAmritha Nambiar * 2: non-tunneled mode 6825efe0c6cSAmritha Nambiar * 3: tunneled mode 6835efe0c6cSAmritha Nambiar */ 6845efe0c6cSAmritha Nambiar #define I40E_AQ_SET_SWITCH_BIT7_VALID 0x80 6855efe0c6cSAmritha Nambiar 6865efe0c6cSAmritha Nambiar 6875efe0c6cSAmritha Nambiar #define I40E_AQ_SET_SWITCH_L4_TYPE_TCP 0x10 6885efe0c6cSAmritha Nambiar 6895efe0c6cSAmritha Nambiar #define I40E_AQ_SET_SWITCH_MODE_NON_TUNNEL 0x02 6905efe0c6cSAmritha Nambiar u8 mode; 6915efe0c6cSAmritha Nambiar u8 rsvd5[5]; 692fa5623a6SShannon Nelson }; 693fa5623a6SShannon Nelson 694fa5623a6SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_set_switch_config); 695fa5623a6SShannon Nelson 69633365143SShannon Nelson /* Read Receive control registers (direct 0x0206) 69733365143SShannon Nelson * Write Receive control registers (direct 0x0207) 69833365143SShannon Nelson * used for accessing Rx control registers that can be 69933365143SShannon Nelson * slow and need special handling when under high Rx load 70033365143SShannon Nelson */ 70133365143SShannon Nelson struct i40e_aqc_rx_ctl_reg_read_write { 70233365143SShannon Nelson __le32 reserved1; 70333365143SShannon Nelson __le32 address; 70433365143SShannon Nelson __le32 reserved2; 70533365143SShannon Nelson __le32 value; 70633365143SShannon Nelson }; 70733365143SShannon Nelson 70833365143SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_rx_ctl_reg_read_write); 70933365143SShannon Nelson 710981b7545SShannon Nelson /* Add VSI (indirect 0x0210) 71156a62fc8SJesse Brandeburg * this indirect command uses struct i40e_aqc_vsi_properties_data 71256a62fc8SJesse Brandeburg * as the indirect buffer (128 bytes) 71356a62fc8SJesse Brandeburg * 714981b7545SShannon Nelson * Update VSI (indirect 0x211) 715981b7545SShannon Nelson * uses the same data structure as Add VSI 716981b7545SShannon Nelson * 717981b7545SShannon Nelson * Get VSI (indirect 0x0212) 718981b7545SShannon Nelson * uses the same completion and data structure as Add VSI 71956a62fc8SJesse Brandeburg */ 72056a62fc8SJesse Brandeburg struct i40e_aqc_add_get_update_vsi { 72156a62fc8SJesse Brandeburg __le16 uplink_seid; 72256a62fc8SJesse Brandeburg u8 connection_type; 72356a62fc8SJesse Brandeburg #define I40E_AQ_VSI_CONN_TYPE_NORMAL 0x1 72456a62fc8SJesse Brandeburg u8 reserved1; 72556a62fc8SJesse Brandeburg u8 vf_id; 72656a62fc8SJesse Brandeburg u8 reserved2; 72756a62fc8SJesse Brandeburg __le16 vsi_flags; 72856a62fc8SJesse Brandeburg #define I40E_AQ_VSI_TYPE_VF 0x0 72956a62fc8SJesse Brandeburg #define I40E_AQ_VSI_TYPE_VMDQ2 0x1 73056a62fc8SJesse Brandeburg #define I40E_AQ_VSI_TYPE_PF 0x2 73156a62fc8SJesse Brandeburg __le32 addr_high; 73256a62fc8SJesse Brandeburg __le32 addr_low; 73356a62fc8SJesse Brandeburg }; 73456a62fc8SJesse Brandeburg 73556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_get_update_vsi); 73656a62fc8SJesse Brandeburg 73756a62fc8SJesse Brandeburg struct i40e_aqc_add_get_update_vsi_completion { 73856a62fc8SJesse Brandeburg __le16 seid; 73956a62fc8SJesse Brandeburg __le16 vsi_number; 74056a62fc8SJesse Brandeburg __le16 vsi_used; 74156a62fc8SJesse Brandeburg __le16 vsi_free; 74256a62fc8SJesse Brandeburg __le32 addr_high; 74356a62fc8SJesse Brandeburg __le32 addr_low; 74456a62fc8SJesse Brandeburg }; 74556a62fc8SJesse Brandeburg 74656a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_get_update_vsi_completion); 74756a62fc8SJesse Brandeburg 74856a62fc8SJesse Brandeburg struct i40e_aqc_vsi_properties_data { 74956a62fc8SJesse Brandeburg /* first 96 byte are written by SW */ 75056a62fc8SJesse Brandeburg __le16 valid_sections; 75156a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PROP_SWITCH_VALID 0x0001 75256a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PROP_SECURITY_VALID 0x0002 75356a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PROP_VLAN_VALID 0x0004 75456a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PROP_QUEUE_MAP_VALID 0x0040 75556a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PROP_QUEUE_OPT_VALID 0x0080 75656a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PROP_SCHED_VALID 0x0200 75756a62fc8SJesse Brandeburg /* switch section */ 75856a62fc8SJesse Brandeburg __le16 switch_id; /* 12bit id combined with flags below */ 75956a62fc8SJesse Brandeburg #define I40E_AQ_VSI_SW_ID_SHIFT 0x0000 76056a62fc8SJesse Brandeburg #define I40E_AQ_VSI_SW_ID_MASK (0xFFF << I40E_AQ_VSI_SW_ID_SHIFT) 76156a62fc8SJesse Brandeburg #define I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB 0x2000 76256a62fc8SJesse Brandeburg #define I40E_AQ_VSI_SW_ID_FLAG_LOCAL_LB 0x4000 76356a62fc8SJesse Brandeburg u8 sw_reserved[2]; 76456a62fc8SJesse Brandeburg /* security section */ 76556a62fc8SJesse Brandeburg u8 sec_flags; 76656a62fc8SJesse Brandeburg #define I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK 0x02 76756a62fc8SJesse Brandeburg #define I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK 0x04 76856a62fc8SJesse Brandeburg u8 sec_reserved; 76956a62fc8SJesse Brandeburg /* VLAN section */ 77056a62fc8SJesse Brandeburg __le16 pvid; /* VLANS include priority bits */ 77156a62fc8SJesse Brandeburg __le16 fcoe_pvid; 77256a62fc8SJesse Brandeburg u8 port_vlan_flags; 77356a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_MODE_SHIFT 0x00 77456a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_MODE_MASK (0x03 << \ 77556a62fc8SJesse Brandeburg I40E_AQ_VSI_PVLAN_MODE_SHIFT) 77656a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_MODE_TAGGED 0x01 77756a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_MODE_ALL 0x03 77856a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_INSERT_PVID 0x04 77956a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_EMOD_SHIFT 0x03 78056a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_EMOD_MASK (0x3 << \ 78156a62fc8SJesse Brandeburg I40E_AQ_VSI_PVLAN_EMOD_SHIFT) 78256a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH 0x0 78356a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_EMOD_STR 0x10 78456a62fc8SJesse Brandeburg #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING 0x18 78556a62fc8SJesse Brandeburg u8 pvlan_reserved[3]; 78656a62fc8SJesse Brandeburg /* ingress egress up sections */ 78756a62fc8SJesse Brandeburg __le32 ingress_table; /* bitmap, 3 bits per up */ 78856a62fc8SJesse Brandeburg __le32 egress_table; /* same defines as for ingress table */ 78956a62fc8SJesse Brandeburg /* cascaded PV section */ 79056a62fc8SJesse Brandeburg __le16 cas_pv_tag; 79156a62fc8SJesse Brandeburg u8 cas_pv_flags; 79256a62fc8SJesse Brandeburg u8 cas_pv_reserved; 79356a62fc8SJesse Brandeburg /* queue mapping section */ 79456a62fc8SJesse Brandeburg __le16 mapping_flags; 79556a62fc8SJesse Brandeburg #define I40E_AQ_VSI_QUE_MAP_CONTIG 0x0 79656a62fc8SJesse Brandeburg #define I40E_AQ_VSI_QUE_MAP_NONCONTIG 0x1 79756a62fc8SJesse Brandeburg __le16 queue_mapping[16]; 79856a62fc8SJesse Brandeburg __le16 tc_mapping[8]; 79956a62fc8SJesse Brandeburg #define I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT 0 80056a62fc8SJesse Brandeburg #define I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT 9 80156a62fc8SJesse Brandeburg /* queueing option section */ 80256a62fc8SJesse Brandeburg u8 queueing_opt_flags; 80356a62fc8SJesse Brandeburg #define I40E_AQ_VSI_QUE_OPT_TCP_ENA 0x10 804e50c8d6dSAnjali Singhai Jain #define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI 0x40 80556a62fc8SJesse Brandeburg u8 queueing_opt_reserved[3]; 80656a62fc8SJesse Brandeburg /* scheduler section */ 80756a62fc8SJesse Brandeburg u8 up_enable_bits; 80856a62fc8SJesse Brandeburg u8 sched_reserved; 80956a62fc8SJesse Brandeburg /* outer up section */ 8108c570dccSJeff Kirsher __le32 outer_up_table; /* same structure and defines as ingress tbl */ 81156a62fc8SJesse Brandeburg u8 cmd_reserved[8]; 81256a62fc8SJesse Brandeburg /* last 32 bytes are written by FW */ 81356a62fc8SJesse Brandeburg __le16 qs_handle[8]; 81456a62fc8SJesse Brandeburg #define I40E_AQ_VSI_QS_HANDLE_INVALID 0xFFFF 81556a62fc8SJesse Brandeburg __le16 stat_counter_idx; 81656a62fc8SJesse Brandeburg __le16 sched_id; 81756a62fc8SJesse Brandeburg u8 resp_reserved[12]; 81856a62fc8SJesse Brandeburg }; 81956a62fc8SJesse Brandeburg 82056a62fc8SJesse Brandeburg I40E_CHECK_STRUCT_LEN(128, i40e_aqc_vsi_properties_data); 82156a62fc8SJesse Brandeburg 82256a62fc8SJesse Brandeburg /* Add Port Virtualizer (direct 0x0220) 82356a62fc8SJesse Brandeburg * also used for update PV (direct 0x0221) but only flags are used 82456a62fc8SJesse Brandeburg * (IS_CTRL_PORT only works on add PV) 82556a62fc8SJesse Brandeburg */ 82656a62fc8SJesse Brandeburg struct i40e_aqc_add_update_pv { 82756a62fc8SJesse Brandeburg __le16 command_flags; 82856a62fc8SJesse Brandeburg __le16 uplink_seid; 82956a62fc8SJesse Brandeburg __le16 connected_seid; 83056a62fc8SJesse Brandeburg u8 reserved[10]; 83156a62fc8SJesse Brandeburg }; 83256a62fc8SJesse Brandeburg 83356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_update_pv); 83456a62fc8SJesse Brandeburg 83556a62fc8SJesse Brandeburg struct i40e_aqc_add_update_pv_completion { 83656a62fc8SJesse Brandeburg /* reserved for update; for add also encodes error if rc == ENOSPC */ 83756a62fc8SJesse Brandeburg __le16 pv_seid; 83856a62fc8SJesse Brandeburg u8 reserved[14]; 83956a62fc8SJesse Brandeburg }; 84056a62fc8SJesse Brandeburg 84156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_update_pv_completion); 84256a62fc8SJesse Brandeburg 84356a62fc8SJesse Brandeburg /* Get PV Params (direct 0x0222) 84456a62fc8SJesse Brandeburg * uses i40e_aqc_switch_seid for the descriptor 84556a62fc8SJesse Brandeburg */ 84656a62fc8SJesse Brandeburg 84756a62fc8SJesse Brandeburg struct i40e_aqc_get_pv_params_completion { 84856a62fc8SJesse Brandeburg __le16 seid; 84956a62fc8SJesse Brandeburg __le16 default_stag; 85056a62fc8SJesse Brandeburg __le16 pv_flags; /* same flags as add_pv */ 85156a62fc8SJesse Brandeburg u8 reserved[8]; 85256a62fc8SJesse Brandeburg __le16 default_port_seid; 85356a62fc8SJesse Brandeburg }; 85456a62fc8SJesse Brandeburg 85556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_get_pv_params_completion); 85656a62fc8SJesse Brandeburg 85756a62fc8SJesse Brandeburg /* Add VEB (direct 0x0230) */ 85856a62fc8SJesse Brandeburg struct i40e_aqc_add_veb { 85956a62fc8SJesse Brandeburg __le16 uplink_seid; 86056a62fc8SJesse Brandeburg __le16 downlink_seid; 86156a62fc8SJesse Brandeburg __le16 veb_flags; 86256a62fc8SJesse Brandeburg #define I40E_AQC_ADD_VEB_FLOATING 0x1 86356a62fc8SJesse Brandeburg #define I40E_AQC_ADD_VEB_PORT_TYPE_DEFAULT 0x2 86456a62fc8SJesse Brandeburg #define I40E_AQC_ADD_VEB_PORT_TYPE_DATA 0x4 865fa5623a6SShannon Nelson #define I40E_AQC_ADD_VEB_ENABLE_DISABLE_STATS 0x10 86656a62fc8SJesse Brandeburg u8 enable_tcs; 86756a62fc8SJesse Brandeburg u8 reserved[9]; 86856a62fc8SJesse Brandeburg }; 86956a62fc8SJesse Brandeburg 87056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_veb); 87156a62fc8SJesse Brandeburg 87256a62fc8SJesse Brandeburg struct i40e_aqc_add_veb_completion { 87356a62fc8SJesse Brandeburg u8 reserved[6]; 87456a62fc8SJesse Brandeburg __le16 switch_seid; 87556a62fc8SJesse Brandeburg /* also encodes error if rc == ENOSPC; codes are the same as add_pv */ 87656a62fc8SJesse Brandeburg __le16 veb_seid; 87756a62fc8SJesse Brandeburg __le16 statistic_index; 87856a62fc8SJesse Brandeburg __le16 vebs_used; 87956a62fc8SJesse Brandeburg __le16 vebs_free; 88056a62fc8SJesse Brandeburg }; 88156a62fc8SJesse Brandeburg 88256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_veb_completion); 88356a62fc8SJesse Brandeburg 88456a62fc8SJesse Brandeburg /* Get VEB Parameters (direct 0x0232) 88556a62fc8SJesse Brandeburg * uses i40e_aqc_switch_seid for the descriptor 88656a62fc8SJesse Brandeburg */ 88756a62fc8SJesse Brandeburg struct i40e_aqc_get_veb_parameters_completion { 88856a62fc8SJesse Brandeburg __le16 seid; 88956a62fc8SJesse Brandeburg __le16 switch_id; 89056a62fc8SJesse Brandeburg __le16 veb_flags; /* only the first/last flags from 0x0230 is valid */ 89156a62fc8SJesse Brandeburg __le16 statistic_index; 89256a62fc8SJesse Brandeburg __le16 vebs_used; 89356a62fc8SJesse Brandeburg __le16 vebs_free; 89456a62fc8SJesse Brandeburg u8 reserved[4]; 89556a62fc8SJesse Brandeburg }; 89656a62fc8SJesse Brandeburg 89756a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_get_veb_parameters_completion); 89856a62fc8SJesse Brandeburg 89956a62fc8SJesse Brandeburg /* Delete Element (direct 0x0243) 90056a62fc8SJesse Brandeburg * uses the generic i40e_aqc_switch_seid 90156a62fc8SJesse Brandeburg */ 90256a62fc8SJesse Brandeburg 90356a62fc8SJesse Brandeburg /* Add MAC-VLAN (indirect 0x0250) */ 90456a62fc8SJesse Brandeburg 90556a62fc8SJesse Brandeburg /* used for the command for most vlan commands */ 90656a62fc8SJesse Brandeburg struct i40e_aqc_macvlan { 90756a62fc8SJesse Brandeburg __le16 num_addresses; 90856a62fc8SJesse Brandeburg __le16 seid[3]; 90956a62fc8SJesse Brandeburg #define I40E_AQC_MACVLAN_CMD_SEID_VALID 0x8000 91056a62fc8SJesse Brandeburg __le32 addr_high; 91156a62fc8SJesse Brandeburg __le32 addr_low; 91256a62fc8SJesse Brandeburg }; 91356a62fc8SJesse Brandeburg 91456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_macvlan); 91556a62fc8SJesse Brandeburg 91656a62fc8SJesse Brandeburg /* indirect data for command and response */ 91756a62fc8SJesse Brandeburg struct i40e_aqc_add_macvlan_element_data { 91856a62fc8SJesse Brandeburg u8 mac_addr[6]; 91956a62fc8SJesse Brandeburg __le16 vlan_tag; 92056a62fc8SJesse Brandeburg __le16 flags; 92156a62fc8SJesse Brandeburg #define I40E_AQC_MACVLAN_ADD_PERFECT_MATCH 0x0001 92256a62fc8SJesse Brandeburg #define I40E_AQC_MACVLAN_ADD_IGNORE_VLAN 0x0004 92390680779SShannon Nelson #define I40E_AQC_MACVLAN_ADD_USE_SHARED_MAC 0x0010 92456a62fc8SJesse Brandeburg __le16 queue_number; 92556a62fc8SJesse Brandeburg /* response section */ 92656a62fc8SJesse Brandeburg u8 match_method; 92756a62fc8SJesse Brandeburg #define I40E_AQC_MM_ERR_NO_RES 0xFF 92856a62fc8SJesse Brandeburg u8 reserved1[3]; 92956a62fc8SJesse Brandeburg }; 93056a62fc8SJesse Brandeburg 93156a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_macvlan_completion { 93256a62fc8SJesse Brandeburg __le16 perfect_mac_used; 93356a62fc8SJesse Brandeburg __le16 perfect_mac_free; 93456a62fc8SJesse Brandeburg __le16 unicast_hash_free; 93556a62fc8SJesse Brandeburg __le16 multicast_hash_free; 93656a62fc8SJesse Brandeburg __le32 addr_high; 93756a62fc8SJesse Brandeburg __le32 addr_low; 93856a62fc8SJesse Brandeburg }; 93956a62fc8SJesse Brandeburg 94056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_macvlan_completion); 94156a62fc8SJesse Brandeburg 94256a62fc8SJesse Brandeburg /* Remove MAC-VLAN (indirect 0x0251) 94356a62fc8SJesse Brandeburg * uses i40e_aqc_macvlan for the descriptor 94456a62fc8SJesse Brandeburg * data points to an array of num_addresses of elements 94556a62fc8SJesse Brandeburg */ 94656a62fc8SJesse Brandeburg 94756a62fc8SJesse Brandeburg struct i40e_aqc_remove_macvlan_element_data { 94856a62fc8SJesse Brandeburg u8 mac_addr[6]; 94956a62fc8SJesse Brandeburg __le16 vlan_tag; 95056a62fc8SJesse Brandeburg u8 flags; 95156a62fc8SJesse Brandeburg #define I40E_AQC_MACVLAN_DEL_PERFECT_MATCH 0x01 95256a62fc8SJesse Brandeburg #define I40E_AQC_MACVLAN_DEL_IGNORE_VLAN 0x08 95356a62fc8SJesse Brandeburg u8 reserved[3]; 95456a62fc8SJesse Brandeburg /* reply section */ 95556a62fc8SJesse Brandeburg u8 error_code; 95656a62fc8SJesse Brandeburg u8 reply_reserved[3]; 95756a62fc8SJesse Brandeburg }; 95856a62fc8SJesse Brandeburg 95956a62fc8SJesse Brandeburg /* Add VLAN (indirect 0x0252) 96056a62fc8SJesse Brandeburg * Remove VLAN (indirect 0x0253) 96156a62fc8SJesse Brandeburg * use the generic i40e_aqc_macvlan for the command 96256a62fc8SJesse Brandeburg */ 96356a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_vlan_element_data { 96456a62fc8SJesse Brandeburg __le16 vlan_tag; 96556a62fc8SJesse Brandeburg u8 vlan_flags; 96656a62fc8SJesse Brandeburg u8 reserved; 96756a62fc8SJesse Brandeburg u8 result; 96856a62fc8SJesse Brandeburg u8 reserved1[3]; 96956a62fc8SJesse Brandeburg }; 97056a62fc8SJesse Brandeburg 97156a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_vlan_completion { 97256a62fc8SJesse Brandeburg u8 reserved[4]; 97356a62fc8SJesse Brandeburg __le16 vlans_used; 97456a62fc8SJesse Brandeburg __le16 vlans_free; 97556a62fc8SJesse Brandeburg __le32 addr_high; 97656a62fc8SJesse Brandeburg __le32 addr_low; 97756a62fc8SJesse Brandeburg }; 97856a62fc8SJesse Brandeburg 97956a62fc8SJesse Brandeburg /* Set VSI Promiscuous Modes (direct 0x0254) */ 98056a62fc8SJesse Brandeburg struct i40e_aqc_set_vsi_promiscuous_modes { 98156a62fc8SJesse Brandeburg __le16 promiscuous_flags; 98256a62fc8SJesse Brandeburg __le16 valid_flags; 98356a62fc8SJesse Brandeburg /* flags used for both fields above */ 98456a62fc8SJesse Brandeburg #define I40E_AQC_SET_VSI_PROMISC_UNICAST 0x01 98556a62fc8SJesse Brandeburg #define I40E_AQC_SET_VSI_PROMISC_MULTICAST 0x02 98656a62fc8SJesse Brandeburg #define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04 98756a62fc8SJesse Brandeburg #define I40E_AQC_SET_VSI_DEFAULT 0x08 98856a62fc8SJesse Brandeburg #define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 9894bd5e02aSPrzemyslaw Patynowski #define I40E_AQC_SET_VSI_PROMISC_RX_ONLY 0x8000 99056a62fc8SJesse Brandeburg __le16 seid; 9910aebd2d9SShannon Nelson __le16 vlan_tag; 9920aebd2d9SShannon Nelson #define I40E_AQC_SET_VSI_VLAN_VALID 0x8000 9930aebd2d9SShannon Nelson u8 reserved[8]; 99456a62fc8SJesse Brandeburg }; 99556a62fc8SJesse Brandeburg 99656a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_set_vsi_promiscuous_modes); 99756a62fc8SJesse Brandeburg 99856a62fc8SJesse Brandeburg /* Add S/E-tag command (direct 0x0255) 99956a62fc8SJesse Brandeburg * Uses generic i40e_aqc_add_remove_tag_completion for completion 100056a62fc8SJesse Brandeburg */ 100156a62fc8SJesse Brandeburg struct i40e_aqc_add_tag { 100256a62fc8SJesse Brandeburg __le16 flags; 100356a62fc8SJesse Brandeburg __le16 seid; 100456a62fc8SJesse Brandeburg __le16 tag; 100556a62fc8SJesse Brandeburg __le16 queue_number; 100656a62fc8SJesse Brandeburg u8 reserved[8]; 100756a62fc8SJesse Brandeburg }; 100856a62fc8SJesse Brandeburg 100956a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_tag); 101056a62fc8SJesse Brandeburg 101156a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_tag_completion { 101256a62fc8SJesse Brandeburg u8 reserved[12]; 101356a62fc8SJesse Brandeburg __le16 tags_used; 101456a62fc8SJesse Brandeburg __le16 tags_free; 101556a62fc8SJesse Brandeburg }; 101656a62fc8SJesse Brandeburg 101756a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_tag_completion); 101856a62fc8SJesse Brandeburg 101956a62fc8SJesse Brandeburg /* Remove S/E-tag command (direct 0x0256) 102056a62fc8SJesse Brandeburg * Uses generic i40e_aqc_add_remove_tag_completion for completion 102156a62fc8SJesse Brandeburg */ 102256a62fc8SJesse Brandeburg struct i40e_aqc_remove_tag { 102356a62fc8SJesse Brandeburg __le16 seid; 102456a62fc8SJesse Brandeburg __le16 tag; 102556a62fc8SJesse Brandeburg u8 reserved[12]; 102656a62fc8SJesse Brandeburg }; 102756a62fc8SJesse Brandeburg 10288d5e33adSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_tag); 10298d5e33adSShannon Nelson 103056a62fc8SJesse Brandeburg /* Add multicast E-Tag (direct 0x0257) 103156a62fc8SJesse Brandeburg * del multicast E-Tag (direct 0x0258) only uses pv_seid and etag fields 103256a62fc8SJesse Brandeburg * and no external data 103356a62fc8SJesse Brandeburg */ 103456a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_mcast_etag { 103556a62fc8SJesse Brandeburg __le16 pv_seid; 103656a62fc8SJesse Brandeburg __le16 etag; 103756a62fc8SJesse Brandeburg u8 num_unicast_etags; 103856a62fc8SJesse Brandeburg u8 reserved[3]; 103956a62fc8SJesse Brandeburg __le32 addr_high; /* address of array of 2-byte s-tags */ 104056a62fc8SJesse Brandeburg __le32 addr_low; 104156a62fc8SJesse Brandeburg }; 104256a62fc8SJesse Brandeburg 104356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_mcast_etag); 104456a62fc8SJesse Brandeburg 104556a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_mcast_etag_completion { 104656a62fc8SJesse Brandeburg u8 reserved[4]; 104756a62fc8SJesse Brandeburg __le16 mcast_etags_used; 104856a62fc8SJesse Brandeburg __le16 mcast_etags_free; 104956a62fc8SJesse Brandeburg __le32 addr_high; 105056a62fc8SJesse Brandeburg __le32 addr_low; 105156a62fc8SJesse Brandeburg 105256a62fc8SJesse Brandeburg }; 105356a62fc8SJesse Brandeburg 105456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_mcast_etag_completion); 105556a62fc8SJesse Brandeburg 105656a62fc8SJesse Brandeburg /* Update S/E-Tag (direct 0x0259) */ 105756a62fc8SJesse Brandeburg struct i40e_aqc_update_tag { 105856a62fc8SJesse Brandeburg __le16 seid; 105956a62fc8SJesse Brandeburg __le16 old_tag; 106056a62fc8SJesse Brandeburg __le16 new_tag; 106156a62fc8SJesse Brandeburg u8 reserved[10]; 106256a62fc8SJesse Brandeburg }; 106356a62fc8SJesse Brandeburg 106456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_update_tag); 106556a62fc8SJesse Brandeburg 106656a62fc8SJesse Brandeburg struct i40e_aqc_update_tag_completion { 106756a62fc8SJesse Brandeburg u8 reserved[12]; 106856a62fc8SJesse Brandeburg __le16 tags_used; 106956a62fc8SJesse Brandeburg __le16 tags_free; 107056a62fc8SJesse Brandeburg }; 107156a62fc8SJesse Brandeburg 107256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_update_tag_completion); 107356a62fc8SJesse Brandeburg 107456a62fc8SJesse Brandeburg /* Add Control Packet filter (direct 0x025A) 107556a62fc8SJesse Brandeburg * Remove Control Packet filter (direct 0x025B) 107656a62fc8SJesse Brandeburg * uses the i40e_aqc_add_oveb_cloud, 107756a62fc8SJesse Brandeburg * and the generic direct completion structure 107856a62fc8SJesse Brandeburg */ 107956a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_control_packet_filter { 108056a62fc8SJesse Brandeburg u8 mac[6]; 108156a62fc8SJesse Brandeburg __le16 etype; 108256a62fc8SJesse Brandeburg __le16 flags; 108356a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC 0x0001 108456a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP 0x0002 108556a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX 0x0008 108690bc8e00SArkadiusz Kubalewski #define I40E_AQC_ADD_CONTROL_PACKET_FLAGS_RX 0x0000 108756a62fc8SJesse Brandeburg __le16 seid; 108856a62fc8SJesse Brandeburg __le16 queue; 108956a62fc8SJesse Brandeburg u8 reserved[2]; 109056a62fc8SJesse Brandeburg }; 109156a62fc8SJesse Brandeburg 109256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_control_packet_filter); 109356a62fc8SJesse Brandeburg 109456a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_control_packet_filter_completion { 109556a62fc8SJesse Brandeburg __le16 mac_etype_used; 109656a62fc8SJesse Brandeburg __le16 etype_used; 109756a62fc8SJesse Brandeburg __le16 mac_etype_free; 109856a62fc8SJesse Brandeburg __le16 etype_free; 109956a62fc8SJesse Brandeburg u8 reserved[8]; 110056a62fc8SJesse Brandeburg }; 110156a62fc8SJesse Brandeburg 110256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_control_packet_filter_completion); 110356a62fc8SJesse Brandeburg 110456a62fc8SJesse Brandeburg /* Add Cloud filters (indirect 0x025C) 110556a62fc8SJesse Brandeburg * Remove Cloud filters (indirect 0x025D) 110656a62fc8SJesse Brandeburg * uses the i40e_aqc_add_remove_cloud_filters, 110756a62fc8SJesse Brandeburg * and the generic indirect completion structure 110856a62fc8SJesse Brandeburg */ 110956a62fc8SJesse Brandeburg struct i40e_aqc_add_remove_cloud_filters { 111056a62fc8SJesse Brandeburg u8 num_filters; 111156a62fc8SJesse Brandeburg u8 reserved; 111256a62fc8SJesse Brandeburg __le16 seid; 11132c001523SAmritha Nambiar u8 big_buffer_flag; 11142c001523SAmritha Nambiar #define I40E_AQC_ADD_CLOUD_CMD_BB 1 11152c001523SAmritha Nambiar u8 reserved2[3]; 111656a62fc8SJesse Brandeburg __le32 addr_high; 111756a62fc8SJesse Brandeburg __le32 addr_low; 111856a62fc8SJesse Brandeburg }; 111956a62fc8SJesse Brandeburg 112056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_cloud_filters); 112156a62fc8SJesse Brandeburg 11222c001523SAmritha Nambiar struct i40e_aqc_cloud_filters_element_data { 112356a62fc8SJesse Brandeburg u8 outer_mac[6]; 112456a62fc8SJesse Brandeburg u8 inner_mac[6]; 112556a62fc8SJesse Brandeburg __le16 inner_vlan; 112656a62fc8SJesse Brandeburg union { 112756a62fc8SJesse Brandeburg struct { 112856a62fc8SJesse Brandeburg u8 reserved[12]; 112956a62fc8SJesse Brandeburg u8 data[4]; 113056a62fc8SJesse Brandeburg } v4; 113156a62fc8SJesse Brandeburg struct { 113256a62fc8SJesse Brandeburg u8 data[16]; 113356a62fc8SJesse Brandeburg } v6; 11342f4b411aSAmritha Nambiar struct { 11352f4b411aSAmritha Nambiar __le16 data[8]; 11362f4b411aSAmritha Nambiar } raw_v6; 113756a62fc8SJesse Brandeburg } ipaddr; 113856a62fc8SJesse Brandeburg __le16 flags; 1139981b7545SShannon Nelson /* 0x0000 reserved */ 1140eaa4950cSJacob Keller /* 0x0001 reserved */ 1141981b7545SShannon Nelson /* 0x0002 reserved */ 114256a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN 0x0003 1143981b7545SShannon Nelson #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN_TEN_ID 0x0004 1144981b7545SShannon Nelson /* 0x0005 reserved */ 114556a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_TEN_ID 0x0006 1146981b7545SShannon Nelson /* 0x0007 reserved */ 114756a62fc8SJesse Brandeburg /* 0x0008 reserved */ 114856a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CLOUD_FILTER_OMAC 0x0009 114956a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A 1150981b7545SShannon Nelson #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B 1151981b7545SShannon Nelson #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C 11523c734bbbSJacob Keller /* 0x000D reserved */ 11533c734bbbSJacob Keller /* 0x000E reserved */ 11543c734bbbSJacob Keller /* 0x000F reserved */ 11552c001523SAmritha Nambiar /* 0x0010 to 0x0017 is for custom filters */ 11562c001523SAmritha Nambiar #define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT 0x0010 /* Dest IP + L4 Port */ 11572c001523SAmritha Nambiar #define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT 0x0011 /* Dest MAC + L4 Port */ 11582c001523SAmritha Nambiar #define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT 0x0012 /* Dest MAC + VLAN + L4 Port */ 1159981b7545SShannon Nelson 116056a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CLOUD_FLAGS_IPV4 0 116156a62fc8SJesse Brandeburg #define I40E_AQC_ADD_CLOUD_FLAGS_IPV6 0x0100 1162981b7545SShannon Nelson 1163981b7545SShannon Nelson #define I40E_AQC_ADD_CLOUD_TNL_TYPE_SHIFT 9 1164981b7545SShannon Nelson #define I40E_AQC_ADD_CLOUD_TNL_TYPE_MASK 0x1E00 116559264253SShannon Nelson #define I40E_AQC_ADD_CLOUD_TNL_TYPE_GENEVE 2 1166981b7545SShannon Nelson 116790680779SShannon Nelson 1168981b7545SShannon Nelson __le32 tenant_id; 1169981b7545SShannon Nelson u8 reserved[4]; 117056a62fc8SJesse Brandeburg __le16 queue_number; 1171981b7545SShannon Nelson u8 reserved2[14]; 117256a62fc8SJesse Brandeburg /* response section */ 117356a62fc8SJesse Brandeburg u8 allocation_result; 117456a62fc8SJesse Brandeburg u8 response_reserved[7]; 117556a62fc8SJesse Brandeburg }; 117656a62fc8SJesse Brandeburg 11772c001523SAmritha Nambiar I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_cloud_filters_element_data); 11782c001523SAmritha Nambiar 11792c001523SAmritha Nambiar /* i40e_aqc_cloud_filters_element_bb is used when 11802c001523SAmritha Nambiar * I40E_AQC_CLOUD_CMD_BB flag is set. 11812c001523SAmritha Nambiar */ 11822c001523SAmritha Nambiar struct i40e_aqc_cloud_filters_element_bb { 11832c001523SAmritha Nambiar struct i40e_aqc_cloud_filters_element_data element; 11842c001523SAmritha Nambiar u16 general_fields[32]; 11852c001523SAmritha Nambiar #define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0 15 11862c001523SAmritha Nambiar }; 11872c001523SAmritha Nambiar 11882c001523SAmritha Nambiar I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_cloud_filters_element_bb); 11892c001523SAmritha Nambiar 119056a62fc8SJesse Brandeburg struct i40e_aqc_remove_cloud_filters_completion { 119156a62fc8SJesse Brandeburg __le16 perfect_ovlan_used; 119256a62fc8SJesse Brandeburg __le16 perfect_ovlan_free; 119356a62fc8SJesse Brandeburg __le16 vlan_used; 119456a62fc8SJesse Brandeburg __le16 vlan_free; 119556a62fc8SJesse Brandeburg __le32 addr_high; 119656a62fc8SJesse Brandeburg __le32 addr_low; 119756a62fc8SJesse Brandeburg }; 119856a62fc8SJesse Brandeburg 119956a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion); 120056a62fc8SJesse Brandeburg 12012c001523SAmritha Nambiar /* Replace filter Command 0x025F 12022c001523SAmritha Nambiar * uses the i40e_aqc_replace_cloud_filters, 12032c001523SAmritha Nambiar * and the generic indirect completion structure 12042c001523SAmritha Nambiar */ 12052c001523SAmritha Nambiar struct i40e_filter_data { 12062c001523SAmritha Nambiar u8 filter_type; 12072c001523SAmritha Nambiar u8 input[3]; 12082c001523SAmritha Nambiar }; 12092c001523SAmritha Nambiar 12102c001523SAmritha Nambiar I40E_CHECK_STRUCT_LEN(4, i40e_filter_data); 12112c001523SAmritha Nambiar 12122c001523SAmritha Nambiar struct i40e_aqc_replace_cloud_filters_cmd { 12132c001523SAmritha Nambiar u8 valid_flags; 12142c001523SAmritha Nambiar u8 old_filter_type; 12152c001523SAmritha Nambiar u8 new_filter_type; 12162c001523SAmritha Nambiar u8 tr_bit; 12172c001523SAmritha Nambiar u8 reserved[4]; 12182c001523SAmritha Nambiar __le32 addr_high; 12192c001523SAmritha Nambiar __le32 addr_low; 12202c001523SAmritha Nambiar }; 12212c001523SAmritha Nambiar 12222c001523SAmritha Nambiar I40E_CHECK_CMD_LENGTH(i40e_aqc_replace_cloud_filters_cmd); 12232c001523SAmritha Nambiar 12242c001523SAmritha Nambiar struct i40e_aqc_replace_cloud_filters_cmd_buf { 12252c001523SAmritha Nambiar u8 data[32]; 12262c001523SAmritha Nambiar struct i40e_filter_data filters[8]; 12272c001523SAmritha Nambiar }; 12282c001523SAmritha Nambiar 12292c001523SAmritha Nambiar I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_replace_cloud_filters_cmd_buf); 12302c001523SAmritha Nambiar 123156a62fc8SJesse Brandeburg /* Add Mirror Rule (indirect or direct 0x0260) 123256a62fc8SJesse Brandeburg * Delete Mirror Rule (indirect or direct 0x0261) 123356a62fc8SJesse Brandeburg * note: some rule types (4,5) do not use an external buffer. 123456a62fc8SJesse Brandeburg * take care to set the flags correctly. 123556a62fc8SJesse Brandeburg */ 123656a62fc8SJesse Brandeburg struct i40e_aqc_add_delete_mirror_rule { 123756a62fc8SJesse Brandeburg __le16 seid; 123856a62fc8SJesse Brandeburg __le16 rule_type; 123956a62fc8SJesse Brandeburg #define I40E_AQC_MIRROR_RULE_TYPE_SHIFT 0 124056a62fc8SJesse Brandeburg #define I40E_AQC_MIRROR_RULE_TYPE_MASK (0x7 << \ 124156a62fc8SJesse Brandeburg I40E_AQC_MIRROR_RULE_TYPE_SHIFT) 124256a62fc8SJesse Brandeburg #define I40E_AQC_MIRROR_RULE_TYPE_VLAN 3 124356a62fc8SJesse Brandeburg #define I40E_AQC_MIRROR_RULE_TYPE_ALL_INGRESS 4 124456a62fc8SJesse Brandeburg #define I40E_AQC_MIRROR_RULE_TYPE_ALL_EGRESS 5 124556a62fc8SJesse Brandeburg __le16 num_entries; 124656a62fc8SJesse Brandeburg __le16 destination; /* VSI for add, rule id for delete */ 124756a62fc8SJesse Brandeburg __le32 addr_high; /* address of array of 2-byte VSI or VLAN ids */ 124856a62fc8SJesse Brandeburg __le32 addr_low; 124956a62fc8SJesse Brandeburg }; 125056a62fc8SJesse Brandeburg 125156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_delete_mirror_rule); 125256a62fc8SJesse Brandeburg 125356a62fc8SJesse Brandeburg struct i40e_aqc_add_delete_mirror_rule_completion { 125456a62fc8SJesse Brandeburg u8 reserved[2]; 125556a62fc8SJesse Brandeburg __le16 rule_id; /* only used on add */ 125656a62fc8SJesse Brandeburg __le16 mirror_rules_used; 125756a62fc8SJesse Brandeburg __le16 mirror_rules_free; 125856a62fc8SJesse Brandeburg __le32 addr_high; 125956a62fc8SJesse Brandeburg __le32 addr_low; 126056a62fc8SJesse Brandeburg }; 126156a62fc8SJesse Brandeburg 126256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_delete_mirror_rule_completion); 126356a62fc8SJesse Brandeburg 1264329e5983SJingjing Wu /* Dynamic Device Personalization */ 12651d5c960cSJingjing Wu struct i40e_aqc_write_personalization_profile { 12661d5c960cSJingjing Wu u8 flags; 12671d5c960cSJingjing Wu u8 reserved[3]; 12681d5c960cSJingjing Wu __le32 profile_track_id; 12691d5c960cSJingjing Wu __le32 addr_high; 12701d5c960cSJingjing Wu __le32 addr_low; 12711d5c960cSJingjing Wu }; 12721d5c960cSJingjing Wu 12731d5c960cSJingjing Wu I40E_CHECK_CMD_LENGTH(i40e_aqc_write_personalization_profile); 12741d5c960cSJingjing Wu 1275329e5983SJingjing Wu struct i40e_aqc_write_ddp_resp { 12761d5c960cSJingjing Wu __le32 error_offset; 12771d5c960cSJingjing Wu __le32 error_info; 12781d5c960cSJingjing Wu __le32 addr_high; 12791d5c960cSJingjing Wu __le32 addr_low; 12801d5c960cSJingjing Wu }; 12811d5c960cSJingjing Wu 12821d5c960cSJingjing Wu struct i40e_aqc_get_applied_profiles { 12831d5c960cSJingjing Wu u8 flags; 12841d5c960cSJingjing Wu u8 rsv[3]; 12851d5c960cSJingjing Wu __le32 reserved; 12861d5c960cSJingjing Wu __le32 addr_high; 12871d5c960cSJingjing Wu __le32 addr_low; 12881d5c960cSJingjing Wu }; 12891d5c960cSJingjing Wu 12901d5c960cSJingjing Wu I40E_CHECK_CMD_LENGTH(i40e_aqc_get_applied_profiles); 12911d5c960cSJingjing Wu 129256a62fc8SJesse Brandeburg /* DCB 0x03xx*/ 129356a62fc8SJesse Brandeburg 129456a62fc8SJesse Brandeburg /* PFC Ignore (direct 0x0301) 129556a62fc8SJesse Brandeburg * the command and response use the same descriptor structure 129656a62fc8SJesse Brandeburg */ 129756a62fc8SJesse Brandeburg struct i40e_aqc_pfc_ignore { 129856a62fc8SJesse Brandeburg u8 tc_bitmap; 129956a62fc8SJesse Brandeburg u8 command_flags; /* unused on response */ 130056a62fc8SJesse Brandeburg u8 reserved[14]; 130156a62fc8SJesse Brandeburg }; 130256a62fc8SJesse Brandeburg 130356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_pfc_ignore); 130456a62fc8SJesse Brandeburg 130556a62fc8SJesse Brandeburg /* DCB Update (direct 0x0302) uses the i40e_aq_desc structure 130656a62fc8SJesse Brandeburg * with no parameters 130756a62fc8SJesse Brandeburg */ 130856a62fc8SJesse Brandeburg 130956a62fc8SJesse Brandeburg /* TX scheduler 0x04xx */ 131056a62fc8SJesse Brandeburg 131156a62fc8SJesse Brandeburg /* Almost all the indirect commands use 131256a62fc8SJesse Brandeburg * this generic struct to pass the SEID in param0 131356a62fc8SJesse Brandeburg */ 131456a62fc8SJesse Brandeburg struct i40e_aqc_tx_sched_ind { 131556a62fc8SJesse Brandeburg __le16 vsi_seid; 131656a62fc8SJesse Brandeburg u8 reserved[6]; 131756a62fc8SJesse Brandeburg __le32 addr_high; 131856a62fc8SJesse Brandeburg __le32 addr_low; 131956a62fc8SJesse Brandeburg }; 132056a62fc8SJesse Brandeburg 132156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_tx_sched_ind); 132256a62fc8SJesse Brandeburg 132356a62fc8SJesse Brandeburg /* Several commands respond with a set of queue set handles */ 132456a62fc8SJesse Brandeburg struct i40e_aqc_qs_handles_resp { 132556a62fc8SJesse Brandeburg __le16 qs_handles[8]; 132656a62fc8SJesse Brandeburg }; 132756a62fc8SJesse Brandeburg 132856a62fc8SJesse Brandeburg /* Configure VSI BW limits (direct 0x0400) */ 132956a62fc8SJesse Brandeburg struct i40e_aqc_configure_vsi_bw_limit { 133056a62fc8SJesse Brandeburg __le16 vsi_seid; 133156a62fc8SJesse Brandeburg u8 reserved[2]; 133256a62fc8SJesse Brandeburg __le16 credit; 133356a62fc8SJesse Brandeburg u8 reserved1[2]; 133456a62fc8SJesse Brandeburg u8 max_credit; /* 0-3, limit = 2^max */ 133556a62fc8SJesse Brandeburg u8 reserved2[7]; 133656a62fc8SJesse Brandeburg }; 133756a62fc8SJesse Brandeburg 133856a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_configure_vsi_bw_limit); 133956a62fc8SJesse Brandeburg 134056a62fc8SJesse Brandeburg /* Configure VSI Bandwidth Limit per Traffic Type (indirect 0x0406) 134156a62fc8SJesse Brandeburg * responds with i40e_aqc_qs_handles_resp 134256a62fc8SJesse Brandeburg */ 134356a62fc8SJesse Brandeburg struct i40e_aqc_configure_vsi_ets_sla_bw_data { 134456a62fc8SJesse Brandeburg u8 tc_valid_bits; 134556a62fc8SJesse Brandeburg u8 reserved[15]; 134656a62fc8SJesse Brandeburg __le16 tc_bw_credits[8]; /* FW writesback QS handles here */ 134756a62fc8SJesse Brandeburg 134856a62fc8SJesse Brandeburg /* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */ 134956a62fc8SJesse Brandeburg __le16 tc_bw_max[2]; 135056a62fc8SJesse Brandeburg u8 reserved1[28]; 135156a62fc8SJesse Brandeburg }; 135256a62fc8SJesse Brandeburg 13538d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_configure_vsi_ets_sla_bw_data); 13548d5e33adSShannon Nelson 135556a62fc8SJesse Brandeburg /* Configure VSI Bandwidth Allocation per Traffic Type (indirect 0x0407) 135656a62fc8SJesse Brandeburg * responds with i40e_aqc_qs_handles_resp 135756a62fc8SJesse Brandeburg */ 135856a62fc8SJesse Brandeburg struct i40e_aqc_configure_vsi_tc_bw_data { 135956a62fc8SJesse Brandeburg u8 tc_valid_bits; 136056a62fc8SJesse Brandeburg u8 reserved[3]; 136156a62fc8SJesse Brandeburg u8 tc_bw_credits[8]; 136256a62fc8SJesse Brandeburg u8 reserved1[4]; 136356a62fc8SJesse Brandeburg __le16 qs_handles[8]; 136456a62fc8SJesse Brandeburg }; 136556a62fc8SJesse Brandeburg 13668d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_configure_vsi_tc_bw_data); 13678d5e33adSShannon Nelson 136856a62fc8SJesse Brandeburg /* Query vsi bw configuration (indirect 0x0408) */ 136956a62fc8SJesse Brandeburg struct i40e_aqc_query_vsi_bw_config_resp { 137056a62fc8SJesse Brandeburg u8 tc_valid_bits; 137156a62fc8SJesse Brandeburg u8 tc_suspended_bits; 137256a62fc8SJesse Brandeburg u8 reserved[14]; 137356a62fc8SJesse Brandeburg __le16 qs_handles[8]; 137456a62fc8SJesse Brandeburg u8 reserved1[4]; 137556a62fc8SJesse Brandeburg __le16 port_bw_limit; 137656a62fc8SJesse Brandeburg u8 reserved2[2]; 137756a62fc8SJesse Brandeburg u8 max_bw; /* 0-3, limit = 2^max */ 137856a62fc8SJesse Brandeburg u8 reserved3[23]; 137956a62fc8SJesse Brandeburg }; 138056a62fc8SJesse Brandeburg 13818d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_query_vsi_bw_config_resp); 13828d5e33adSShannon Nelson 138356a62fc8SJesse Brandeburg /* Query VSI Bandwidth Allocation per Traffic Type (indirect 0x040A) */ 138456a62fc8SJesse Brandeburg struct i40e_aqc_query_vsi_ets_sla_config_resp { 138556a62fc8SJesse Brandeburg u8 tc_valid_bits; 138656a62fc8SJesse Brandeburg u8 reserved[3]; 138756a62fc8SJesse Brandeburg u8 share_credits[8]; 138856a62fc8SJesse Brandeburg __le16 credits[8]; 138956a62fc8SJesse Brandeburg 139056a62fc8SJesse Brandeburg /* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */ 139156a62fc8SJesse Brandeburg __le16 tc_bw_max[2]; 139256a62fc8SJesse Brandeburg }; 139356a62fc8SJesse Brandeburg 13948d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_query_vsi_ets_sla_config_resp); 13958d5e33adSShannon Nelson 139656a62fc8SJesse Brandeburg /* Configure Switching Component Bandwidth Limit (direct 0x0410) */ 139756a62fc8SJesse Brandeburg struct i40e_aqc_configure_switching_comp_bw_limit { 139856a62fc8SJesse Brandeburg __le16 seid; 139956a62fc8SJesse Brandeburg u8 reserved[2]; 140056a62fc8SJesse Brandeburg __le16 credit; 140156a62fc8SJesse Brandeburg u8 reserved1[2]; 140256a62fc8SJesse Brandeburg u8 max_bw; /* 0-3, limit = 2^max */ 140356a62fc8SJesse Brandeburg u8 reserved2[7]; 140456a62fc8SJesse Brandeburg }; 140556a62fc8SJesse Brandeburg 140656a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_configure_switching_comp_bw_limit); 140756a62fc8SJesse Brandeburg 140856a62fc8SJesse Brandeburg /* Enable Physical Port ETS (indirect 0x0413) 140956a62fc8SJesse Brandeburg * Modify Physical Port ETS (indirect 0x0414) 141056a62fc8SJesse Brandeburg * Disable Physical Port ETS (indirect 0x0415) 141156a62fc8SJesse Brandeburg */ 141256a62fc8SJesse Brandeburg struct i40e_aqc_configure_switching_comp_ets_data { 141356a62fc8SJesse Brandeburg u8 reserved[4]; 141456a62fc8SJesse Brandeburg u8 tc_valid_bits; 1415f94234eeSShannon Nelson u8 seepage; 141656a62fc8SJesse Brandeburg u8 tc_strict_priority_flags; 1417f94234eeSShannon Nelson u8 reserved1[17]; 141856a62fc8SJesse Brandeburg u8 tc_bw_share_credits[8]; 1419f94234eeSShannon Nelson u8 reserved2[96]; 142056a62fc8SJesse Brandeburg }; 142156a62fc8SJesse Brandeburg 14228d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_configure_switching_comp_ets_data); 14238d5e33adSShannon Nelson 142456a62fc8SJesse Brandeburg /* Configure Switching Component Bandwidth Limits per Tc (indirect 0x0416) */ 142556a62fc8SJesse Brandeburg struct i40e_aqc_configure_switching_comp_ets_bw_limit_data { 142656a62fc8SJesse Brandeburg u8 tc_valid_bits; 142756a62fc8SJesse Brandeburg u8 reserved[15]; 142856a62fc8SJesse Brandeburg __le16 tc_bw_credit[8]; 142956a62fc8SJesse Brandeburg 143056a62fc8SJesse Brandeburg /* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */ 143156a62fc8SJesse Brandeburg __le16 tc_bw_max[2]; 143256a62fc8SJesse Brandeburg u8 reserved1[28]; 143356a62fc8SJesse Brandeburg }; 143456a62fc8SJesse Brandeburg 14358d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x40, 14368d5e33adSShannon Nelson i40e_aqc_configure_switching_comp_ets_bw_limit_data); 14378d5e33adSShannon Nelson 143856a62fc8SJesse Brandeburg /* Configure Switching Component Bandwidth Allocation per Tc 143956a62fc8SJesse Brandeburg * (indirect 0x0417) 144056a62fc8SJesse Brandeburg */ 144156a62fc8SJesse Brandeburg struct i40e_aqc_configure_switching_comp_bw_config_data { 144256a62fc8SJesse Brandeburg u8 tc_valid_bits; 144356a62fc8SJesse Brandeburg u8 reserved[2]; 144456a62fc8SJesse Brandeburg u8 absolute_credits; /* bool */ 144556a62fc8SJesse Brandeburg u8 tc_bw_share_credits[8]; 144656a62fc8SJesse Brandeburg u8 reserved1[20]; 144756a62fc8SJesse Brandeburg }; 144856a62fc8SJesse Brandeburg 14498d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_configure_switching_comp_bw_config_data); 14508d5e33adSShannon Nelson 145156a62fc8SJesse Brandeburg /* Query Switching Component Configuration (indirect 0x0418) */ 145256a62fc8SJesse Brandeburg struct i40e_aqc_query_switching_comp_ets_config_resp { 145356a62fc8SJesse Brandeburg u8 tc_valid_bits; 145456a62fc8SJesse Brandeburg u8 reserved[35]; 145556a62fc8SJesse Brandeburg __le16 port_bw_limit; 145656a62fc8SJesse Brandeburg u8 reserved1[2]; 145756a62fc8SJesse Brandeburg u8 tc_bw_max; /* 0-3, limit = 2^max */ 145856a62fc8SJesse Brandeburg u8 reserved2[23]; 145956a62fc8SJesse Brandeburg }; 146056a62fc8SJesse Brandeburg 14618d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_query_switching_comp_ets_config_resp); 14628d5e33adSShannon Nelson 146356a62fc8SJesse Brandeburg /* Query PhysicalPort ETS Configuration (indirect 0x0419) */ 146456a62fc8SJesse Brandeburg struct i40e_aqc_query_port_ets_config_resp { 146556a62fc8SJesse Brandeburg u8 reserved[4]; 146656a62fc8SJesse Brandeburg u8 tc_valid_bits; 146756a62fc8SJesse Brandeburg u8 reserved1; 146856a62fc8SJesse Brandeburg u8 tc_strict_priority_bits; 146956a62fc8SJesse Brandeburg u8 reserved2; 147056a62fc8SJesse Brandeburg u8 tc_bw_share_credits[8]; 147156a62fc8SJesse Brandeburg __le16 tc_bw_limits[8]; 147256a62fc8SJesse Brandeburg 147356a62fc8SJesse Brandeburg /* 4 bits per tc 0-7, 4th bit reserved, limit = 2^max */ 147456a62fc8SJesse Brandeburg __le16 tc_bw_max[2]; 147556a62fc8SJesse Brandeburg u8 reserved3[32]; 147656a62fc8SJesse Brandeburg }; 147756a62fc8SJesse Brandeburg 14788d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x44, i40e_aqc_query_port_ets_config_resp); 14798d5e33adSShannon Nelson 148056a62fc8SJesse Brandeburg /* Query Switching Component Bandwidth Allocation per Traffic Type 148156a62fc8SJesse Brandeburg * (indirect 0x041A) 148256a62fc8SJesse Brandeburg */ 148356a62fc8SJesse Brandeburg struct i40e_aqc_query_switching_comp_bw_config_resp { 148456a62fc8SJesse Brandeburg u8 tc_valid_bits; 148556a62fc8SJesse Brandeburg u8 reserved[2]; 148656a62fc8SJesse Brandeburg u8 absolute_credits_enable; /* bool */ 148756a62fc8SJesse Brandeburg u8 tc_bw_share_credits[8]; 148856a62fc8SJesse Brandeburg __le16 tc_bw_limits[8]; 148956a62fc8SJesse Brandeburg 149056a62fc8SJesse Brandeburg /* 4 bits per tc 0-7, 4th bit is reserved, limit = 2^max */ 149156a62fc8SJesse Brandeburg __le16 tc_bw_max[2]; 149256a62fc8SJesse Brandeburg }; 149356a62fc8SJesse Brandeburg 14948d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_query_switching_comp_bw_config_resp); 14958d5e33adSShannon Nelson 149656a62fc8SJesse Brandeburg /* Suspend/resume port TX traffic 149756a62fc8SJesse Brandeburg * (direct 0x041B and 0x041C) uses the generic SEID struct 149856a62fc8SJesse Brandeburg */ 149956a62fc8SJesse Brandeburg 1500befc229cSShannon Nelson /* Configure partition BW 1501befc229cSShannon Nelson * (indirect 0x041D) 1502befc229cSShannon Nelson */ 1503befc229cSShannon Nelson struct i40e_aqc_configure_partition_bw_data { 1504befc229cSShannon Nelson __le16 pf_valid_bits; 1505befc229cSShannon Nelson u8 min_bw[16]; /* guaranteed bandwidth */ 1506befc229cSShannon Nelson u8 max_bw[16]; /* bandwidth limit */ 1507befc229cSShannon Nelson }; 1508befc229cSShannon Nelson 15098d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x22, i40e_aqc_configure_partition_bw_data); 15108d5e33adSShannon Nelson 15117d94906bSCarolyn Wyborny /* Get and set the active HMC resource profile and status. 15127d94906bSCarolyn Wyborny * (direct 0x0500) and (direct 0x0501) 15137d94906bSCarolyn Wyborny */ 15147d94906bSCarolyn Wyborny struct i40e_aq_get_set_hmc_resource_profile { 15157d94906bSCarolyn Wyborny u8 pm_profile; 15167d94906bSCarolyn Wyborny u8 pe_vf_enabled; 15177d94906bSCarolyn Wyborny u8 reserved[14]; 15187d94906bSCarolyn Wyborny }; 15197d94906bSCarolyn Wyborny 15207d94906bSCarolyn Wyborny I40E_CHECK_CMD_LENGTH(i40e_aq_get_set_hmc_resource_profile); 15217d94906bSCarolyn Wyborny 15227d94906bSCarolyn Wyborny enum i40e_aq_hmc_profile { 15237d94906bSCarolyn Wyborny /* I40E_HMC_PROFILE_NO_CHANGE = 0, reserved */ 15247d94906bSCarolyn Wyborny I40E_HMC_PROFILE_DEFAULT = 1, 15257d94906bSCarolyn Wyborny I40E_HMC_PROFILE_FAVOR_VF = 2, 15267d94906bSCarolyn Wyborny I40E_HMC_PROFILE_EQUAL = 3, 15277d94906bSCarolyn Wyborny }; 15287d94906bSCarolyn Wyborny 152956a62fc8SJesse Brandeburg /* Get PHY Abilities (indirect 0x0600) uses the generic indirect struct */ 153056a62fc8SJesse Brandeburg 153156a62fc8SJesse Brandeburg /* set in param0 for get phy abilities to report qualified modules */ 153256a62fc8SJesse Brandeburg #define I40E_AQ_PHY_REPORT_QUALIFIED_MODULES 0x0001 153356a62fc8SJesse Brandeburg #define I40E_AQ_PHY_REPORT_INITIAL_VALUES 0x0002 153456a62fc8SJesse Brandeburg 153556a62fc8SJesse Brandeburg enum i40e_aq_phy_type { 153656a62fc8SJesse Brandeburg I40E_PHY_TYPE_SGMII = 0x0, 153756a62fc8SJesse Brandeburg I40E_PHY_TYPE_1000BASE_KX = 0x1, 153856a62fc8SJesse Brandeburg I40E_PHY_TYPE_10GBASE_KX4 = 0x2, 153956a62fc8SJesse Brandeburg I40E_PHY_TYPE_10GBASE_KR = 0x3, 154056a62fc8SJesse Brandeburg I40E_PHY_TYPE_40GBASE_KR4 = 0x4, 154156a62fc8SJesse Brandeburg I40E_PHY_TYPE_XAUI = 0x5, 154256a62fc8SJesse Brandeburg I40E_PHY_TYPE_XFI = 0x6, 154356a62fc8SJesse Brandeburg I40E_PHY_TYPE_SFI = 0x7, 154456a62fc8SJesse Brandeburg I40E_PHY_TYPE_XLAUI = 0x8, 154556a62fc8SJesse Brandeburg I40E_PHY_TYPE_XLPPI = 0x9, 154656a62fc8SJesse Brandeburg I40E_PHY_TYPE_40GBASE_CR4_CU = 0xA, 154756a62fc8SJesse Brandeburg I40E_PHY_TYPE_10GBASE_CR1_CU = 0xB, 1548f94234eeSShannon Nelson I40E_PHY_TYPE_10GBASE_AOC = 0xC, 1549f94234eeSShannon Nelson I40E_PHY_TYPE_40GBASE_AOC = 0xD, 1550d60bcc79SFilip Sadowski I40E_PHY_TYPE_UNRECOGNIZED = 0xE, 1551d60bcc79SFilip Sadowski I40E_PHY_TYPE_UNSUPPORTED = 0xF, 155256a62fc8SJesse Brandeburg I40E_PHY_TYPE_100BASE_TX = 0x11, 155356a62fc8SJesse Brandeburg I40E_PHY_TYPE_1000BASE_T = 0x12, 155456a62fc8SJesse Brandeburg I40E_PHY_TYPE_10GBASE_T = 0x13, 155556a62fc8SJesse Brandeburg I40E_PHY_TYPE_10GBASE_SR = 0x14, 155656a62fc8SJesse Brandeburg I40E_PHY_TYPE_10GBASE_LR = 0x15, 155756a62fc8SJesse Brandeburg I40E_PHY_TYPE_10GBASE_SFPP_CU = 0x16, 155856a62fc8SJesse Brandeburg I40E_PHY_TYPE_10GBASE_CR1 = 0x17, 155956a62fc8SJesse Brandeburg I40E_PHY_TYPE_40GBASE_CR4 = 0x18, 156056a62fc8SJesse Brandeburg I40E_PHY_TYPE_40GBASE_SR4 = 0x19, 156156a62fc8SJesse Brandeburg I40E_PHY_TYPE_40GBASE_LR4 = 0x1A, 1562f94234eeSShannon Nelson I40E_PHY_TYPE_1000BASE_SX = 0x1B, 1563f94234eeSShannon Nelson I40E_PHY_TYPE_1000BASE_LX = 0x1C, 1564f94234eeSShannon Nelson I40E_PHY_TYPE_1000BASE_T_OPTICAL = 0x1D, 1565f94234eeSShannon Nelson I40E_PHY_TYPE_20GBASE_KR2 = 0x1E, 15663123237aSCarolyn Wyborny I40E_PHY_TYPE_25GBASE_KR = 0x1F, 15673123237aSCarolyn Wyborny I40E_PHY_TYPE_25GBASE_CR = 0x20, 15683123237aSCarolyn Wyborny I40E_PHY_TYPE_25GBASE_SR = 0x21, 15693123237aSCarolyn Wyborny I40E_PHY_TYPE_25GBASE_LR = 0x22, 1570211b4c14SSudheer Mogilappagari I40E_PHY_TYPE_25GBASE_AOC = 0x23, 1571211b4c14SSudheer Mogilappagari I40E_PHY_TYPE_25GBASE_ACC = 0x24, 157215395ec4SMateusz Palczewski I40E_PHY_TYPE_2_5GBASE_T = 0x26, 157315395ec4SMateusz Palczewski I40E_PHY_TYPE_5GBASE_T = 0x27, 157415395ec4SMateusz Palczewski I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS = 0x30, 157515395ec4SMateusz Palczewski I40E_PHY_TYPE_5GBASE_T_LINK_STATUS = 0x31, 157660518a04SMitch Williams I40E_PHY_TYPE_MAX, 15779a858178SFilip Sadowski I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP = 0xFD, 1578d60bcc79SFilip Sadowski I40E_PHY_TYPE_EMPTY = 0xFE, 1579d60bcc79SFilip Sadowski I40E_PHY_TYPE_DEFAULT = 0xFF, 158056a62fc8SJesse Brandeburg }; 158156a62fc8SJesse Brandeburg 1582c3880bd1SMariusz Stachura #define I40E_PHY_TYPES_BITMASK (BIT_ULL(I40E_PHY_TYPE_SGMII) | \ 1583c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_1000BASE_KX) | \ 1584c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_10GBASE_KX4) | \ 1585c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_10GBASE_KR) | \ 1586c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_40GBASE_KR4) | \ 1587c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_XAUI) | \ 1588c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_XFI) | \ 1589c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_SFI) | \ 1590c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_XLAUI) | \ 1591c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_XLPPI) | \ 1592c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_40GBASE_CR4_CU) | \ 1593c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1_CU) | \ 1594c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_10GBASE_AOC) | \ 1595c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_40GBASE_AOC) | \ 1596c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_UNRECOGNIZED) | \ 1597c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_UNSUPPORTED) | \ 1598c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_100BASE_TX) | \ 1599c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_1000BASE_T) | \ 1600c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_10GBASE_T) | \ 1601c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_10GBASE_SR) | \ 1602c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_10GBASE_LR) | \ 1603c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_10GBASE_SFPP_CU) | \ 1604c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1) | \ 1605c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_40GBASE_CR4) | \ 1606c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_40GBASE_SR4) | \ 1607c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_40GBASE_LR4) | \ 1608c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_1000BASE_SX) | \ 1609c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_1000BASE_LX) | \ 1610c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_1000BASE_T_OPTICAL) | \ 1611c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_20GBASE_KR2) | \ 1612c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_25GBASE_KR) | \ 1613c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_25GBASE_CR) | \ 1614c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_25GBASE_SR) | \ 1615c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_25GBASE_LR) | \ 1616c3880bd1SMariusz Stachura BIT_ULL(I40E_PHY_TYPE_25GBASE_AOC) | \ 16172e45d3f4SAleksandr Loktionov BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC) | \ 16182e45d3f4SAleksandr Loktionov BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T) | \ 16192e45d3f4SAleksandr Loktionov BIT_ULL(I40E_PHY_TYPE_5GBASE_T)) 1620c3880bd1SMariusz Stachura 16212e45d3f4SAleksandr Loktionov #define I40E_LINK_SPEED_2_5GB_SHIFT 0x0 162256a62fc8SJesse Brandeburg #define I40E_LINK_SPEED_100MB_SHIFT 0x1 162356a62fc8SJesse Brandeburg #define I40E_LINK_SPEED_1000MB_SHIFT 0x2 162456a62fc8SJesse Brandeburg #define I40E_LINK_SPEED_10GB_SHIFT 0x3 162556a62fc8SJesse Brandeburg #define I40E_LINK_SPEED_40GB_SHIFT 0x4 162656a62fc8SJesse Brandeburg #define I40E_LINK_SPEED_20GB_SHIFT 0x5 16273123237aSCarolyn Wyborny #define I40E_LINK_SPEED_25GB_SHIFT 0x6 16282e45d3f4SAleksandr Loktionov #define I40E_LINK_SPEED_5GB_SHIFT 0x7 162956a62fc8SJesse Brandeburg 163056a62fc8SJesse Brandeburg enum i40e_aq_link_speed { 163156a62fc8SJesse Brandeburg I40E_LINK_SPEED_UNKNOWN = 0, 16322101bac2SJacob Keller I40E_LINK_SPEED_100MB = BIT(I40E_LINK_SPEED_100MB_SHIFT), 16332101bac2SJacob Keller I40E_LINK_SPEED_1GB = BIT(I40E_LINK_SPEED_1000MB_SHIFT), 16342e45d3f4SAleksandr Loktionov I40E_LINK_SPEED_2_5GB = (1 << I40E_LINK_SPEED_2_5GB_SHIFT), 16352e45d3f4SAleksandr Loktionov I40E_LINK_SPEED_5GB = (1 << I40E_LINK_SPEED_5GB_SHIFT), 16362101bac2SJacob Keller I40E_LINK_SPEED_10GB = BIT(I40E_LINK_SPEED_10GB_SHIFT), 16372101bac2SJacob Keller I40E_LINK_SPEED_40GB = BIT(I40E_LINK_SPEED_40GB_SHIFT), 16383123237aSCarolyn Wyborny I40E_LINK_SPEED_20GB = BIT(I40E_LINK_SPEED_20GB_SHIFT), 16393123237aSCarolyn Wyborny I40E_LINK_SPEED_25GB = BIT(I40E_LINK_SPEED_25GB_SHIFT), 164056a62fc8SJesse Brandeburg }; 164156a62fc8SJesse Brandeburg 164256a62fc8SJesse Brandeburg struct i40e_aqc_module_desc { 164356a62fc8SJesse Brandeburg u8 oui[3]; 164456a62fc8SJesse Brandeburg u8 reserved1; 164556a62fc8SJesse Brandeburg u8 part_number[16]; 164656a62fc8SJesse Brandeburg u8 revision[4]; 164756a62fc8SJesse Brandeburg u8 reserved2[8]; 164856a62fc8SJesse Brandeburg }; 164956a62fc8SJesse Brandeburg 16508d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_module_desc); 16518d5e33adSShannon Nelson 165256a62fc8SJesse Brandeburg struct i40e_aq_get_phy_abilities_resp { 165356a62fc8SJesse Brandeburg __le32 phy_type; /* bitmap using the above enum for offsets */ 1654981b7545SShannon Nelson u8 link_speed; /* bitmap using the above enum bit patterns */ 165556a62fc8SJesse Brandeburg u8 abilities; 165656a62fc8SJesse Brandeburg #define I40E_AQ_PHY_FLAG_PAUSE_TX 0x01 165756a62fc8SJesse Brandeburg #define I40E_AQ_PHY_FLAG_PAUSE_RX 0x02 165856a62fc8SJesse Brandeburg __le16 eee_capability; 165956a62fc8SJesse Brandeburg __le32 eeer_val; 166056a62fc8SJesse Brandeburg u8 d3_lpan; 16613123237aSCarolyn Wyborny u8 phy_type_ext; 16623123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_KR 0X01 16633123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_CR 0X02 16643123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_SR 0x04 16653123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_LR 0x08 166660f000a4SCarolyn Wyborny u8 fec_cfg_curr_mod_ext_info; 166760f000a4SCarolyn Wyborny #define I40E_AQ_REQUEST_FEC_KR 0x04 166860f000a4SCarolyn Wyborny #define I40E_AQ_REQUEST_FEC_RS 0x08 166960f000a4SCarolyn Wyborny #define I40E_AQ_ENABLE_FEC_AUTO 0x10 167060f000a4SCarolyn Wyborny 16713123237aSCarolyn Wyborny u8 ext_comp_code; 167256a62fc8SJesse Brandeburg u8 phy_id[4]; 167356a62fc8SJesse Brandeburg u8 module_type[3]; 167456a62fc8SJesse Brandeburg u8 qualified_module_count; 167556a62fc8SJesse Brandeburg #define I40E_AQ_PHY_MAX_QMS 16 167656a62fc8SJesse Brandeburg struct i40e_aqc_module_desc qualified_module[I40E_AQ_PHY_MAX_QMS]; 167756a62fc8SJesse Brandeburg }; 167856a62fc8SJesse Brandeburg 16798d5e33adSShannon Nelson I40E_CHECK_STRUCT_LEN(0x218, i40e_aq_get_phy_abilities_resp); 16808d5e33adSShannon Nelson 168156a62fc8SJesse Brandeburg /* Set PHY Config (direct 0x0601) */ 168256a62fc8SJesse Brandeburg struct i40e_aq_set_phy_config { /* same bits as above in all */ 168356a62fc8SJesse Brandeburg __le32 phy_type; 168456a62fc8SJesse Brandeburg u8 link_speed; 168556a62fc8SJesse Brandeburg u8 abilities; 1686981b7545SShannon Nelson /* bits 0-2 use the values from get_phy_abilities_resp */ 1687d5ec9e2cSArkadiusz Kubalewski #define I40E_AQ_PHY_ENABLE_LINK 0x08 1688981b7545SShannon Nelson #define I40E_AQ_PHY_ENABLE_AN 0x10 1689981b7545SShannon Nelson #define I40E_AQ_PHY_ENABLE_ATOMIC_LINK 0x20 169056a62fc8SJesse Brandeburg __le16 eee_capability; 169156a62fc8SJesse Brandeburg __le32 eeer; 169256a62fc8SJesse Brandeburg u8 low_power_ctrl; 16933123237aSCarolyn Wyborny u8 phy_type_ext; 16943123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_KR 0X01 16953123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_CR 0X02 16963123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_SR 0x04 16973123237aSCarolyn Wyborny #define I40E_AQ_PHY_TYPE_EXT_25G_LR 0x08 169860f000a4SCarolyn Wyborny u8 fec_config; 169960f000a4SCarolyn Wyborny #define I40E_AQ_SET_FEC_ABILITY_KR BIT(0) 170060f000a4SCarolyn Wyborny #define I40E_AQ_SET_FEC_ABILITY_RS BIT(1) 170160f000a4SCarolyn Wyborny #define I40E_AQ_SET_FEC_REQUEST_KR BIT(2) 170260f000a4SCarolyn Wyborny #define I40E_AQ_SET_FEC_REQUEST_RS BIT(3) 170360f000a4SCarolyn Wyborny #define I40E_AQ_SET_FEC_AUTO BIT(4) 170460f000a4SCarolyn Wyborny #define I40E_AQ_PHY_FEC_CONFIG_SHIFT 0x0 170560f000a4SCarolyn Wyborny #define I40E_AQ_PHY_FEC_CONFIG_MASK (0x1F << I40E_AQ_PHY_FEC_CONFIG_SHIFT) 170660f000a4SCarolyn Wyborny u8 reserved; 170756a62fc8SJesse Brandeburg }; 170856a62fc8SJesse Brandeburg 170956a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config); 171056a62fc8SJesse Brandeburg 171156a62fc8SJesse Brandeburg /* Set MAC Config command data structure (direct 0x0603) */ 171256a62fc8SJesse Brandeburg struct i40e_aq_set_mac_config { 171356a62fc8SJesse Brandeburg __le16 max_frame_size; 171456a62fc8SJesse Brandeburg u8 params; 171556a62fc8SJesse Brandeburg u8 tx_timer_priority; /* bitmap */ 171656a62fc8SJesse Brandeburg __le16 tx_timer_value; 171756a62fc8SJesse Brandeburg __le16 fc_refresh_threshold; 171856a62fc8SJesse Brandeburg u8 reserved[8]; 171956a62fc8SJesse Brandeburg }; 172056a62fc8SJesse Brandeburg 172156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aq_set_mac_config); 172256a62fc8SJesse Brandeburg 172356a62fc8SJesse Brandeburg /* Restart Auto-Negotiation (direct 0x605) */ 172456a62fc8SJesse Brandeburg struct i40e_aqc_set_link_restart_an { 172556a62fc8SJesse Brandeburg u8 command; 172656a62fc8SJesse Brandeburg #define I40E_AQ_PHY_RESTART_AN 0x02 172756a62fc8SJesse Brandeburg #define I40E_AQ_PHY_LINK_ENABLE 0x04 172856a62fc8SJesse Brandeburg u8 reserved[15]; 172956a62fc8SJesse Brandeburg }; 173056a62fc8SJesse Brandeburg 173156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_set_link_restart_an); 173256a62fc8SJesse Brandeburg 173356a62fc8SJesse Brandeburg /* Get Link Status cmd & response data structure (direct 0x0607) */ 173456a62fc8SJesse Brandeburg struct i40e_aqc_get_link_status { 173556a62fc8SJesse Brandeburg __le16 command_flags; /* only field set on command */ 173656a62fc8SJesse Brandeburg #define I40E_AQ_LSE_DISABLE 0x2 173756a62fc8SJesse Brandeburg #define I40E_AQ_LSE_ENABLE 0x3 173856a62fc8SJesse Brandeburg /* only response uses this flag */ 173956a62fc8SJesse Brandeburg #define I40E_AQ_LSE_IS_ENABLED 0x1 174056a62fc8SJesse Brandeburg u8 phy_type; /* i40e_aq_phy_type */ 174156a62fc8SJesse Brandeburg u8 link_speed; /* i40e_aq_link_speed */ 174256a62fc8SJesse Brandeburg u8 link_info; 17431d55aa9cSShannon Nelson #define I40E_AQ_LINK_UP 0x01 /* obsolete */ 174456a62fc8SJesse Brandeburg #define I40E_AQ_MEDIA_AVAILABLE 0x40 174556a62fc8SJesse Brandeburg u8 an_info; 174656a62fc8SJesse Brandeburg #define I40E_AQ_AN_COMPLETED 0x01 174756a62fc8SJesse Brandeburg #define I40E_AQ_LINK_PAUSE_TX 0x20 174856a62fc8SJesse Brandeburg #define I40E_AQ_LINK_PAUSE_RX 0x40 174956a62fc8SJesse Brandeburg #define I40E_AQ_QUALIFIED_MODULE 0x80 175056a62fc8SJesse Brandeburg u8 ext_info; 175156a62fc8SJesse Brandeburg u8 loopback; /* use defines from i40e_aqc_set_lb_mode */ 1752d60bcc79SFilip Sadowski /* Since firmware API 1.7 loopback field keeps power class info as well */ 1753d60bcc79SFilip Sadowski #define I40E_AQ_LOOPBACK_MASK 0x07 175456a62fc8SJesse Brandeburg __le16 max_frame_size; 175556a62fc8SJesse Brandeburg u8 config; 175660f000a4SCarolyn Wyborny #define I40E_AQ_CONFIG_FEC_KR_ENA 0x01 175760f000a4SCarolyn Wyborny #define I40E_AQ_CONFIG_FEC_RS_ENA 0x02 175856a62fc8SJesse Brandeburg #define I40E_AQ_CONFIG_CRC_ENA 0x04 175956a62fc8SJesse Brandeburg #define I40E_AQ_CONFIG_PACING_MASK 0x78 1760d60bcc79SFilip Sadowski union { 1761d60bcc79SFilip Sadowski struct { 1762d60be2caSShannon Nelson u8 power_desc; 17635eb772f7SShannon Nelson u8 reserved[4]; 176456a62fc8SJesse Brandeburg }; 1765d60bcc79SFilip Sadowski struct { 1766d60bcc79SFilip Sadowski u8 link_type[4]; 1767d60bcc79SFilip Sadowski u8 link_type_ext; 1768d60bcc79SFilip Sadowski }; 1769d60bcc79SFilip Sadowski }; 1770d60bcc79SFilip Sadowski }; 177156a62fc8SJesse Brandeburg 177256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_get_link_status); 177356a62fc8SJesse Brandeburg 177456a62fc8SJesse Brandeburg /* Set event mask command (direct 0x613) */ 177556a62fc8SJesse Brandeburg struct i40e_aqc_set_phy_int_mask { 177656a62fc8SJesse Brandeburg u8 reserved[8]; 177756a62fc8SJesse Brandeburg __le16 event_mask; 177856a62fc8SJesse Brandeburg #define I40E_AQ_EVENT_LINK_UPDOWN 0x0002 177956a62fc8SJesse Brandeburg #define I40E_AQ_EVENT_MEDIA_NA 0x0004 178056a62fc8SJesse Brandeburg #define I40E_AQ_EVENT_MODULE_QUAL_FAIL 0x0100 178156a62fc8SJesse Brandeburg u8 reserved1[6]; 178256a62fc8SJesse Brandeburg }; 178356a62fc8SJesse Brandeburg 178456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_set_phy_int_mask); 178556a62fc8SJesse Brandeburg 178656a62fc8SJesse Brandeburg /* Get Local AN advt register (direct 0x0614) 178756a62fc8SJesse Brandeburg * Set Local AN advt register (direct 0x0615) 178856a62fc8SJesse Brandeburg * Get Link Partner AN advt register (direct 0x0616) 178956a62fc8SJesse Brandeburg */ 179056a62fc8SJesse Brandeburg struct i40e_aqc_an_advt_reg { 179156a62fc8SJesse Brandeburg __le32 local_an_reg0; 179256a62fc8SJesse Brandeburg __le16 local_an_reg1; 179356a62fc8SJesse Brandeburg u8 reserved[10]; 179456a62fc8SJesse Brandeburg }; 179556a62fc8SJesse Brandeburg 179656a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_an_advt_reg); 179756a62fc8SJesse Brandeburg 179856a62fc8SJesse Brandeburg /* Set Loopback mode (0x0618) */ 179956a62fc8SJesse Brandeburg struct i40e_aqc_set_lb_mode { 180056a62fc8SJesse Brandeburg __le16 lb_mode; 1801b1746fbaSTirthendu Sarkar #define I40E_LEGACY_LOOPBACK_NVM_VER 0x6000 1802b1746fbaSTirthendu Sarkar #define I40E_AQ_LB_MAC_LOCAL 0x01 1803b1746fbaSTirthendu Sarkar #define I40E_AQ_LB_PHY_LOCAL 0x05 1804b1746fbaSTirthendu Sarkar #define I40E_AQ_LB_PHY_REMOTE 0x06 1805b1746fbaSTirthendu Sarkar #define I40E_AQ_LB_MAC_LOCAL_LEGACY 0x04 180656a62fc8SJesse Brandeburg u8 reserved[14]; 180756a62fc8SJesse Brandeburg }; 180856a62fc8SJesse Brandeburg 180956a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_set_lb_mode); 181056a62fc8SJesse Brandeburg 1811f94234eeSShannon Nelson /* Set PHY Debug command (0x0622) */ 1812f94234eeSShannon Nelson struct i40e_aqc_set_phy_debug { 1813f94234eeSShannon Nelson u8 command_flags; 181406c0e39bSKevin Scott /* Disable link manageability on a single port */ 1815f94234eeSShannon Nelson #define I40E_AQ_PHY_DEBUG_DISABLE_LINK_FW 0x10 181606c0e39bSKevin Scott /* Disable link manageability on all ports */ 181706c0e39bSKevin Scott #define I40E_AQ_PHY_DEBUG_DISABLE_ALL_LINK_FW 0x20 181856a62fc8SJesse Brandeburg u8 reserved[15]; 181956a62fc8SJesse Brandeburg }; 182056a62fc8SJesse Brandeburg 1821f94234eeSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_set_phy_debug); 182256a62fc8SJesse Brandeburg 182356a62fc8SJesse Brandeburg enum i40e_aq_phy_reg_type { 182456a62fc8SJesse Brandeburg I40E_AQC_PHY_REG_INTERNAL = 0x1, 182556a62fc8SJesse Brandeburg I40E_AQC_PHY_REG_EXERNAL_BASET = 0x2, 182656a62fc8SJesse Brandeburg I40E_AQC_PHY_REG_EXERNAL_MODULE = 0x3 182756a62fc8SJesse Brandeburg }; 182856a62fc8SJesse Brandeburg 18295394f02fSShannon Nelson /* Run PHY Activity (0x0626) */ 18305394f02fSShannon Nelson struct i40e_aqc_run_phy_activity { 18315394f02fSShannon Nelson __le16 activity_id; 18325394f02fSShannon Nelson u8 flags; 18335394f02fSShannon Nelson u8 reserved1; 18345394f02fSShannon Nelson __le32 control; 18355394f02fSShannon Nelson __le32 data; 18365394f02fSShannon Nelson u8 reserved2[4]; 18375394f02fSShannon Nelson }; 18385394f02fSShannon Nelson 18395394f02fSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_run_phy_activity); 18405394f02fSShannon Nelson 18419c0e5cafSFilip Sadowski /* Set PHY Register command (0x0628) */ 18429c0e5cafSFilip Sadowski /* Get PHY Register command (0x0629) */ 18439c0e5cafSFilip Sadowski struct i40e_aqc_phy_register_access { 18449c0e5cafSFilip Sadowski u8 phy_interface; 18459c0e5cafSFilip Sadowski #define I40E_AQ_PHY_REG_ACCESS_EXTERNAL 1 18469c0e5cafSFilip Sadowski #define I40E_AQ_PHY_REG_ACCESS_EXTERNAL_MODULE 2 18479c0e5cafSFilip Sadowski u8 dev_address; 18480514db37SPiotr Azarewicz u8 cmd_flags; 18490514db37SPiotr Azarewicz #define I40E_AQ_PHY_REG_ACCESS_DONT_CHANGE_QSFP_PAGE 0x01 18500514db37SPiotr Azarewicz #define I40E_AQ_PHY_REG_ACCESS_SET_MDIO_IF_NUMBER 0x02 18510514db37SPiotr Azarewicz #define I40E_AQ_PHY_REG_ACCESS_MDIO_IF_NUMBER_SHIFT 2 18520514db37SPiotr Azarewicz #define I40E_AQ_PHY_REG_ACCESS_MDIO_IF_NUMBER_MASK (0x3 << \ 18530514db37SPiotr Azarewicz I40E_AQ_PHY_REG_ACCESS_MDIO_IF_NUMBER_SHIFT) 18540514db37SPiotr Azarewicz u8 reserved1; 18559c0e5cafSFilip Sadowski __le32 reg_address; 18569c0e5cafSFilip Sadowski __le32 reg_value; 18579c0e5cafSFilip Sadowski u8 reserved2[4]; 18589c0e5cafSFilip Sadowski }; 18599c0e5cafSFilip Sadowski 18609c0e5cafSFilip Sadowski I40E_CHECK_CMD_LENGTH(i40e_aqc_phy_register_access); 18619c0e5cafSFilip Sadowski 186256a62fc8SJesse Brandeburg /* NVM Read command (indirect 0x0701) 186356a62fc8SJesse Brandeburg * NVM Erase commands (direct 0x0702) 186456a62fc8SJesse Brandeburg * NVM Update commands (indirect 0x0703) 186556a62fc8SJesse Brandeburg */ 186656a62fc8SJesse Brandeburg struct i40e_aqc_nvm_update { 186756a62fc8SJesse Brandeburg u8 command_flags; 186856a62fc8SJesse Brandeburg #define I40E_AQ_NVM_LAST_CMD 0x01 1869f05798b4SPiotr Azarewicz #define I40E_AQ_NVM_REARRANGE_TO_FLAT 0x20 1870f05798b4SPiotr Azarewicz #define I40E_AQ_NVM_REARRANGE_TO_STRUCT 0x40 1871e3a5d6e6SPawel Jablonski #define I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT 1 1872e3a5d6e6SPawel Jablonski #define I40E_AQ_NVM_PRESERVATION_FLAGS_SELECTED 0x03 1873e3a5d6e6SPawel Jablonski #define I40E_AQ_NVM_PRESERVATION_FLAGS_ALL 0x01 187456a62fc8SJesse Brandeburg u8 module_pointer; 187556a62fc8SJesse Brandeburg __le16 length; 187656a62fc8SJesse Brandeburg __le32 offset; 187756a62fc8SJesse Brandeburg __le32 addr_high; 187856a62fc8SJesse Brandeburg __le32 addr_low; 187956a62fc8SJesse Brandeburg }; 188056a62fc8SJesse Brandeburg 188156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update); 188256a62fc8SJesse Brandeburg 1883f94234eeSShannon Nelson /* NVM Config Read (indirect 0x0704) */ 1884f94234eeSShannon Nelson struct i40e_aqc_nvm_config_read { 1885f94234eeSShannon Nelson __le16 cmd_flags; 1886f94234eeSShannon Nelson __le16 element_count; 1887f94234eeSShannon Nelson __le16 element_id; /* Feature/field ID */ 1888e910ca7cSJeff Kirsher __le16 element_id_msw; /* MSWord of field ID */ 1889f94234eeSShannon Nelson __le32 address_high; 1890f94234eeSShannon Nelson __le32 address_low; 1891f94234eeSShannon Nelson }; 1892f94234eeSShannon Nelson 1893f94234eeSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_read); 1894f94234eeSShannon Nelson 1895f94234eeSShannon Nelson /* NVM Config Write (indirect 0x0705) */ 1896f94234eeSShannon Nelson struct i40e_aqc_nvm_config_write { 1897f94234eeSShannon Nelson __le16 cmd_flags; 1898f94234eeSShannon Nelson __le16 element_count; 1899f94234eeSShannon Nelson u8 reserved[4]; 1900f94234eeSShannon Nelson __le32 address_high; 1901f94234eeSShannon Nelson __le32 address_low; 1902f94234eeSShannon Nelson }; 1903f94234eeSShannon Nelson 1904f94234eeSShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_config_write); 1905f94234eeSShannon Nelson 1906672415c5SShannon Nelson /* Used for 0x0704 as well as for 0x0705 commands */ 1907f94234eeSShannon Nelson struct i40e_aqc_nvm_config_data_feature { 1908f94234eeSShannon Nelson __le16 feature_id; 1909f94234eeSShannon Nelson __le16 feature_options; 1910f94234eeSShannon Nelson __le16 feature_selection; 1911f94234eeSShannon Nelson }; 1912f94234eeSShannon Nelson 1913672415c5SShannon Nelson I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature); 1914672415c5SShannon Nelson 1915f94234eeSShannon Nelson struct i40e_aqc_nvm_config_data_immediate_field { 1916672415c5SShannon Nelson __le32 field_id; 1917672415c5SShannon Nelson __le32 field_value; 1918f94234eeSShannon Nelson __le16 field_options; 1919672415c5SShannon Nelson __le16 reserved; 1920f94234eeSShannon Nelson }; 1921f94234eeSShannon Nelson 1922672415c5SShannon Nelson I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field); 1923672415c5SShannon Nelson 192400ada50dSMichal Kosiarz /* OEM Post Update (indirect 0x0720) 192500ada50dSMichal Kosiarz * no command data struct used 192600ada50dSMichal Kosiarz */ 192700ada50dSMichal Kosiarz struct i40e_aqc_nvm_oem_post_update { 192800ada50dSMichal Kosiarz u8 sel_data; 192900ada50dSMichal Kosiarz u8 reserved[7]; 193000ada50dSMichal Kosiarz }; 193100ada50dSMichal Kosiarz 193200ada50dSMichal Kosiarz I40E_CHECK_STRUCT_LEN(0x8, i40e_aqc_nvm_oem_post_update); 193300ada50dSMichal Kosiarz 193400ada50dSMichal Kosiarz struct i40e_aqc_nvm_oem_post_update_buffer { 193500ada50dSMichal Kosiarz u8 str_len; 193600ada50dSMichal Kosiarz u8 dev_addr; 193700ada50dSMichal Kosiarz __le16 eeprom_addr; 193800ada50dSMichal Kosiarz u8 data[36]; 193900ada50dSMichal Kosiarz }; 194000ada50dSMichal Kosiarz 194100ada50dSMichal Kosiarz I40E_CHECK_STRUCT_LEN(0x28, i40e_aqc_nvm_oem_post_update_buffer); 194200ada50dSMichal Kosiarz 19436774faf9SShannon Nelson /* Thermal Sensor (indirect 0x0721) 19446774faf9SShannon Nelson * read or set thermal sensor configs and values 19456774faf9SShannon Nelson * takes a sensor and command specific data buffer, not detailed here 19466774faf9SShannon Nelson */ 19476774faf9SShannon Nelson struct i40e_aqc_thermal_sensor { 19486774faf9SShannon Nelson u8 sensor_action; 19496774faf9SShannon Nelson u8 reserved[7]; 19506774faf9SShannon Nelson __le32 addr_high; 19516774faf9SShannon Nelson __le32 addr_low; 19526774faf9SShannon Nelson }; 19536774faf9SShannon Nelson 19546774faf9SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_thermal_sensor); 19556774faf9SShannon Nelson 195656a62fc8SJesse Brandeburg /* Send to PF command (indirect 0x0801) id is only used by PF 195756a62fc8SJesse Brandeburg * Send to VF command (indirect 0x0802) id is only used by PF 195856a62fc8SJesse Brandeburg * Send to Peer PF command (indirect 0x0803) 195956a62fc8SJesse Brandeburg */ 196056a62fc8SJesse Brandeburg struct i40e_aqc_pf_vf_message { 196156a62fc8SJesse Brandeburg __le32 id; 196256a62fc8SJesse Brandeburg u8 reserved[4]; 196356a62fc8SJesse Brandeburg __le32 addr_high; 196456a62fc8SJesse Brandeburg __le32 addr_low; 196556a62fc8SJesse Brandeburg }; 196656a62fc8SJesse Brandeburg 196756a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_pf_vf_message); 196856a62fc8SJesse Brandeburg 196956a62fc8SJesse Brandeburg /* Alternate structure */ 197056a62fc8SJesse Brandeburg 197156a62fc8SJesse Brandeburg /* Direct write (direct 0x0900) 197256a62fc8SJesse Brandeburg * Direct read (direct 0x0902) 197356a62fc8SJesse Brandeburg */ 197456a62fc8SJesse Brandeburg struct i40e_aqc_alternate_write { 197556a62fc8SJesse Brandeburg __le32 address0; 197656a62fc8SJesse Brandeburg __le32 data0; 197756a62fc8SJesse Brandeburg __le32 address1; 197856a62fc8SJesse Brandeburg __le32 data1; 197956a62fc8SJesse Brandeburg }; 198056a62fc8SJesse Brandeburg 198156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_write); 198256a62fc8SJesse Brandeburg 198356a62fc8SJesse Brandeburg /* Indirect write (indirect 0x0901) 198456a62fc8SJesse Brandeburg * Indirect read (indirect 0x0903) 198556a62fc8SJesse Brandeburg */ 198656a62fc8SJesse Brandeburg 198756a62fc8SJesse Brandeburg struct i40e_aqc_alternate_ind_write { 198856a62fc8SJesse Brandeburg __le32 address; 198956a62fc8SJesse Brandeburg __le32 length; 199056a62fc8SJesse Brandeburg __le32 addr_high; 199156a62fc8SJesse Brandeburg __le32 addr_low; 199256a62fc8SJesse Brandeburg }; 199356a62fc8SJesse Brandeburg 199456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_ind_write); 199556a62fc8SJesse Brandeburg 199656a62fc8SJesse Brandeburg /* Done alternate write (direct 0x0904) 199756a62fc8SJesse Brandeburg * uses i40e_aq_desc 199856a62fc8SJesse Brandeburg */ 199956a62fc8SJesse Brandeburg struct i40e_aqc_alternate_write_done { 200056a62fc8SJesse Brandeburg __le16 cmd_flags; 200156a62fc8SJesse Brandeburg u8 reserved[14]; 200256a62fc8SJesse Brandeburg }; 200356a62fc8SJesse Brandeburg 200456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_write_done); 200556a62fc8SJesse Brandeburg 200656a62fc8SJesse Brandeburg /* Set OEM mode (direct 0x0905) */ 200756a62fc8SJesse Brandeburg struct i40e_aqc_alternate_set_mode { 200856a62fc8SJesse Brandeburg __le32 mode; 200956a62fc8SJesse Brandeburg u8 reserved[12]; 201056a62fc8SJesse Brandeburg }; 201156a62fc8SJesse Brandeburg 201256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_alternate_set_mode); 201356a62fc8SJesse Brandeburg 201456a62fc8SJesse Brandeburg /* Clear port Alternate RAM (direct 0x0906) uses i40e_aq_desc */ 201556a62fc8SJesse Brandeburg 201656a62fc8SJesse Brandeburg /* async events 0x10xx */ 201756a62fc8SJesse Brandeburg 201856a62fc8SJesse Brandeburg /* Lan Queue Overflow Event (direct, 0x1001) */ 201956a62fc8SJesse Brandeburg struct i40e_aqc_lan_overflow { 202056a62fc8SJesse Brandeburg __le32 prtdcb_rupto; 202156a62fc8SJesse Brandeburg __le32 otx_ctl; 202256a62fc8SJesse Brandeburg u8 reserved[8]; 202356a62fc8SJesse Brandeburg }; 202456a62fc8SJesse Brandeburg 202556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lan_overflow); 202656a62fc8SJesse Brandeburg 202756a62fc8SJesse Brandeburg /* Get LLDP MIB (indirect 0x0A00) */ 202856a62fc8SJesse Brandeburg struct i40e_aqc_lldp_get_mib { 202956a62fc8SJesse Brandeburg u8 type; 203056a62fc8SJesse Brandeburg u8 reserved1; 203156a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_MIB_TYPE_MASK 0x3 203256a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_MIB_LOCAL 0x0 203356a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_MIB_REMOTE 0x1 203456a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_BRIDGE_TYPE_MASK 0xC 203556a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT 0x2 203656a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE 0x0 203756a62fc8SJesse Brandeburg /* TX pause flags use I40E_AQ_LINK_TX_* above */ 203856a62fc8SJesse Brandeburg __le16 local_len; 203956a62fc8SJesse Brandeburg __le16 remote_len; 204056a62fc8SJesse Brandeburg u8 reserved2[2]; 204156a62fc8SJesse Brandeburg __le32 addr_high; 204256a62fc8SJesse Brandeburg __le32 addr_low; 204356a62fc8SJesse Brandeburg }; 204456a62fc8SJesse Brandeburg 204556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_get_mib); 204656a62fc8SJesse Brandeburg 204756a62fc8SJesse Brandeburg /* Configure LLDP MIB Change Event (direct 0x0A01) 204856a62fc8SJesse Brandeburg * also used for the event (with type in the command field) 204956a62fc8SJesse Brandeburg */ 205056a62fc8SJesse Brandeburg struct i40e_aqc_lldp_update_mib { 205156a62fc8SJesse Brandeburg u8 command; 205256a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_MIB_UPDATE_DISABLE 0x1 205356a62fc8SJesse Brandeburg u8 reserved[7]; 205456a62fc8SJesse Brandeburg __le32 addr_high; 205556a62fc8SJesse Brandeburg __le32 addr_low; 205656a62fc8SJesse Brandeburg }; 205756a62fc8SJesse Brandeburg 205856a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_mib); 205956a62fc8SJesse Brandeburg 206056a62fc8SJesse Brandeburg /* Add LLDP TLV (indirect 0x0A02) 206156a62fc8SJesse Brandeburg * Delete LLDP TLV (indirect 0x0A04) 206256a62fc8SJesse Brandeburg */ 206356a62fc8SJesse Brandeburg struct i40e_aqc_lldp_add_tlv { 206456a62fc8SJesse Brandeburg u8 type; /* only nearest bridge and non-TPMR from 0x0A00 */ 206556a62fc8SJesse Brandeburg u8 reserved1[1]; 206656a62fc8SJesse Brandeburg __le16 len; 206756a62fc8SJesse Brandeburg u8 reserved2[4]; 206856a62fc8SJesse Brandeburg __le32 addr_high; 206956a62fc8SJesse Brandeburg __le32 addr_low; 207056a62fc8SJesse Brandeburg }; 207156a62fc8SJesse Brandeburg 207256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_add_tlv); 207356a62fc8SJesse Brandeburg 207456a62fc8SJesse Brandeburg /* Update LLDP TLV (indirect 0x0A03) */ 207556a62fc8SJesse Brandeburg struct i40e_aqc_lldp_update_tlv { 207656a62fc8SJesse Brandeburg u8 type; /* only nearest bridge and non-TPMR from 0x0A00 */ 207756a62fc8SJesse Brandeburg u8 reserved; 207856a62fc8SJesse Brandeburg __le16 old_len; 207956a62fc8SJesse Brandeburg __le16 new_offset; 208056a62fc8SJesse Brandeburg __le16 new_len; 208156a62fc8SJesse Brandeburg __le32 addr_high; 208256a62fc8SJesse Brandeburg __le32 addr_low; 208356a62fc8SJesse Brandeburg }; 208456a62fc8SJesse Brandeburg 208556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_tlv); 208656a62fc8SJesse Brandeburg 208756a62fc8SJesse Brandeburg /* Stop LLDP (direct 0x0A05) */ 208856a62fc8SJesse Brandeburg struct i40e_aqc_lldp_stop { 208956a62fc8SJesse Brandeburg u8 command; 209056a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_AGENT_SHUTDOWN 0x1 2091c65e78f8SAleksandr Loktionov #define I40E_AQ_LLDP_AGENT_STOP_PERSIST 0x2 209256a62fc8SJesse Brandeburg u8 reserved[15]; 209356a62fc8SJesse Brandeburg }; 209456a62fc8SJesse Brandeburg 209556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop); 209656a62fc8SJesse Brandeburg 209756a62fc8SJesse Brandeburg /* Start LLDP (direct 0x0A06) */ 209856a62fc8SJesse Brandeburg struct i40e_aqc_lldp_start { 209956a62fc8SJesse Brandeburg u8 command; 210056a62fc8SJesse Brandeburg #define I40E_AQ_LLDP_AGENT_START 0x1 2101c65e78f8SAleksandr Loktionov #define I40E_AQ_LLDP_AGENT_START_PERSIST 0x2 210256a62fc8SJesse Brandeburg u8 reserved[15]; 210356a62fc8SJesse Brandeburg }; 210456a62fc8SJesse Brandeburg 210556a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start); 210656a62fc8SJesse Brandeburg 2107b6a02a6fSUpasana Menon /* Set DCB (direct 0x0303) */ 2108b6a02a6fSUpasana Menon struct i40e_aqc_set_dcb_parameters { 2109b6a02a6fSUpasana Menon u8 command; 2110b6a02a6fSUpasana Menon #define I40E_AQ_DCB_SET_AGENT 0x1 2111b6a02a6fSUpasana Menon #define I40E_DCB_VALID 0x1 2112b6a02a6fSUpasana Menon u8 valid_flags; 2113b6a02a6fSUpasana Menon u8 reserved[14]; 2114b6a02a6fSUpasana Menon }; 2115b6a02a6fSUpasana Menon 2116b6a02a6fSUpasana Menon I40E_CHECK_CMD_LENGTH(i40e_aqc_set_dcb_parameters); 2117b6a02a6fSUpasana Menon 21189fa61dd2SNeerav Parikh /* Get CEE DCBX Oper Config (0x0A07) 21199fa61dd2SNeerav Parikh * uses the generic descriptor struct 21209fa61dd2SNeerav Parikh * returns below as indirect response 212156a62fc8SJesse Brandeburg */ 212256a62fc8SJesse Brandeburg 21239fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_FCOE_SHIFT 0x0 21249fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_FCOE_MASK (0x7 << I40E_AQC_CEE_APP_FCOE_SHIFT) 21259fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_ISCSI_SHIFT 0x3 21269fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_ISCSI_MASK (0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT) 21279fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_FIP_SHIFT 0x8 21289fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_FIP_MASK (0x7 << I40E_AQC_CEE_APP_FIP_SHIFT) 2129725821f3SShannon Nelson 21309fa61dd2SNeerav Parikh #define I40E_AQC_CEE_PG_STATUS_SHIFT 0x0 21319fa61dd2SNeerav Parikh #define I40E_AQC_CEE_PG_STATUS_MASK (0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT) 21329fa61dd2SNeerav Parikh #define I40E_AQC_CEE_PFC_STATUS_SHIFT 0x3 21339fa61dd2SNeerav Parikh #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT) 21349fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 21359fa61dd2SNeerav Parikh #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT) 2136cb2f65bcSGreg Rose #define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8 2137cb2f65bcSGreg Rose #define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT) 2138725821f3SShannon Nelson #define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xB 2139cb2f65bcSGreg Rose #define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT) 2140cb2f65bcSGreg Rose #define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10 2141cb2f65bcSGreg Rose #define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT) 214217351401SShannon Nelson 214317351401SShannon Nelson /* struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with 214417351401SShannon Nelson * word boundary layout issues, which the Linux compilers silently deal 214517351401SShannon Nelson * with by adding padding, making the actual struct larger than designed. 214617351401SShannon Nelson * However, the FW compiler for the NIC is less lenient and complains 214717351401SShannon Nelson * about the struct. Hence, the struct defined here has an extra byte in 214817351401SShannon Nelson * fields reserved3 and reserved4 to directly acknowledge that padding, 214917351401SShannon Nelson * and the new length is used in the length check macro. 215017351401SShannon Nelson */ 21519fa61dd2SNeerav Parikh struct i40e_aqc_get_cee_dcb_cfg_v1_resp { 21529fa61dd2SNeerav Parikh u8 reserved1; 21539fa61dd2SNeerav Parikh u8 oper_num_tc; 21549fa61dd2SNeerav Parikh u8 oper_prio_tc[4]; 21559fa61dd2SNeerav Parikh u8 reserved2; 21569fa61dd2SNeerav Parikh u8 oper_tc_bw[8]; 21579fa61dd2SNeerav Parikh u8 oper_pfc_en; 215817351401SShannon Nelson u8 reserved3[2]; 21599fa61dd2SNeerav Parikh __le16 oper_app_prio; 216017351401SShannon Nelson u8 reserved4[2]; 21619fa61dd2SNeerav Parikh __le16 tlv_status; 21629fa61dd2SNeerav Parikh }; 21639fa61dd2SNeerav Parikh 21649fa61dd2SNeerav Parikh I40E_CHECK_STRUCT_LEN(0x18, i40e_aqc_get_cee_dcb_cfg_v1_resp); 21659fa61dd2SNeerav Parikh 21669fa61dd2SNeerav Parikh struct i40e_aqc_get_cee_dcb_cfg_resp { 21679fa61dd2SNeerav Parikh u8 oper_num_tc; 21689fa61dd2SNeerav Parikh u8 oper_prio_tc[4]; 21699fa61dd2SNeerav Parikh u8 oper_tc_bw[8]; 21709fa61dd2SNeerav Parikh u8 oper_pfc_en; 21719fa61dd2SNeerav Parikh __le16 oper_app_prio; 2172672415c5SShannon Nelson #define I40E_AQC_CEE_APP_FCOE_SHIFT 0x0 2173672415c5SShannon Nelson #define I40E_AQC_CEE_APP_FCOE_MASK (0x7 << I40E_AQC_CEE_APP_FCOE_SHIFT) 2174672415c5SShannon Nelson #define I40E_AQC_CEE_APP_ISCSI_SHIFT 0x3 2175672415c5SShannon Nelson #define I40E_AQC_CEE_APP_ISCSI_MASK (0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT) 2176672415c5SShannon Nelson #define I40E_AQC_CEE_APP_FIP_SHIFT 0x8 2177672415c5SShannon Nelson #define I40E_AQC_CEE_APP_FIP_MASK (0x7 << I40E_AQC_CEE_APP_FIP_SHIFT) 2178672415c5SShannon Nelson #define I40E_AQC_CEE_APP_FIP_MASK (0x7 << I40E_AQC_CEE_APP_FIP_SHIFT) 21799fa61dd2SNeerav Parikh __le32 tlv_status; 2180672415c5SShannon Nelson #define I40E_AQC_CEE_PG_STATUS_SHIFT 0x0 2181672415c5SShannon Nelson #define I40E_AQC_CEE_PG_STATUS_MASK (0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT) 2182672415c5SShannon Nelson #define I40E_AQC_CEE_PFC_STATUS_SHIFT 0x3 2183672415c5SShannon Nelson #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT) 2184672415c5SShannon Nelson #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 2185672415c5SShannon Nelson #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT) 21869fa61dd2SNeerav Parikh u8 reserved[12]; 21879fa61dd2SNeerav Parikh }; 21889fa61dd2SNeerav Parikh 21899fa61dd2SNeerav Parikh I40E_CHECK_STRUCT_LEN(0x20, i40e_aqc_get_cee_dcb_cfg_resp); 21909fa61dd2SNeerav Parikh 2191672415c5SShannon Nelson /* Set Local LLDP MIB (indirect 0x0A08) 2192672415c5SShannon Nelson * Used to replace the local MIB of a given LLDP agent. e.g. DCBx 2193672415c5SShannon Nelson */ 2194672415c5SShannon Nelson struct i40e_aqc_lldp_set_local_mib { 219590bc8e00SArkadiusz Kubalewski #define SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT 0 219690bc8e00SArkadiusz Kubalewski #define SET_LOCAL_MIB_AC_TYPE_DCBX_MASK (1 << \ 219790bc8e00SArkadiusz Kubalewski SET_LOCAL_MIB_AC_TYPE_DCBX_SHIFT) 219890bc8e00SArkadiusz Kubalewski #define SET_LOCAL_MIB_AC_TYPE_LOCAL_MIB 0x0 219990bc8e00SArkadiusz Kubalewski #define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT (1) 220090bc8e00SArkadiusz Kubalewski #define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_MASK (1 << \ 220190bc8e00SArkadiusz Kubalewski SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS_SHIFT) 220290bc8e00SArkadiusz Kubalewski #define SET_LOCAL_MIB_AC_TYPE_NON_WILLING_APPS 0x1 2203672415c5SShannon Nelson u8 type; 2204672415c5SShannon Nelson u8 reserved0; 2205672415c5SShannon Nelson __le16 length; 2206672415c5SShannon Nelson u8 reserved1[4]; 2207672415c5SShannon Nelson __le32 address_high; 2208672415c5SShannon Nelson __le32 address_low; 2209672415c5SShannon Nelson }; 2210672415c5SShannon Nelson 2211672415c5SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_set_local_mib); 2212672415c5SShannon Nelson 2213672415c5SShannon Nelson /* Stop/Start LLDP Agent (direct 0x0A09) 2214672415c5SShannon Nelson * Used for stopping/starting specific LLDP agent. e.g. DCBx 2215672415c5SShannon Nelson */ 2216672415c5SShannon Nelson struct i40e_aqc_lldp_stop_start_specific_agent { 2217672415c5SShannon Nelson u8 command; 2218672415c5SShannon Nelson u8 reserved[15]; 2219672415c5SShannon Nelson }; 2220672415c5SShannon Nelson 2221672415c5SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop_start_specific_agent); 2222672415c5SShannon Nelson 2223c65e78f8SAleksandr Loktionov /* Restore LLDP Agent factory settings (direct 0x0A0A) */ 2224c65e78f8SAleksandr Loktionov struct i40e_aqc_lldp_restore { 2225c65e78f8SAleksandr Loktionov u8 command; 2226c65e78f8SAleksandr Loktionov #define I40E_AQ_LLDP_AGENT_RESTORE 0x1 2227c65e78f8SAleksandr Loktionov u8 reserved[15]; 2228c65e78f8SAleksandr Loktionov }; 2229c65e78f8SAleksandr Loktionov 2230c65e78f8SAleksandr Loktionov I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_restore); 2231c65e78f8SAleksandr Loktionov 223256a62fc8SJesse Brandeburg /* Add Udp Tunnel command and completion (direct 0x0B00) */ 223356a62fc8SJesse Brandeburg struct i40e_aqc_add_udp_tunnel { 223456a62fc8SJesse Brandeburg __le16 udp_port; 22350aebd2d9SShannon Nelson u8 reserved0[3]; 2236981b7545SShannon Nelson u8 protocol_type; 22370aebd2d9SShannon Nelson #define I40E_AQC_TUNNEL_TYPE_VXLAN 0x00 22380aebd2d9SShannon Nelson #define I40E_AQC_TUNNEL_TYPE_NGE 0x01 22390aebd2d9SShannon Nelson u8 reserved1[10]; 224056a62fc8SJesse Brandeburg }; 224156a62fc8SJesse Brandeburg 224256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel); 224356a62fc8SJesse Brandeburg 2244981b7545SShannon Nelson struct i40e_aqc_add_udp_tunnel_completion { 2245981b7545SShannon Nelson __le16 udp_port; 2246981b7545SShannon Nelson u8 filter_entry_index; 2247981b7545SShannon Nelson u8 multiple_pfs; 2248981b7545SShannon Nelson u8 total_filters; 2249981b7545SShannon Nelson u8 reserved[11]; 2250981b7545SShannon Nelson }; 2251981b7545SShannon Nelson 2252981b7545SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_add_udp_tunnel_completion); 2253981b7545SShannon Nelson 225456a62fc8SJesse Brandeburg /* remove UDP Tunnel command (0x0B01) */ 225556a62fc8SJesse Brandeburg struct i40e_aqc_remove_udp_tunnel { 225656a62fc8SJesse Brandeburg u8 reserved[2]; 225756a62fc8SJesse Brandeburg u8 index; /* 0 to 15 */ 2258981b7545SShannon Nelson u8 reserved2[13]; 225956a62fc8SJesse Brandeburg }; 226056a62fc8SJesse Brandeburg 226156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_udp_tunnel); 226256a62fc8SJesse Brandeburg 226356a62fc8SJesse Brandeburg struct i40e_aqc_del_udp_tunnel_completion { 226456a62fc8SJesse Brandeburg __le16 udp_port; 226556a62fc8SJesse Brandeburg u8 index; /* 0 to 15 */ 2266981b7545SShannon Nelson u8 multiple_pfs; 2267981b7545SShannon Nelson u8 total_filters_used; 2268981b7545SShannon Nelson u8 reserved1[11]; 226956a62fc8SJesse Brandeburg }; 227056a62fc8SJesse Brandeburg 227156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion); 227256a62fc8SJesse Brandeburg 2273e50c8d6dSAnjali Singhai Jain struct i40e_aqc_get_set_rss_key { 22742101bac2SJacob Keller #define I40E_AQC_SET_RSS_KEY_VSI_VALID BIT(15) 2275e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT 0 2276e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK (0x3FF << \ 2277e50c8d6dSAnjali Singhai Jain I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) 2278e50c8d6dSAnjali Singhai Jain __le16 vsi_id; 2279e50c8d6dSAnjali Singhai Jain u8 reserved[6]; 2280e50c8d6dSAnjali Singhai Jain __le32 addr_high; 2281e50c8d6dSAnjali Singhai Jain __le32 addr_low; 2282e50c8d6dSAnjali Singhai Jain }; 2283e50c8d6dSAnjali Singhai Jain 2284e50c8d6dSAnjali Singhai Jain I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key); 2285e50c8d6dSAnjali Singhai Jain 2286e50c8d6dSAnjali Singhai Jain struct i40e_aqc_get_set_rss_key_data { 2287e50c8d6dSAnjali Singhai Jain u8 standard_rss_key[0x28]; 2288e50c8d6dSAnjali Singhai Jain u8 extended_hash_key[0xc]; 2289e50c8d6dSAnjali Singhai Jain }; 2290e50c8d6dSAnjali Singhai Jain 2291e50c8d6dSAnjali Singhai Jain I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data); 2292e50c8d6dSAnjali Singhai Jain 2293e50c8d6dSAnjali Singhai Jain struct i40e_aqc_get_set_rss_lut { 22942101bac2SJacob Keller #define I40E_AQC_SET_RSS_LUT_VSI_VALID BIT(15) 2295e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT 0 2296e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK (0x3FF << \ 2297e50c8d6dSAnjali Singhai Jain I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) 2298e50c8d6dSAnjali Singhai Jain __le16 vsi_id; 2299e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT 0 23002101bac2SJacob Keller #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK BIT(I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) 2301e50c8d6dSAnjali Singhai Jain 2302e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI 0 2303e50c8d6dSAnjali Singhai Jain #define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF 1 2304e50c8d6dSAnjali Singhai Jain __le16 flags; 2305e50c8d6dSAnjali Singhai Jain u8 reserved[4]; 2306e50c8d6dSAnjali Singhai Jain __le32 addr_high; 2307e50c8d6dSAnjali Singhai Jain __le32 addr_low; 2308e50c8d6dSAnjali Singhai Jain }; 2309e50c8d6dSAnjali Singhai Jain 2310e50c8d6dSAnjali Singhai Jain I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut); 2311e50c8d6dSAnjali Singhai Jain 231256a62fc8SJesse Brandeburg /* tunnel key structure 0x0B10 */ 2313981b7545SShannon Nelson 231456a62fc8SJesse Brandeburg struct i40e_aqc_tunnel_key_structure { 2315981b7545SShannon Nelson u8 key1_off; 2316981b7545SShannon Nelson u8 key2_off; 2317981b7545SShannon Nelson u8 key1_len; /* 0 to 15 */ 2318981b7545SShannon Nelson u8 key2_len; /* 0 to 15 */ 2319981b7545SShannon Nelson u8 flags; 2320981b7545SShannon Nelson u8 network_key_index; 2321981b7545SShannon Nelson u8 reserved[10]; 232256a62fc8SJesse Brandeburg }; 232356a62fc8SJesse Brandeburg 232456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_tunnel_key_structure); 232556a62fc8SJesse Brandeburg 232656a62fc8SJesse Brandeburg /* OEM mode commands (direct 0xFE0x) */ 232756a62fc8SJesse Brandeburg struct i40e_aqc_oem_param_change { 232856a62fc8SJesse Brandeburg __le32 param_type; 232956a62fc8SJesse Brandeburg __le32 param_value1; 233035155fe6SShannon Nelson __le16 param_value2; 233135155fe6SShannon Nelson u8 reserved[6]; 233256a62fc8SJesse Brandeburg }; 233356a62fc8SJesse Brandeburg 233456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_oem_param_change); 233556a62fc8SJesse Brandeburg 233656a62fc8SJesse Brandeburg struct i40e_aqc_oem_state_change { 233756a62fc8SJesse Brandeburg __le32 state; 233856a62fc8SJesse Brandeburg u8 reserved[12]; 233956a62fc8SJesse Brandeburg }; 234056a62fc8SJesse Brandeburg 234156a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_oem_state_change); 234256a62fc8SJesse Brandeburg 2343672415c5SShannon Nelson /* Initialize OCSD (0xFE02, direct) */ 2344672415c5SShannon Nelson struct i40e_aqc_opc_oem_ocsd_initialize { 2345672415c5SShannon Nelson u8 type_status; 2346672415c5SShannon Nelson u8 reserved1[3]; 2347672415c5SShannon Nelson __le32 ocsd_memory_block_addr_high; 2348672415c5SShannon Nelson __le32 ocsd_memory_block_addr_low; 2349672415c5SShannon Nelson __le32 requested_update_interval; 2350672415c5SShannon Nelson }; 2351672415c5SShannon Nelson 2352672415c5SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_opc_oem_ocsd_initialize); 2353672415c5SShannon Nelson 2354672415c5SShannon Nelson /* Initialize OCBB (0xFE03, direct) */ 2355672415c5SShannon Nelson struct i40e_aqc_opc_oem_ocbb_initialize { 2356672415c5SShannon Nelson u8 type_status; 2357672415c5SShannon Nelson u8 reserved1[3]; 2358672415c5SShannon Nelson __le32 ocbb_memory_block_addr_high; 2359672415c5SShannon Nelson __le32 ocbb_memory_block_addr_low; 2360672415c5SShannon Nelson u8 reserved2[4]; 2361672415c5SShannon Nelson }; 2362672415c5SShannon Nelson 2363672415c5SShannon Nelson I40E_CHECK_CMD_LENGTH(i40e_aqc_opc_oem_ocbb_initialize); 2364672415c5SShannon Nelson 236556a62fc8SJesse Brandeburg /* debug commands */ 236656a62fc8SJesse Brandeburg 236756a62fc8SJesse Brandeburg /* get device id (0xFF00) uses the generic structure */ 236856a62fc8SJesse Brandeburg 236956a62fc8SJesse Brandeburg /* set test more (0xFF01, internal) */ 237056a62fc8SJesse Brandeburg 237156a62fc8SJesse Brandeburg struct i40e_acq_set_test_mode { 237256a62fc8SJesse Brandeburg u8 mode; 237356a62fc8SJesse Brandeburg u8 reserved[3]; 237456a62fc8SJesse Brandeburg u8 command; 237556a62fc8SJesse Brandeburg u8 reserved2[3]; 237656a62fc8SJesse Brandeburg __le32 address_high; 237756a62fc8SJesse Brandeburg __le32 address_low; 237856a62fc8SJesse Brandeburg }; 237956a62fc8SJesse Brandeburg 238056a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_acq_set_test_mode); 238156a62fc8SJesse Brandeburg 238256a62fc8SJesse Brandeburg /* Debug Read Register command (0xFF03) 238356a62fc8SJesse Brandeburg * Debug Write Register command (0xFF04) 238456a62fc8SJesse Brandeburg */ 238556a62fc8SJesse Brandeburg struct i40e_aqc_debug_reg_read_write { 238656a62fc8SJesse Brandeburg __le32 reserved; 238756a62fc8SJesse Brandeburg __le32 address; 238856a62fc8SJesse Brandeburg __le32 value_high; 238956a62fc8SJesse Brandeburg __le32 value_low; 239056a62fc8SJesse Brandeburg }; 239156a62fc8SJesse Brandeburg 239256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_reg_read_write); 239356a62fc8SJesse Brandeburg 239456a62fc8SJesse Brandeburg /* Scatter/gather Reg Read (indirect 0xFF05) 239556a62fc8SJesse Brandeburg * Scatter/gather Reg Write (indirect 0xFF06) 239656a62fc8SJesse Brandeburg */ 239756a62fc8SJesse Brandeburg 239856a62fc8SJesse Brandeburg /* i40e_aq_desc is used for the command */ 239956a62fc8SJesse Brandeburg struct i40e_aqc_debug_reg_sg_element_data { 240056a62fc8SJesse Brandeburg __le32 address; 240156a62fc8SJesse Brandeburg __le32 value; 240256a62fc8SJesse Brandeburg }; 240356a62fc8SJesse Brandeburg 240456a62fc8SJesse Brandeburg /* Debug Modify register (direct 0xFF07) */ 240556a62fc8SJesse Brandeburg struct i40e_aqc_debug_modify_reg { 240656a62fc8SJesse Brandeburg __le32 address; 240756a62fc8SJesse Brandeburg __le32 value; 240856a62fc8SJesse Brandeburg __le32 clear_mask; 240956a62fc8SJesse Brandeburg __le32 set_mask; 241056a62fc8SJesse Brandeburg }; 241156a62fc8SJesse Brandeburg 241256a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_reg); 241356a62fc8SJesse Brandeburg 241456a62fc8SJesse Brandeburg /* dump internal data (0xFF08, indirect) */ 241556a62fc8SJesse Brandeburg struct i40e_aqc_debug_dump_internals { 241656a62fc8SJesse Brandeburg u8 cluster_id; 241756a62fc8SJesse Brandeburg u8 table_id; 241856a62fc8SJesse Brandeburg __le16 data_size; 241956a62fc8SJesse Brandeburg __le32 idx; 242056a62fc8SJesse Brandeburg __le32 address_high; 242156a62fc8SJesse Brandeburg __le32 address_low; 242256a62fc8SJesse Brandeburg }; 242356a62fc8SJesse Brandeburg 242456a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_dump_internals); 242556a62fc8SJesse Brandeburg 242656a62fc8SJesse Brandeburg struct i40e_aqc_debug_modify_internals { 242756a62fc8SJesse Brandeburg u8 cluster_id; 242856a62fc8SJesse Brandeburg u8 cluster_specific_params[7]; 242956a62fc8SJesse Brandeburg __le32 address_high; 243056a62fc8SJesse Brandeburg __le32 address_low; 243156a62fc8SJesse Brandeburg }; 243256a62fc8SJesse Brandeburg 243356a62fc8SJesse Brandeburg I40E_CHECK_CMD_LENGTH(i40e_aqc_debug_modify_internals); 243456a62fc8SJesse Brandeburg 24352f175f55SHelin Zhang #endif /* _I40E_ADMINQ_CMD_H_ */ 2436