mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
ice, libie: move generic adminq descriptors to lib
The descriptor structure is the same in ice, ixgbe and i40e. Move it to
common libie header to use it across different driver.
Leave device specific adminq commands in separate folders. This lead to
a change that need to be done in filling/getting descriptor:
- previous: struct specific_desc *cmd;
cmd = &desc.params.specific_desc;
- now: struct specific_desc *cmd;
cmd = libie_aq_raw(&desc);
Do this changes across the driver to allow clean build. The casting only
have to be done in case of specific descriptors, for generic one union
can still be used.
Changes beside code moving:
- change ICE_ prefix to LIBIE_ prefix (ice_ and libie_ too)
- remove shift variables not otherwise needed (in libie_aq_flags)
- fill/get descriptor data based on desc.params.raw whenever the
descriptor isn't defined in libie
- move defines from the libie_aq_sth structure outside
- add libie_aq_raw helper and use it instead of explicit casting
Reviewed by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
parent
94619ea2d9
commit
fdb7f13986
|
|
@ -217,10 +217,12 @@ static void ice_config_health_events(struct ice_pf *pf, bool enable)
|
|||
void ice_process_health_status_event(struct ice_pf *pf, struct ice_rq_event_info *event)
|
||||
{
|
||||
const struct ice_aqc_health_status_elem *health_info;
|
||||
const struct ice_aqc_get_health_status *cmd;
|
||||
u16 count;
|
||||
|
||||
health_info = (struct ice_aqc_health_status_elem *)event->msg_buf;
|
||||
count = le16_to_cpu(event->desc.params.get_health_status.health_status_count);
|
||||
cmd = libie_aq_raw(&event->desc);
|
||||
count = le16_to_cpu(cmd->health_status_count);
|
||||
|
||||
if (count > (event->buf_len / sizeof(*health_info))) {
|
||||
dev_err(ice_pf_to_dev(pf), "Received a health status event with invalid element count\n");
|
||||
|
|
|
|||
|
|
@ -960,7 +960,7 @@ int ice_plug_aux_dev(struct ice_pf *pf);
|
|||
void ice_unplug_aux_dev(struct ice_pf *pf);
|
||||
int ice_init_rdma(struct ice_pf *pf);
|
||||
void ice_deinit_rdma(struct ice_pf *pf);
|
||||
const char *ice_aq_str(enum ice_aq_err aq_err);
|
||||
const char *ice_aq_str(enum libie_aq_err aq_err);
|
||||
bool ice_is_wol_supported(struct ice_hw *hw);
|
||||
void ice_fdir_del_all_fltrs(struct ice_vsi *vsi);
|
||||
int
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
#ifndef _ICE_ADMINQ_CMD_H_
|
||||
#define _ICE_ADMINQ_CMD_H_
|
||||
|
||||
#include <linux/net/intel/libie/adminq.h>
|
||||
|
||||
/* This header file defines the Admin Queue commands, error codes and
|
||||
* descriptor format. It is shared between Firmware and Software.
|
||||
*/
|
||||
|
|
@ -31,38 +33,6 @@ typedef struct __packed { u8 buf[ICE_TXQ_CTX_SZ]; } ice_txq_ctx_buf_t;
|
|||
|
||||
typedef struct __packed { u8 buf[ICE_TXQ_CTX_FULL_SZ]; } ice_txq_ctx_buf_full_t;
|
||||
|
||||
struct ice_aqc_generic {
|
||||
__le32 param0;
|
||||
__le32 param1;
|
||||
__le32 addr_high;
|
||||
__le32 addr_low;
|
||||
};
|
||||
|
||||
/* Get version (direct 0x0001) */
|
||||
struct ice_aqc_get_ver {
|
||||
__le32 rom_ver;
|
||||
__le32 fw_build;
|
||||
u8 fw_branch;
|
||||
u8 fw_major;
|
||||
u8 fw_minor;
|
||||
u8 fw_patch;
|
||||
u8 api_branch;
|
||||
u8 api_major;
|
||||
u8 api_minor;
|
||||
u8 api_patch;
|
||||
};
|
||||
|
||||
/* Send driver version (indirect 0x0002) */
|
||||
struct ice_aqc_driver_ver {
|
||||
u8 major_ver;
|
||||
u8 minor_ver;
|
||||
u8 build_ver;
|
||||
u8 subbuild_ver;
|
||||
u8 reserved[4];
|
||||
__le32 addr_high;
|
||||
__le32 addr_low;
|
||||
};
|
||||
|
||||
/* Queue Shutdown (direct 0x0003) */
|
||||
struct ice_aqc_q_shutdown {
|
||||
u8 driver_unloading;
|
||||
|
|
@ -70,94 +40,6 @@ struct ice_aqc_q_shutdown {
|
|||
u8 reserved[15];
|
||||
};
|
||||
|
||||
/* Request resource ownership (direct 0x0008)
|
||||
* Release resource ownership (direct 0x0009)
|
||||
*/
|
||||
struct ice_aqc_req_res {
|
||||
__le16 res_id;
|
||||
#define ICE_AQC_RES_ID_NVM 1
|
||||
#define ICE_AQC_RES_ID_SDP 2
|
||||
#define ICE_AQC_RES_ID_CHNG_LOCK 3
|
||||
#define ICE_AQC_RES_ID_GLBL_LOCK 4
|
||||
__le16 access_type;
|
||||
#define ICE_AQC_RES_ACCESS_READ 1
|
||||
#define ICE_AQC_RES_ACCESS_WRITE 2
|
||||
|
||||
/* Upon successful completion, FW writes this value and driver is
|
||||
* expected to release resource before timeout. This value is provided
|
||||
* in milliseconds.
|
||||
*/
|
||||
__le32 timeout;
|
||||
#define ICE_AQ_RES_NVM_READ_DFLT_TIMEOUT_MS 3000
|
||||
#define ICE_AQ_RES_NVM_WRITE_DFLT_TIMEOUT_MS 180000
|
||||
#define ICE_AQ_RES_CHNG_LOCK_DFLT_TIMEOUT_MS 1000
|
||||
#define ICE_AQ_RES_GLBL_LOCK_DFLT_TIMEOUT_MS 3000
|
||||
/* For SDP: pin ID of the SDP */
|
||||
__le32 res_number;
|
||||
/* Status is only used for ICE_AQC_RES_ID_GLBL_LOCK */
|
||||
__le16 status;
|
||||
#define ICE_AQ_RES_GLBL_SUCCESS 0
|
||||
#define ICE_AQ_RES_GLBL_IN_PROG 1
|
||||
#define ICE_AQ_RES_GLBL_DONE 2
|
||||
u8 reserved[2];
|
||||
};
|
||||
|
||||
/* Get function capabilities (indirect 0x000A)
|
||||
* Get device capabilities (indirect 0x000B)
|
||||
*/
|
||||
struct ice_aqc_list_caps {
|
||||
u8 cmd_flags;
|
||||
u8 pf_index;
|
||||
u8 reserved[2];
|
||||
__le32 count;
|
||||
__le32 addr_high;
|
||||
__le32 addr_low;
|
||||
};
|
||||
|
||||
/* Device/Function buffer entry, repeated per reported capability */
|
||||
struct ice_aqc_list_caps_elem {
|
||||
__le16 cap;
|
||||
#define ICE_AQC_CAPS_VALID_FUNCTIONS 0x0005
|
||||
#define ICE_AQC_CAPS_SRIOV 0x0012
|
||||
#define ICE_AQC_CAPS_VF 0x0013
|
||||
#define ICE_AQC_CAPS_VSI 0x0017
|
||||
#define ICE_AQC_CAPS_DCB 0x0018
|
||||
#define ICE_AQC_CAPS_RSS 0x0040
|
||||
#define ICE_AQC_CAPS_RXQS 0x0041
|
||||
#define ICE_AQC_CAPS_TXQS 0x0042
|
||||
#define ICE_AQC_CAPS_MSIX 0x0043
|
||||
#define ICE_AQC_CAPS_FD 0x0045
|
||||
#define ICE_AQC_CAPS_1588 0x0046
|
||||
#define ICE_AQC_CAPS_MAX_MTU 0x0047
|
||||
#define ICE_AQC_CAPS_NVM_VER 0x0048
|
||||
#define ICE_AQC_CAPS_PENDING_NVM_VER 0x0049
|
||||
#define ICE_AQC_CAPS_OROM_VER 0x004A
|
||||
#define ICE_AQC_CAPS_PENDING_OROM_VER 0x004B
|
||||
#define ICE_AQC_CAPS_NET_VER 0x004C
|
||||
#define ICE_AQC_CAPS_PENDING_NET_VER 0x004D
|
||||
#define ICE_AQC_CAPS_RDMA 0x0051
|
||||
#define ICE_AQC_CAPS_SENSOR_READING 0x0067
|
||||
#define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076
|
||||
#define ICE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT 0x0077
|
||||
#define ICE_AQC_CAPS_NVM_MGMT 0x0080
|
||||
#define ICE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE 0x0085
|
||||
#define ICE_AQC_CAPS_NAC_TOPOLOGY 0x0087
|
||||
#define ICE_AQC_CAPS_FW_LAG_SUPPORT 0x0092
|
||||
#define ICE_AQC_BIT_ROCEV2_LAG 0x01
|
||||
#define ICE_AQC_BIT_SRIOV_LAG 0x02
|
||||
|
||||
u8 major_ver;
|
||||
u8 minor_ver;
|
||||
/* Number of resources described by this capability */
|
||||
__le32 number;
|
||||
/* Only meaningful for some types of resources */
|
||||
__le32 logical_id;
|
||||
/* Only meaningful for some types of resources */
|
||||
__le32 phys_id;
|
||||
__le64 rsvd1;
|
||||
__le64 rsvd2;
|
||||
};
|
||||
|
||||
/* Manage MAC address, read command - indirect (0x0107)
|
||||
* This struct is also used for the response
|
||||
*/
|
||||
|
|
@ -2672,154 +2554,6 @@ struct ice_aqc_fw_log_cfg_resp {
|
|||
u8 rsvd0;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ice_aq_desc - Admin Queue (AQ) descriptor
|
||||
* @flags: ICE_AQ_FLAG_* flags
|
||||
* @opcode: AQ command opcode
|
||||
* @datalen: length in bytes of indirect/external data buffer
|
||||
* @retval: return value from firmware
|
||||
* @cookie_high: opaque data high-half
|
||||
* @cookie_low: opaque data low-half
|
||||
* @params: command-specific parameters
|
||||
*
|
||||
* Descriptor format for commands the driver posts on the Admin Transmit Queue
|
||||
* (ATQ). The firmware writes back onto the command descriptor and returns
|
||||
* the result of the command. Asynchronous events that are not an immediate
|
||||
* result of the command are written to the Admin Receive Queue (ARQ) using
|
||||
* the same descriptor format. Descriptors are in little-endian notation with
|
||||
* 32-bit words.
|
||||
*/
|
||||
struct ice_aq_desc {
|
||||
__le16 flags;
|
||||
__le16 opcode;
|
||||
__le16 datalen;
|
||||
__le16 retval;
|
||||
__le32 cookie_high;
|
||||
__le32 cookie_low;
|
||||
union {
|
||||
u8 raw[16];
|
||||
struct ice_aqc_generic generic;
|
||||
struct ice_aqc_get_ver get_ver;
|
||||
struct ice_aqc_driver_ver driver_ver;
|
||||
struct ice_aqc_q_shutdown q_shutdown;
|
||||
struct ice_aqc_req_res res_owner;
|
||||
struct ice_aqc_manage_mac_read mac_read;
|
||||
struct ice_aqc_manage_mac_write mac_write;
|
||||
struct ice_aqc_clear_pxe clear_pxe;
|
||||
struct ice_aqc_list_caps get_cap;
|
||||
struct ice_aqc_get_phy_caps get_phy;
|
||||
struct ice_aqc_set_phy_cfg set_phy;
|
||||
struct ice_aqc_restart_an restart_an;
|
||||
struct ice_aqc_set_phy_rec_clk_out set_phy_rec_clk_out;
|
||||
struct ice_aqc_get_phy_rec_clk_out get_phy_rec_clk_out;
|
||||
struct ice_aqc_get_sensor_reading get_sensor_reading;
|
||||
struct ice_aqc_get_sensor_reading_resp get_sensor_reading_resp;
|
||||
struct ice_aqc_gpio read_write_gpio;
|
||||
struct ice_aqc_sff_eeprom read_write_sff_param;
|
||||
struct ice_aqc_set_port_id_led set_port_id_led;
|
||||
struct ice_aqc_get_port_options get_port_options;
|
||||
struct ice_aqc_set_port_option set_port_option;
|
||||
struct ice_aqc_get_sw_cfg get_sw_conf;
|
||||
struct ice_aqc_set_port_params set_port_params;
|
||||
struct ice_aqc_sw_rules sw_rules;
|
||||
struct ice_aqc_add_get_recipe add_get_recipe;
|
||||
struct ice_aqc_recipe_to_profile recipe_to_profile;
|
||||
struct ice_aqc_get_topo get_topo;
|
||||
struct ice_aqc_sched_elem_cmd sched_elem_cmd;
|
||||
struct ice_aqc_query_txsched_res query_sched_res;
|
||||
struct ice_aqc_query_port_ets port_ets;
|
||||
struct ice_aqc_rl_profile rl_profile;
|
||||
struct ice_aqc_nvm nvm;
|
||||
struct ice_aqc_nvm_checksum nvm_checksum;
|
||||
struct ice_aqc_nvm_pkg_data pkg_data;
|
||||
struct ice_aqc_nvm_pass_comp_tbl pass_comp_tbl;
|
||||
struct ice_aqc_pf_vf_msg virt;
|
||||
struct ice_aqc_set_query_pfc_mode set_query_pfc_mode;
|
||||
struct ice_aqc_lldp_get_mib lldp_get_mib;
|
||||
struct ice_aqc_lldp_set_mib_change lldp_set_event;
|
||||
struct ice_aqc_lldp_stop lldp_stop;
|
||||
struct ice_aqc_lldp_start lldp_start;
|
||||
struct ice_aqc_lldp_set_local_mib lldp_set_mib;
|
||||
struct ice_aqc_lldp_stop_start_specific_agent lldp_agent_ctrl;
|
||||
struct ice_aqc_lldp_filter_ctrl lldp_filter_ctrl;
|
||||
struct ice_aqc_get_set_rss_lut get_set_rss_lut;
|
||||
struct ice_aqc_get_set_rss_key get_set_rss_key;
|
||||
struct ice_aqc_neigh_dev_req neigh_dev;
|
||||
struct ice_aqc_add_txqs add_txqs;
|
||||
struct ice_aqc_dis_txqs dis_txqs;
|
||||
struct ice_aqc_cfg_txqs cfg_txqs;
|
||||
struct ice_aqc_add_rdma_qset add_rdma_qset;
|
||||
struct ice_aqc_add_get_update_free_vsi vsi_cmd;
|
||||
struct ice_aqc_add_update_free_vsi_resp add_update_free_vsi_res;
|
||||
struct ice_aqc_download_pkg download_pkg;
|
||||
struct ice_aqc_get_cgu_input_measure get_cgu_input_measure;
|
||||
struct ice_aqc_set_cgu_input_config set_cgu_input_config;
|
||||
struct ice_aqc_get_cgu_input_config get_cgu_input_config;
|
||||
struct ice_aqc_set_cgu_output_config set_cgu_output_config;
|
||||
struct ice_aqc_get_cgu_output_config get_cgu_output_config;
|
||||
struct ice_aqc_get_cgu_dpll_status get_cgu_dpll_status;
|
||||
struct ice_aqc_set_cgu_dpll_config set_cgu_dpll_config;
|
||||
struct ice_aqc_set_cgu_ref_prio set_cgu_ref_prio;
|
||||
struct ice_aqc_get_cgu_ref_prio get_cgu_ref_prio;
|
||||
struct ice_aqc_get_cgu_info get_cgu_info;
|
||||
struct ice_aqc_driver_shared_params drv_shared_params;
|
||||
struct ice_aqc_fw_log fw_log;
|
||||
struct ice_aqc_set_mac_lb set_mac_lb;
|
||||
struct ice_aqc_alloc_free_res_cmd sw_res_ctrl;
|
||||
struct ice_aqc_set_mac_cfg set_mac_cfg;
|
||||
struct ice_aqc_set_event_mask set_event_mask;
|
||||
struct ice_aqc_get_link_status get_link_status;
|
||||
struct ice_aqc_event_lan_overflow lan_overflow;
|
||||
struct ice_aqc_get_link_topo get_link_topo;
|
||||
struct ice_aqc_set_health_status_cfg set_health_status_cfg;
|
||||
struct ice_aqc_get_health_status get_health_status;
|
||||
struct ice_aqc_dnl_call_command dnl_call;
|
||||
struct ice_aqc_i2c read_write_i2c;
|
||||
struct ice_aqc_read_i2c_resp read_i2c_resp;
|
||||
struct ice_aqc_get_set_tx_topo get_set_tx_topo;
|
||||
} params;
|
||||
};
|
||||
|
||||
/* FW defined boundary for a large buffer, 4k >= Large buffer > 512 bytes */
|
||||
#define ICE_AQ_LG_BUF 512
|
||||
|
||||
#define ICE_AQ_FLAG_DD_S 0
|
||||
#define ICE_AQ_FLAG_CMP_S 1
|
||||
#define ICE_AQ_FLAG_ERR_S 2
|
||||
#define ICE_AQ_FLAG_LB_S 9
|
||||
#define ICE_AQ_FLAG_RD_S 10
|
||||
#define ICE_AQ_FLAG_BUF_S 12
|
||||
#define ICE_AQ_FLAG_SI_S 13
|
||||
|
||||
#define ICE_AQ_FLAG_DD BIT(ICE_AQ_FLAG_DD_S) /* 0x1 */
|
||||
#define ICE_AQ_FLAG_CMP BIT(ICE_AQ_FLAG_CMP_S) /* 0x2 */
|
||||
#define ICE_AQ_FLAG_ERR BIT(ICE_AQ_FLAG_ERR_S) /* 0x4 */
|
||||
#define ICE_AQ_FLAG_LB BIT(ICE_AQ_FLAG_LB_S) /* 0x200 */
|
||||
#define ICE_AQ_FLAG_RD BIT(ICE_AQ_FLAG_RD_S) /* 0x400 */
|
||||
#define ICE_AQ_FLAG_BUF BIT(ICE_AQ_FLAG_BUF_S) /* 0x1000 */
|
||||
#define ICE_AQ_FLAG_SI BIT(ICE_AQ_FLAG_SI_S) /* 0x2000 */
|
||||
|
||||
/* error codes */
|
||||
enum ice_aq_err {
|
||||
ICE_AQ_RC_OK = 0, /* Success */
|
||||
ICE_AQ_RC_EPERM = 1, /* Operation not permitted */
|
||||
ICE_AQ_RC_ENOENT = 2, /* No such element */
|
||||
ICE_AQ_RC_ESRCH = 3, /* Bad opcode */
|
||||
ICE_AQ_RC_EAGAIN = 8, /* Try again */
|
||||
ICE_AQ_RC_ENOMEM = 9, /* Out of memory */
|
||||
ICE_AQ_RC_EBUSY = 12, /* Device or resource busy */
|
||||
ICE_AQ_RC_EEXIST = 13, /* Object already exists */
|
||||
ICE_AQ_RC_EINVAL = 14, /* Invalid argument */
|
||||
ICE_AQ_RC_ENOSPC = 16, /* No space left or allocation failure */
|
||||
ICE_AQ_RC_ENOSYS = 17, /* Function not implemented */
|
||||
ICE_AQ_RC_EMODE = 21, /* Op not allowed in current dev mode */
|
||||
ICE_AQ_RC_ENOSEC = 24, /* Missing security manifest */
|
||||
ICE_AQ_RC_EBADSIG = 25, /* Bad RSA signature */
|
||||
ICE_AQ_RC_ESVN = 26, /* SVN number prohibits this package */
|
||||
ICE_AQ_RC_EBADMAN = 27, /* Manifest hash mismatch */
|
||||
ICE_AQ_RC_EBADBUF = 28, /* Buffer hash mismatches manifest */
|
||||
};
|
||||
|
||||
/* Admin Queue command opcodes */
|
||||
enum ice_adminq_opc {
|
||||
/* AQ commands */
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -109,7 +109,7 @@ bool ice_is_sbq_supported(struct ice_hw *hw);
|
|||
struct ice_ctl_q_info *ice_get_sbq(struct ice_hw *hw);
|
||||
int
|
||||
ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
||||
struct ice_aq_desc *desc, void *buf, u16 buf_size,
|
||||
struct libie_aq_desc *desc, void *buf, u16 buf_size,
|
||||
struct ice_sq_cd *cd);
|
||||
void ice_clear_pxe_mode(struct ice_hw *hw);
|
||||
int ice_get_caps(struct ice_hw *hw);
|
||||
|
|
@ -138,14 +138,14 @@ ice_aq_set_rss_key(struct ice_hw *hw, u16 vsi_handle,
|
|||
|
||||
bool ice_check_sq_alive(struct ice_hw *hw, struct ice_ctl_q_info *cq);
|
||||
int ice_aq_q_shutdown(struct ice_hw *hw, bool unloading);
|
||||
void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode);
|
||||
void ice_fill_dflt_direct_cmd_desc(struct libie_aq_desc *desc, u16 opcode);
|
||||
|
||||
void ice_pack_txq_ctx(const struct ice_tlan_ctx *ctx, ice_txq_ctx_buf_t *buf);
|
||||
|
||||
extern struct mutex ice_global_cfg_lock_sw;
|
||||
|
||||
int
|
||||
ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc,
|
||||
ice_aq_send_cmd(struct ice_hw *hw, struct libie_aq_desc *desc,
|
||||
void *buf, u16 buf_size, struct ice_sq_cd *cd);
|
||||
int ice_aq_get_fw_ver(struct ice_hw *hw, struct ice_sq_cd *cd);
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ bool ice_check_sq_alive(struct ice_hw *hw, struct ice_ctl_q_info *cq)
|
|||
static int
|
||||
ice_alloc_ctrlq_sq_ring(struct ice_hw *hw, struct ice_ctl_q_info *cq)
|
||||
{
|
||||
size_t size = cq->num_sq_entries * sizeof(struct ice_aq_desc);
|
||||
size_t size = cq->num_sq_entries * sizeof(struct libie_aq_desc);
|
||||
|
||||
cq->sq.desc_buf.va = dmam_alloc_coherent(ice_hw_to_dev(hw), size,
|
||||
&cq->sq.desc_buf.pa,
|
||||
|
|
@ -110,7 +110,7 @@ ice_alloc_ctrlq_sq_ring(struct ice_hw *hw, struct ice_ctl_q_info *cq)
|
|||
static int
|
||||
ice_alloc_ctrlq_rq_ring(struct ice_hw *hw, struct ice_ctl_q_info *cq)
|
||||
{
|
||||
size_t size = cq->num_rq_entries * sizeof(struct ice_aq_desc);
|
||||
size_t size = cq->num_rq_entries * sizeof(struct libie_aq_desc);
|
||||
|
||||
cq->rq.desc_buf.va = dmam_alloc_coherent(ice_hw_to_dev(hw), size,
|
||||
&cq->rq.desc_buf.pa,
|
||||
|
|
@ -159,7 +159,7 @@ ice_alloc_rq_bufs(struct ice_hw *hw, struct ice_ctl_q_info *cq)
|
|||
|
||||
/* allocate the mapped buffers */
|
||||
for (i = 0; i < cq->num_rq_entries; i++) {
|
||||
struct ice_aq_desc *desc;
|
||||
struct libie_aq_desc *desc;
|
||||
struct ice_dma_mem *bi;
|
||||
|
||||
bi = &cq->rq.r.rq_bi[i];
|
||||
|
|
@ -173,9 +173,9 @@ ice_alloc_rq_bufs(struct ice_hw *hw, struct ice_ctl_q_info *cq)
|
|||
/* now configure the descriptors for use */
|
||||
desc = ICE_CTL_Q_DESC(cq->rq, i);
|
||||
|
||||
desc->flags = cpu_to_le16(ICE_AQ_FLAG_BUF);
|
||||
if (cq->rq_buf_size > ICE_AQ_LG_BUF)
|
||||
desc->flags |= cpu_to_le16(ICE_AQ_FLAG_LB);
|
||||
desc->flags = cpu_to_le16(LIBIE_AQ_FLAG_BUF);
|
||||
if (cq->rq_buf_size > LIBIE_AQ_LG_BUF)
|
||||
desc->flags |= cpu_to_le16(LIBIE_AQ_FLAG_LB);
|
||||
desc->opcode = 0;
|
||||
/* This is in accordance with control queue design, there is no
|
||||
* register for buffer size configuration
|
||||
|
|
@ -858,7 +858,7 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
|
|||
{
|
||||
struct ice_ctl_q_ring *sq = &cq->sq;
|
||||
u16 ntc = sq->next_to_clean;
|
||||
struct ice_aq_desc *desc;
|
||||
struct libie_aq_desc *desc;
|
||||
|
||||
desc = ICE_CTL_Q_DESC(*sq, ntc);
|
||||
|
||||
|
|
@ -912,7 +912,7 @@ static const char *ice_ctl_q_str(enum ice_ctl_q qtype)
|
|||
static void ice_debug_cq(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
||||
void *desc, void *buf, u16 buf_len, bool response)
|
||||
{
|
||||
struct ice_aq_desc *cq_desc = desc;
|
||||
struct libie_aq_desc *cq_desc = desc;
|
||||
u16 datalen, flags;
|
||||
|
||||
if (!IS_ENABLED(CONFIG_DYNAMIC_DEBUG) &&
|
||||
|
|
@ -939,7 +939,8 @@ static void ice_debug_cq(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
|||
* by the DD and/or CMP flag set or a command with the RD flag set.
|
||||
*/
|
||||
if (buf && cq_desc->datalen &&
|
||||
(flags & (ICE_AQ_FLAG_DD | ICE_AQ_FLAG_CMP | ICE_AQ_FLAG_RD))) {
|
||||
(flags & (LIBIE_AQ_FLAG_DD | LIBIE_AQ_FLAG_CMP |
|
||||
LIBIE_AQ_FLAG_RD))) {
|
||||
char prefix[] = KBUILD_MODNAME " 0x12341234 0x12341234 ";
|
||||
|
||||
sprintf(prefix, KBUILD_MODNAME " 0x%08X 0x%08X ",
|
||||
|
|
@ -992,11 +993,11 @@ static bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq)
|
|||
*/
|
||||
int
|
||||
ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
||||
struct ice_aq_desc *desc, void *buf, u16 buf_size,
|
||||
struct libie_aq_desc *desc, void *buf, u16 buf_size,
|
||||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_dma_mem *dma_buf = NULL;
|
||||
struct ice_aq_desc *desc_on_ring;
|
||||
struct libie_aq_desc *desc_on_ring;
|
||||
bool cmd_completed = false;
|
||||
int status = 0;
|
||||
u16 retval = 0;
|
||||
|
|
@ -1007,7 +1008,7 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
|||
return -EBUSY;
|
||||
mutex_lock(&cq->sq_lock);
|
||||
|
||||
cq->sq_last_status = ICE_AQ_RC_OK;
|
||||
cq->sq_last_status = LIBIE_AQ_RC_OK;
|
||||
|
||||
if (!cq->sq.count) {
|
||||
ice_debug(hw, ICE_DBG_AQ_MSG, "Control Send queue not initialized.\n");
|
||||
|
|
@ -1028,9 +1029,9 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
|||
goto sq_send_command_error;
|
||||
}
|
||||
|
||||
desc->flags |= cpu_to_le16(ICE_AQ_FLAG_BUF);
|
||||
if (buf_size > ICE_AQ_LG_BUF)
|
||||
desc->flags |= cpu_to_le16(ICE_AQ_FLAG_LB);
|
||||
desc->flags |= cpu_to_le16(LIBIE_AQ_FLAG_BUF);
|
||||
if (buf_size > LIBIE_AQ_LG_BUF)
|
||||
desc->flags |= cpu_to_le16(LIBIE_AQ_FLAG_LB);
|
||||
}
|
||||
|
||||
val = rd32(hw, cq->sq.head);
|
||||
|
|
@ -1112,9 +1113,9 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
|||
retval &= 0xff;
|
||||
}
|
||||
cmd_completed = true;
|
||||
if (!status && retval != ICE_AQ_RC_OK)
|
||||
if (!status && retval != LIBIE_AQ_RC_OK)
|
||||
status = -EIO;
|
||||
cq->sq_last_status = (enum ice_aq_err)retval;
|
||||
cq->sq_last_status = (enum libie_aq_err)retval;
|
||||
}
|
||||
|
||||
ice_debug(hw, ICE_DBG_AQ_MSG, "ATQ: desc and buffer writeback:\n");
|
||||
|
|
@ -1149,12 +1150,12 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
|||
*
|
||||
* Fill the desc with default values
|
||||
*/
|
||||
void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode)
|
||||
void ice_fill_dflt_direct_cmd_desc(struct libie_aq_desc *desc, u16 opcode)
|
||||
{
|
||||
/* zero out the desc */
|
||||
memset(desc, 0, sizeof(*desc));
|
||||
desc->opcode = cpu_to_le16(opcode);
|
||||
desc->flags = cpu_to_le16(ICE_AQ_FLAG_SI);
|
||||
desc->flags = cpu_to_le16(LIBIE_AQ_FLAG_SI);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1172,9 +1173,9 @@ int
|
|||
ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
||||
struct ice_rq_event_info *e, u16 *pending)
|
||||
{
|
||||
enum libie_aq_err rq_last_status;
|
||||
u16 ntc = cq->rq.next_to_clean;
|
||||
enum ice_aq_err rq_last_status;
|
||||
struct ice_aq_desc *desc;
|
||||
struct libie_aq_desc *desc;
|
||||
struct ice_dma_mem *bi;
|
||||
int ret_code = 0;
|
||||
u16 desc_idx;
|
||||
|
|
@ -1207,9 +1208,9 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
|||
desc = ICE_CTL_Q_DESC(cq->rq, ntc);
|
||||
desc_idx = ntc;
|
||||
|
||||
rq_last_status = (enum ice_aq_err)le16_to_cpu(desc->retval);
|
||||
rq_last_status = (enum libie_aq_err)le16_to_cpu(desc->retval);
|
||||
flags = le16_to_cpu(desc->flags);
|
||||
if (flags & ICE_AQ_FLAG_ERR) {
|
||||
if (flags & LIBIE_AQ_FLAG_ERR) {
|
||||
ret_code = -EIO;
|
||||
ice_debug(hw, ICE_DBG_AQ_MSG, "Control Receive Queue Event 0x%04X received with error 0x%X\n",
|
||||
le16_to_cpu(desc->opcode), rq_last_status);
|
||||
|
|
@ -1230,9 +1231,9 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
|
|||
bi = &cq->rq.r.rq_bi[ntc];
|
||||
memset(desc, 0, sizeof(*desc));
|
||||
|
||||
desc->flags = cpu_to_le16(ICE_AQ_FLAG_BUF);
|
||||
if (cq->rq_buf_size > ICE_AQ_LG_BUF)
|
||||
desc->flags |= cpu_to_le16(ICE_AQ_FLAG_LB);
|
||||
desc->flags = cpu_to_le16(LIBIE_AQ_FLAG_BUF);
|
||||
if (cq->rq_buf_size > LIBIE_AQ_LG_BUF)
|
||||
desc->flags |= cpu_to_le16(LIBIE_AQ_FLAG_LB);
|
||||
desc->datalen = cpu_to_le16(bi->size);
|
||||
desc->params.generic.addr_high = cpu_to_le32(upper_32_bits(bi->pa));
|
||||
desc->params.generic.addr_low = cpu_to_le32(lower_32_bits(bi->pa));
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#define ICE_SBQ_MAX_BUF_LEN 512
|
||||
|
||||
#define ICE_CTL_Q_DESC(R, i) \
|
||||
(&(((struct ice_aq_desc *)((R).desc_buf.va))[i]))
|
||||
(&(((struct libie_aq_desc *)((R).desc_buf.va))[i]))
|
||||
|
||||
#define ICE_CTL_Q_DESC_UNUSED(R) \
|
||||
((u16)((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
|
||||
|
|
@ -76,12 +76,12 @@ struct ice_ctl_q_ring {
|
|||
|
||||
/* sq transaction details */
|
||||
struct ice_sq_cd {
|
||||
struct ice_aq_desc *wb_desc;
|
||||
struct libie_aq_desc *wb_desc;
|
||||
};
|
||||
|
||||
/* rq event information */
|
||||
struct ice_rq_event_info {
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
u16 msg_len;
|
||||
u16 buf_len;
|
||||
u8 *msg_buf;
|
||||
|
|
@ -96,7 +96,7 @@ struct ice_ctl_q_info {
|
|||
u16 num_sq_entries; /* send queue depth */
|
||||
u16 rq_buf_size; /* receive queue buffer size */
|
||||
u16 sq_buf_size; /* send queue buffer size */
|
||||
enum ice_aq_err sq_last_status; /* last status on send queue */
|
||||
enum libie_aq_err sq_last_status; /* last status on send queue */
|
||||
struct mutex sq_lock; /* Send queue lock */
|
||||
struct mutex rq_lock; /* Receive queue lock */
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ ice_aq_get_lldp_mib(struct ice_hw *hw, u8 bridge_type, u8 mib_type, void *buf,
|
|||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_lldp_get_mib *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
cmd = &desc.params.lldp_get_mib;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
if (buf_size == 0 || !buf)
|
||||
return -EINVAL;
|
||||
|
|
@ -64,9 +64,9 @@ ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,
|
|||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_lldp_set_mib_change *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
cmd = &desc.params.lldp_set_event;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_set_mib_change);
|
||||
|
||||
|
|
@ -95,9 +95,9 @@ ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent, bool persist,
|
|||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_lldp_stop *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
cmd = &desc.params.lldp_stop;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_stop);
|
||||
|
||||
|
|
@ -121,9 +121,9 @@ ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent, bool persist,
|
|||
int ice_aq_start_lldp(struct ice_hw *hw, bool persist, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_lldp_start *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
cmd = &desc.params.lldp_start;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_start);
|
||||
|
||||
|
|
@ -677,11 +677,11 @@ ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent,
|
|||
bool *dcbx_agent_status, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_lldp_stop_start_specific_agent *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
u16 opcode;
|
||||
int status;
|
||||
|
||||
cmd = &desc.params.lldp_agent_ctrl;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
opcode = ice_aqc_opc_lldp_stop_start_specific_agent;
|
||||
|
||||
|
|
@ -714,7 +714,7 @@ ice_aq_get_cee_dcb_cfg(struct ice_hw *hw,
|
|||
struct ice_aqc_get_cee_dcb_cfg_resp *buff,
|
||||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_cee_dcb_cfg);
|
||||
|
||||
|
|
@ -733,13 +733,13 @@ ice_aq_get_cee_dcb_cfg(struct ice_hw *hw,
|
|||
int ice_aq_set_pfc_mode(struct ice_hw *hw, u8 pfc_mode, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_set_query_pfc_mode *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
if (pfc_mode > ICE_AQC_PFC_DSCP_BASED_PFC)
|
||||
return -EINVAL;
|
||||
|
||||
cmd = &desc.params.set_query_pfc_mode;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_pfc_mode);
|
||||
|
||||
|
|
@ -914,7 +914,7 @@ static int ice_get_ieee_or_cee_dcb_cfg(struct ice_port_info *pi, u8 dcbx_mode)
|
|||
ret = ice_aq_get_dcb_cfg(pi->hw, ICE_AQ_LLDP_MIB_REMOTE,
|
||||
ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID, dcbx_cfg);
|
||||
/* Don't treat ENOENT as an error for Remote MIBs */
|
||||
if (pi->hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT)
|
||||
if (pi->hw->adminq.sq_last_status == LIBIE_AQ_RC_ENOENT)
|
||||
ret = 0;
|
||||
|
||||
out:
|
||||
|
|
@ -941,7 +941,7 @@ int ice_get_dcb_cfg(struct ice_port_info *pi)
|
|||
/* CEE mode */
|
||||
ret = ice_get_ieee_or_cee_dcb_cfg(pi, ICE_DCBX_MODE_CEE);
|
||||
ice_cee_to_dcb_cfg(&cee_cfg, pi);
|
||||
} else if (pi->hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT) {
|
||||
} else if (pi->hw->adminq.sq_last_status == LIBIE_AQ_RC_ENOENT) {
|
||||
/* CEE mode not enabled try querying IEEE data */
|
||||
dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg;
|
||||
dcbx_cfg->dcbx_mode = ICE_DCBX_MODE_IEEE;
|
||||
|
|
@ -965,7 +965,7 @@ void ice_get_dcb_cfg_from_mib_change(struct ice_port_info *pi,
|
|||
struct ice_aqc_lldp_get_mib *mib;
|
||||
u8 change_type, dcbx_mode;
|
||||
|
||||
mib = (struct ice_aqc_lldp_get_mib *)&event->desc.params.raw;
|
||||
mib = libie_aq_raw(&event->desc);
|
||||
|
||||
change_type = FIELD_GET(ICE_AQ_LLDP_MIB_TYPE_M, mib->type);
|
||||
if (change_type == ICE_AQ_LLDP_MIB_REMOTE)
|
||||
|
|
@ -1537,12 +1537,12 @@ ice_aq_query_port_ets(struct ice_port_info *pi,
|
|||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_query_port_ets *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
if (!pi)
|
||||
return -EINVAL;
|
||||
cmd = &desc.params.port_ets;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_query_port_ets);
|
||||
cmd->port_teid = pi->root->info.node_teid;
|
||||
|
||||
|
|
|
|||
|
|
@ -1020,7 +1020,7 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,
|
|||
}
|
||||
|
||||
pi = pf->hw.port_info;
|
||||
mib = (struct ice_aqc_lldp_get_mib *)&event->desc.params.raw;
|
||||
mib = libie_aq_raw(&event->desc);
|
||||
|
||||
/* Ignore if event is not for Nearest Bridge */
|
||||
mib_type = FIELD_GET(ICE_AQ_LLDP_BRID_TYPE_M, mib->type);
|
||||
|
|
|
|||
|
|
@ -1101,16 +1101,16 @@ struct ice_buf *ice_pkg_buf(struct ice_buf_build *bld)
|
|||
return &bld->buf;
|
||||
}
|
||||
|
||||
static enum ice_ddp_state ice_map_aq_err_to_ddp_state(enum ice_aq_err aq_err)
|
||||
static enum ice_ddp_state ice_map_aq_err_to_ddp_state(enum libie_aq_err aq_err)
|
||||
{
|
||||
switch (aq_err) {
|
||||
case ICE_AQ_RC_ENOSEC:
|
||||
case ICE_AQ_RC_EBADSIG:
|
||||
case LIBIE_AQ_RC_ENOSEC:
|
||||
case LIBIE_AQ_RC_EBADSIG:
|
||||
return ICE_DDP_PKG_FILE_SIGNATURE_INVALID;
|
||||
case ICE_AQ_RC_ESVN:
|
||||
case LIBIE_AQ_RC_ESVN:
|
||||
return ICE_DDP_PKG_FILE_REVISION_TOO_LOW;
|
||||
case ICE_AQ_RC_EBADMAN:
|
||||
case ICE_AQ_RC_EBADBUF:
|
||||
case LIBIE_AQ_RC_EBADMAN:
|
||||
case LIBIE_AQ_RC_EBADBUF:
|
||||
return ICE_DDP_PKG_LOAD_ERROR;
|
||||
default:
|
||||
return ICE_DDP_PKG_ERR;
|
||||
|
|
@ -1180,7 +1180,7 @@ ice_aq_download_pkg(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf,
|
|||
u32 *error_info, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_download_pkg *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
if (error_offset)
|
||||
|
|
@ -1188,9 +1188,9 @@ ice_aq_download_pkg(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf,
|
|||
if (error_info)
|
||||
*error_info = 0;
|
||||
|
||||
cmd = &desc.params.download_pkg;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_download_pkg);
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
|
||||
if (last_buf)
|
||||
cmd->flags |= ICE_AQC_DOWNLOAD_PKG_LAST_BUF;
|
||||
|
|
@ -1259,7 +1259,7 @@ static enum ice_ddp_state ice_ddp_send_hunk(struct ice_ddp_send_ctx *ctx,
|
|||
struct ice_buf_hdr *prev_hunk = ctx->hdr;
|
||||
struct ice_hw *hw = ctx->hw;
|
||||
bool prev_was_last = !hunk;
|
||||
enum ice_aq_err aq_err;
|
||||
enum libie_aq_err aq_err;
|
||||
u32 offset, info;
|
||||
int attempt, err;
|
||||
|
||||
|
|
@ -1278,7 +1278,8 @@ static enum ice_ddp_state ice_ddp_send_hunk(struct ice_ddp_send_ctx *ctx,
|
|||
prev_was_last, &offset, &info, NULL);
|
||||
|
||||
aq_err = hw->adminq.sq_last_status;
|
||||
if (aq_err != ICE_AQ_RC_ENOSEC && aq_err != ICE_AQ_RC_EBADSIG)
|
||||
if (aq_err != LIBIE_AQ_RC_ENOSEC &&
|
||||
aq_err != LIBIE_AQ_RC_EBADSIG)
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1537,7 +1538,7 @@ ice_post_dwnld_pkg_actions(struct ice_hw *hw)
|
|||
static enum ice_ddp_state
|
||||
ice_download_pkg_with_sig_seg(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr)
|
||||
{
|
||||
enum ice_aq_err aq_err = hw->adminq.sq_last_status;
|
||||
enum libie_aq_err aq_err = hw->adminq.sq_last_status;
|
||||
enum ice_ddp_state state = ICE_DDP_PKG_ERR;
|
||||
struct ice_ddp_send_ctx ctx = { .hw = hw };
|
||||
int status;
|
||||
|
|
@ -1687,7 +1688,7 @@ static int ice_aq_get_pkg_info_list(struct ice_hw *hw,
|
|||
struct ice_aqc_get_pkg_info_resp *pkg_info,
|
||||
u16 buf_size, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_pkg_info_list);
|
||||
|
||||
|
|
@ -1711,7 +1712,7 @@ static int ice_aq_update_pkg(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf,
|
|||
u32 *error_info, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_download_pkg *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
if (error_offset)
|
||||
|
|
@ -1719,9 +1720,9 @@ static int ice_aq_update_pkg(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf,
|
|||
if (error_info)
|
||||
*error_info = 0;
|
||||
|
||||
cmd = &desc.params.download_pkg;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_update_pkg);
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
|
||||
if (last_buf)
|
||||
cmd->flags |= ICE_AQC_DOWNLOAD_PKG_LAST_BUF;
|
||||
|
|
@ -1753,10 +1754,10 @@ static int ice_aq_update_pkg(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf,
|
|||
int ice_aq_upload_section(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf,
|
||||
u16 buf_size, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_upload_section);
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
|
||||
return ice_aq_send_cmd(hw, &desc, pkg_buf, buf_size, cd);
|
||||
}
|
||||
|
|
@ -2333,10 +2334,10 @@ ice_get_set_tx_topo(struct ice_hw *hw, u8 *buf, u16 buf_size,
|
|||
struct ice_sq_cd *cd, u8 *flags, bool set)
|
||||
{
|
||||
struct ice_aqc_get_set_tx_topo *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
cmd = &desc.params.get_set_tx_topo;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
if (set) {
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_tx_topo);
|
||||
cmd->set_flags = ICE_AQC_TX_TOPO_FLAGS_ISSUED;
|
||||
|
|
@ -2345,14 +2346,14 @@ ice_get_set_tx_topo(struct ice_hw *hw, u8 *buf, u16 buf_size,
|
|||
cmd->set_flags |= ICE_AQC_TX_TOPO_FLAGS_SRC_RAM |
|
||||
ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW;
|
||||
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
} else {
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_tx_topo);
|
||||
cmd->get_flags = ICE_AQC_TX_TOPO_GET_RAM;
|
||||
|
||||
if (hw->mac_type == ICE_MAC_E810 ||
|
||||
hw->mac_type == ICE_MAC_GENERIC)
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
}
|
||||
|
||||
status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
|
||||
|
|
@ -2360,7 +2361,7 @@ ice_get_set_tx_topo(struct ice_hw *hw, u8 *buf, u16 buf_size,
|
|||
return status;
|
||||
/* read the return flag values (first byte) for get operation */
|
||||
if (!set && flags)
|
||||
*flags = desc.params.get_set_tx_topo.set_flags;
|
||||
*flags = cmd->set_flags;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2509,7 +2509,7 @@ static bool ice_dpll_is_pps_phase_monitor(struct ice_pf *pf)
|
|||
int ret = ice_aq_get_cgu_input_pin_measure(&pf->hw, DPLL_TYPE_PPS, meas,
|
||||
ARRAY_SIZE(meas));
|
||||
|
||||
if (ret && pf->hw.adminq.sq_last_status == ICE_AQ_RC_ESRCH)
|
||||
if (ret && pf->hw.adminq.sq_last_status == LIBIE_AQ_RC_ESRCH)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
@ -2562,7 +2562,7 @@ static int ice_dpll_pps_update_phase_offsets(struct ice_pf *pf,
|
|||
*phase_offset_pins_updated = 0;
|
||||
ret = ice_aq_get_cgu_input_pin_measure(&pf->hw, DPLL_TYPE_PPS, meas,
|
||||
ARRAY_SIZE(meas));
|
||||
if (ret && pf->hw.adminq.sq_last_status == ICE_AQ_RC_EAGAIN) {
|
||||
if (ret && pf->hw.adminq.sq_last_status == LIBIE_AQ_RC_EAGAIN) {
|
||||
return 0;
|
||||
} else if (ret) {
|
||||
dev_err(ice_pf_to_dev(pf),
|
||||
|
|
|
|||
|
|
@ -299,7 +299,8 @@ int ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
|
|||
struct device *dev = ice_pf_to_dev(pf);
|
||||
struct ice_aq_task task = {};
|
||||
struct ice_hw *hw = &pf->hw;
|
||||
struct ice_aq_desc *desc;
|
||||
struct libie_aq_desc *desc;
|
||||
struct ice_aqc_nvm *cmd;
|
||||
u32 completion_offset;
|
||||
int err;
|
||||
|
||||
|
|
@ -333,11 +334,12 @@ int ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
|
|||
}
|
||||
|
||||
desc = &task.event.desc;
|
||||
completion_module = le16_to_cpu(desc->params.nvm.module_typeid);
|
||||
cmd = libie_aq_raw(desc);
|
||||
completion_module = le16_to_cpu(cmd->module_typeid);
|
||||
completion_retval = le16_to_cpu(desc->retval);
|
||||
|
||||
completion_offset = le16_to_cpu(desc->params.nvm.offset_low);
|
||||
completion_offset |= desc->params.nvm.offset_high << 16;
|
||||
completion_offset = le16_to_cpu(cmd->offset_low);
|
||||
completion_offset |= cmd->offset_high << 16;
|
||||
|
||||
if (completion_module != module) {
|
||||
dev_err(dev, "Unexpected module_typeid in write completion: got 0x%x, expected 0x%x\n",
|
||||
|
|
@ -356,7 +358,7 @@ int ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
|
|||
if (completion_retval) {
|
||||
dev_err(dev, "Firmware failed to flash module 0x%02x with block of size %u at offset %u, err %s\n",
|
||||
module, block_size, offset,
|
||||
ice_aq_str((enum ice_aq_err)completion_retval));
|
||||
ice_aq_str((enum libie_aq_err)completion_retval));
|
||||
NL_SET_ERR_MSG_MOD(extack, "Firmware failed to program flash module");
|
||||
return -EIO;
|
||||
}
|
||||
|
|
@ -369,7 +371,7 @@ int ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
|
|||
*/
|
||||
if (reset_level && last_cmd && module == ICE_SR_1ST_NVM_BANK_PTR) {
|
||||
if (hw->dev_caps.common_cap.pcie_reset_avoidance) {
|
||||
*reset_level = desc->params.nvm.cmd_flags &
|
||||
*reset_level = cmd->cmd_flags &
|
||||
ICE_AQC_NVM_RESET_LVL_M;
|
||||
dev_dbg(dev, "Firmware reported required reset level as %u\n",
|
||||
*reset_level);
|
||||
|
|
@ -487,7 +489,8 @@ ice_erase_nvm_module(struct ice_pf *pf, u16 module, const char *component,
|
|||
struct device *dev = ice_pf_to_dev(pf);
|
||||
struct ice_aq_task task = {};
|
||||
struct ice_hw *hw = &pf->hw;
|
||||
struct ice_aq_desc *desc;
|
||||
struct libie_aq_desc *desc;
|
||||
struct ice_aqc_nvm *cmd;
|
||||
struct devlink *devlink;
|
||||
int err;
|
||||
|
||||
|
|
@ -518,7 +521,8 @@ ice_erase_nvm_module(struct ice_pf *pf, u16 module, const char *component,
|
|||
}
|
||||
|
||||
desc = &task.event.desc;
|
||||
completion_module = le16_to_cpu(desc->params.nvm.module_typeid);
|
||||
cmd = libie_aq_raw(desc);
|
||||
completion_module = le16_to_cpu(cmd->module_typeid);
|
||||
completion_retval = le16_to_cpu(desc->retval);
|
||||
|
||||
if (completion_module != module) {
|
||||
|
|
@ -532,7 +536,7 @@ ice_erase_nvm_module(struct ice_pf *pf, u16 module, const char *component,
|
|||
if (completion_retval) {
|
||||
dev_err(dev, "Firmware failed to erase %s (module 0x02%x), aq_err %s\n",
|
||||
component, module,
|
||||
ice_aq_str((enum ice_aq_err)completion_retval));
|
||||
ice_aq_str((enum libie_aq_err)completion_retval));
|
||||
NL_SET_ERR_MSG_MOD(extack, "Firmware failed to erase flash");
|
||||
err = -EIO;
|
||||
goto out_notify_devlink;
|
||||
|
|
@ -611,7 +615,7 @@ ice_switch_flash_banks(struct ice_pf *pf, u8 activate_flags,
|
|||
completion_retval = le16_to_cpu(task.event.desc.retval);
|
||||
if (completion_retval) {
|
||||
dev_err(dev, "Firmware failed to switch active flash banks aq_err %s\n",
|
||||
ice_aq_str((enum ice_aq_err)completion_retval));
|
||||
ice_aq_str((enum libie_aq_err)completion_retval));
|
||||
NL_SET_ERR_MSG_MOD(extack, "Firmware failed to switch active flash banks");
|
||||
return -EIO;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ ice_aq_fwlog_set(struct ice_hw *hw, struct ice_fwlog_module_entry *entries,
|
|||
{
|
||||
struct ice_aqc_fw_log_cfg_resp *fw_modules;
|
||||
struct ice_aqc_fw_log *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
int i;
|
||||
|
||||
|
|
@ -255,9 +255,9 @@ ice_aq_fwlog_set(struct ice_hw *hw, struct ice_fwlog_module_entry *entries,
|
|||
}
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logs_config);
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
|
||||
cmd = &desc.params.fw_log;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
cmd->cmd_flags = ICE_AQC_FW_LOG_CONF_SET_VALID;
|
||||
cmd->ops.cfg.log_resolution = cpu_to_le16(log_resolution);
|
||||
|
|
@ -309,7 +309,7 @@ static int ice_aq_fwlog_get(struct ice_hw *hw, struct ice_fwlog_cfg *cfg)
|
|||
{
|
||||
struct ice_aqc_fw_log_cfg_resp *fw_modules;
|
||||
struct ice_aqc_fw_log *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
u16 module_id_cnt;
|
||||
int status;
|
||||
void *buf;
|
||||
|
|
@ -322,7 +322,7 @@ static int ice_aq_fwlog_get(struct ice_hw *hw, struct ice_fwlog_cfg *cfg)
|
|||
return -ENOMEM;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logs_query);
|
||||
cmd = &desc.params.fw_log;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
cmd->cmd_flags = ICE_AQC_FW_LOG_AQ_QUERY;
|
||||
|
||||
|
|
@ -384,12 +384,14 @@ int ice_fwlog_get(struct ice_hw *hw, struct ice_fwlog_cfg *cfg)
|
|||
*/
|
||||
static int ice_aq_fwlog_register(struct ice_hw *hw, bool reg)
|
||||
{
|
||||
struct ice_aq_desc desc;
|
||||
struct ice_aqc_fw_log *cmd;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logs_register);
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
if (reg)
|
||||
desc.params.fw_log.cmd_flags = ICE_AQC_FW_LOG_AQ_REGISTER;
|
||||
cmd->cmd_flags = ICE_AQC_FW_LOG_AQ_REGISTER;
|
||||
|
||||
return ice_aq_send_cmd(hw, &desc, NULL, 0, NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1144,7 +1144,7 @@ ice_lag_set_swid(u16 primary_swid, struct ice_lag *local_lag,
|
|||
{
|
||||
struct ice_aqc_alloc_free_res_elem *buf;
|
||||
struct ice_aqc_set_port_params *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
u16 buf_len, swid;
|
||||
int status, i;
|
||||
|
||||
|
|
@ -1192,7 +1192,7 @@ ice_lag_set_swid(u16 primary_swid, struct ice_lag *local_lag,
|
|||
else
|
||||
swid = local_lag->pf->hw.port_info->sw_id;
|
||||
|
||||
cmd = &desc.params.set_port_params;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_port_params);
|
||||
|
||||
cmd->swid = cpu_to_le16(ICE_AQC_PORT_SWID_VALID | swid);
|
||||
|
|
|
|||
|
|
@ -3736,13 +3736,13 @@ int ice_set_link(struct ice_vsi *vsi, bool ena)
|
|||
|
||||
status = ice_aq_set_link_restart_an(pi, ena, NULL);
|
||||
|
||||
/* if link is owned by manageability, FW will return ICE_AQ_RC_EMODE.
|
||||
/* if link is owned by manageability, FW will return LIBIE_AQ_RC_EMODE.
|
||||
* this is not a fatal error, so print a warning message and return
|
||||
* a success code. Return an error if FW returns an error code other
|
||||
* than ICE_AQ_RC_EMODE
|
||||
* than LIBIE_AQ_RC_EMODE
|
||||
*/
|
||||
if (status == -EIO) {
|
||||
if (hw->adminq.sq_last_status == ICE_AQ_RC_EMODE)
|
||||
if (hw->adminq.sq_last_status == LIBIE_AQ_RC_EMODE)
|
||||
dev_dbg(dev, "can't set link to %s, err %d aq_err %s. not fatal, continuing\n",
|
||||
(ena ? "ON" : "OFF"), status,
|
||||
ice_aq_str(hw->adminq.sq_last_status));
|
||||
|
|
|
|||
|
|
@ -379,7 +379,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
|
|||
* should go into promiscuous mode. There should be some
|
||||
* space reserved for promiscuous filters.
|
||||
*/
|
||||
if (hw->adminq.sq_last_status == ICE_AQ_RC_ENOSPC &&
|
||||
if (hw->adminq.sq_last_status == LIBIE_AQ_RC_ENOSPC &&
|
||||
!test_and_set_bit(ICE_FLTR_OVERFLOW_PROMISC,
|
||||
vsi->state)) {
|
||||
promisc_forced_on = true;
|
||||
|
|
@ -7914,42 +7914,42 @@ int ice_change_mtu(struct net_device *netdev, int new_mtu)
|
|||
* ice_aq_str - convert AQ err code to a string
|
||||
* @aq_err: the AQ error code to convert
|
||||
*/
|
||||
const char *ice_aq_str(enum ice_aq_err aq_err)
|
||||
const char *ice_aq_str(enum libie_aq_err aq_err)
|
||||
{
|
||||
switch (aq_err) {
|
||||
case ICE_AQ_RC_OK:
|
||||
case LIBIE_AQ_RC_OK:
|
||||
return "OK";
|
||||
case ICE_AQ_RC_EPERM:
|
||||
case LIBIE_AQ_RC_EPERM:
|
||||
return "ICE_AQ_RC_EPERM";
|
||||
case ICE_AQ_RC_ENOENT:
|
||||
case LIBIE_AQ_RC_ENOENT:
|
||||
return "ICE_AQ_RC_ENOENT";
|
||||
case ICE_AQ_RC_ESRCH:
|
||||
case LIBIE_AQ_RC_ESRCH:
|
||||
return "ICE_AQ_RC_ESRCH";
|
||||
case ICE_AQ_RC_EAGAIN:
|
||||
case LIBIE_AQ_RC_EAGAIN:
|
||||
return "ICE_AQ_RC_EAGAIN";
|
||||
case ICE_AQ_RC_ENOMEM:
|
||||
case LIBIE_AQ_RC_ENOMEM:
|
||||
return "ICE_AQ_RC_ENOMEM";
|
||||
case ICE_AQ_RC_EBUSY:
|
||||
case LIBIE_AQ_RC_EBUSY:
|
||||
return "ICE_AQ_RC_EBUSY";
|
||||
case ICE_AQ_RC_EEXIST:
|
||||
case LIBIE_AQ_RC_EEXIST:
|
||||
return "ICE_AQ_RC_EEXIST";
|
||||
case ICE_AQ_RC_EINVAL:
|
||||
case LIBIE_AQ_RC_EINVAL:
|
||||
return "ICE_AQ_RC_EINVAL";
|
||||
case ICE_AQ_RC_ENOSPC:
|
||||
case LIBIE_AQ_RC_ENOSPC:
|
||||
return "ICE_AQ_RC_ENOSPC";
|
||||
case ICE_AQ_RC_ENOSYS:
|
||||
case LIBIE_AQ_RC_ENOSYS:
|
||||
return "ICE_AQ_RC_ENOSYS";
|
||||
case ICE_AQ_RC_EMODE:
|
||||
case LIBIE_AQ_RC_EMODE:
|
||||
return "ICE_AQ_RC_EMODE";
|
||||
case ICE_AQ_RC_ENOSEC:
|
||||
case LIBIE_AQ_RC_ENOSEC:
|
||||
return "ICE_AQ_RC_ENOSEC";
|
||||
case ICE_AQ_RC_EBADSIG:
|
||||
case LIBIE_AQ_RC_EBADSIG:
|
||||
return "ICE_AQ_RC_EBADSIG";
|
||||
case ICE_AQ_RC_ESVN:
|
||||
case LIBIE_AQ_RC_ESVN:
|
||||
return "ICE_AQ_RC_ESVN";
|
||||
case ICE_AQ_RC_EBADMAN:
|
||||
case LIBIE_AQ_RC_EBADMAN:
|
||||
return "ICE_AQ_RC_EBADMAN";
|
||||
case ICE_AQ_RC_EBADBUF:
|
||||
case LIBIE_AQ_RC_EBADBUF:
|
||||
return "ICE_AQ_RC_EBADBUF";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@ int ice_aq_read_nvm(struct ice_hw *hw, u16 module_typeid, u32 offset,
|
|||
u16 length, void *data, bool last_command,
|
||||
bool read_shadow_ram, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
struct ice_aqc_nvm *cmd;
|
||||
|
||||
cmd = &desc.params.nvm;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
if (offset > ICE_AQC_NVM_MAX_OFFSET)
|
||||
return -EINVAL;
|
||||
|
|
@ -125,10 +125,10 @@ ice_aq_update_nvm(struct ice_hw *hw, u16 module_typeid, u32 offset,
|
|||
u16 length, void *data, bool last_command, u8 command_flags,
|
||||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
struct ice_aqc_nvm *cmd;
|
||||
|
||||
cmd = &desc.params.nvm;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
/* In offset the highest byte must be zeroed. */
|
||||
if (offset & 0xFF000000)
|
||||
|
|
@ -146,7 +146,7 @@ ice_aq_update_nvm(struct ice_hw *hw, u16 module_typeid, u32 offset,
|
|||
cmd->offset_high = (offset >> 16) & 0xFF;
|
||||
cmd->length = cpu_to_le16(length);
|
||||
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
|
||||
return ice_aq_send_cmd(hw, &desc, data, length, cd);
|
||||
}
|
||||
|
|
@ -161,10 +161,10 @@ ice_aq_update_nvm(struct ice_hw *hw, u16 module_typeid, u32 offset,
|
|||
*/
|
||||
int ice_aq_erase_nvm(struct ice_hw *hw, u16 module_typeid, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
struct ice_aqc_nvm *cmd;
|
||||
|
||||
cmd = &desc.params.nvm;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_nvm_erase);
|
||||
|
||||
|
|
@ -869,7 +869,7 @@ static int ice_discover_flash_size(struct ice_hw *hw)
|
|||
|
||||
status = ice_read_flat_nvm(hw, offset, &len, &data, false);
|
||||
if (status == -EIO &&
|
||||
hw->adminq.sq_last_status == ICE_AQ_RC_EINVAL) {
|
||||
hw->adminq.sq_last_status == LIBIE_AQ_RC_EINVAL) {
|
||||
ice_debug(hw, ICE_DBG_NVM, "%s: New upper bound of %u bytes\n",
|
||||
__func__, offset);
|
||||
status = 0;
|
||||
|
|
@ -1182,14 +1182,14 @@ int ice_init_nvm(struct ice_hw *hw)
|
|||
int ice_nvm_validate_checksum(struct ice_hw *hw)
|
||||
{
|
||||
struct ice_aqc_nvm_checksum *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
status = ice_acquire_nvm(hw, ICE_RES_READ);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
cmd = &desc.params.nvm_checksum;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_nvm_checksum);
|
||||
cmd->flags = ICE_AQC_NVM_CHECKSUM_VERIFY;
|
||||
|
|
@ -1226,11 +1226,11 @@ int ice_nvm_validate_checksum(struct ice_hw *hw)
|
|||
*/
|
||||
int ice_nvm_write_activate(struct ice_hw *hw, u16 cmd_flags, u8 *response_flags)
|
||||
{
|
||||
struct libie_aq_desc desc;
|
||||
struct ice_aqc_nvm *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
int err;
|
||||
|
||||
cmd = &desc.params.nvm;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_nvm_write_activate);
|
||||
|
||||
cmd->cmd_flags = (u8)(cmd_flags & 0xFF);
|
||||
|
|
@ -1252,7 +1252,7 @@ int ice_nvm_write_activate(struct ice_hw *hw, u16 cmd_flags, u8 *response_flags)
|
|||
*/
|
||||
int ice_aq_nvm_update_empr(struct ice_hw *hw)
|
||||
{
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_nvm_update_empr);
|
||||
|
||||
|
|
@ -1278,15 +1278,15 @@ ice_nvm_set_pkg_data(struct ice_hw *hw, bool del_pkg_data_flag, u8 *data,
|
|||
u16 length, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_nvm_pkg_data *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
if (length != 0 && !data)
|
||||
return -EINVAL;
|
||||
|
||||
cmd = &desc.params.pkg_data;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_nvm_pkg_data);
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
|
||||
if (del_pkg_data_flag)
|
||||
cmd->cmd_flags |= ICE_AQC_NVM_PKG_DELETE;
|
||||
|
|
@ -1316,17 +1316,17 @@ ice_nvm_pass_component_tbl(struct ice_hw *hw, u8 *data, u16 length,
|
|||
u8 *comp_response_code, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_nvm_pass_comp_tbl *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
if (!data || !comp_response || !comp_response_code)
|
||||
return -EINVAL;
|
||||
|
||||
cmd = &desc.params.pass_comp_tbl;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc,
|
||||
ice_aqc_opc_nvm_pass_component_tbl);
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
|
||||
cmd->transfer_flag = transfer_flag;
|
||||
status = ice_aq_send_cmd(hw, &desc, data, length, cd);
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ static int ice_write_phy_eth56g(struct ice_hw *hw, u8 port, u32 addr, u32 val)
|
|||
};
|
||||
int err;
|
||||
|
||||
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
|
||||
err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD);
|
||||
if (err)
|
||||
ice_debug(hw, ICE_DBG_PTP, "PTP failed to send msg to phy %d\n",
|
||||
err);
|
||||
|
|
@ -451,7 +451,7 @@ static int ice_read_phy_eth56g(struct ice_hw *hw, u8 port, u32 addr, u32 *val)
|
|||
};
|
||||
int err;
|
||||
|
||||
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
|
||||
err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD);
|
||||
if (err)
|
||||
ice_debug(hw, ICE_DBG_PTP, "PTP failed to send msg to phy %d\n",
|
||||
err);
|
||||
|
|
@ -2348,7 +2348,7 @@ ice_read_phy_reg_e82x(struct ice_hw *hw, u8 port, u16 offset, u32 *val)
|
|||
ice_fill_phy_msg_e82x(hw, &msg, port, offset);
|
||||
msg.opcode = ice_sbq_msg_rd;
|
||||
|
||||
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
|
||||
err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD);
|
||||
if (err) {
|
||||
ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
|
||||
err);
|
||||
|
|
@ -2426,7 +2426,7 @@ ice_write_phy_reg_e82x(struct ice_hw *hw, u8 port, u16 offset, u32 val)
|
|||
msg.opcode = ice_sbq_msg_wr;
|
||||
msg.data = val;
|
||||
|
||||
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
|
||||
err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD);
|
||||
if (err) {
|
||||
ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
|
||||
err);
|
||||
|
|
@ -2587,7 +2587,7 @@ ice_read_quad_reg_e82x(struct ice_hw *hw, u8 quad, u16 offset, u32 *val)
|
|||
|
||||
msg.opcode = ice_sbq_msg_rd;
|
||||
|
||||
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
|
||||
err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD);
|
||||
if (err) {
|
||||
ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
|
||||
err);
|
||||
|
|
@ -2622,7 +2622,7 @@ ice_write_quad_reg_e82x(struct ice_hw *hw, u8 quad, u16 offset, u32 val)
|
|||
msg.opcode = ice_sbq_msg_wr;
|
||||
msg.data = val;
|
||||
|
||||
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
|
||||
err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD);
|
||||
if (err) {
|
||||
ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
|
||||
err);
|
||||
|
|
@ -4267,7 +4267,7 @@ static int ice_read_phy_reg_e810(struct ice_hw *hw, u32 addr, u32 *val)
|
|||
msg.opcode = ice_sbq_msg_rd;
|
||||
msg.dest_dev = ice_sbq_dev_phy_0;
|
||||
|
||||
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
|
||||
err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD);
|
||||
if (err) {
|
||||
ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
|
||||
err);
|
||||
|
|
@ -4298,7 +4298,7 @@ static int ice_write_phy_reg_e810(struct ice_hw *hw, u32 addr, u32 val)
|
|||
msg.dest_dev = ice_sbq_dev_phy_0;
|
||||
msg.data = val;
|
||||
|
||||
err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD);
|
||||
err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD);
|
||||
if (err) {
|
||||
ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n",
|
||||
err);
|
||||
|
|
|
|||
|
|
@ -123,13 +123,13 @@ ice_aqc_send_sched_elem_cmd(struct ice_hw *hw, enum ice_adminq_opc cmd_opc,
|
|||
u16 *elems_resp, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_sched_elem_cmd *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
cmd = &desc.params.sched_elem_cmd;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, cmd_opc);
|
||||
cmd->num_elem_req = cpu_to_le16(elems_req);
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
|
||||
if (!status && elems_resp)
|
||||
*elems_resp = le16_to_cpu(cmd->num_elem_resp);
|
||||
|
|
@ -392,10 +392,10 @@ ice_aq_get_dflt_topo(struct ice_hw *hw, u8 lport,
|
|||
u8 *num_branches, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_get_topo *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
cmd = &desc.params.get_topo;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_dflt_topo);
|
||||
cmd->port_num = lport;
|
||||
status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
|
||||
|
|
@ -518,7 +518,7 @@ ice_aq_query_sched_res(struct ice_hw *hw, u16 buf_size,
|
|||
struct ice_aqc_query_txsched_res_resp *buf,
|
||||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_query_sched_res);
|
||||
return ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
|
||||
|
|
@ -683,13 +683,13 @@ ice_aq_rl_profile(struct ice_hw *hw, enum ice_adminq_opc opcode,
|
|||
u16 buf_size, u16 *num_processed, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_rl_profile *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
cmd = &desc.params.rl_profile;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, opcode);
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
cmd->num_profiles = cpu_to_le16(num_profiles);
|
||||
status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
|
||||
if (!status && num_processed)
|
||||
|
|
|
|||
|
|
@ -1161,10 +1161,12 @@ static u32 ice_globalq_to_pfq(struct ice_pf *pf, u32 globalq)
|
|||
void
|
||||
ice_vf_lan_overflow_event(struct ice_pf *pf, struct ice_rq_event_info *event)
|
||||
{
|
||||
struct ice_aqc_event_lan_overflow *cmd;
|
||||
u32 gldcb_rtctq, queue;
|
||||
struct ice_vf *vf;
|
||||
|
||||
gldcb_rtctq = le32_to_cpu(event->desc.params.lan_overflow.prtdcb_ruptq);
|
||||
cmd = libie_aq_raw(&event->desc);
|
||||
gldcb_rtctq = le32_to_cpu(cmd->prtdcb_ruptq);
|
||||
dev_dbg(ice_pf_to_dev(pf), "GLDCB_RTCTQ: 0x%08x\n", gldcb_rtctq);
|
||||
|
||||
/* event returns device global Rx queue number */
|
||||
|
|
|
|||
|
|
@ -1511,11 +1511,11 @@ ice_aq_get_sw_cfg(struct ice_hw *hw, struct ice_aqc_get_sw_cfg_resp_elem *buf,
|
|||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_get_sw_cfg *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_sw_cfg);
|
||||
cmd = &desc.params.get_sw_conf;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
cmd->element = cpu_to_le16(*req_desc);
|
||||
|
||||
status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
|
||||
|
|
@ -1541,11 +1541,11 @@ ice_aq_add_vsi(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx,
|
|||
{
|
||||
struct ice_aqc_add_update_free_vsi_resp *res;
|
||||
struct ice_aqc_add_get_update_free_vsi *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
cmd = &desc.params.vsi_cmd;
|
||||
res = &desc.params.add_update_free_vsi_res;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
res = libie_aq_raw(&desc);
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_add_vsi);
|
||||
|
||||
|
|
@ -1556,7 +1556,7 @@ ice_aq_add_vsi(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx,
|
|||
|
||||
cmd->vsi_flags = cpu_to_le16(vsi_ctx->flags);
|
||||
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
|
||||
status = ice_aq_send_cmd(hw, &desc, &vsi_ctx->info,
|
||||
sizeof(vsi_ctx->info), cd);
|
||||
|
|
@ -1585,11 +1585,11 @@ ice_aq_free_vsi(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx,
|
|||
{
|
||||
struct ice_aqc_add_update_free_vsi_resp *resp;
|
||||
struct ice_aqc_add_get_update_free_vsi *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
cmd = &desc.params.vsi_cmd;
|
||||
resp = &desc.params.add_update_free_vsi_res;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
resp = libie_aq_raw(&desc);
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_free_vsi);
|
||||
|
||||
|
|
@ -1620,17 +1620,17 @@ ice_aq_update_vsi(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx,
|
|||
{
|
||||
struct ice_aqc_add_update_free_vsi_resp *resp;
|
||||
struct ice_aqc_add_get_update_free_vsi *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
cmd = &desc.params.vsi_cmd;
|
||||
resp = &desc.params.add_update_free_vsi_res;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
resp = libie_aq_raw(&desc);
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_update_vsi);
|
||||
|
||||
cmd->vsi_num = cpu_to_le16(vsi_ctx->vsi_num | ICE_AQ_VSI_IS_VALID);
|
||||
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
|
||||
status = ice_aq_send_cmd(hw, &desc, &vsi_ctx->info,
|
||||
sizeof(vsi_ctx->info), cd);
|
||||
|
|
@ -1944,7 +1944,8 @@ int
|
|||
ice_aq_sw_rules(struct ice_hw *hw, void *rule_list, u16 rule_list_sz,
|
||||
u8 num_rules, enum ice_adminq_opc opc, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aq_desc desc;
|
||||
struct ice_aqc_sw_rules *cmd;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
if (opc != ice_aqc_opc_add_sw_rules &&
|
||||
|
|
@ -1953,13 +1954,13 @@ ice_aq_sw_rules(struct ice_hw *hw, void *rule_list, u16 rule_list_sz,
|
|||
return -EINVAL;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, opc);
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.params.sw_rules.num_rules_fltr_entry_index =
|
||||
cpu_to_le16(num_rules);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
cmd->num_rules_fltr_entry_index = cpu_to_le16(num_rules);
|
||||
status = ice_aq_send_cmd(hw, &desc, rule_list, rule_list_sz, cd);
|
||||
if (opc != ice_aqc_opc_add_sw_rules &&
|
||||
hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT)
|
||||
hw->adminq.sq_last_status == LIBIE_AQ_RC_ENOENT)
|
||||
status = -ENOENT;
|
||||
|
||||
if (!status) {
|
||||
|
|
@ -1989,14 +1990,14 @@ ice_aq_add_recipe(struct ice_hw *hw,
|
|||
u16 num_recipes, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_add_get_recipe *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
u16 buf_size;
|
||||
|
||||
cmd = &desc.params.add_get_recipe;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_add_recipe);
|
||||
|
||||
cmd->num_sub_recipes = cpu_to_le16(num_recipes);
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
|
||||
buf_size = num_recipes * sizeof(*s_recipe_list);
|
||||
|
||||
|
|
@ -2026,14 +2027,14 @@ ice_aq_get_recipe(struct ice_hw *hw,
|
|||
u16 *num_recipes, u16 recipe_root, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_add_get_recipe *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
u16 buf_size;
|
||||
int status;
|
||||
|
||||
if (*num_recipes != ICE_MAX_NUM_RECIPES)
|
||||
return -EINVAL;
|
||||
|
||||
cmd = &desc.params.add_get_recipe;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_recipe);
|
||||
|
||||
cmd->return_index = cpu_to_le16(recipe_root);
|
||||
|
|
@ -2118,9 +2119,9 @@ ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 r_assoc,
|
|||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_recipe_to_profile *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
cmd = &desc.params.recipe_to_profile;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_recipe_to_profile);
|
||||
cmd->profile_id = cpu_to_le16(profile_id);
|
||||
/* Set the recipe ID bit in the bitmask to let the device know which
|
||||
|
|
@ -2144,10 +2145,10 @@ ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 *r_assoc,
|
|||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_recipe_to_profile *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
int status;
|
||||
|
||||
cmd = &desc.params.recipe_to_profile;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_recipe_to_profile);
|
||||
cmd->profile_id = cpu_to_le16(profile_id);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 v_retval,
|
|||
u8 *msg, u16 msglen, struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_pf_vf_msg *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_opc_send_msg_to_vf);
|
||||
|
||||
cmd = &desc.params.virt;
|
||||
cmd = libie_aq_raw(&desc);
|
||||
cmd->id = cpu_to_le32(vfid);
|
||||
|
||||
desc.cookie_high = cpu_to_le32(v_opcode);
|
||||
desc.cookie_low = cpu_to_le32(v_retval);
|
||||
|
||||
if (msglen)
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
|
||||
return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode,
|
|||
|
||||
aq_ret = ice_aq_send_msg_to_vf(&pf->hw, vf->vf_id, v_opcode, v_retval,
|
||||
msg, msglen, NULL);
|
||||
if (aq_ret && pf->hw.mailboxq.sq_last_status != ICE_AQ_RC_ENOSYS) {
|
||||
if (aq_ret && pf->hw.mailboxq.sq_last_status != LIBIE_AQ_RC_ENOSYS) {
|
||||
dev_info(dev, "Unable to send the message to VF %d ret %d aq_err %s\n",
|
||||
vf->vf_id, aq_ret,
|
||||
ice_aq_str(pf->hw.mailboxq.sq_last_status));
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ static int
|
|||
ice_aq_get_vlan_mode(struct ice_hw *hw,
|
||||
struct ice_aqc_get_vlan_mode *get_params)
|
||||
{
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
if (!get_params)
|
||||
return -EINVAL;
|
||||
|
|
@ -275,7 +275,7 @@ ice_aq_set_vlan_mode(struct ice_hw *hw,
|
|||
struct ice_aqc_set_vlan_mode *set_params)
|
||||
{
|
||||
u8 rdma_packet, mng_vlan_prot_id;
|
||||
struct ice_aq_desc desc;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
if (!set_params)
|
||||
return -EINVAL;
|
||||
|
|
@ -295,7 +295,7 @@ ice_aq_set_vlan_mode(struct ice_hw *hw,
|
|||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc,
|
||||
ice_aqc_opc_set_vlan_mode_parameters);
|
||||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);
|
||||
desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD);
|
||||
|
||||
return ice_aq_send_cmd(hw, &desc, set_params, sizeof(*set_params),
|
||||
NULL);
|
||||
|
|
|
|||
273
include/linux/net/intel/libie/adminq.h
Normal file
273
include/linux/net/intel/libie/adminq.h
Normal file
|
|
@ -0,0 +1,273 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/* Copyright (C) 2025 Intel Corporation */
|
||||
|
||||
#ifndef __LIBIE_ADMINQ_H
|
||||
#define __LIBIE_ADMINQ_H
|
||||
|
||||
#include <linux/build_bug.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#define LIBIE_CHECK_STRUCT_LEN(n, X) \
|
||||
static_assert((n) == sizeof(struct X))
|
||||
|
||||
/**
|
||||
* struct libie_aqc_generic - Generic structure used in adminq communication
|
||||
* @param0: generic parameter high 32bit
|
||||
* @param1: generic parameter lower 32bit
|
||||
* @addr_high: generic address high 32bit
|
||||
* @addr_low: generic address lower 32bit
|
||||
*/
|
||||
struct libie_aqc_generic {
|
||||
__le32 param0;
|
||||
__le32 param1;
|
||||
__le32 addr_high;
|
||||
__le32 addr_low;
|
||||
};
|
||||
LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_generic);
|
||||
|
||||
/**
|
||||
* struct libie_aqc_get_ver - Used in command get version (direct 0x0001)
|
||||
* @rom_ver: rom version
|
||||
* @fw_build: number coressponding to firmware build
|
||||
* @fw_branch: branch identifier of firmware version
|
||||
* @fw_major: major number of firmware version
|
||||
* @fw_minor: minor number of firmware version
|
||||
* @fw_patch: patch of firmware version
|
||||
* @api_branch: brancch identifier of API version
|
||||
* @api_major: major number of API version
|
||||
* @api_minor: minor number of API version
|
||||
* @api_patch: patch of API version
|
||||
*/
|
||||
struct libie_aqc_get_ver {
|
||||
__le32 rom_ver;
|
||||
__le32 fw_build;
|
||||
u8 fw_branch;
|
||||
u8 fw_major;
|
||||
u8 fw_minor;
|
||||
u8 fw_patch;
|
||||
u8 api_branch;
|
||||
u8 api_major;
|
||||
u8 api_minor;
|
||||
u8 api_patch;
|
||||
};
|
||||
LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_get_ver);
|
||||
|
||||
/**
|
||||
* struct libie_aqc_driver_ver - Used in command send driver version
|
||||
* (indirect 0x0002)
|
||||
* @major_ver: driver major version
|
||||
* @minor_ver: driver minor version
|
||||
* @build_ver: driver build version
|
||||
* @subbuild_ver: driver subbuild version
|
||||
* @reserved: for feature use
|
||||
* @addr_high: high part of response address buff
|
||||
* @addr_low: low part of response address buff
|
||||
*/
|
||||
struct libie_aqc_driver_ver {
|
||||
u8 major_ver;
|
||||
u8 minor_ver;
|
||||
u8 build_ver;
|
||||
u8 subbuild_ver;
|
||||
u8 reserved[4];
|
||||
__le32 addr_high;
|
||||
__le32 addr_low;
|
||||
};
|
||||
LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_driver_ver);
|
||||
|
||||
enum libie_aq_res_id {
|
||||
LIBIE_AQC_RES_ID_NVM = 1,
|
||||
LIBIE_AQC_RES_ID_SDP = 2,
|
||||
LIBIE_AQC_RES_ID_CHNG_LOCK = 3,
|
||||
LIBIE_AQC_RES_ID_GLBL_LOCK = 4,
|
||||
};
|
||||
|
||||
enum libie_aq_res_access_type {
|
||||
LIBIE_AQC_RES_ACCESS_READ = 1,
|
||||
LIBIE_AQC_RES_ACCESS_WRITE = 2,
|
||||
};
|
||||
|
||||
#define LIBIE_AQ_RES_NVM_READ_DFLT_TIMEOUT_MS 3000
|
||||
#define LIBIE_AQ_RES_NVM_WRITE_DFLT_TIMEOUT_MS 180000
|
||||
#define LIBIE_AQ_RES_CHNG_LOCK_DFLT_TIMEOUT_MS 1000
|
||||
#define LIBIE_AQ_RES_GLBL_LOCK_DFLT_TIMEOUT_MS 3000
|
||||
|
||||
#define LIBIE_AQ_RES_GLBL_SUCCESS 0
|
||||
#define LIBIE_AQ_RES_GLBL_IN_PROG 1
|
||||
#define LIBIE_AQ_RES_GLBL_DONE 2
|
||||
|
||||
/**
|
||||
* struct libie_aqc_req_res - Request resource ownership
|
||||
* @res_id: resource ID (look at enum definition above)
|
||||
* @access_type: read or write (enum definition above)
|
||||
* @timeout: Upon successful completion, FW writes this value and driver is
|
||||
* expected to release resource before timeout. This value is provided in
|
||||
* milliseconds.
|
||||
* @res_number: for SDP, this is the pin ID of the SDP
|
||||
* @status: status only used for LIBIE_AQC_RES_ID_GLBL_LOCK, for others reserved
|
||||
* @reserved: reserved for future use
|
||||
*
|
||||
* Used in commands:
|
||||
* request resource ownership (direct 0x0008)
|
||||
* request resource ownership (direct 0x0009)
|
||||
*/
|
||||
struct libie_aqc_req_res {
|
||||
__le16 res_id;
|
||||
__le16 access_type;
|
||||
|
||||
__le32 timeout;
|
||||
__le32 res_number;
|
||||
__le16 status;
|
||||
u8 reserved[2];
|
||||
};
|
||||
LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_req_res);
|
||||
|
||||
/**
|
||||
* struct libie_aqc_list_caps - Getting capabilities
|
||||
* @cmd_flags: command flags
|
||||
* @pf_index: index of PF to get caps from
|
||||
* @reserved: reserved for future use
|
||||
* @count: number of capabilities records
|
||||
* @addr_high: high part of response address buff
|
||||
* @addr_low: low part of response address buff
|
||||
*
|
||||
* Used in commands:
|
||||
* get function capabilities (indirect 0x000A)
|
||||
* get device capabilities (indirect 0x000B)
|
||||
*/
|
||||
struct libie_aqc_list_caps {
|
||||
u8 cmd_flags;
|
||||
u8 pf_index;
|
||||
u8 reserved[2];
|
||||
__le32 count;
|
||||
__le32 addr_high;
|
||||
__le32 addr_low;
|
||||
};
|
||||
LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_list_caps);
|
||||
|
||||
/* Device/Function buffer entry, repeated per reported capability */
|
||||
#define LIBIE_AQC_CAPS_VALID_FUNCTIONS 0x0005
|
||||
#define LIBIE_AQC_CAPS_SRIOV 0x0012
|
||||
#define LIBIE_AQC_CAPS_VF 0x0013
|
||||
#define LIBIE_AQC_CAPS_VSI 0x0017
|
||||
#define LIBIE_AQC_CAPS_DCB 0x0018
|
||||
#define LIBIE_AQC_CAPS_RSS 0x0040
|
||||
#define LIBIE_AQC_CAPS_RXQS 0x0041
|
||||
#define LIBIE_AQC_CAPS_TXQS 0x0042
|
||||
#define LIBIE_AQC_CAPS_MSIX 0x0043
|
||||
#define LIBIE_AQC_CAPS_FD 0x0045
|
||||
#define LIBIE_AQC_CAPS_1588 0x0046
|
||||
#define LIBIE_AQC_CAPS_MAX_MTU 0x0047
|
||||
#define LIBIE_AQC_CAPS_NVM_VER 0x0048
|
||||
#define LIBIE_AQC_CAPS_PENDING_NVM_VER 0x0049
|
||||
#define LIBIE_AQC_CAPS_OROM_VER 0x004A
|
||||
#define LIBIE_AQC_CAPS_PENDING_OROM_VER 0x004B
|
||||
#define LIBIE_AQC_CAPS_NET_VER 0x004C
|
||||
#define LIBIE_AQC_CAPS_PENDING_NET_VER 0x004D
|
||||
#define LIBIE_AQC_CAPS_RDMA 0x0051
|
||||
#define LIBIE_AQC_CAPS_SENSOR_READING 0x0067
|
||||
#define LIBIE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076
|
||||
#define LIBIE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT 0x0077
|
||||
#define LIBIE_AQC_CAPS_NVM_MGMT 0x0080
|
||||
#define LIBIE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE 0x0085
|
||||
#define LIBIE_AQC_CAPS_NAC_TOPOLOGY 0x0087
|
||||
#define LIBIE_AQC_CAPS_FW_LAG_SUPPORT 0x0092
|
||||
#define LIBIE_AQC_BIT_ROCEV2_LAG 0x01
|
||||
#define LIBIE_AQC_BIT_SRIOV_LAG 0x02
|
||||
|
||||
/**
|
||||
* struct libie_aqc_list_caps_elem - Getting list of caps elements
|
||||
* @cap: one from the defines list above
|
||||
* @major_ver: major version
|
||||
* @minor_ver: minor version
|
||||
* @number: number of resources described by this capability
|
||||
* @logical_id: logical ID, only meaningful for some types of resources
|
||||
* @phys_id: physical ID, only meaningful for some types of resources
|
||||
* @rsvd1: reserved for future use
|
||||
* @rsvd2: reserved for future use
|
||||
*/
|
||||
struct libie_aqc_list_caps_elem {
|
||||
__le16 cap;
|
||||
|
||||
u8 major_ver;
|
||||
u8 minor_ver;
|
||||
__le32 number;
|
||||
__le32 logical_id;
|
||||
__le32 phys_id;
|
||||
__le64 rsvd1;
|
||||
__le64 rsvd2;
|
||||
};
|
||||
LIBIE_CHECK_STRUCT_LEN(32, libie_aqc_list_caps_elem);
|
||||
|
||||
/**
|
||||
* struct libie_aq_desc - Admin Queue (AQ) descriptor
|
||||
* @flags: LIBIE_AQ_FLAG_* flags
|
||||
* @opcode: AQ command opcode
|
||||
* @datalen: length in bytes of indirect/external data buffer
|
||||
* @retval: return value from firmware
|
||||
* @cookie_high: opaque data high-half
|
||||
* @cookie_low: opaque data low-half
|
||||
* @params: command-specific parameters
|
||||
*
|
||||
* Descriptor format for commands the driver posts on the Admin Transmit Queue
|
||||
* (ATQ). The firmware writes back onto the command descriptor and returns
|
||||
* the result of the command. Asynchronous events that are not an immediate
|
||||
* result of the command are written to the Admin Receive Queue (ARQ) using
|
||||
* the same descriptor format. Descriptors are in little-endian notation with
|
||||
* 32-bit words.
|
||||
*/
|
||||
struct libie_aq_desc {
|
||||
__le16 flags;
|
||||
__le16 opcode;
|
||||
__le16 datalen;
|
||||
__le16 retval;
|
||||
__le32 cookie_high;
|
||||
__le32 cookie_low;
|
||||
union {
|
||||
u8 raw[16];
|
||||
struct libie_aqc_generic generic;
|
||||
struct libie_aqc_get_ver get_ver;
|
||||
struct libie_aqc_driver_ver driver_ver;
|
||||
struct libie_aqc_req_res res_owner;
|
||||
struct libie_aqc_list_caps get_cap;
|
||||
} params;
|
||||
};
|
||||
LIBIE_CHECK_STRUCT_LEN(32, libie_aq_desc);
|
||||
|
||||
/* FW defined boundary for a large buffer, 4k >= Large buffer > 512 bytes */
|
||||
#define LIBIE_AQ_LG_BUF 512
|
||||
|
||||
#define LIBIE_AQ_FLAG_DD BIT(0) /* 0x1 */
|
||||
#define LIBIE_AQ_FLAG_CMP BIT(1) /* 0x2 */
|
||||
#define LIBIE_AQ_FLAG_ERR BIT(2) /* 0x4 */
|
||||
#define LIBIE_AQ_FLAG_LB BIT(9) /* 0x200 */
|
||||
#define LIBIE_AQ_FLAG_RD BIT(10) /* 0x400 */
|
||||
#define LIBIE_AQ_FLAG_BUF BIT(12) /* 0x1000 */
|
||||
#define LIBIE_AQ_FLAG_SI BIT(13) /* 0x2000 */
|
||||
|
||||
/* error codes */
|
||||
enum libie_aq_err {
|
||||
LIBIE_AQ_RC_OK = 0, /* Success */
|
||||
LIBIE_AQ_RC_EPERM = 1, /* Operation not permitted */
|
||||
LIBIE_AQ_RC_ENOENT = 2, /* No such element */
|
||||
LIBIE_AQ_RC_ESRCH = 3, /* Bad opcode */
|
||||
LIBIE_AQ_RC_EAGAIN = 8, /* Try again */
|
||||
LIBIE_AQ_RC_ENOMEM = 9, /* Out of memory */
|
||||
LIBIE_AQ_RC_EBUSY = 12, /* Device or resource busy */
|
||||
LIBIE_AQ_RC_EEXIST = 13, /* Object already exists */
|
||||
LIBIE_AQ_RC_EINVAL = 14, /* Invalid argument */
|
||||
LIBIE_AQ_RC_ENOSPC = 16, /* No space left or allocation failure */
|
||||
LIBIE_AQ_RC_ENOSYS = 17, /* Function not implemented */
|
||||
LIBIE_AQ_RC_EMODE = 21, /* Op not allowed in current dev mode */
|
||||
LIBIE_AQ_RC_ENOSEC = 24, /* Missing security manifest */
|
||||
LIBIE_AQ_RC_EBADSIG = 25, /* Bad RSA signature */
|
||||
LIBIE_AQ_RC_ESVN = 26, /* SVN number prohibits this package */
|
||||
LIBIE_AQ_RC_EBADMAN = 27, /* Manifest hash mismatch */
|
||||
LIBIE_AQ_RC_EBADBUF = 28, /* Buffer hash mismatches manifest */
|
||||
};
|
||||
|
||||
static inline void *libie_aq_raw(struct libie_aq_desc *desc)
|
||||
{
|
||||
return &desc->params.raw;
|
||||
}
|
||||
|
||||
#endif /* __LIBIE_ADMINQ_H */
|
||||
Loading…
Reference in New Issue
Block a user