Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Michal Swiatkowski and committed by
Tony Nguyen
fdb7f139 94619ea2

+673 -649
+3 -1
drivers/net/ethernet/intel/ice/devlink/health.c
··· 217 217 void ice_process_health_status_event(struct ice_pf *pf, struct ice_rq_event_info *event) 218 218 { 219 219 const struct ice_aqc_health_status_elem *health_info; 220 + const struct ice_aqc_get_health_status *cmd; 220 221 u16 count; 221 222 222 223 health_info = (struct ice_aqc_health_status_elem *)event->msg_buf; 223 - count = le16_to_cpu(event->desc.params.get_health_status.health_status_count); 224 + cmd = libie_aq_raw(&event->desc); 225 + count = le16_to_cpu(cmd->health_status_count); 224 226 225 227 if (count > (event->buf_len / sizeof(*health_info))) { 226 228 dev_err(ice_pf_to_dev(pf), "Received a health status event with invalid element count\n");
+1 -1
drivers/net/ethernet/intel/ice/ice.h
··· 960 960 void ice_unplug_aux_dev(struct ice_pf *pf); 961 961 int ice_init_rdma(struct ice_pf *pf); 962 962 void ice_deinit_rdma(struct ice_pf *pf); 963 - const char *ice_aq_str(enum ice_aq_err aq_err); 963 + const char *ice_aq_str(enum libie_aq_err aq_err); 964 964 bool ice_is_wol_supported(struct ice_hw *hw); 965 965 void ice_fdir_del_all_fltrs(struct ice_vsi *vsi); 966 966 int
+2 -268
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
··· 4 4 #ifndef _ICE_ADMINQ_CMD_H_ 5 5 #define _ICE_ADMINQ_CMD_H_ 6 6 7 + #include <linux/net/intel/libie/adminq.h> 8 + 7 9 /* This header file defines the Admin Queue commands, error codes and 8 10 * descriptor format. It is shared between Firmware and Software. 9 11 */ ··· 33 31 34 32 typedef struct __packed { u8 buf[ICE_TXQ_CTX_FULL_SZ]; } ice_txq_ctx_buf_full_t; 35 33 36 - struct ice_aqc_generic { 37 - __le32 param0; 38 - __le32 param1; 39 - __le32 addr_high; 40 - __le32 addr_low; 41 - }; 42 - 43 - /* Get version (direct 0x0001) */ 44 - struct ice_aqc_get_ver { 45 - __le32 rom_ver; 46 - __le32 fw_build; 47 - u8 fw_branch; 48 - u8 fw_major; 49 - u8 fw_minor; 50 - u8 fw_patch; 51 - u8 api_branch; 52 - u8 api_major; 53 - u8 api_minor; 54 - u8 api_patch; 55 - }; 56 - 57 - /* Send driver version (indirect 0x0002) */ 58 - struct ice_aqc_driver_ver { 59 - u8 major_ver; 60 - u8 minor_ver; 61 - u8 build_ver; 62 - u8 subbuild_ver; 63 - u8 reserved[4]; 64 - __le32 addr_high; 65 - __le32 addr_low; 66 - }; 67 - 68 34 /* Queue Shutdown (direct 0x0003) */ 69 35 struct ice_aqc_q_shutdown { 70 36 u8 driver_unloading; 71 37 #define ICE_AQC_DRIVER_UNLOADING BIT(0) 72 38 u8 reserved[15]; 73 - }; 74 - 75 - /* Request resource ownership (direct 0x0008) 76 - * Release resource ownership (direct 0x0009) 77 - */ 78 - struct ice_aqc_req_res { 79 - __le16 res_id; 80 - #define ICE_AQC_RES_ID_NVM 1 81 - #define ICE_AQC_RES_ID_SDP 2 82 - #define ICE_AQC_RES_ID_CHNG_LOCK 3 83 - #define ICE_AQC_RES_ID_GLBL_LOCK 4 84 - __le16 access_type; 85 - #define ICE_AQC_RES_ACCESS_READ 1 86 - #define ICE_AQC_RES_ACCESS_WRITE 2 87 - 88 - /* Upon successful completion, FW writes this value and driver is 89 - * expected to release resource before timeout. This value is provided 90 - * in milliseconds. 91 - */ 92 - __le32 timeout; 93 - #define ICE_AQ_RES_NVM_READ_DFLT_TIMEOUT_MS 3000 94 - #define ICE_AQ_RES_NVM_WRITE_DFLT_TIMEOUT_MS 180000 95 - #define ICE_AQ_RES_CHNG_LOCK_DFLT_TIMEOUT_MS 1000 96 - #define ICE_AQ_RES_GLBL_LOCK_DFLT_TIMEOUT_MS 3000 97 - /* For SDP: pin ID of the SDP */ 98 - __le32 res_number; 99 - /* Status is only used for ICE_AQC_RES_ID_GLBL_LOCK */ 100 - __le16 status; 101 - #define ICE_AQ_RES_GLBL_SUCCESS 0 102 - #define ICE_AQ_RES_GLBL_IN_PROG 1 103 - #define ICE_AQ_RES_GLBL_DONE 2 104 - u8 reserved[2]; 105 - }; 106 - 107 - /* Get function capabilities (indirect 0x000A) 108 - * Get device capabilities (indirect 0x000B) 109 - */ 110 - struct ice_aqc_list_caps { 111 - u8 cmd_flags; 112 - u8 pf_index; 113 - u8 reserved[2]; 114 - __le32 count; 115 - __le32 addr_high; 116 - __le32 addr_low; 117 - }; 118 - 119 - /* Device/Function buffer entry, repeated per reported capability */ 120 - struct ice_aqc_list_caps_elem { 121 - __le16 cap; 122 - #define ICE_AQC_CAPS_VALID_FUNCTIONS 0x0005 123 - #define ICE_AQC_CAPS_SRIOV 0x0012 124 - #define ICE_AQC_CAPS_VF 0x0013 125 - #define ICE_AQC_CAPS_VSI 0x0017 126 - #define ICE_AQC_CAPS_DCB 0x0018 127 - #define ICE_AQC_CAPS_RSS 0x0040 128 - #define ICE_AQC_CAPS_RXQS 0x0041 129 - #define ICE_AQC_CAPS_TXQS 0x0042 130 - #define ICE_AQC_CAPS_MSIX 0x0043 131 - #define ICE_AQC_CAPS_FD 0x0045 132 - #define ICE_AQC_CAPS_1588 0x0046 133 - #define ICE_AQC_CAPS_MAX_MTU 0x0047 134 - #define ICE_AQC_CAPS_NVM_VER 0x0048 135 - #define ICE_AQC_CAPS_PENDING_NVM_VER 0x0049 136 - #define ICE_AQC_CAPS_OROM_VER 0x004A 137 - #define ICE_AQC_CAPS_PENDING_OROM_VER 0x004B 138 - #define ICE_AQC_CAPS_NET_VER 0x004C 139 - #define ICE_AQC_CAPS_PENDING_NET_VER 0x004D 140 - #define ICE_AQC_CAPS_RDMA 0x0051 141 - #define ICE_AQC_CAPS_SENSOR_READING 0x0067 142 - #define ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076 143 - #define ICE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT 0x0077 144 - #define ICE_AQC_CAPS_NVM_MGMT 0x0080 145 - #define ICE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE 0x0085 146 - #define ICE_AQC_CAPS_NAC_TOPOLOGY 0x0087 147 - #define ICE_AQC_CAPS_FW_LAG_SUPPORT 0x0092 148 - #define ICE_AQC_BIT_ROCEV2_LAG 0x01 149 - #define ICE_AQC_BIT_SRIOV_LAG 0x02 150 - 151 - u8 major_ver; 152 - u8 minor_ver; 153 - /* Number of resources described by this capability */ 154 - __le32 number; 155 - /* Only meaningful for some types of resources */ 156 - __le32 logical_id; 157 - /* Only meaningful for some types of resources */ 158 - __le32 phys_id; 159 - __le64 rsvd1; 160 - __le64 rsvd2; 161 39 }; 162 40 163 41 /* Manage MAC address, read command - indirect (0x0107) ··· 2552 2670 __le16 module_identifier; 2553 2671 u8 log_level; 2554 2672 u8 rsvd0; 2555 - }; 2556 - 2557 - /** 2558 - * struct ice_aq_desc - Admin Queue (AQ) descriptor 2559 - * @flags: ICE_AQ_FLAG_* flags 2560 - * @opcode: AQ command opcode 2561 - * @datalen: length in bytes of indirect/external data buffer 2562 - * @retval: return value from firmware 2563 - * @cookie_high: opaque data high-half 2564 - * @cookie_low: opaque data low-half 2565 - * @params: command-specific parameters 2566 - * 2567 - * Descriptor format for commands the driver posts on the Admin Transmit Queue 2568 - * (ATQ). The firmware writes back onto the command descriptor and returns 2569 - * the result of the command. Asynchronous events that are not an immediate 2570 - * result of the command are written to the Admin Receive Queue (ARQ) using 2571 - * the same descriptor format. Descriptors are in little-endian notation with 2572 - * 32-bit words. 2573 - */ 2574 - struct ice_aq_desc { 2575 - __le16 flags; 2576 - __le16 opcode; 2577 - __le16 datalen; 2578 - __le16 retval; 2579 - __le32 cookie_high; 2580 - __le32 cookie_low; 2581 - union { 2582 - u8 raw[16]; 2583 - struct ice_aqc_generic generic; 2584 - struct ice_aqc_get_ver get_ver; 2585 - struct ice_aqc_driver_ver driver_ver; 2586 - struct ice_aqc_q_shutdown q_shutdown; 2587 - struct ice_aqc_req_res res_owner; 2588 - struct ice_aqc_manage_mac_read mac_read; 2589 - struct ice_aqc_manage_mac_write mac_write; 2590 - struct ice_aqc_clear_pxe clear_pxe; 2591 - struct ice_aqc_list_caps get_cap; 2592 - struct ice_aqc_get_phy_caps get_phy; 2593 - struct ice_aqc_set_phy_cfg set_phy; 2594 - struct ice_aqc_restart_an restart_an; 2595 - struct ice_aqc_set_phy_rec_clk_out set_phy_rec_clk_out; 2596 - struct ice_aqc_get_phy_rec_clk_out get_phy_rec_clk_out; 2597 - struct ice_aqc_get_sensor_reading get_sensor_reading; 2598 - struct ice_aqc_get_sensor_reading_resp get_sensor_reading_resp; 2599 - struct ice_aqc_gpio read_write_gpio; 2600 - struct ice_aqc_sff_eeprom read_write_sff_param; 2601 - struct ice_aqc_set_port_id_led set_port_id_led; 2602 - struct ice_aqc_get_port_options get_port_options; 2603 - struct ice_aqc_set_port_option set_port_option; 2604 - struct ice_aqc_get_sw_cfg get_sw_conf; 2605 - struct ice_aqc_set_port_params set_port_params; 2606 - struct ice_aqc_sw_rules sw_rules; 2607 - struct ice_aqc_add_get_recipe add_get_recipe; 2608 - struct ice_aqc_recipe_to_profile recipe_to_profile; 2609 - struct ice_aqc_get_topo get_topo; 2610 - struct ice_aqc_sched_elem_cmd sched_elem_cmd; 2611 - struct ice_aqc_query_txsched_res query_sched_res; 2612 - struct ice_aqc_query_port_ets port_ets; 2613 - struct ice_aqc_rl_profile rl_profile; 2614 - struct ice_aqc_nvm nvm; 2615 - struct ice_aqc_nvm_checksum nvm_checksum; 2616 - struct ice_aqc_nvm_pkg_data pkg_data; 2617 - struct ice_aqc_nvm_pass_comp_tbl pass_comp_tbl; 2618 - struct ice_aqc_pf_vf_msg virt; 2619 - struct ice_aqc_set_query_pfc_mode set_query_pfc_mode; 2620 - struct ice_aqc_lldp_get_mib lldp_get_mib; 2621 - struct ice_aqc_lldp_set_mib_change lldp_set_event; 2622 - struct ice_aqc_lldp_stop lldp_stop; 2623 - struct ice_aqc_lldp_start lldp_start; 2624 - struct ice_aqc_lldp_set_local_mib lldp_set_mib; 2625 - struct ice_aqc_lldp_stop_start_specific_agent lldp_agent_ctrl; 2626 - struct ice_aqc_lldp_filter_ctrl lldp_filter_ctrl; 2627 - struct ice_aqc_get_set_rss_lut get_set_rss_lut; 2628 - struct ice_aqc_get_set_rss_key get_set_rss_key; 2629 - struct ice_aqc_neigh_dev_req neigh_dev; 2630 - struct ice_aqc_add_txqs add_txqs; 2631 - struct ice_aqc_dis_txqs dis_txqs; 2632 - struct ice_aqc_cfg_txqs cfg_txqs; 2633 - struct ice_aqc_add_rdma_qset add_rdma_qset; 2634 - struct ice_aqc_add_get_update_free_vsi vsi_cmd; 2635 - struct ice_aqc_add_update_free_vsi_resp add_update_free_vsi_res; 2636 - struct ice_aqc_download_pkg download_pkg; 2637 - struct ice_aqc_get_cgu_input_measure get_cgu_input_measure; 2638 - struct ice_aqc_set_cgu_input_config set_cgu_input_config; 2639 - struct ice_aqc_get_cgu_input_config get_cgu_input_config; 2640 - struct ice_aqc_set_cgu_output_config set_cgu_output_config; 2641 - struct ice_aqc_get_cgu_output_config get_cgu_output_config; 2642 - struct ice_aqc_get_cgu_dpll_status get_cgu_dpll_status; 2643 - struct ice_aqc_set_cgu_dpll_config set_cgu_dpll_config; 2644 - struct ice_aqc_set_cgu_ref_prio set_cgu_ref_prio; 2645 - struct ice_aqc_get_cgu_ref_prio get_cgu_ref_prio; 2646 - struct ice_aqc_get_cgu_info get_cgu_info; 2647 - struct ice_aqc_driver_shared_params drv_shared_params; 2648 - struct ice_aqc_fw_log fw_log; 2649 - struct ice_aqc_set_mac_lb set_mac_lb; 2650 - struct ice_aqc_alloc_free_res_cmd sw_res_ctrl; 2651 - struct ice_aqc_set_mac_cfg set_mac_cfg; 2652 - struct ice_aqc_set_event_mask set_event_mask; 2653 - struct ice_aqc_get_link_status get_link_status; 2654 - struct ice_aqc_event_lan_overflow lan_overflow; 2655 - struct ice_aqc_get_link_topo get_link_topo; 2656 - struct ice_aqc_set_health_status_cfg set_health_status_cfg; 2657 - struct ice_aqc_get_health_status get_health_status; 2658 - struct ice_aqc_dnl_call_command dnl_call; 2659 - struct ice_aqc_i2c read_write_i2c; 2660 - struct ice_aqc_read_i2c_resp read_i2c_resp; 2661 - struct ice_aqc_get_set_tx_topo get_set_tx_topo; 2662 - } params; 2663 - }; 2664 - 2665 - /* FW defined boundary for a large buffer, 4k >= Large buffer > 512 bytes */ 2666 - #define ICE_AQ_LG_BUF 512 2667 - 2668 - #define ICE_AQ_FLAG_DD_S 0 2669 - #define ICE_AQ_FLAG_CMP_S 1 2670 - #define ICE_AQ_FLAG_ERR_S 2 2671 - #define ICE_AQ_FLAG_LB_S 9 2672 - #define ICE_AQ_FLAG_RD_S 10 2673 - #define ICE_AQ_FLAG_BUF_S 12 2674 - #define ICE_AQ_FLAG_SI_S 13 2675 - 2676 - #define ICE_AQ_FLAG_DD BIT(ICE_AQ_FLAG_DD_S) /* 0x1 */ 2677 - #define ICE_AQ_FLAG_CMP BIT(ICE_AQ_FLAG_CMP_S) /* 0x2 */ 2678 - #define ICE_AQ_FLAG_ERR BIT(ICE_AQ_FLAG_ERR_S) /* 0x4 */ 2679 - #define ICE_AQ_FLAG_LB BIT(ICE_AQ_FLAG_LB_S) /* 0x200 */ 2680 - #define ICE_AQ_FLAG_RD BIT(ICE_AQ_FLAG_RD_S) /* 0x400 */ 2681 - #define ICE_AQ_FLAG_BUF BIT(ICE_AQ_FLAG_BUF_S) /* 0x1000 */ 2682 - #define ICE_AQ_FLAG_SI BIT(ICE_AQ_FLAG_SI_S) /* 0x2000 */ 2683 - 2684 - /* error codes */ 2685 - enum ice_aq_err { 2686 - ICE_AQ_RC_OK = 0, /* Success */ 2687 - ICE_AQ_RC_EPERM = 1, /* Operation not permitted */ 2688 - ICE_AQ_RC_ENOENT = 2, /* No such element */ 2689 - ICE_AQ_RC_ESRCH = 3, /* Bad opcode */ 2690 - ICE_AQ_RC_EAGAIN = 8, /* Try again */ 2691 - ICE_AQ_RC_ENOMEM = 9, /* Out of memory */ 2692 - ICE_AQ_RC_EBUSY = 12, /* Device or resource busy */ 2693 - ICE_AQ_RC_EEXIST = 13, /* Object already exists */ 2694 - ICE_AQ_RC_EINVAL = 14, /* Invalid argument */ 2695 - ICE_AQ_RC_ENOSPC = 16, /* No space left or allocation failure */ 2696 - ICE_AQ_RC_ENOSYS = 17, /* Function not implemented */ 2697 - ICE_AQ_RC_EMODE = 21, /* Op not allowed in current dev mode */ 2698 - ICE_AQ_RC_ENOSEC = 24, /* Missing security manifest */ 2699 - ICE_AQ_RC_EBADSIG = 25, /* Bad RSA signature */ 2700 - ICE_AQ_RC_ESVN = 26, /* SVN number prohibits this package */ 2701 - ICE_AQ_RC_EBADMAN = 27, /* Manifest hash mismatch */ 2702 - ICE_AQ_RC_EBADBUF = 28, /* Buffer hash mismatches manifest */ 2703 2673 }; 2704 2674 2705 2675 /* Admin Queue command opcodes */
+194 -190
drivers/net/ethernet/intel/ice/ice_common.c
··· 248 248 */ 249 249 int ice_clear_pf_cfg(struct ice_hw *hw) 250 250 { 251 - struct ice_aq_desc desc; 251 + struct libie_aq_desc desc; 252 252 253 253 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_clear_pf_cfg); 254 254 ··· 276 276 { 277 277 struct ice_aqc_manage_mac_read_resp *resp; 278 278 struct ice_aqc_manage_mac_read *cmd; 279 - struct ice_aq_desc desc; 279 + struct libie_aq_desc desc; 280 280 int status; 281 281 u16 flags; 282 282 u8 i; 283 283 284 - cmd = &desc.params.mac_read; 284 + cmd = libie_aq_raw(&desc); 285 285 286 286 if (buf_size < sizeof(*resp)) 287 287 return -EINVAL; ··· 330 330 { 331 331 struct ice_aqc_get_phy_caps *cmd; 332 332 u16 pcaps_size = sizeof(*pcaps); 333 - struct ice_aq_desc desc; 333 + struct libie_aq_desc desc; 334 334 const char *prefix; 335 335 struct ice_hw *hw; 336 336 int status; 337 337 338 - cmd = &desc.params.get_phy; 338 + cmd = libie_aq_raw(&desc); 339 339 340 340 if (!pcaps || (report_mode & ~ICE_AQC_REPORT_MODE_M) || !pi) 341 341 return -EINVAL; ··· 424 424 struct ice_sq_cd *cd) 425 425 { 426 426 struct ice_aqc_get_link_topo *cmd; 427 - struct ice_aq_desc desc; 427 + struct libie_aq_desc desc; 428 428 429 - cmd = &desc.params.get_link_topo; 429 + cmd = libie_aq_raw(&desc); 430 430 431 431 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_topo); 432 432 ··· 454 454 ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd, 455 455 u8 *node_part_number, u16 *node_handle) 456 456 { 457 - struct ice_aq_desc desc; 457 + struct ice_aqc_get_link_topo *resp; 458 + struct libie_aq_desc desc; 458 459 459 460 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_topo); 460 - desc.params.get_link_topo = *cmd; 461 + resp = libie_aq_raw(&desc); 462 + *resp = *cmd; 461 463 462 464 if (ice_aq_send_cmd(hw, &desc, NULL, 0, NULL)) 463 465 return -EINTR; 464 466 465 467 if (node_handle) 466 - *node_handle = 467 - le16_to_cpu(desc.params.get_link_topo.addr.handle); 468 + *node_handle = le16_to_cpu(resp->addr.handle); 468 469 if (node_part_number) 469 - *node_part_number = desc.params.get_link_topo.node_part_num; 470 + *node_part_number = resp->node_part_num; 470 471 471 472 return 0; 472 473 } ··· 690 689 struct ice_link_status *li_old, *li; 691 690 enum ice_media_type *hw_media_type; 692 691 struct ice_fc_info *hw_fc_info; 692 + struct libie_aq_desc desc; 693 693 bool tx_pause, rx_pause; 694 - struct ice_aq_desc desc; 695 694 struct ice_hw *hw; 696 695 u16 cmd_flags; 697 696 int status; ··· 706 705 707 706 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_status); 708 707 cmd_flags = (ena_lse) ? ICE_AQ_LSE_ENA : ICE_AQ_LSE_DIS; 709 - resp = &desc.params.get_link_status; 708 + resp = libie_aq_raw(&desc); 710 709 resp->cmd_flags = cpu_to_le16(cmd_flags); 711 710 resp->lport_num = pi->lport; 712 711 ··· 835 834 ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, struct ice_sq_cd *cd) 836 835 { 837 836 struct ice_aqc_set_mac_cfg *cmd; 838 - struct ice_aq_desc desc; 837 + struct libie_aq_desc desc; 839 838 840 - cmd = &desc.params.set_mac_cfg; 839 + cmd = libie_aq_raw(&desc); 841 840 842 841 if (max_frame_size == 0) 843 842 return -EINVAL; ··· 1708 1707 void *buf, u16 buf_size, struct ice_sq_cd *cd) 1709 1708 { 1710 1709 return ice_sq_send_cmd(hw, ice_get_sbq(hw), 1711 - (struct ice_aq_desc *)desc, buf, buf_size, cd); 1710 + (struct libie_aq_desc *)desc, buf, buf_size, cd); 1712 1711 } 1713 1712 1714 1713 /** ··· 1793 1792 */ 1794 1793 static int 1795 1794 ice_sq_send_cmd_retry(struct ice_hw *hw, struct ice_ctl_q_info *cq, 1796 - struct ice_aq_desc *desc, void *buf, u16 buf_size, 1795 + struct libie_aq_desc *desc, void *buf, u16 buf_size, 1797 1796 struct ice_sq_cd *cd) 1798 1797 { 1799 - struct ice_aq_desc desc_cpy; 1798 + struct libie_aq_desc desc_cpy; 1800 1799 bool is_cmd_for_retry; 1801 1800 u8 idx = 0; 1802 1801 u16 opcode; ··· 1817 1816 status = ice_sq_send_cmd(hw, cq, desc, buf, buf_size, cd); 1818 1817 1819 1818 if (!is_cmd_for_retry || !status || 1820 - hw->adminq.sq_last_status != ICE_AQ_RC_EBUSY) 1819 + hw->adminq.sq_last_status != LIBIE_AQ_RC_EBUSY) 1821 1820 break; 1822 1821 1823 1822 memcpy(desc, &desc_cpy, sizeof(desc_cpy)); ··· 1840 1839 * Helper function to send FW Admin Queue commands to the FW Admin Queue. 1841 1840 */ 1842 1841 int 1843 - ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf, 1842 + ice_aq_send_cmd(struct ice_hw *hw, struct libie_aq_desc *desc, void *buf, 1844 1843 u16 buf_size, struct ice_sq_cd *cd) 1845 1844 { 1846 - struct ice_aqc_req_res *cmd = &desc->params.res_owner; 1845 + struct libie_aqc_req_res *cmd = libie_aq_raw(desc); 1847 1846 bool lock_acquired = false; 1848 1847 int status; 1849 1848 ··· 1874 1873 case ice_aqc_opc_get_recipe_to_profile: 1875 1874 break; 1876 1875 case ice_aqc_opc_release_res: 1877 - if (le16_to_cpu(cmd->res_id) == ICE_AQC_RES_ID_GLBL_LOCK) 1876 + if (le16_to_cpu(cmd->res_id) == LIBIE_AQC_RES_ID_GLBL_LOCK) 1878 1877 break; 1879 1878 fallthrough; 1880 1879 default: ··· 1899 1898 */ 1900 1899 int ice_aq_get_fw_ver(struct ice_hw *hw, struct ice_sq_cd *cd) 1901 1900 { 1902 - struct ice_aqc_get_ver *resp; 1903 - struct ice_aq_desc desc; 1901 + struct libie_aqc_get_ver *resp; 1902 + struct libie_aq_desc desc; 1904 1903 int status; 1905 1904 1906 1905 resp = &desc.params.get_ver; ··· 1936 1935 ice_aq_send_driver_ver(struct ice_hw *hw, struct ice_driver_ver *dv, 1937 1936 struct ice_sq_cd *cd) 1938 1937 { 1939 - struct ice_aqc_driver_ver *cmd; 1940 - struct ice_aq_desc desc; 1938 + struct libie_aqc_driver_ver *cmd; 1939 + struct libie_aq_desc desc; 1941 1940 u16 len; 1942 1941 1943 1942 cmd = &desc.params.driver_ver; ··· 1947 1946 1948 1947 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_driver_ver); 1949 1948 1950 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 1949 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 1951 1950 cmd->major_ver = dv->major_ver; 1952 1951 cmd->minor_ver = dv->minor_ver; 1953 1952 cmd->build_ver = dv->build_ver; ··· 1972 1971 int ice_aq_q_shutdown(struct ice_hw *hw, bool unloading) 1973 1972 { 1974 1973 struct ice_aqc_q_shutdown *cmd; 1975 - struct ice_aq_desc desc; 1974 + struct libie_aq_desc desc; 1976 1975 1977 - cmd = &desc.params.q_shutdown; 1976 + cmd = libie_aq_raw(&desc); 1978 1977 1979 1978 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_q_shutdown); 1980 1979 ··· 2015 2014 enum ice_aq_res_access_type access, u8 sdp_number, u32 *timeout, 2016 2015 struct ice_sq_cd *cd) 2017 2016 { 2018 - struct ice_aqc_req_res *cmd_resp; 2019 - struct ice_aq_desc desc; 2017 + struct libie_aqc_req_res *cmd_resp; 2018 + struct libie_aq_desc desc; 2020 2019 int status; 2021 2020 2022 2021 cmd_resp = &desc.params.res_owner; ··· 2038 2037 /* Global config lock response utilizes an additional status field. 2039 2038 * 2040 2039 * If the Global config lock resource is held by some other driver, the 2041 - * command completes with ICE_AQ_RES_GLBL_IN_PROG in the status field 2040 + * command completes with LIBIE_AQ_RES_GLBL_IN_PROG in the status field 2042 2041 * and the timeout field indicates the maximum time the current owner 2043 2042 * of the resource has to free it. 2044 2043 */ 2045 2044 if (res == ICE_GLOBAL_CFG_LOCK_RES_ID) { 2046 - if (le16_to_cpu(cmd_resp->status) == ICE_AQ_RES_GLBL_SUCCESS) { 2045 + if (le16_to_cpu(cmd_resp->status) == LIBIE_AQ_RES_GLBL_SUCCESS) { 2047 2046 *timeout = le32_to_cpu(cmd_resp->timeout); 2048 2047 return 0; 2049 2048 } else if (le16_to_cpu(cmd_resp->status) == 2050 - ICE_AQ_RES_GLBL_IN_PROG) { 2049 + LIBIE_AQ_RES_GLBL_IN_PROG) { 2051 2050 *timeout = le32_to_cpu(cmd_resp->timeout); 2052 2051 return -EIO; 2053 2052 } else if (le16_to_cpu(cmd_resp->status) == 2054 - ICE_AQ_RES_GLBL_DONE) { 2053 + LIBIE_AQ_RES_GLBL_DONE) { 2055 2054 return -EALREADY; 2056 2055 } 2057 2056 ··· 2064 2063 * with a busy return value and the timeout field indicates the maximum 2065 2064 * time the current owner of the resource has to free it. 2066 2065 */ 2067 - if (!status || hw->adminq.sq_last_status == ICE_AQ_RC_EBUSY) 2066 + if (!status || hw->adminq.sq_last_status == LIBIE_AQ_RC_EBUSY) 2068 2067 *timeout = le32_to_cpu(cmd_resp->timeout); 2069 2068 2070 2069 return status; ··· 2083 2082 ice_aq_release_res(struct ice_hw *hw, enum ice_aq_res_ids res, u8 sdp_number, 2084 2083 struct ice_sq_cd *cd) 2085 2084 { 2086 - struct ice_aqc_req_res *cmd; 2087 - struct ice_aq_desc desc; 2085 + struct libie_aqc_req_res *cmd; 2086 + struct libie_aq_desc desc; 2088 2087 2089 2088 cmd = &desc.params.res_owner; 2090 2089 ··· 2193 2192 enum ice_adminq_opc opc) 2194 2193 { 2195 2194 struct ice_aqc_alloc_free_res_cmd *cmd; 2196 - struct ice_aq_desc desc; 2195 + struct libie_aq_desc desc; 2197 2196 2198 - cmd = &desc.params.sw_res_ctrl; 2197 + cmd = libie_aq_raw(&desc); 2199 2198 2200 2199 if (!buf || buf_size < flex_array_size(buf, elem, 1)) 2201 2200 return -EINVAL; 2202 2201 2203 2202 ice_fill_dflt_direct_cmd_desc(&desc, opc); 2204 2203 2205 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 2204 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 2206 2205 2207 2206 cmd->num_entries = cpu_to_le16(1); 2208 2207 ··· 2316 2315 */ 2317 2316 static bool 2318 2317 ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, 2319 - struct ice_aqc_list_caps_elem *elem, const char *prefix) 2318 + struct libie_aqc_list_caps_elem *elem, const char *prefix) 2320 2319 { 2321 2320 u32 logical_id = le32_to_cpu(elem->logical_id); 2322 2321 u32 phys_id = le32_to_cpu(elem->phys_id); ··· 2325 2324 bool found = true; 2326 2325 2327 2326 switch (cap) { 2328 - case ICE_AQC_CAPS_VALID_FUNCTIONS: 2327 + case LIBIE_AQC_CAPS_VALID_FUNCTIONS: 2329 2328 caps->valid_functions = number; 2330 2329 ice_debug(hw, ICE_DBG_INIT, "%s: valid_functions (bitmap) = %d\n", prefix, 2331 2330 caps->valid_functions); 2332 2331 break; 2333 - case ICE_AQC_CAPS_SRIOV: 2332 + case LIBIE_AQC_CAPS_SRIOV: 2334 2333 caps->sr_iov_1_1 = (number == 1); 2335 2334 ice_debug(hw, ICE_DBG_INIT, "%s: sr_iov_1_1 = %d\n", prefix, 2336 2335 caps->sr_iov_1_1); 2337 2336 break; 2338 - case ICE_AQC_CAPS_DCB: 2337 + case LIBIE_AQC_CAPS_DCB: 2339 2338 caps->dcb = (number == 1); 2340 2339 caps->active_tc_bitmap = logical_id; 2341 2340 caps->maxtc = phys_id; ··· 2344 2343 caps->active_tc_bitmap); 2345 2344 ice_debug(hw, ICE_DBG_INIT, "%s: maxtc = %d\n", prefix, caps->maxtc); 2346 2345 break; 2347 - case ICE_AQC_CAPS_RSS: 2346 + case LIBIE_AQC_CAPS_RSS: 2348 2347 caps->rss_table_size = number; 2349 2348 caps->rss_table_entry_width = logical_id; 2350 2349 ice_debug(hw, ICE_DBG_INIT, "%s: rss_table_size = %d\n", prefix, ··· 2352 2351 ice_debug(hw, ICE_DBG_INIT, "%s: rss_table_entry_width = %d\n", prefix, 2353 2352 caps->rss_table_entry_width); 2354 2353 break; 2355 - case ICE_AQC_CAPS_RXQS: 2354 + case LIBIE_AQC_CAPS_RXQS: 2356 2355 caps->num_rxq = number; 2357 2356 caps->rxq_first_id = phys_id; 2358 2357 ice_debug(hw, ICE_DBG_INIT, "%s: num_rxq = %d\n", prefix, ··· 2360 2359 ice_debug(hw, ICE_DBG_INIT, "%s: rxq_first_id = %d\n", prefix, 2361 2360 caps->rxq_first_id); 2362 2361 break; 2363 - case ICE_AQC_CAPS_TXQS: 2362 + case LIBIE_AQC_CAPS_TXQS: 2364 2363 caps->num_txq = number; 2365 2364 caps->txq_first_id = phys_id; 2366 2365 ice_debug(hw, ICE_DBG_INIT, "%s: num_txq = %d\n", prefix, ··· 2368 2367 ice_debug(hw, ICE_DBG_INIT, "%s: txq_first_id = %d\n", prefix, 2369 2368 caps->txq_first_id); 2370 2369 break; 2371 - case ICE_AQC_CAPS_MSIX: 2370 + case LIBIE_AQC_CAPS_MSIX: 2372 2371 caps->num_msix_vectors = number; 2373 2372 caps->msix_vector_first_id = phys_id; 2374 2373 ice_debug(hw, ICE_DBG_INIT, "%s: num_msix_vectors = %d\n", prefix, ··· 2376 2375 ice_debug(hw, ICE_DBG_INIT, "%s: msix_vector_first_id = %d\n", prefix, 2377 2376 caps->msix_vector_first_id); 2378 2377 break; 2379 - case ICE_AQC_CAPS_PENDING_NVM_VER: 2378 + case LIBIE_AQC_CAPS_PENDING_NVM_VER: 2380 2379 caps->nvm_update_pending_nvm = true; 2381 2380 ice_debug(hw, ICE_DBG_INIT, "%s: update_pending_nvm\n", prefix); 2382 2381 break; 2383 - case ICE_AQC_CAPS_PENDING_OROM_VER: 2382 + case LIBIE_AQC_CAPS_PENDING_OROM_VER: 2384 2383 caps->nvm_update_pending_orom = true; 2385 2384 ice_debug(hw, ICE_DBG_INIT, "%s: update_pending_orom\n", prefix); 2386 2385 break; 2387 - case ICE_AQC_CAPS_PENDING_NET_VER: 2386 + case LIBIE_AQC_CAPS_PENDING_NET_VER: 2388 2387 caps->nvm_update_pending_netlist = true; 2389 2388 ice_debug(hw, ICE_DBG_INIT, "%s: update_pending_netlist\n", prefix); 2390 2389 break; 2391 - case ICE_AQC_CAPS_NVM_MGMT: 2390 + case LIBIE_AQC_CAPS_NVM_MGMT: 2392 2391 caps->nvm_unified_update = 2393 2392 (number & ICE_NVM_MGMT_UNIFIED_UPD_SUPPORT) ? 2394 2393 true : false; 2395 2394 ice_debug(hw, ICE_DBG_INIT, "%s: nvm_unified_update = %d\n", prefix, 2396 2395 caps->nvm_unified_update); 2397 2396 break; 2398 - case ICE_AQC_CAPS_RDMA: 2397 + case LIBIE_AQC_CAPS_RDMA: 2399 2398 if (IS_ENABLED(CONFIG_INFINIBAND_IRDMA)) 2400 2399 caps->rdma = (number == 1); 2401 2400 ice_debug(hw, ICE_DBG_INIT, "%s: rdma = %d\n", prefix, caps->rdma); 2402 2401 break; 2403 - case ICE_AQC_CAPS_MAX_MTU: 2402 + case LIBIE_AQC_CAPS_MAX_MTU: 2404 2403 caps->max_mtu = number; 2405 2404 ice_debug(hw, ICE_DBG_INIT, "%s: max_mtu = %d\n", 2406 2405 prefix, caps->max_mtu); 2407 2406 break; 2408 - case ICE_AQC_CAPS_PCIE_RESET_AVOIDANCE: 2407 + case LIBIE_AQC_CAPS_PCIE_RESET_AVOIDANCE: 2409 2408 caps->pcie_reset_avoidance = (number > 0); 2410 2409 ice_debug(hw, ICE_DBG_INIT, 2411 2410 "%s: pcie_reset_avoidance = %d\n", prefix, 2412 2411 caps->pcie_reset_avoidance); 2413 2412 break; 2414 - case ICE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT: 2413 + case LIBIE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT: 2415 2414 caps->reset_restrict_support = (number == 1); 2416 2415 ice_debug(hw, ICE_DBG_INIT, 2417 2416 "%s: reset_restrict_support = %d\n", prefix, 2418 2417 caps->reset_restrict_support); 2419 2418 break; 2420 - case ICE_AQC_CAPS_FW_LAG_SUPPORT: 2421 - caps->roce_lag = !!(number & ICE_AQC_BIT_ROCEV2_LAG); 2419 + case LIBIE_AQC_CAPS_FW_LAG_SUPPORT: 2420 + caps->roce_lag = !!(number & LIBIE_AQC_BIT_ROCEV2_LAG); 2422 2421 ice_debug(hw, ICE_DBG_INIT, "%s: roce_lag = %u\n", 2423 2422 prefix, caps->roce_lag); 2424 - caps->sriov_lag = !!(number & ICE_AQC_BIT_SRIOV_LAG); 2423 + caps->sriov_lag = !!(number & LIBIE_AQC_BIT_SRIOV_LAG); 2425 2424 ice_debug(hw, ICE_DBG_INIT, "%s: sriov_lag = %u\n", 2426 2425 prefix, caps->sriov_lag); 2427 2426 break; 2428 - case ICE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE: 2427 + case LIBIE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE: 2429 2428 caps->tx_sched_topo_comp_mode_en = (number == 1); 2430 2429 break; 2431 2430 default: ··· 2479 2478 */ 2480 2479 static void 2481 2480 ice_parse_vf_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p, 2482 - struct ice_aqc_list_caps_elem *cap) 2481 + struct libie_aqc_list_caps_elem *cap) 2483 2482 { 2484 2483 u32 logical_id = le32_to_cpu(cap->logical_id); 2485 2484 u32 number = le32_to_cpu(cap->number); ··· 2502 2501 */ 2503 2502 static void 2504 2503 ice_parse_vsi_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p, 2505 - struct ice_aqc_list_caps_elem *cap) 2504 + struct libie_aqc_list_caps_elem *cap) 2506 2505 { 2507 2506 func_p->guar_num_vsi = ice_get_num_per_func(hw, ICE_MAX_VSI); 2508 2507 ice_debug(hw, ICE_DBG_INIT, "func caps: guar_num_vsi (fw) = %d\n", ··· 2521 2520 */ 2522 2521 static void 2523 2522 ice_parse_1588_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p, 2524 - struct ice_aqc_list_caps_elem *cap) 2523 + struct libie_aqc_list_caps_elem *cap) 2525 2524 { 2526 2525 struct ice_ts_func_info *info = &func_p->ts_func_info; 2527 2526 u32 number = le32_to_cpu(cap->number); ··· 2620 2619 ice_parse_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p, 2621 2620 void *buf, u32 cap_count) 2622 2621 { 2623 - struct ice_aqc_list_caps_elem *cap_resp; 2622 + struct libie_aqc_list_caps_elem *cap_resp; 2624 2623 u32 i; 2625 2624 2626 2625 cap_resp = buf; ··· 2635 2634 &cap_resp[i], "func caps"); 2636 2635 2637 2636 switch (cap) { 2638 - case ICE_AQC_CAPS_VF: 2637 + case LIBIE_AQC_CAPS_VF: 2639 2638 ice_parse_vf_func_caps(hw, func_p, &cap_resp[i]); 2640 2639 break; 2641 - case ICE_AQC_CAPS_VSI: 2640 + case LIBIE_AQC_CAPS_VSI: 2642 2641 ice_parse_vsi_func_caps(hw, func_p, &cap_resp[i]); 2643 2642 break; 2644 - case ICE_AQC_CAPS_1588: 2643 + case LIBIE_AQC_CAPS_1588: 2645 2644 ice_parse_1588_func_caps(hw, func_p, &cap_resp[i]); 2646 2645 break; 2647 - case ICE_AQC_CAPS_FD: 2646 + case LIBIE_AQC_CAPS_FD: 2648 2647 ice_parse_fdir_func_caps(hw, func_p); 2649 2648 break; 2650 2649 default: ··· 2688 2687 */ 2689 2688 static void 2690 2689 ice_parse_valid_functions_cap(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, 2691 - struct ice_aqc_list_caps_elem *cap) 2690 + struct libie_aqc_list_caps_elem *cap) 2692 2691 { 2693 2692 u32 number = le32_to_cpu(cap->number); 2694 2693 ··· 2709 2708 */ 2710 2709 static void 2711 2710 ice_parse_vf_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, 2712 - struct ice_aqc_list_caps_elem *cap) 2711 + struct libie_aqc_list_caps_elem *cap) 2713 2712 { 2714 2713 u32 number = le32_to_cpu(cap->number); 2715 2714 ··· 2728 2727 */ 2729 2728 static void 2730 2729 ice_parse_vsi_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, 2731 - struct ice_aqc_list_caps_elem *cap) 2730 + struct libie_aqc_list_caps_elem *cap) 2732 2731 { 2733 2732 u32 number = le32_to_cpu(cap->number); 2734 2733 ··· 2747 2746 */ 2748 2747 static void 2749 2748 ice_parse_1588_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, 2750 - struct ice_aqc_list_caps_elem *cap) 2749 + struct libie_aqc_list_caps_elem *cap) 2751 2750 { 2752 2751 struct ice_ts_dev_info *info = &dev_p->ts_dev_info; 2753 2752 u32 logical_id = le32_to_cpu(cap->logical_id); ··· 2808 2807 */ 2809 2808 static void 2810 2809 ice_parse_fdir_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, 2811 - struct ice_aqc_list_caps_elem *cap) 2810 + struct libie_aqc_list_caps_elem *cap) 2812 2811 { 2813 2812 u32 number = le32_to_cpu(cap->number); 2814 2813 ··· 2828 2827 */ 2829 2828 static void 2830 2829 ice_parse_sensor_reading_cap(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, 2831 - struct ice_aqc_list_caps_elem *cap) 2830 + struct libie_aqc_list_caps_elem *cap) 2832 2831 { 2833 2832 dev_p->supported_sensors = le32_to_cpu(cap->number); 2834 2833 ··· 2847 2846 */ 2848 2847 static void ice_parse_nac_topo_dev_caps(struct ice_hw *hw, 2849 2848 struct ice_hw_dev_caps *dev_p, 2850 - struct ice_aqc_list_caps_elem *cap) 2849 + struct libie_aqc_list_caps_elem *cap) 2851 2850 { 2852 2851 dev_p->nac_topo.mode = le32_to_cpu(cap->number); 2853 2852 dev_p->nac_topo.id = le32_to_cpu(cap->phys_id) & ICE_NAC_TOPO_ID_M; ··· 2883 2882 ice_parse_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, 2884 2883 void *buf, u32 cap_count) 2885 2884 { 2886 - struct ice_aqc_list_caps_elem *cap_resp; 2885 + struct libie_aqc_list_caps_elem *cap_resp; 2887 2886 u32 i; 2888 2887 2889 2888 cap_resp = buf; ··· 2898 2897 &cap_resp[i], "dev caps"); 2899 2898 2900 2899 switch (cap) { 2901 - case ICE_AQC_CAPS_VALID_FUNCTIONS: 2900 + case LIBIE_AQC_CAPS_VALID_FUNCTIONS: 2902 2901 ice_parse_valid_functions_cap(hw, dev_p, &cap_resp[i]); 2903 2902 break; 2904 - case ICE_AQC_CAPS_VF: 2903 + case LIBIE_AQC_CAPS_VF: 2905 2904 ice_parse_vf_dev_caps(hw, dev_p, &cap_resp[i]); 2906 2905 break; 2907 - case ICE_AQC_CAPS_VSI: 2906 + case LIBIE_AQC_CAPS_VSI: 2908 2907 ice_parse_vsi_dev_caps(hw, dev_p, &cap_resp[i]); 2909 2908 break; 2910 - case ICE_AQC_CAPS_1588: 2909 + case LIBIE_AQC_CAPS_1588: 2911 2910 ice_parse_1588_dev_caps(hw, dev_p, &cap_resp[i]); 2912 2911 break; 2913 - case ICE_AQC_CAPS_FD: 2912 + case LIBIE_AQC_CAPS_FD: 2914 2913 ice_parse_fdir_dev_caps(hw, dev_p, &cap_resp[i]); 2915 2914 break; 2916 - case ICE_AQC_CAPS_SENSOR_READING: 2915 + case LIBIE_AQC_CAPS_SENSOR_READING: 2917 2916 ice_parse_sensor_reading_cap(hw, dev_p, &cap_resp[i]); 2918 2917 break; 2919 - case ICE_AQC_CAPS_NAC_TOPOLOGY: 2918 + case LIBIE_AQC_CAPS_NAC_TOPOLOGY: 2920 2919 ice_parse_nac_topo_dev_caps(hw, dev_p, &cap_resp[i]); 2921 2920 break; 2922 2921 default: ··· 3036 3035 ice_aq_list_caps(struct ice_hw *hw, void *buf, u16 buf_size, u32 *cap_count, 3037 3036 enum ice_adminq_opc opc, struct ice_sq_cd *cd) 3038 3037 { 3039 - struct ice_aqc_list_caps *cmd; 3040 - struct ice_aq_desc desc; 3038 + struct libie_aqc_list_caps *cmd; 3039 + struct libie_aq_desc desc; 3041 3040 int status; 3042 3041 3043 3042 cmd = &desc.params.get_cap; ··· 3078 3077 * device will return, we can simply send a 4KB buffer, the maximum 3079 3078 * possible size that firmware can return. 3080 3079 */ 3081 - cap_count = ICE_AQ_MAX_BUF_LEN / sizeof(struct ice_aqc_list_caps_elem); 3080 + cap_count = ICE_AQ_MAX_BUF_LEN / sizeof(struct libie_aqc_list_caps_elem); 3082 3081 3083 3082 status = ice_aq_list_caps(hw, cbuf, ICE_AQ_MAX_BUF_LEN, &cap_count, 3084 3083 ice_aqc_opc_list_dev_caps, NULL); ··· 3112 3111 * device will return, we can simply send a 4KB buffer, the maximum 3113 3112 * possible size that firmware can return. 3114 3113 */ 3115 - cap_count = ICE_AQ_MAX_BUF_LEN / sizeof(struct ice_aqc_list_caps_elem); 3114 + cap_count = ICE_AQ_MAX_BUF_LEN / sizeof(struct libie_aqc_list_caps_elem); 3116 3115 3117 3116 status = ice_aq_list_caps(hw, cbuf, ICE_AQ_MAX_BUF_LEN, &cap_count, 3118 3117 ice_aqc_opc_list_func_caps, NULL); ··· 3221 3220 struct ice_sq_cd *cd) 3222 3221 { 3223 3222 struct ice_aqc_manage_mac_write *cmd; 3224 - struct ice_aq_desc desc; 3223 + struct libie_aq_desc desc; 3225 3224 3226 - cmd = &desc.params.mac_write; 3225 + cmd = libie_aq_raw(&desc); 3227 3226 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_manage_mac_write); 3228 3227 3229 3228 cmd->flags = flags; ··· 3240 3239 */ 3241 3240 static int ice_aq_clear_pxe_mode(struct ice_hw *hw) 3242 3241 { 3243 - struct ice_aq_desc desc; 3242 + struct ice_aqc_clear_pxe *cmd; 3243 + struct libie_aq_desc desc; 3244 3244 3245 + cmd = libie_aq_raw(&desc); 3245 3246 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_clear_pxe_mode); 3246 - desc.params.clear_pxe.rx_cnt = ICE_AQC_CLEAR_PXE_RX_CNT; 3247 + cmd->rx_cnt = ICE_AQC_CLEAR_PXE_RX_CNT; 3247 3248 3248 3249 return ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); 3249 3250 } ··· 3278 3275 { 3279 3276 struct ice_aqc_set_port_params *cmd; 3280 3277 struct ice_hw *hw = pi->hw; 3281 - struct ice_aq_desc desc; 3278 + struct libie_aq_desc desc; 3282 3279 u16 cmd_flags = 0; 3283 3280 3284 - cmd = &desc.params.set_port_params; 3281 + cmd = libie_aq_raw(&desc); 3285 3282 3286 3283 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_port_params); 3287 3284 if (double_vlan) ··· 3518 3515 ice_aq_set_phy_cfg(struct ice_hw *hw, struct ice_port_info *pi, 3519 3516 struct ice_aqc_set_phy_cfg_data *cfg, struct ice_sq_cd *cd) 3520 3517 { 3521 - struct ice_aq_desc desc; 3518 + struct ice_aqc_set_phy_cfg *cmd; 3519 + struct libie_aq_desc desc; 3522 3520 int status; 3523 3521 3524 3522 if (!cfg) ··· 3534 3530 } 3535 3531 3536 3532 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_phy_cfg); 3537 - desc.params.set_phy.lport_num = pi->lport; 3538 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 3533 + cmd = libie_aq_raw(&desc); 3534 + cmd->lport_num = pi->lport; 3535 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 3539 3536 3540 3537 ice_debug(hw, ICE_DBG_LINK, "set phy cfg\n"); 3541 3538 ice_debug(hw, ICE_DBG_LINK, " phy_type_low = 0x%llx\n", ··· 3552 3547 cfg->link_fec_opt); 3553 3548 3554 3549 status = ice_aq_send_cmd(hw, &desc, cfg, sizeof(*cfg), cd); 3555 - if (hw->adminq.sq_last_status == ICE_AQ_RC_EMODE) 3550 + if (hw->adminq.sq_last_status == LIBIE_AQ_RC_EMODE) 3556 3551 status = 0; 3557 3552 3558 3553 if (!status) ··· 3609 3604 { 3610 3605 struct ice_aqc_dnl_call_command *cmd; 3611 3606 struct ice_aqc_dnl_call buf = {}; 3612 - struct ice_aq_desc desc; 3607 + struct libie_aq_desc desc; 3613 3608 int err; 3614 3609 3615 3610 buf.sto.txrx_equa_reqs.data_in = cpu_to_le16(data_in); 3616 3611 buf.sto.txrx_equa_reqs.op_code_serdes_sel = 3617 3612 cpu_to_le16(op_code | (serdes_num & 0xF)); 3618 - cmd = &desc.params.dnl_call; 3613 + cmd = libie_aq_raw(&desc); 3619 3614 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_dnl_call); 3620 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_BUF | 3621 - ICE_AQ_FLAG_RD | 3622 - ICE_AQ_FLAG_SI); 3615 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_BUF | 3616 + LIBIE_AQ_FLAG_RD | 3617 + LIBIE_AQ_FLAG_SI); 3623 3618 desc.datalen = cpu_to_le16(sizeof(struct ice_aqc_dnl_call)); 3624 3619 cmd->activity_id = cpu_to_le16(ICE_AQC_ACT_ID_DNL); 3625 3620 ··· 3657 3652 int ice_aq_get_fec_stats(struct ice_hw *hw, u16 pcs_quad, u16 pcs_port, 3658 3653 enum ice_fec_stats_types fec_type, u32 *output) 3659 3654 { 3660 - u16 flag = (ICE_AQ_FLAG_RD | ICE_AQ_FLAG_BUF | ICE_AQ_FLAG_SI); 3655 + u16 flag = (LIBIE_AQ_FLAG_RD | LIBIE_AQ_FLAG_BUF | LIBIE_AQ_FLAG_SI); 3661 3656 struct ice_sbq_msg_input msg = {}; 3662 3657 u32 receiver_id, reg_offset; 3663 3658 int err; ··· 4080 4075 struct ice_sq_cd *cd) 4081 4076 { 4082 4077 struct ice_aqc_restart_an *cmd; 4083 - struct ice_aq_desc desc; 4078 + struct libie_aq_desc desc; 4084 4079 4085 - cmd = &desc.params.restart_an; 4080 + cmd = libie_aq_raw(&desc); 4086 4081 4087 4082 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_restart_an); 4088 4083 ··· 4110 4105 struct ice_sq_cd *cd) 4111 4106 { 4112 4107 struct ice_aqc_set_event_mask *cmd; 4113 - struct ice_aq_desc desc; 4108 + struct libie_aq_desc desc; 4114 4109 4115 - cmd = &desc.params.set_event_mask; 4110 + cmd = libie_aq_raw(&desc); 4116 4111 4117 4112 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_event_mask); 4118 4113 ··· 4134 4129 ice_aq_set_mac_loopback(struct ice_hw *hw, bool ena_lpbk, struct ice_sq_cd *cd) 4135 4130 { 4136 4131 struct ice_aqc_set_mac_lb *cmd; 4137 - struct ice_aq_desc desc; 4132 + struct libie_aq_desc desc; 4138 4133 4139 - cmd = &desc.params.set_mac_lb; 4134 + cmd = libie_aq_raw(&desc); 4140 4135 4141 4136 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_mac_lb); 4142 4137 if (ena_lpbk) ··· 4159 4154 { 4160 4155 struct ice_aqc_set_port_id_led *cmd; 4161 4156 struct ice_hw *hw = pi->hw; 4162 - struct ice_aq_desc desc; 4157 + struct libie_aq_desc desc; 4163 4158 4164 - cmd = &desc.params.set_port_id_led; 4159 + cmd = libie_aq_raw(&desc); 4165 4160 4166 4161 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_port_id_led); 4167 4162 ··· 4197 4192 u8 *pending_option_idx, bool *pending_option_valid) 4198 4193 { 4199 4194 struct ice_aqc_get_port_options *cmd; 4200 - struct ice_aq_desc desc; 4195 + struct libie_aq_desc desc; 4201 4196 int status; 4202 4197 u8 i; 4203 4198 ··· 4205 4200 if (*option_count < ICE_AQC_PORT_OPT_COUNT_M) 4206 4201 return -EINVAL; 4207 4202 4208 - cmd = &desc.params.get_port_options; 4203 + cmd = libie_aq_raw(&desc); 4209 4204 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_port_options); 4210 4205 4211 4206 if (lport_valid) ··· 4271 4266 u8 new_option) 4272 4267 { 4273 4268 struct ice_aqc_set_port_option *cmd; 4274 - struct ice_aq_desc desc; 4269 + struct libie_aq_desc desc; 4275 4270 4276 4271 if (new_option > ICE_AQC_PORT_OPT_COUNT_M) 4277 4272 return -EINVAL; 4278 4273 4279 - cmd = &desc.params.set_port_option; 4274 + cmd = libie_aq_raw(&desc); 4280 4275 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_port_option); 4281 4276 4282 4277 if (lport_valid) ··· 4362 4357 bool write, struct ice_sq_cd *cd) 4363 4358 { 4364 4359 struct ice_aqc_sff_eeprom *cmd; 4365 - struct ice_aq_desc desc; 4360 + struct libie_aq_desc desc; 4366 4361 u16 i2c_bus_addr; 4367 4362 int status; 4368 4363 ··· 4370 4365 return -EINVAL; 4371 4366 4372 4367 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_sff_eeprom); 4373 - cmd = &desc.params.read_write_sff_param; 4374 - desc.flags = cpu_to_le16(ICE_AQ_FLAG_RD); 4368 + cmd = libie_aq_raw(&desc); 4369 + desc.flags = cpu_to_le16(LIBIE_AQ_FLAG_RD); 4375 4370 cmd->lport_num = (u8)(lport & 0xff); 4376 4371 cmd->lport_num_valid = (u8)((lport >> 8) & 0x01); 4377 4372 i2c_bus_addr = FIELD_PREP(ICE_AQC_SFF_I2CBUS_7BIT_M, bus_addr >> 1) | ··· 4431 4426 struct ice_aqc_get_set_rss_lut *desc_params; 4432 4427 enum ice_aqc_lut_flags flags; 4433 4428 enum ice_lut_size lut_size; 4434 - struct ice_aq_desc desc; 4429 + struct libie_aq_desc desc; 4435 4430 u8 *lut = params->lut; 4436 4431 4437 4432 ··· 4447 4442 opcode = set ? ice_aqc_opc_set_rss_lut : ice_aqc_opc_get_rss_lut; 4448 4443 ice_fill_dflt_direct_cmd_desc(&desc, opcode); 4449 4444 if (set) 4450 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 4445 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 4451 4446 4452 - desc_params = &desc.params.get_set_rss_lut; 4447 + desc_params = libie_aq_raw(&desc); 4453 4448 vsi_id = ice_get_hw_vsi_num(hw, vsi_handle); 4454 4449 desc_params->vsi_id = cpu_to_le16(vsi_id | ICE_AQC_RSS_VSI_VALID); 4455 4450 ··· 4504 4499 { 4505 4500 struct ice_aqc_get_set_rss_key *desc_params; 4506 4501 u16 key_size = sizeof(*key); 4507 - struct ice_aq_desc desc; 4502 + struct libie_aq_desc desc; 4508 4503 4509 4504 if (set) { 4510 4505 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_rss_key); 4511 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 4506 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 4512 4507 } else { 4513 4508 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_rss_key); 4514 4509 } 4515 4510 4516 - desc_params = &desc.params.get_set_rss_key; 4511 + desc_params = libie_aq_raw(&desc); 4517 4512 desc_params->vsi_id = cpu_to_le16(vsi_id | ICE_AQC_RSS_VSI_VALID); 4518 4513 4519 4514 return ice_aq_send_cmd(hw, &desc, key, key_size, NULL); ··· 4585 4580 { 4586 4581 struct ice_aqc_add_tx_qgrp *list; 4587 4582 struct ice_aqc_add_txqs *cmd; 4588 - struct ice_aq_desc desc; 4583 + struct libie_aq_desc desc; 4589 4584 u16 i, sum_size = 0; 4590 4585 4591 - cmd = &desc.params.add_txqs; 4586 + cmd = libie_aq_raw(&desc); 4592 4587 4593 4588 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_add_txqs); 4594 4589 ··· 4607 4602 if (buf_size != sum_size) 4608 4603 return -EINVAL; 4609 4604 4610 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 4605 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 4611 4606 4612 4607 cmd->num_qgrps = num_qgrps; 4613 4608 ··· 4634 4629 { 4635 4630 struct ice_aqc_dis_txq_item *item; 4636 4631 struct ice_aqc_dis_txqs *cmd; 4637 - struct ice_aq_desc desc; 4632 + struct libie_aq_desc desc; 4638 4633 u16 vmvf_and_timeout; 4639 4634 u16 i, sz = 0; 4640 4635 int status; 4641 4636 4642 - cmd = &desc.params.dis_txqs; 4637 + cmd = libie_aq_raw(&desc); 4643 4638 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_dis_txqs); 4644 4639 4645 4640 /* qg_list can be NULL only in VM/VF reset flow */ ··· 4680 4675 /* set RD bit to indicate that command buffer is provided by the driver 4681 4676 * and it needs to be read by the firmware 4682 4677 */ 4683 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 4678 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 4684 4679 4685 4680 for (i = 0, item = qg_list; i < num_qgrps; i++) { 4686 4681 u16 item_size = struct_size(item, q_id, item->num_qs); ··· 4732 4727 struct ice_sq_cd *cd) 4733 4728 { 4734 4729 struct ice_aqc_cfg_txqs *cmd; 4735 - struct ice_aq_desc desc; 4730 + struct libie_aq_desc desc; 4736 4731 int status; 4737 4732 4738 - cmd = &desc.params.cfg_txqs; 4733 + cmd = libie_aq_raw(&desc); 4739 4734 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_cfg_txqs); 4740 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 4735 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 4741 4736 4742 4737 if (!buf) 4743 4738 return -EINVAL; ··· 4773 4768 { 4774 4769 struct ice_aqc_add_rdma_qset_data *list; 4775 4770 struct ice_aqc_add_rdma_qset *cmd; 4776 - struct ice_aq_desc desc; 4771 + struct libie_aq_desc desc; 4777 4772 u16 i, sum_size = 0; 4778 4773 4779 - cmd = &desc.params.add_rdma_qset; 4774 + cmd = libie_aq_raw(&desc); 4780 4775 4781 4776 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_add_rdma_qset); 4782 4777 ··· 4794 4789 if (buf_size != sum_size) 4795 4790 return -EINVAL; 4796 4791 4797 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 4792 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 4798 4793 4799 4794 cmd->num_qset_grps = num_qset_grps; 4800 4795 ··· 5228 5223 u16 meas_num) 5229 5224 { 5230 5225 struct ice_aqc_get_cgu_input_measure *cmd; 5231 - struct ice_aq_desc desc; 5226 + struct libie_aq_desc desc; 5232 5227 5233 5228 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_cgu_input_measure); 5234 - cmd = &desc.params.get_cgu_input_measure; 5229 + cmd = libie_aq_raw(&desc); 5235 5230 cmd->dpll_idx_opt = dpll_idx & ICE_AQC_GET_CGU_IN_MEAS_DPLL_IDX_M; 5236 5231 5237 5232 return ice_aq_send_cmd(hw, &desc, meas, meas_num * sizeof(*meas), NULL); ··· 5249 5244 ice_aq_get_cgu_abilities(struct ice_hw *hw, 5250 5245 struct ice_aqc_get_cgu_abilities *abilities) 5251 5246 { 5252 - struct ice_aq_desc desc; 5247 + struct libie_aq_desc desc; 5253 5248 5254 5249 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_cgu_abilities); 5255 5250 return ice_aq_send_cmd(hw, &desc, abilities, sizeof(*abilities), NULL); ··· 5272 5267 u32 freq, s32 phase_delay) 5273 5268 { 5274 5269 struct ice_aqc_set_cgu_input_config *cmd; 5275 - struct ice_aq_desc desc; 5270 + struct libie_aq_desc desc; 5276 5271 5277 5272 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_cgu_input_config); 5278 - cmd = &desc.params.set_cgu_input_config; 5273 + cmd = libie_aq_raw(&desc); 5279 5274 cmd->input_idx = input_idx; 5280 5275 cmd->flags1 = flags1; 5281 5276 cmd->flags2 = flags2; ··· 5304 5299 u8 *flags1, u8 *flags2, u32 *freq, s32 *phase_delay) 5305 5300 { 5306 5301 struct ice_aqc_get_cgu_input_config *cmd; 5307 - struct ice_aq_desc desc; 5302 + struct libie_aq_desc desc; 5308 5303 int ret; 5309 5304 5310 5305 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_cgu_input_config); 5311 - cmd = &desc.params.get_cgu_input_config; 5306 + cmd = libie_aq_raw(&desc); 5312 5307 cmd->input_idx = input_idx; 5313 5308 5314 5309 ret = ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); ··· 5347 5342 u8 src_sel, u32 freq, s32 phase_delay) 5348 5343 { 5349 5344 struct ice_aqc_set_cgu_output_config *cmd; 5350 - struct ice_aq_desc desc; 5345 + struct libie_aq_desc desc; 5351 5346 5352 5347 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_cgu_output_config); 5353 - cmd = &desc.params.set_cgu_output_config; 5348 + cmd = libie_aq_raw(&desc); 5354 5349 cmd->output_idx = output_idx; 5355 5350 cmd->flags = flags; 5356 5351 cmd->src_sel = src_sel; ··· 5377 5372 u8 *src_sel, u32 *freq, u32 *src_freq) 5378 5373 { 5379 5374 struct ice_aqc_get_cgu_output_config *cmd; 5380 - struct ice_aq_desc desc; 5375 + struct libie_aq_desc desc; 5381 5376 int ret; 5382 5377 5383 5378 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_cgu_output_config); 5384 - cmd = &desc.params.get_cgu_output_config; 5379 + cmd = libie_aq_raw(&desc); 5385 5380 cmd->output_idx = output_idx; 5386 5381 5387 5382 ret = ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); ··· 5418 5413 u8 *eec_mode) 5419 5414 { 5420 5415 struct ice_aqc_get_cgu_dpll_status *cmd; 5421 - struct ice_aq_desc desc; 5416 + struct libie_aq_desc desc; 5422 5417 int status; 5423 5418 5424 5419 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_cgu_dpll_status); 5425 - cmd = &desc.params.get_cgu_dpll_status; 5420 + cmd = libie_aq_raw(&desc); 5426 5421 cmd->dpll_num = dpll_num; 5427 5422 5428 5423 status = ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); ··· 5456 5451 u8 config, u8 eec_mode) 5457 5452 { 5458 5453 struct ice_aqc_set_cgu_dpll_config *cmd; 5459 - struct ice_aq_desc desc; 5454 + struct libie_aq_desc desc; 5460 5455 5461 5456 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_cgu_dpll_config); 5462 - cmd = &desc.params.set_cgu_dpll_config; 5457 + cmd = libie_aq_raw(&desc); 5463 5458 cmd->dpll_num = dpll_num; 5464 5459 cmd->ref_state = ref_state; 5465 5460 cmd->config = config; ··· 5483 5478 u8 ref_priority) 5484 5479 { 5485 5480 struct ice_aqc_set_cgu_ref_prio *cmd; 5486 - struct ice_aq_desc desc; 5481 + struct libie_aq_desc desc; 5487 5482 5488 5483 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_cgu_ref_prio); 5489 - cmd = &desc.params.set_cgu_ref_prio; 5484 + cmd = libie_aq_raw(&desc); 5490 5485 cmd->dpll_num = dpll_num; 5491 5486 cmd->ref_idx = ref_idx; 5492 5487 cmd->ref_priority = ref_priority; ··· 5509 5504 u8 *ref_prio) 5510 5505 { 5511 5506 struct ice_aqc_get_cgu_ref_prio *cmd; 5512 - struct ice_aq_desc desc; 5507 + struct libie_aq_desc desc; 5513 5508 int status; 5514 5509 5515 5510 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_cgu_ref_prio); 5516 - cmd = &desc.params.get_cgu_ref_prio; 5511 + cmd = libie_aq_raw(&desc); 5517 5512 cmd->dpll_num = dpll_num; 5518 5513 cmd->ref_idx = ref_idx; 5519 5514 ··· 5539 5534 u32 *cgu_fw_ver) 5540 5535 { 5541 5536 struct ice_aqc_get_cgu_info *cmd; 5542 - struct ice_aq_desc desc; 5537 + struct libie_aq_desc desc; 5543 5538 int status; 5544 5539 5545 5540 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_cgu_info); 5546 - cmd = &desc.params.get_cgu_info; 5541 + cmd = libie_aq_raw(&desc); 5547 5542 5548 5543 status = ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); 5549 5544 if (!status) { ··· 5570 5565 u32 *freq) 5571 5566 { 5572 5567 struct ice_aqc_set_phy_rec_clk_out *cmd; 5573 - struct ice_aq_desc desc; 5568 + struct libie_aq_desc desc; 5574 5569 int status; 5575 5570 5576 5571 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_phy_rec_clk_out); 5577 - cmd = &desc.params.set_phy_rec_clk_out; 5572 + cmd = libie_aq_raw(&desc); 5578 5573 cmd->phy_output = phy_output; 5579 5574 cmd->port_num = ICE_AQC_SET_PHY_REC_CLK_OUT_CURR_PORT; 5580 5575 cmd->flags = enable & ICE_AQC_SET_PHY_REC_CLK_OUT_OUT_EN; ··· 5603 5598 u8 *flags, u16 *node_handle) 5604 5599 { 5605 5600 struct ice_aqc_get_phy_rec_clk_out *cmd; 5606 - struct ice_aq_desc desc; 5601 + struct libie_aq_desc desc; 5607 5602 int status; 5608 5603 5609 5604 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_phy_rec_clk_out); 5610 - cmd = &desc.params.get_phy_rec_clk_out; 5605 + cmd = libie_aq_raw(&desc); 5611 5606 cmd->phy_output = *phy_output; 5612 5607 5613 5608 status = ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); ··· 5635 5630 struct ice_aqc_get_sensor_reading_resp *data) 5636 5631 { 5637 5632 struct ice_aqc_get_sensor_reading *cmd; 5638 - struct ice_aq_desc desc; 5633 + struct libie_aq_desc desc; 5639 5634 int status; 5640 5635 5641 5636 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_sensor_reading); 5642 - cmd = &desc.params.get_sensor_reading; 5637 + cmd = libie_aq_raw(&desc); 5643 5638 #define ICE_INTERNAL_TEMP_SENSOR_FORMAT 0 5644 5639 #define ICE_INTERNAL_TEMP_SENSOR 0 5645 5640 cmd->sensor = ICE_INTERNAL_TEMP_SENSOR; ··· 5647 5642 5648 5643 status = ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); 5649 5644 if (!status) 5650 - memcpy(data, &desc.params.get_sensor_reading_resp, 5645 + memcpy(data, &desc.params.raw, 5651 5646 sizeof(*data)); 5652 5647 5653 5648 return status; ··· 5844 5839 u16 bus_addr, __le16 addr, u8 params, u8 *data, 5845 5840 struct ice_sq_cd *cd) 5846 5841 { 5847 - struct ice_aq_desc desc = { 0 }; 5842 + struct libie_aq_desc desc = { 0 }; 5848 5843 struct ice_aqc_i2c *cmd; 5849 5844 u8 data_size; 5850 5845 int status; 5851 5846 5852 5847 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_read_i2c); 5853 - cmd = &desc.params.read_write_i2c; 5848 + cmd = libie_aq_raw(&desc); 5854 5849 5855 5850 if (!data) 5856 5851 return -EINVAL; ··· 5867 5862 struct ice_aqc_read_i2c_resp *resp; 5868 5863 u8 i; 5869 5864 5870 - resp = &desc.params.read_i2c_resp; 5865 + resp = libie_aq_raw(&desc); 5871 5866 for (i = 0; i < data_size; i++) { 5872 5867 *data = resp->i2c_data[i]; 5873 5868 data++; ··· 5899 5894 u16 bus_addr, __le16 addr, u8 params, const u8 *data, 5900 5895 struct ice_sq_cd *cd) 5901 5896 { 5902 - struct ice_aq_desc desc = { 0 }; 5897 + struct libie_aq_desc desc = { 0 }; 5903 5898 struct ice_aqc_i2c *cmd; 5904 5899 u8 data_size; 5905 5900 5906 5901 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_write_i2c); 5907 - cmd = &desc.params.read_write_i2c; 5902 + cmd = libie_aq_raw(&desc); 5908 5903 5909 5904 data_size = FIELD_GET(ICE_AQC_I2C_DATA_SIZE_M, params); 5910 5905 ··· 5936 5931 int ice_get_pca9575_handle(struct ice_hw *hw, u16 *pca9575_handle) 5937 5932 { 5938 5933 struct ice_aqc_get_link_topo *cmd; 5939 - struct ice_aq_desc desc; 5934 + struct libie_aq_desc desc; 5940 5935 int err; 5941 5936 u8 idx; 5942 5937 ··· 5959 5954 5960 5955 /* If handle was not detected read it from the netlist */ 5961 5956 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_topo); 5962 - cmd = &desc.params.get_link_topo; 5957 + cmd = libie_aq_raw(&desc); 5963 5958 cmd->addr.topo_params.node_type_ctx = 5964 5959 ICE_AQC_LINK_TOPO_NODE_TYPE_GPIO_CTRL; 5965 5960 cmd->addr.topo_params.index = idx; ··· 5969 5964 return -ENXIO; 5970 5965 5971 5966 /* Verify if we found the right IO expander type */ 5972 - if (desc.params.get_link_topo.node_part_num != 5973 - ICE_AQC_GET_LINK_TOPO_NODE_NR_PCA9575) 5967 + if (cmd->node_part_num != ICE_AQC_GET_LINK_TOPO_NODE_NR_PCA9575) 5974 5968 return -ENXIO; 5975 5969 5976 5970 /* If present save the handle and return it */ 5977 5971 hw->io_expander_handle = 5978 - le16_to_cpu(desc.params.get_link_topo.addr.handle); 5972 + le16_to_cpu(cmd->addr.handle); 5979 5973 *pca9575_handle = hw->io_expander_handle; 5980 5974 5981 5975 return 0; ··· 6025 6021 ice_aq_set_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, bool value, 6026 6022 struct ice_sq_cd *cd) 6027 6023 { 6024 + struct libie_aq_desc desc; 6028 6025 struct ice_aqc_gpio *cmd; 6029 - struct ice_aq_desc desc; 6030 6026 6031 6027 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_gpio); 6032 - cmd = &desc.params.read_write_gpio; 6028 + cmd = libie_aq_raw(&desc); 6033 6029 cmd->gpio_ctrl_handle = cpu_to_le16(gpio_ctrl_handle); 6034 6030 cmd->gpio_num = pin_idx; 6035 6031 cmd->gpio_val = value ? 1 : 0; ··· 6052 6048 ice_aq_get_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, 6053 6049 bool *value, struct ice_sq_cd *cd) 6054 6050 { 6051 + struct libie_aq_desc desc; 6055 6052 struct ice_aqc_gpio *cmd; 6056 - struct ice_aq_desc desc; 6057 6053 int status; 6058 6054 6059 6055 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_gpio); 6060 - cmd = &desc.params.read_write_gpio; 6056 + cmd = libie_aq_raw(&desc); 6061 6057 cmd->gpio_ctrl_handle = cpu_to_le16(gpio_ctrl_handle); 6062 6058 cmd->gpio_num = pin_idx; 6063 6059 ··· 6220 6216 int ice_aq_set_health_status_cfg(struct ice_hw *hw, u8 event_source) 6221 6217 { 6222 6218 struct ice_aqc_set_health_status_cfg *cmd; 6223 - struct ice_aq_desc desc; 6219 + struct libie_aq_desc desc; 6224 6220 6225 - cmd = &desc.params.set_health_status_cfg; 6221 + cmd = libie_aq_raw(&desc); 6226 6222 6227 6223 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_health_status_cfg); 6228 6224 ··· 6246 6242 struct ice_sq_cd *cd) 6247 6243 { 6248 6244 struct ice_aqc_lldp_set_local_mib *cmd; 6249 - struct ice_aq_desc desc; 6245 + struct libie_aq_desc desc; 6250 6246 6251 - cmd = &desc.params.lldp_set_mib; 6247 + cmd = libie_aq_raw(&desc); 6252 6248 6253 6249 if (buf_size == 0 || !buf) 6254 6250 return -EINVAL; 6255 6251 6256 6252 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_set_local_mib); 6257 6253 6258 - desc.flags |= cpu_to_le16((u16)ICE_AQ_FLAG_RD); 6254 + desc.flags |= cpu_to_le16((u16)LIBIE_AQ_FLAG_RD); 6259 6255 desc.datalen = cpu_to_le16(buf_size); 6260 6256 6261 6257 cmd->type = mib_type; ··· 6291 6287 int ice_lldp_fltr_add_remove(struct ice_hw *hw, struct ice_vsi *vsi, bool add) 6292 6288 { 6293 6289 struct ice_aqc_lldp_filter_ctrl *cmd; 6294 - struct ice_aq_desc desc; 6290 + struct libie_aq_desc desc; 6295 6291 6296 6292 if (vsi->type != ICE_VSI_PF || !ice_fw_supports_lldp_fltr_ctrl(hw)) 6297 6293 return -EOPNOTSUPP; 6298 6294 6299 - cmd = &desc.params.lldp_filter_ctrl; 6295 + cmd = libie_aq_raw(&desc); 6300 6296 6301 6297 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_filter_ctrl); 6302 6298 ··· 6316 6312 */ 6317 6313 int ice_lldp_execute_pending_mib(struct ice_hw *hw) 6318 6314 { 6319 - struct ice_aq_desc desc; 6315 + struct libie_aq_desc desc; 6320 6316 6321 6317 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_execute_pending_mib); 6322 6318 ··· 6393 6389 }; 6394 6390 int err; 6395 6391 6396 - err = ice_sbq_rw_reg(hw, &cgu_msg, ICE_AQ_FLAG_RD); 6392 + err = ice_sbq_rw_reg(hw, &cgu_msg, LIBIE_AQ_FLAG_RD); 6397 6393 if (err) { 6398 6394 ice_debug(hw, ICE_DBG_PTP, "Failed to read CGU register 0x%04x, err %d\n", 6399 6395 addr, err); ··· 6426 6422 }; 6427 6423 int err; 6428 6424 6429 - err = ice_sbq_rw_reg(hw, &cgu_msg, ICE_AQ_FLAG_RD); 6425 + err = ice_sbq_rw_reg(hw, &cgu_msg, LIBIE_AQ_FLAG_RD); 6430 6426 if (err) 6431 6427 ice_debug(hw, ICE_DBG_PTP, "Failed to write CGU register 0x%04x, err %d\n", 6432 6428 addr, err);
+3 -3
drivers/net/ethernet/intel/ice/ice_common.h
··· 109 109 struct ice_ctl_q_info *ice_get_sbq(struct ice_hw *hw); 110 110 int 111 111 ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq, 112 - struct ice_aq_desc *desc, void *buf, u16 buf_size, 112 + struct libie_aq_desc *desc, void *buf, u16 buf_size, 113 113 struct ice_sq_cd *cd); 114 114 void ice_clear_pxe_mode(struct ice_hw *hw); 115 115 int ice_get_caps(struct ice_hw *hw); ··· 138 138 139 139 bool ice_check_sq_alive(struct ice_hw *hw, struct ice_ctl_q_info *cq); 140 140 int ice_aq_q_shutdown(struct ice_hw *hw, bool unloading); 141 - void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode); 141 + void ice_fill_dflt_direct_cmd_desc(struct libie_aq_desc *desc, u16 opcode); 142 142 143 143 void ice_pack_txq_ctx(const struct ice_tlan_ctx *ctx, ice_txq_ctx_buf_t *buf); 144 144 145 145 extern struct mutex ice_global_cfg_lock_sw; 146 146 147 147 int 148 - ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, 148 + ice_aq_send_cmd(struct ice_hw *hw, struct libie_aq_desc *desc, 149 149 void *buf, u16 buf_size, struct ice_sq_cd *cd); 150 150 int ice_aq_get_fw_ver(struct ice_hw *hw, struct ice_sq_cd *cd); 151 151
+27 -26
drivers/net/ethernet/intel/ice/ice_controlq.c
··· 90 90 static int 91 91 ice_alloc_ctrlq_sq_ring(struct ice_hw *hw, struct ice_ctl_q_info *cq) 92 92 { 93 - size_t size = cq->num_sq_entries * sizeof(struct ice_aq_desc); 93 + size_t size = cq->num_sq_entries * sizeof(struct libie_aq_desc); 94 94 95 95 cq->sq.desc_buf.va = dmam_alloc_coherent(ice_hw_to_dev(hw), size, 96 96 &cq->sq.desc_buf.pa, ··· 110 110 static int 111 111 ice_alloc_ctrlq_rq_ring(struct ice_hw *hw, struct ice_ctl_q_info *cq) 112 112 { 113 - size_t size = cq->num_rq_entries * sizeof(struct ice_aq_desc); 113 + size_t size = cq->num_rq_entries * sizeof(struct libie_aq_desc); 114 114 115 115 cq->rq.desc_buf.va = dmam_alloc_coherent(ice_hw_to_dev(hw), size, 116 116 &cq->rq.desc_buf.pa, ··· 159 159 160 160 /* allocate the mapped buffers */ 161 161 for (i = 0; i < cq->num_rq_entries; i++) { 162 - struct ice_aq_desc *desc; 162 + struct libie_aq_desc *desc; 163 163 struct ice_dma_mem *bi; 164 164 165 165 bi = &cq->rq.r.rq_bi[i]; ··· 173 173 /* now configure the descriptors for use */ 174 174 desc = ICE_CTL_Q_DESC(cq->rq, i); 175 175 176 - desc->flags = cpu_to_le16(ICE_AQ_FLAG_BUF); 177 - if (cq->rq_buf_size > ICE_AQ_LG_BUF) 178 - desc->flags |= cpu_to_le16(ICE_AQ_FLAG_LB); 176 + desc->flags = cpu_to_le16(LIBIE_AQ_FLAG_BUF); 177 + if (cq->rq_buf_size > LIBIE_AQ_LG_BUF) 178 + desc->flags |= cpu_to_le16(LIBIE_AQ_FLAG_LB); 179 179 desc->opcode = 0; 180 180 /* This is in accordance with control queue design, there is no 181 181 * register for buffer size configuration ··· 858 858 { 859 859 struct ice_ctl_q_ring *sq = &cq->sq; 860 860 u16 ntc = sq->next_to_clean; 861 - struct ice_aq_desc *desc; 861 + struct libie_aq_desc *desc; 862 862 863 863 desc = ICE_CTL_Q_DESC(*sq, ntc); 864 864 ··· 912 912 static void ice_debug_cq(struct ice_hw *hw, struct ice_ctl_q_info *cq, 913 913 void *desc, void *buf, u16 buf_len, bool response) 914 914 { 915 - struct ice_aq_desc *cq_desc = desc; 915 + struct libie_aq_desc *cq_desc = desc; 916 916 u16 datalen, flags; 917 917 918 918 if (!IS_ENABLED(CONFIG_DYNAMIC_DEBUG) && ··· 939 939 * by the DD and/or CMP flag set or a command with the RD flag set. 940 940 */ 941 941 if (buf && cq_desc->datalen && 942 - (flags & (ICE_AQ_FLAG_DD | ICE_AQ_FLAG_CMP | ICE_AQ_FLAG_RD))) { 942 + (flags & (LIBIE_AQ_FLAG_DD | LIBIE_AQ_FLAG_CMP | 943 + LIBIE_AQ_FLAG_RD))) { 943 944 char prefix[] = KBUILD_MODNAME " 0x12341234 0x12341234 "; 944 945 945 946 sprintf(prefix, KBUILD_MODNAME " 0x%08X 0x%08X ", ··· 993 992 */ 994 993 int 995 994 ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq, 996 - struct ice_aq_desc *desc, void *buf, u16 buf_size, 995 + struct libie_aq_desc *desc, void *buf, u16 buf_size, 997 996 struct ice_sq_cd *cd) 998 997 { 999 998 struct ice_dma_mem *dma_buf = NULL; 1000 - struct ice_aq_desc *desc_on_ring; 999 + struct libie_aq_desc *desc_on_ring; 1001 1000 bool cmd_completed = false; 1002 1001 int status = 0; 1003 1002 u16 retval = 0; ··· 1008 1007 return -EBUSY; 1009 1008 mutex_lock(&cq->sq_lock); 1010 1009 1011 - cq->sq_last_status = ICE_AQ_RC_OK; 1010 + cq->sq_last_status = LIBIE_AQ_RC_OK; 1012 1011 1013 1012 if (!cq->sq.count) { 1014 1013 ice_debug(hw, ICE_DBG_AQ_MSG, "Control Send queue not initialized.\n"); ··· 1029 1028 goto sq_send_command_error; 1030 1029 } 1031 1030 1032 - desc->flags |= cpu_to_le16(ICE_AQ_FLAG_BUF); 1033 - if (buf_size > ICE_AQ_LG_BUF) 1034 - desc->flags |= cpu_to_le16(ICE_AQ_FLAG_LB); 1031 + desc->flags |= cpu_to_le16(LIBIE_AQ_FLAG_BUF); 1032 + if (buf_size > LIBIE_AQ_LG_BUF) 1033 + desc->flags |= cpu_to_le16(LIBIE_AQ_FLAG_LB); 1035 1034 } 1036 1035 1037 1036 val = rd32(hw, cq->sq.head); ··· 1113 1112 retval &= 0xff; 1114 1113 } 1115 1114 cmd_completed = true; 1116 - if (!status && retval != ICE_AQ_RC_OK) 1115 + if (!status && retval != LIBIE_AQ_RC_OK) 1117 1116 status = -EIO; 1118 - cq->sq_last_status = (enum ice_aq_err)retval; 1117 + cq->sq_last_status = (enum libie_aq_err)retval; 1119 1118 } 1120 1119 1121 1120 ice_debug(hw, ICE_DBG_AQ_MSG, "ATQ: desc and buffer writeback:\n"); ··· 1150 1149 * 1151 1150 * Fill the desc with default values 1152 1151 */ 1153 - void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode) 1152 + void ice_fill_dflt_direct_cmd_desc(struct libie_aq_desc *desc, u16 opcode) 1154 1153 { 1155 1154 /* zero out the desc */ 1156 1155 memset(desc, 0, sizeof(*desc)); 1157 1156 desc->opcode = cpu_to_le16(opcode); 1158 - desc->flags = cpu_to_le16(ICE_AQ_FLAG_SI); 1157 + desc->flags = cpu_to_le16(LIBIE_AQ_FLAG_SI); 1159 1158 } 1160 1159 1161 1160 /** ··· 1173 1172 ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq, 1174 1173 struct ice_rq_event_info *e, u16 *pending) 1175 1174 { 1175 + enum libie_aq_err rq_last_status; 1176 1176 u16 ntc = cq->rq.next_to_clean; 1177 - enum ice_aq_err rq_last_status; 1178 - struct ice_aq_desc *desc; 1177 + struct libie_aq_desc *desc; 1179 1178 struct ice_dma_mem *bi; 1180 1179 int ret_code = 0; 1181 1180 u16 desc_idx; ··· 1208 1207 desc = ICE_CTL_Q_DESC(cq->rq, ntc); 1209 1208 desc_idx = ntc; 1210 1209 1211 - rq_last_status = (enum ice_aq_err)le16_to_cpu(desc->retval); 1210 + rq_last_status = (enum libie_aq_err)le16_to_cpu(desc->retval); 1212 1211 flags = le16_to_cpu(desc->flags); 1213 - if (flags & ICE_AQ_FLAG_ERR) { 1212 + if (flags & LIBIE_AQ_FLAG_ERR) { 1214 1213 ret_code = -EIO; 1215 1214 ice_debug(hw, ICE_DBG_AQ_MSG, "Control Receive Queue Event 0x%04X received with error 0x%X\n", 1216 1215 le16_to_cpu(desc->opcode), rq_last_status); ··· 1231 1230 bi = &cq->rq.r.rq_bi[ntc]; 1232 1231 memset(desc, 0, sizeof(*desc)); 1233 1232 1234 - desc->flags = cpu_to_le16(ICE_AQ_FLAG_BUF); 1235 - if (cq->rq_buf_size > ICE_AQ_LG_BUF) 1236 - desc->flags |= cpu_to_le16(ICE_AQ_FLAG_LB); 1233 + desc->flags = cpu_to_le16(LIBIE_AQ_FLAG_BUF); 1234 + if (cq->rq_buf_size > LIBIE_AQ_LG_BUF) 1235 + desc->flags |= cpu_to_le16(LIBIE_AQ_FLAG_LB); 1237 1236 desc->datalen = cpu_to_le16(bi->size); 1238 1237 desc->params.generic.addr_high = cpu_to_le32(upper_32_bits(bi->pa)); 1239 1238 desc->params.generic.addr_low = cpu_to_le32(lower_32_bits(bi->pa));
+4 -4
drivers/net/ethernet/intel/ice/ice_controlq.h
··· 12 12 #define ICE_SBQ_MAX_BUF_LEN 512 13 13 14 14 #define ICE_CTL_Q_DESC(R, i) \ 15 - (&(((struct ice_aq_desc *)((R).desc_buf.va))[i])) 15 + (&(((struct libie_aq_desc *)((R).desc_buf.va))[i])) 16 16 17 17 #define ICE_CTL_Q_DESC_UNUSED(R) \ 18 18 ((u16)((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \ ··· 76 76 77 77 /* sq transaction details */ 78 78 struct ice_sq_cd { 79 - struct ice_aq_desc *wb_desc; 79 + struct libie_aq_desc *wb_desc; 80 80 }; 81 81 82 82 /* rq event information */ 83 83 struct ice_rq_event_info { 84 - struct ice_aq_desc desc; 84 + struct libie_aq_desc desc; 85 85 u16 msg_len; 86 86 u16 buf_len; 87 87 u8 *msg_buf; ··· 96 96 u16 num_sq_entries; /* send queue depth */ 97 97 u16 rq_buf_size; /* receive queue buffer size */ 98 98 u16 sq_buf_size; /* send queue buffer size */ 99 - enum ice_aq_err sq_last_status; /* last status on send queue */ 99 + enum libie_aq_err sq_last_status; /* last status on send queue */ 100 100 struct mutex sq_lock; /* Send queue lock */ 101 101 struct mutex rq_lock; /* Receive queue lock */ 102 102 };
+18 -18
drivers/net/ethernet/intel/ice/ice_dcb.c
··· 24 24 struct ice_sq_cd *cd) 25 25 { 26 26 struct ice_aqc_lldp_get_mib *cmd; 27 - struct ice_aq_desc desc; 27 + struct libie_aq_desc desc; 28 28 int status; 29 29 30 - cmd = &desc.params.lldp_get_mib; 30 + cmd = libie_aq_raw(&desc); 31 31 32 32 if (buf_size == 0 || !buf) 33 33 return -EINVAL; ··· 64 64 struct ice_sq_cd *cd) 65 65 { 66 66 struct ice_aqc_lldp_set_mib_change *cmd; 67 - struct ice_aq_desc desc; 67 + struct libie_aq_desc desc; 68 68 69 - cmd = &desc.params.lldp_set_event; 69 + cmd = libie_aq_raw(&desc); 70 70 71 71 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_set_mib_change); 72 72 ··· 95 95 struct ice_sq_cd *cd) 96 96 { 97 97 struct ice_aqc_lldp_stop *cmd; 98 - struct ice_aq_desc desc; 98 + struct libie_aq_desc desc; 99 99 100 - cmd = &desc.params.lldp_stop; 100 + cmd = libie_aq_raw(&desc); 101 101 102 102 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_stop); 103 103 ··· 121 121 int ice_aq_start_lldp(struct ice_hw *hw, bool persist, struct ice_sq_cd *cd) 122 122 { 123 123 struct ice_aqc_lldp_start *cmd; 124 - struct ice_aq_desc desc; 124 + struct libie_aq_desc desc; 125 125 126 - cmd = &desc.params.lldp_start; 126 + cmd = libie_aq_raw(&desc); 127 127 128 128 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_start); 129 129 ··· 677 677 bool *dcbx_agent_status, struct ice_sq_cd *cd) 678 678 { 679 679 struct ice_aqc_lldp_stop_start_specific_agent *cmd; 680 - struct ice_aq_desc desc; 680 + struct libie_aq_desc desc; 681 681 u16 opcode; 682 682 int status; 683 683 684 - cmd = &desc.params.lldp_agent_ctrl; 684 + cmd = libie_aq_raw(&desc); 685 685 686 686 opcode = ice_aqc_opc_lldp_stop_start_specific_agent; 687 687 ··· 714 714 struct ice_aqc_get_cee_dcb_cfg_resp *buff, 715 715 struct ice_sq_cd *cd) 716 716 { 717 - struct ice_aq_desc desc; 717 + struct libie_aq_desc desc; 718 718 719 719 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_cee_dcb_cfg); 720 720 ··· 733 733 int ice_aq_set_pfc_mode(struct ice_hw *hw, u8 pfc_mode, struct ice_sq_cd *cd) 734 734 { 735 735 struct ice_aqc_set_query_pfc_mode *cmd; 736 - struct ice_aq_desc desc; 736 + struct libie_aq_desc desc; 737 737 int status; 738 738 739 739 if (pfc_mode > ICE_AQC_PFC_DSCP_BASED_PFC) 740 740 return -EINVAL; 741 741 742 - cmd = &desc.params.set_query_pfc_mode; 742 + cmd = libie_aq_raw(&desc); 743 743 744 744 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_pfc_mode); 745 745 ··· 914 914 ret = ice_aq_get_dcb_cfg(pi->hw, ICE_AQ_LLDP_MIB_REMOTE, 915 915 ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID, dcbx_cfg); 916 916 /* Don't treat ENOENT as an error for Remote MIBs */ 917 - if (pi->hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT) 917 + if (pi->hw->adminq.sq_last_status == LIBIE_AQ_RC_ENOENT) 918 918 ret = 0; 919 919 920 920 out: ··· 941 941 /* CEE mode */ 942 942 ret = ice_get_ieee_or_cee_dcb_cfg(pi, ICE_DCBX_MODE_CEE); 943 943 ice_cee_to_dcb_cfg(&cee_cfg, pi); 944 - } else if (pi->hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT) { 944 + } else if (pi->hw->adminq.sq_last_status == LIBIE_AQ_RC_ENOENT) { 945 945 /* CEE mode not enabled try querying IEEE data */ 946 946 dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg; 947 947 dcbx_cfg->dcbx_mode = ICE_DCBX_MODE_IEEE; ··· 965 965 struct ice_aqc_lldp_get_mib *mib; 966 966 u8 change_type, dcbx_mode; 967 967 968 - mib = (struct ice_aqc_lldp_get_mib *)&event->desc.params.raw; 968 + mib = libie_aq_raw(&event->desc); 969 969 970 970 change_type = FIELD_GET(ICE_AQ_LLDP_MIB_TYPE_M, mib->type); 971 971 if (change_type == ICE_AQ_LLDP_MIB_REMOTE) ··· 1537 1537 struct ice_sq_cd *cd) 1538 1538 { 1539 1539 struct ice_aqc_query_port_ets *cmd; 1540 - struct ice_aq_desc desc; 1540 + struct libie_aq_desc desc; 1541 1541 int status; 1542 1542 1543 1543 if (!pi) 1544 1544 return -EINVAL; 1545 - cmd = &desc.params.port_ets; 1545 + cmd = libie_aq_raw(&desc); 1546 1546 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_query_port_ets); 1547 1547 cmd->port_teid = pi->root->info.node_teid; 1548 1548
+1 -1
drivers/net/ethernet/intel/ice/ice_dcb_lib.c
··· 1020 1020 } 1021 1021 1022 1022 pi = pf->hw.port_info; 1023 - mib = (struct ice_aqc_lldp_get_mib *)&event->desc.params.raw; 1023 + mib = libie_aq_raw(&event->desc); 1024 1024 1025 1025 /* Ignore if event is not for Nearest Bridge */ 1026 1026 mib_type = FIELD_GET(ICE_AQ_LLDP_BRID_TYPE_M, mib->type);
+24 -23
drivers/net/ethernet/intel/ice/ice_ddp.c
··· 1101 1101 return &bld->buf; 1102 1102 } 1103 1103 1104 - static enum ice_ddp_state ice_map_aq_err_to_ddp_state(enum ice_aq_err aq_err) 1104 + static enum ice_ddp_state ice_map_aq_err_to_ddp_state(enum libie_aq_err aq_err) 1105 1105 { 1106 1106 switch (aq_err) { 1107 - case ICE_AQ_RC_ENOSEC: 1108 - case ICE_AQ_RC_EBADSIG: 1107 + case LIBIE_AQ_RC_ENOSEC: 1108 + case LIBIE_AQ_RC_EBADSIG: 1109 1109 return ICE_DDP_PKG_FILE_SIGNATURE_INVALID; 1110 - case ICE_AQ_RC_ESVN: 1110 + case LIBIE_AQ_RC_ESVN: 1111 1111 return ICE_DDP_PKG_FILE_REVISION_TOO_LOW; 1112 - case ICE_AQ_RC_EBADMAN: 1113 - case ICE_AQ_RC_EBADBUF: 1112 + case LIBIE_AQ_RC_EBADMAN: 1113 + case LIBIE_AQ_RC_EBADBUF: 1114 1114 return ICE_DDP_PKG_LOAD_ERROR; 1115 1115 default: 1116 1116 return ICE_DDP_PKG_ERR; ··· 1180 1180 u32 *error_info, struct ice_sq_cd *cd) 1181 1181 { 1182 1182 struct ice_aqc_download_pkg *cmd; 1183 - struct ice_aq_desc desc; 1183 + struct libie_aq_desc desc; 1184 1184 int status; 1185 1185 1186 1186 if (error_offset) ··· 1188 1188 if (error_info) 1189 1189 *error_info = 0; 1190 1190 1191 - cmd = &desc.params.download_pkg; 1191 + cmd = libie_aq_raw(&desc); 1192 1192 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_download_pkg); 1193 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 1193 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 1194 1194 1195 1195 if (last_buf) 1196 1196 cmd->flags |= ICE_AQC_DOWNLOAD_PKG_LAST_BUF; ··· 1259 1259 struct ice_buf_hdr *prev_hunk = ctx->hdr; 1260 1260 struct ice_hw *hw = ctx->hw; 1261 1261 bool prev_was_last = !hunk; 1262 - enum ice_aq_err aq_err; 1262 + enum libie_aq_err aq_err; 1263 1263 u32 offset, info; 1264 1264 int attempt, err; 1265 1265 ··· 1278 1278 prev_was_last, &offset, &info, NULL); 1279 1279 1280 1280 aq_err = hw->adminq.sq_last_status; 1281 - if (aq_err != ICE_AQ_RC_ENOSEC && aq_err != ICE_AQ_RC_EBADSIG) 1281 + if (aq_err != LIBIE_AQ_RC_ENOSEC && 1282 + aq_err != LIBIE_AQ_RC_EBADSIG) 1282 1283 break; 1283 1284 } 1284 1285 ··· 1538 1537 static enum ice_ddp_state 1539 1538 ice_download_pkg_with_sig_seg(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr) 1540 1539 { 1541 - enum ice_aq_err aq_err = hw->adminq.sq_last_status; 1540 + enum libie_aq_err aq_err = hw->adminq.sq_last_status; 1542 1541 enum ice_ddp_state state = ICE_DDP_PKG_ERR; 1543 1542 struct ice_ddp_send_ctx ctx = { .hw = hw }; 1544 1543 int status; ··· 1688 1687 struct ice_aqc_get_pkg_info_resp *pkg_info, 1689 1688 u16 buf_size, struct ice_sq_cd *cd) 1690 1689 { 1691 - struct ice_aq_desc desc; 1690 + struct libie_aq_desc desc; 1692 1691 1693 1692 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_pkg_info_list); 1694 1693 ··· 1712 1711 u32 *error_info, struct ice_sq_cd *cd) 1713 1712 { 1714 1713 struct ice_aqc_download_pkg *cmd; 1715 - struct ice_aq_desc desc; 1714 + struct libie_aq_desc desc; 1716 1715 int status; 1717 1716 1718 1717 if (error_offset) ··· 1720 1719 if (error_info) 1721 1720 *error_info = 0; 1722 1721 1723 - cmd = &desc.params.download_pkg; 1722 + cmd = libie_aq_raw(&desc); 1724 1723 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_update_pkg); 1725 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 1724 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 1726 1725 1727 1726 if (last_buf) 1728 1727 cmd->flags |= ICE_AQC_DOWNLOAD_PKG_LAST_BUF; ··· 1754 1753 int ice_aq_upload_section(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf, 1755 1754 u16 buf_size, struct ice_sq_cd *cd) 1756 1755 { 1757 - struct ice_aq_desc desc; 1756 + struct libie_aq_desc desc; 1758 1757 1759 1758 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_upload_section); 1760 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 1759 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 1761 1760 1762 1761 return ice_aq_send_cmd(hw, &desc, pkg_buf, buf_size, cd); 1763 1762 } ··· 2334 2333 struct ice_sq_cd *cd, u8 *flags, bool set) 2335 2334 { 2336 2335 struct ice_aqc_get_set_tx_topo *cmd; 2337 - struct ice_aq_desc desc; 2336 + struct libie_aq_desc desc; 2338 2337 int status; 2339 2338 2340 - cmd = &desc.params.get_set_tx_topo; 2339 + cmd = libie_aq_raw(&desc); 2341 2340 if (set) { 2342 2341 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_tx_topo); 2343 2342 cmd->set_flags = ICE_AQC_TX_TOPO_FLAGS_ISSUED; ··· 2346 2345 cmd->set_flags |= ICE_AQC_TX_TOPO_FLAGS_SRC_RAM | 2347 2346 ICE_AQC_TX_TOPO_FLAGS_LOAD_NEW; 2348 2347 2349 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 2348 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 2350 2349 } else { 2351 2350 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_tx_topo); 2352 2351 cmd->get_flags = ICE_AQC_TX_TOPO_GET_RAM; 2353 2352 2354 2353 if (hw->mac_type == ICE_MAC_E810 || 2355 2354 hw->mac_type == ICE_MAC_GENERIC) 2356 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 2355 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 2357 2356 } 2358 2357 2359 2358 status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd); ··· 2361 2360 return status; 2362 2361 /* read the return flag values (first byte) for get operation */ 2363 2362 if (!set && flags) 2364 - *flags = desc.params.get_set_tx_topo.set_flags; 2363 + *flags = cmd->set_flags; 2365 2364 2366 2365 return 0; 2367 2366 }
+2 -2
drivers/net/ethernet/intel/ice/ice_dpll.c
··· 2509 2509 int ret = ice_aq_get_cgu_input_pin_measure(&pf->hw, DPLL_TYPE_PPS, meas, 2510 2510 ARRAY_SIZE(meas)); 2511 2511 2512 - if (ret && pf->hw.adminq.sq_last_status == ICE_AQ_RC_ESRCH) 2512 + if (ret && pf->hw.adminq.sq_last_status == LIBIE_AQ_RC_ESRCH) 2513 2513 return false; 2514 2514 2515 2515 return true; ··· 2562 2562 *phase_offset_pins_updated = 0; 2563 2563 ret = ice_aq_get_cgu_input_pin_measure(&pf->hw, DPLL_TYPE_PPS, meas, 2564 2564 ARRAY_SIZE(meas)); 2565 - if (ret && pf->hw.adminq.sq_last_status == ICE_AQ_RC_EAGAIN) { 2565 + if (ret && pf->hw.adminq.sq_last_status == LIBIE_AQ_RC_EAGAIN) { 2566 2566 return 0; 2567 2567 } else if (ret) { 2568 2568 dev_err(ice_pf_to_dev(pf),
+14 -10
drivers/net/ethernet/intel/ice/ice_fw_update.c
··· 299 299 struct device *dev = ice_pf_to_dev(pf); 300 300 struct ice_aq_task task = {}; 301 301 struct ice_hw *hw = &pf->hw; 302 - struct ice_aq_desc *desc; 302 + struct libie_aq_desc *desc; 303 + struct ice_aqc_nvm *cmd; 303 304 u32 completion_offset; 304 305 int err; 305 306 ··· 334 333 } 335 334 336 335 desc = &task.event.desc; 337 - completion_module = le16_to_cpu(desc->params.nvm.module_typeid); 336 + cmd = libie_aq_raw(desc); 337 + completion_module = le16_to_cpu(cmd->module_typeid); 338 338 completion_retval = le16_to_cpu(desc->retval); 339 339 340 - completion_offset = le16_to_cpu(desc->params.nvm.offset_low); 341 - completion_offset |= desc->params.nvm.offset_high << 16; 340 + completion_offset = le16_to_cpu(cmd->offset_low); 341 + completion_offset |= cmd->offset_high << 16; 342 342 343 343 if (completion_module != module) { 344 344 dev_err(dev, "Unexpected module_typeid in write completion: got 0x%x, expected 0x%x\n", ··· 358 356 if (completion_retval) { 359 357 dev_err(dev, "Firmware failed to flash module 0x%02x with block of size %u at offset %u, err %s\n", 360 358 module, block_size, offset, 361 - ice_aq_str((enum ice_aq_err)completion_retval)); 359 + ice_aq_str((enum libie_aq_err)completion_retval)); 362 360 NL_SET_ERR_MSG_MOD(extack, "Firmware failed to program flash module"); 363 361 return -EIO; 364 362 } ··· 371 369 */ 372 370 if (reset_level && last_cmd && module == ICE_SR_1ST_NVM_BANK_PTR) { 373 371 if (hw->dev_caps.common_cap.pcie_reset_avoidance) { 374 - *reset_level = desc->params.nvm.cmd_flags & 372 + *reset_level = cmd->cmd_flags & 375 373 ICE_AQC_NVM_RESET_LVL_M; 376 374 dev_dbg(dev, "Firmware reported required reset level as %u\n", 377 375 *reset_level); ··· 489 487 struct device *dev = ice_pf_to_dev(pf); 490 488 struct ice_aq_task task = {}; 491 489 struct ice_hw *hw = &pf->hw; 492 - struct ice_aq_desc *desc; 490 + struct libie_aq_desc *desc; 491 + struct ice_aqc_nvm *cmd; 493 492 struct devlink *devlink; 494 493 int err; 495 494 ··· 521 518 } 522 519 523 520 desc = &task.event.desc; 524 - completion_module = le16_to_cpu(desc->params.nvm.module_typeid); 521 + cmd = libie_aq_raw(desc); 522 + completion_module = le16_to_cpu(cmd->module_typeid); 525 523 completion_retval = le16_to_cpu(desc->retval); 526 524 527 525 if (completion_module != module) { ··· 536 532 if (completion_retval) { 537 533 dev_err(dev, "Firmware failed to erase %s (module 0x02%x), aq_err %s\n", 538 534 component, module, 539 - ice_aq_str((enum ice_aq_err)completion_retval)); 535 + ice_aq_str((enum libie_aq_err)completion_retval)); 540 536 NL_SET_ERR_MSG_MOD(extack, "Firmware failed to erase flash"); 541 537 err = -EIO; 542 538 goto out_notify_devlink; ··· 615 611 completion_retval = le16_to_cpu(task.event.desc.retval); 616 612 if (completion_retval) { 617 613 dev_err(dev, "Firmware failed to switch active flash banks aq_err %s\n", 618 - ice_aq_str((enum ice_aq_err)completion_retval)); 614 + ice_aq_str((enum libie_aq_err)completion_retval)); 619 615 NL_SET_ERR_MSG_MOD(extack, "Firmware failed to switch active flash banks"); 620 616 return -EIO; 621 617 }
+9 -7
drivers/net/ethernet/intel/ice/ice_fwlog.c
··· 240 240 { 241 241 struct ice_aqc_fw_log_cfg_resp *fw_modules; 242 242 struct ice_aqc_fw_log *cmd; 243 - struct ice_aq_desc desc; 243 + struct libie_aq_desc desc; 244 244 int status; 245 245 int i; 246 246 ··· 255 255 } 256 256 257 257 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logs_config); 258 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 258 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 259 259 260 - cmd = &desc.params.fw_log; 260 + cmd = libie_aq_raw(&desc); 261 261 262 262 cmd->cmd_flags = ICE_AQC_FW_LOG_CONF_SET_VALID; 263 263 cmd->ops.cfg.log_resolution = cpu_to_le16(log_resolution); ··· 309 309 { 310 310 struct ice_aqc_fw_log_cfg_resp *fw_modules; 311 311 struct ice_aqc_fw_log *cmd; 312 - struct ice_aq_desc desc; 312 + struct libie_aq_desc desc; 313 313 u16 module_id_cnt; 314 314 int status; 315 315 void *buf; ··· 322 322 return -ENOMEM; 323 323 324 324 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logs_query); 325 - cmd = &desc.params.fw_log; 325 + cmd = libie_aq_raw(&desc); 326 326 327 327 cmd->cmd_flags = ICE_AQC_FW_LOG_AQ_QUERY; 328 328 ··· 384 384 */ 385 385 static int ice_aq_fwlog_register(struct ice_hw *hw, bool reg) 386 386 { 387 - struct ice_aq_desc desc; 387 + struct ice_aqc_fw_log *cmd; 388 + struct libie_aq_desc desc; 388 389 389 390 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logs_register); 391 + cmd = libie_aq_raw(&desc); 390 392 391 393 if (reg) 392 - desc.params.fw_log.cmd_flags = ICE_AQC_FW_LOG_AQ_REGISTER; 394 + cmd->cmd_flags = ICE_AQC_FW_LOG_AQ_REGISTER; 393 395 394 396 return ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); 395 397 }
+2 -2
drivers/net/ethernet/intel/ice/ice_lag.c
··· 1144 1144 { 1145 1145 struct ice_aqc_alloc_free_res_elem *buf; 1146 1146 struct ice_aqc_set_port_params *cmd; 1147 - struct ice_aq_desc desc; 1147 + struct libie_aq_desc desc; 1148 1148 u16 buf_len, swid; 1149 1149 int status, i; 1150 1150 ··· 1192 1192 else 1193 1193 swid = local_lag->pf->hw.port_info->sw_id; 1194 1194 1195 - cmd = &desc.params.set_port_params; 1195 + cmd = libie_aq_raw(&desc); 1196 1196 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_port_params); 1197 1197 1198 1198 cmd->swid = cpu_to_le16(ICE_AQC_PORT_SWID_VALID | swid);
+3 -3
drivers/net/ethernet/intel/ice/ice_lib.c
··· 3736 3736 3737 3737 status = ice_aq_set_link_restart_an(pi, ena, NULL); 3738 3738 3739 - /* if link is owned by manageability, FW will return ICE_AQ_RC_EMODE. 3739 + /* if link is owned by manageability, FW will return LIBIE_AQ_RC_EMODE. 3740 3740 * this is not a fatal error, so print a warning message and return 3741 3741 * a success code. Return an error if FW returns an error code other 3742 - * than ICE_AQ_RC_EMODE 3742 + * than LIBIE_AQ_RC_EMODE 3743 3743 */ 3744 3744 if (status == -EIO) { 3745 - if (hw->adminq.sq_last_status == ICE_AQ_RC_EMODE) 3745 + if (hw->adminq.sq_last_status == LIBIE_AQ_RC_EMODE) 3746 3746 dev_dbg(dev, "can't set link to %s, err %d aq_err %s. not fatal, continuing\n", 3747 3747 (ena ? "ON" : "OFF"), status, 3748 3748 ice_aq_str(hw->adminq.sq_last_status));
+19 -19
drivers/net/ethernet/intel/ice/ice_main.c
··· 379 379 * should go into promiscuous mode. There should be some 380 380 * space reserved for promiscuous filters. 381 381 */ 382 - if (hw->adminq.sq_last_status == ICE_AQ_RC_ENOSPC && 382 + if (hw->adminq.sq_last_status == LIBIE_AQ_RC_ENOSPC && 383 383 !test_and_set_bit(ICE_FLTR_OVERFLOW_PROMISC, 384 384 vsi->state)) { 385 385 promisc_forced_on = true; ··· 7914 7914 * ice_aq_str - convert AQ err code to a string 7915 7915 * @aq_err: the AQ error code to convert 7916 7916 */ 7917 - const char *ice_aq_str(enum ice_aq_err aq_err) 7917 + const char *ice_aq_str(enum libie_aq_err aq_err) 7918 7918 { 7919 7919 switch (aq_err) { 7920 - case ICE_AQ_RC_OK: 7920 + case LIBIE_AQ_RC_OK: 7921 7921 return "OK"; 7922 - case ICE_AQ_RC_EPERM: 7922 + case LIBIE_AQ_RC_EPERM: 7923 7923 return "ICE_AQ_RC_EPERM"; 7924 - case ICE_AQ_RC_ENOENT: 7924 + case LIBIE_AQ_RC_ENOENT: 7925 7925 return "ICE_AQ_RC_ENOENT"; 7926 - case ICE_AQ_RC_ESRCH: 7926 + case LIBIE_AQ_RC_ESRCH: 7927 7927 return "ICE_AQ_RC_ESRCH"; 7928 - case ICE_AQ_RC_EAGAIN: 7928 + case LIBIE_AQ_RC_EAGAIN: 7929 7929 return "ICE_AQ_RC_EAGAIN"; 7930 - case ICE_AQ_RC_ENOMEM: 7930 + case LIBIE_AQ_RC_ENOMEM: 7931 7931 return "ICE_AQ_RC_ENOMEM"; 7932 - case ICE_AQ_RC_EBUSY: 7932 + case LIBIE_AQ_RC_EBUSY: 7933 7933 return "ICE_AQ_RC_EBUSY"; 7934 - case ICE_AQ_RC_EEXIST: 7934 + case LIBIE_AQ_RC_EEXIST: 7935 7935 return "ICE_AQ_RC_EEXIST"; 7936 - case ICE_AQ_RC_EINVAL: 7936 + case LIBIE_AQ_RC_EINVAL: 7937 7937 return "ICE_AQ_RC_EINVAL"; 7938 - case ICE_AQ_RC_ENOSPC: 7938 + case LIBIE_AQ_RC_ENOSPC: 7939 7939 return "ICE_AQ_RC_ENOSPC"; 7940 - case ICE_AQ_RC_ENOSYS: 7940 + case LIBIE_AQ_RC_ENOSYS: 7941 7941 return "ICE_AQ_RC_ENOSYS"; 7942 - case ICE_AQ_RC_EMODE: 7942 + case LIBIE_AQ_RC_EMODE: 7943 7943 return "ICE_AQ_RC_EMODE"; 7944 - case ICE_AQ_RC_ENOSEC: 7944 + case LIBIE_AQ_RC_ENOSEC: 7945 7945 return "ICE_AQ_RC_ENOSEC"; 7946 - case ICE_AQ_RC_EBADSIG: 7946 + case LIBIE_AQ_RC_EBADSIG: 7947 7947 return "ICE_AQ_RC_EBADSIG"; 7948 - case ICE_AQ_RC_ESVN: 7948 + case LIBIE_AQ_RC_ESVN: 7949 7949 return "ICE_AQ_RC_ESVN"; 7950 - case ICE_AQ_RC_EBADMAN: 7950 + case LIBIE_AQ_RC_EBADMAN: 7951 7951 return "ICE_AQ_RC_EBADMAN"; 7952 - case ICE_AQ_RC_EBADBUF: 7952 + case LIBIE_AQ_RC_EBADBUF: 7953 7953 return "ICE_AQ_RC_EBADBUF"; 7954 7954 } 7955 7955
+19 -19
drivers/net/ethernet/intel/ice/ice_nvm.c
··· 22 22 u16 length, void *data, bool last_command, 23 23 bool read_shadow_ram, struct ice_sq_cd *cd) 24 24 { 25 - struct ice_aq_desc desc; 25 + struct libie_aq_desc desc; 26 26 struct ice_aqc_nvm *cmd; 27 27 28 - cmd = &desc.params.nvm; 28 + cmd = libie_aq_raw(&desc); 29 29 30 30 if (offset > ICE_AQC_NVM_MAX_OFFSET) 31 31 return -EINVAL; ··· 125 125 u16 length, void *data, bool last_command, u8 command_flags, 126 126 struct ice_sq_cd *cd) 127 127 { 128 - struct ice_aq_desc desc; 128 + struct libie_aq_desc desc; 129 129 struct ice_aqc_nvm *cmd; 130 130 131 - cmd = &desc.params.nvm; 131 + cmd = libie_aq_raw(&desc); 132 132 133 133 /* In offset the highest byte must be zeroed. */ 134 134 if (offset & 0xFF000000) ··· 146 146 cmd->offset_high = (offset >> 16) & 0xFF; 147 147 cmd->length = cpu_to_le16(length); 148 148 149 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 149 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 150 150 151 151 return ice_aq_send_cmd(hw, &desc, data, length, cd); 152 152 } ··· 161 161 */ 162 162 int ice_aq_erase_nvm(struct ice_hw *hw, u16 module_typeid, struct ice_sq_cd *cd) 163 163 { 164 - struct ice_aq_desc desc; 164 + struct libie_aq_desc desc; 165 165 struct ice_aqc_nvm *cmd; 166 166 167 - cmd = &desc.params.nvm; 167 + cmd = libie_aq_raw(&desc); 168 168 169 169 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_nvm_erase); 170 170 ··· 869 869 870 870 status = ice_read_flat_nvm(hw, offset, &len, &data, false); 871 871 if (status == -EIO && 872 - hw->adminq.sq_last_status == ICE_AQ_RC_EINVAL) { 872 + hw->adminq.sq_last_status == LIBIE_AQ_RC_EINVAL) { 873 873 ice_debug(hw, ICE_DBG_NVM, "%s: New upper bound of %u bytes\n", 874 874 __func__, offset); 875 875 status = 0; ··· 1182 1182 int ice_nvm_validate_checksum(struct ice_hw *hw) 1183 1183 { 1184 1184 struct ice_aqc_nvm_checksum *cmd; 1185 - struct ice_aq_desc desc; 1185 + struct libie_aq_desc desc; 1186 1186 int status; 1187 1187 1188 1188 status = ice_acquire_nvm(hw, ICE_RES_READ); 1189 1189 if (status) 1190 1190 return status; 1191 1191 1192 - cmd = &desc.params.nvm_checksum; 1192 + cmd = libie_aq_raw(&desc); 1193 1193 1194 1194 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_nvm_checksum); 1195 1195 cmd->flags = ICE_AQC_NVM_CHECKSUM_VERIFY; ··· 1226 1226 */ 1227 1227 int ice_nvm_write_activate(struct ice_hw *hw, u16 cmd_flags, u8 *response_flags) 1228 1228 { 1229 + struct libie_aq_desc desc; 1229 1230 struct ice_aqc_nvm *cmd; 1230 - struct ice_aq_desc desc; 1231 1231 int err; 1232 1232 1233 - cmd = &desc.params.nvm; 1233 + cmd = libie_aq_raw(&desc); 1234 1234 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_nvm_write_activate); 1235 1235 1236 1236 cmd->cmd_flags = (u8)(cmd_flags & 0xFF); ··· 1252 1252 */ 1253 1253 int ice_aq_nvm_update_empr(struct ice_hw *hw) 1254 1254 { 1255 - struct ice_aq_desc desc; 1255 + struct libie_aq_desc desc; 1256 1256 1257 1257 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_nvm_update_empr); 1258 1258 ··· 1278 1278 u16 length, struct ice_sq_cd *cd) 1279 1279 { 1280 1280 struct ice_aqc_nvm_pkg_data *cmd; 1281 - struct ice_aq_desc desc; 1281 + struct libie_aq_desc desc; 1282 1282 1283 1283 if (length != 0 && !data) 1284 1284 return -EINVAL; 1285 1285 1286 - cmd = &desc.params.pkg_data; 1286 + cmd = libie_aq_raw(&desc); 1287 1287 1288 1288 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_nvm_pkg_data); 1289 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 1289 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 1290 1290 1291 1291 if (del_pkg_data_flag) 1292 1292 cmd->cmd_flags |= ICE_AQC_NVM_PKG_DELETE; ··· 1316 1316 u8 *comp_response_code, struct ice_sq_cd *cd) 1317 1317 { 1318 1318 struct ice_aqc_nvm_pass_comp_tbl *cmd; 1319 - struct ice_aq_desc desc; 1319 + struct libie_aq_desc desc; 1320 1320 int status; 1321 1321 1322 1322 if (!data || !comp_response || !comp_response_code) 1323 1323 return -EINVAL; 1324 1324 1325 - cmd = &desc.params.pass_comp_tbl; 1325 + cmd = libie_aq_raw(&desc); 1326 1326 1327 1327 ice_fill_dflt_direct_cmd_desc(&desc, 1328 1328 ice_aqc_opc_nvm_pass_component_tbl); 1329 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 1329 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 1330 1330 1331 1331 cmd->transfer_flag = transfer_flag; 1332 1332 status = ice_aq_send_cmd(hw, &desc, data, length, cd);
+8 -8
drivers/net/ethernet/intel/ice/ice_ptp_hw.c
··· 424 424 }; 425 425 int err; 426 426 427 - err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); 427 + err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD); 428 428 if (err) 429 429 ice_debug(hw, ICE_DBG_PTP, "PTP failed to send msg to phy %d\n", 430 430 err); ··· 451 451 }; 452 452 int err; 453 453 454 - err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); 454 + err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD); 455 455 if (err) 456 456 ice_debug(hw, ICE_DBG_PTP, "PTP failed to send msg to phy %d\n", 457 457 err); ··· 2348 2348 ice_fill_phy_msg_e82x(hw, &msg, port, offset); 2349 2349 msg.opcode = ice_sbq_msg_rd; 2350 2350 2351 - err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); 2351 + err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD); 2352 2352 if (err) { 2353 2353 ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n", 2354 2354 err); ··· 2426 2426 msg.opcode = ice_sbq_msg_wr; 2427 2427 msg.data = val; 2428 2428 2429 - err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); 2429 + err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD); 2430 2430 if (err) { 2431 2431 ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n", 2432 2432 err); ··· 2587 2587 2588 2588 msg.opcode = ice_sbq_msg_rd; 2589 2589 2590 - err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); 2590 + err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD); 2591 2591 if (err) { 2592 2592 ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n", 2593 2593 err); ··· 2622 2622 msg.opcode = ice_sbq_msg_wr; 2623 2623 msg.data = val; 2624 2624 2625 - err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); 2625 + err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD); 2626 2626 if (err) { 2627 2627 ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n", 2628 2628 err); ··· 4267 4267 msg.opcode = ice_sbq_msg_rd; 4268 4268 msg.dest_dev = ice_sbq_dev_phy_0; 4269 4269 4270 - err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); 4270 + err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD); 4271 4271 if (err) { 4272 4272 ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n", 4273 4273 err); ··· 4298 4298 msg.dest_dev = ice_sbq_dev_phy_0; 4299 4299 msg.data = val; 4300 4300 4301 - err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); 4301 + err = ice_sbq_rw_reg(hw, &msg, LIBIE_AQ_FLAG_RD); 4302 4302 if (err) { 4303 4303 ice_debug(hw, ICE_DBG_PTP, "Failed to send message to PHY, err %d\n", 4304 4304 err);
+9 -9
drivers/net/ethernet/intel/ice/ice_sched.c
··· 123 123 u16 *elems_resp, struct ice_sq_cd *cd) 124 124 { 125 125 struct ice_aqc_sched_elem_cmd *cmd; 126 - struct ice_aq_desc desc; 126 + struct libie_aq_desc desc; 127 127 int status; 128 128 129 - cmd = &desc.params.sched_elem_cmd; 129 + cmd = libie_aq_raw(&desc); 130 130 ice_fill_dflt_direct_cmd_desc(&desc, cmd_opc); 131 131 cmd->num_elem_req = cpu_to_le16(elems_req); 132 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 132 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 133 133 status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd); 134 134 if (!status && elems_resp) 135 135 *elems_resp = le16_to_cpu(cmd->num_elem_resp); ··· 392 392 u8 *num_branches, struct ice_sq_cd *cd) 393 393 { 394 394 struct ice_aqc_get_topo *cmd; 395 - struct ice_aq_desc desc; 395 + struct libie_aq_desc desc; 396 396 int status; 397 397 398 - cmd = &desc.params.get_topo; 398 + cmd = libie_aq_raw(&desc); 399 399 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_dflt_topo); 400 400 cmd->port_num = lport; 401 401 status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd); ··· 518 518 struct ice_aqc_query_txsched_res_resp *buf, 519 519 struct ice_sq_cd *cd) 520 520 { 521 - struct ice_aq_desc desc; 521 + struct libie_aq_desc desc; 522 522 523 523 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_query_sched_res); 524 524 return ice_aq_send_cmd(hw, &desc, buf, buf_size, cd); ··· 683 683 u16 buf_size, u16 *num_processed, struct ice_sq_cd *cd) 684 684 { 685 685 struct ice_aqc_rl_profile *cmd; 686 - struct ice_aq_desc desc; 686 + struct libie_aq_desc desc; 687 687 int status; 688 688 689 - cmd = &desc.params.rl_profile; 689 + cmd = libie_aq_raw(&desc); 690 690 691 691 ice_fill_dflt_direct_cmd_desc(&desc, opcode); 692 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 692 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 693 693 cmd->num_profiles = cpu_to_le16(num_profiles); 694 694 status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd); 695 695 if (!status && num_processed)
+3 -1
drivers/net/ethernet/intel/ice/ice_sriov.c
··· 1161 1161 void 1162 1162 ice_vf_lan_overflow_event(struct ice_pf *pf, struct ice_rq_event_info *event) 1163 1163 { 1164 + struct ice_aqc_event_lan_overflow *cmd; 1164 1165 u32 gldcb_rtctq, queue; 1165 1166 struct ice_vf *vf; 1166 1167 1167 - gldcb_rtctq = le32_to_cpu(event->desc.params.lan_overflow.prtdcb_ruptq); 1168 + cmd = libie_aq_raw(&event->desc); 1169 + gldcb_rtctq = le32_to_cpu(cmd->prtdcb_ruptq); 1168 1170 dev_dbg(ice_pf_to_dev(pf), "GLDCB_RTCTQ: 0x%08x\n", gldcb_rtctq); 1169 1171 1170 1172 /* event returns device global Rx queue number */
+28 -27
drivers/net/ethernet/intel/ice/ice_switch.c
··· 1511 1511 struct ice_sq_cd *cd) 1512 1512 { 1513 1513 struct ice_aqc_get_sw_cfg *cmd; 1514 - struct ice_aq_desc desc; 1514 + struct libie_aq_desc desc; 1515 1515 int status; 1516 1516 1517 1517 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_sw_cfg); 1518 - cmd = &desc.params.get_sw_conf; 1518 + cmd = libie_aq_raw(&desc); 1519 1519 cmd->element = cpu_to_le16(*req_desc); 1520 1520 1521 1521 status = ice_aq_send_cmd(hw, &desc, buf, buf_size, cd); ··· 1541 1541 { 1542 1542 struct ice_aqc_add_update_free_vsi_resp *res; 1543 1543 struct ice_aqc_add_get_update_free_vsi *cmd; 1544 - struct ice_aq_desc desc; 1544 + struct libie_aq_desc desc; 1545 1545 int status; 1546 1546 1547 - cmd = &desc.params.vsi_cmd; 1548 - res = &desc.params.add_update_free_vsi_res; 1547 + cmd = libie_aq_raw(&desc); 1548 + res = libie_aq_raw(&desc); 1549 1549 1550 1550 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_add_vsi); 1551 1551 ··· 1556 1556 1557 1557 cmd->vsi_flags = cpu_to_le16(vsi_ctx->flags); 1558 1558 1559 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 1559 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 1560 1560 1561 1561 status = ice_aq_send_cmd(hw, &desc, &vsi_ctx->info, 1562 1562 sizeof(vsi_ctx->info), cd); ··· 1585 1585 { 1586 1586 struct ice_aqc_add_update_free_vsi_resp *resp; 1587 1587 struct ice_aqc_add_get_update_free_vsi *cmd; 1588 - struct ice_aq_desc desc; 1588 + struct libie_aq_desc desc; 1589 1589 int status; 1590 1590 1591 - cmd = &desc.params.vsi_cmd; 1592 - resp = &desc.params.add_update_free_vsi_res; 1591 + cmd = libie_aq_raw(&desc); 1592 + resp = libie_aq_raw(&desc); 1593 1593 1594 1594 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_free_vsi); 1595 1595 ··· 1620 1620 { 1621 1621 struct ice_aqc_add_update_free_vsi_resp *resp; 1622 1622 struct ice_aqc_add_get_update_free_vsi *cmd; 1623 - struct ice_aq_desc desc; 1623 + struct libie_aq_desc desc; 1624 1624 int status; 1625 1625 1626 - cmd = &desc.params.vsi_cmd; 1627 - resp = &desc.params.add_update_free_vsi_res; 1626 + cmd = libie_aq_raw(&desc); 1627 + resp = libie_aq_raw(&desc); 1628 1628 1629 1629 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_update_vsi); 1630 1630 1631 1631 cmd->vsi_num = cpu_to_le16(vsi_ctx->vsi_num | ICE_AQ_VSI_IS_VALID); 1632 1632 1633 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 1633 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 1634 1634 1635 1635 status = ice_aq_send_cmd(hw, &desc, &vsi_ctx->info, 1636 1636 sizeof(vsi_ctx->info), cd); ··· 1944 1944 ice_aq_sw_rules(struct ice_hw *hw, void *rule_list, u16 rule_list_sz, 1945 1945 u8 num_rules, enum ice_adminq_opc opc, struct ice_sq_cd *cd) 1946 1946 { 1947 - struct ice_aq_desc desc; 1947 + struct ice_aqc_sw_rules *cmd; 1948 + struct libie_aq_desc desc; 1948 1949 int status; 1949 1950 1950 1951 if (opc != ice_aqc_opc_add_sw_rules && ··· 1954 1953 return -EINVAL; 1955 1954 1956 1955 ice_fill_dflt_direct_cmd_desc(&desc, opc); 1956 + cmd = libie_aq_raw(&desc); 1957 1957 1958 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 1959 - desc.params.sw_rules.num_rules_fltr_entry_index = 1960 - cpu_to_le16(num_rules); 1958 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 1959 + cmd->num_rules_fltr_entry_index = cpu_to_le16(num_rules); 1961 1960 status = ice_aq_send_cmd(hw, &desc, rule_list, rule_list_sz, cd); 1962 1961 if (opc != ice_aqc_opc_add_sw_rules && 1963 - hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT) 1962 + hw->adminq.sq_last_status == LIBIE_AQ_RC_ENOENT) 1964 1963 status = -ENOENT; 1965 1964 1966 1965 if (!status) { ··· 1990 1989 u16 num_recipes, struct ice_sq_cd *cd) 1991 1990 { 1992 1991 struct ice_aqc_add_get_recipe *cmd; 1993 - struct ice_aq_desc desc; 1992 + struct libie_aq_desc desc; 1994 1993 u16 buf_size; 1995 1994 1996 - cmd = &desc.params.add_get_recipe; 1995 + cmd = libie_aq_raw(&desc); 1997 1996 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_add_recipe); 1998 1997 1999 1998 cmd->num_sub_recipes = cpu_to_le16(num_recipes); 2000 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 1999 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 2001 2000 2002 2001 buf_size = num_recipes * sizeof(*s_recipe_list); 2003 2002 ··· 2027 2026 u16 *num_recipes, u16 recipe_root, struct ice_sq_cd *cd) 2028 2027 { 2029 2028 struct ice_aqc_add_get_recipe *cmd; 2030 - struct ice_aq_desc desc; 2029 + struct libie_aq_desc desc; 2031 2030 u16 buf_size; 2032 2031 int status; 2033 2032 2034 2033 if (*num_recipes != ICE_MAX_NUM_RECIPES) 2035 2034 return -EINVAL; 2036 2035 2037 - cmd = &desc.params.add_get_recipe; 2036 + cmd = libie_aq_raw(&desc); 2038 2037 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_recipe); 2039 2038 2040 2039 cmd->return_index = cpu_to_le16(recipe_root); ··· 2119 2118 struct ice_sq_cd *cd) 2120 2119 { 2121 2120 struct ice_aqc_recipe_to_profile *cmd; 2122 - struct ice_aq_desc desc; 2121 + struct libie_aq_desc desc; 2123 2122 2124 - cmd = &desc.params.recipe_to_profile; 2123 + cmd = libie_aq_raw(&desc); 2125 2124 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_recipe_to_profile); 2126 2125 cmd->profile_id = cpu_to_le16(profile_id); 2127 2126 /* Set the recipe ID bit in the bitmask to let the device know which ··· 2145 2144 struct ice_sq_cd *cd) 2146 2145 { 2147 2146 struct ice_aqc_recipe_to_profile *cmd; 2148 - struct ice_aq_desc desc; 2147 + struct libie_aq_desc desc; 2149 2148 int status; 2150 2149 2151 - cmd = &desc.params.recipe_to_profile; 2150 + cmd = libie_aq_raw(&desc); 2152 2151 ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_recipe_to_profile); 2153 2152 cmd->profile_id = cpu_to_le16(profile_id); 2154 2153
+3 -3
drivers/net/ethernet/intel/ice/ice_vf_mbx.c
··· 23 23 u8 *msg, u16 msglen, struct ice_sq_cd *cd) 24 24 { 25 25 struct ice_aqc_pf_vf_msg *cmd; 26 - struct ice_aq_desc desc; 26 + struct libie_aq_desc desc; 27 27 28 28 ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_opc_send_msg_to_vf); 29 29 30 - cmd = &desc.params.virt; 30 + cmd = libie_aq_raw(&desc); 31 31 cmd->id = cpu_to_le32(vfid); 32 32 33 33 desc.cookie_high = cpu_to_le32(v_opcode); 34 34 desc.cookie_low = cpu_to_le32(v_retval); 35 35 36 36 if (msglen) 37 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 37 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 38 38 39 39 return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd); 40 40 }
+1 -1
drivers/net/ethernet/intel/ice/ice_virtchnl.c
··· 304 304 305 305 aq_ret = ice_aq_send_msg_to_vf(&pf->hw, vf->vf_id, v_opcode, v_retval, 306 306 msg, msglen, NULL); 307 - if (aq_ret && pf->hw.mailboxq.sq_last_status != ICE_AQ_RC_ENOSYS) { 307 + if (aq_ret && pf->hw.mailboxq.sq_last_status != LIBIE_AQ_RC_ENOSYS) { 308 308 dev_info(dev, "Unable to send the message to VF %d ret %d aq_err %s\n", 309 309 vf->vf_id, aq_ret, 310 310 ice_aq_str(pf->hw.mailboxq.sq_last_status));
+3 -3
drivers/net/ethernet/intel/ice/ice_vlan_mode.c
··· 63 63 ice_aq_get_vlan_mode(struct ice_hw *hw, 64 64 struct ice_aqc_get_vlan_mode *get_params) 65 65 { 66 - struct ice_aq_desc desc; 66 + struct libie_aq_desc desc; 67 67 68 68 if (!get_params) 69 69 return -EINVAL; ··· 275 275 struct ice_aqc_set_vlan_mode *set_params) 276 276 { 277 277 u8 rdma_packet, mng_vlan_prot_id; 278 - struct ice_aq_desc desc; 278 + struct libie_aq_desc desc; 279 279 280 280 if (!set_params) 281 281 return -EINVAL; ··· 295 295 296 296 ice_fill_dflt_direct_cmd_desc(&desc, 297 297 ice_aqc_opc_set_vlan_mode_parameters); 298 - desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); 298 + desc.flags |= cpu_to_le16(LIBIE_AQ_FLAG_RD); 299 299 300 300 return ice_aq_send_cmd(hw, &desc, set_params, sizeof(*set_params), 301 301 NULL);
+273
include/linux/net/intel/libie/adminq.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + /* Copyright (C) 2025 Intel Corporation */ 3 + 4 + #ifndef __LIBIE_ADMINQ_H 5 + #define __LIBIE_ADMINQ_H 6 + 7 + #include <linux/build_bug.h> 8 + #include <linux/types.h> 9 + 10 + #define LIBIE_CHECK_STRUCT_LEN(n, X) \ 11 + static_assert((n) == sizeof(struct X)) 12 + 13 + /** 14 + * struct libie_aqc_generic - Generic structure used in adminq communication 15 + * @param0: generic parameter high 32bit 16 + * @param1: generic parameter lower 32bit 17 + * @addr_high: generic address high 32bit 18 + * @addr_low: generic address lower 32bit 19 + */ 20 + struct libie_aqc_generic { 21 + __le32 param0; 22 + __le32 param1; 23 + __le32 addr_high; 24 + __le32 addr_low; 25 + }; 26 + LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_generic); 27 + 28 + /** 29 + * struct libie_aqc_get_ver - Used in command get version (direct 0x0001) 30 + * @rom_ver: rom version 31 + * @fw_build: number coressponding to firmware build 32 + * @fw_branch: branch identifier of firmware version 33 + * @fw_major: major number of firmware version 34 + * @fw_minor: minor number of firmware version 35 + * @fw_patch: patch of firmware version 36 + * @api_branch: brancch identifier of API version 37 + * @api_major: major number of API version 38 + * @api_minor: minor number of API version 39 + * @api_patch: patch of API version 40 + */ 41 + struct libie_aqc_get_ver { 42 + __le32 rom_ver; 43 + __le32 fw_build; 44 + u8 fw_branch; 45 + u8 fw_major; 46 + u8 fw_minor; 47 + u8 fw_patch; 48 + u8 api_branch; 49 + u8 api_major; 50 + u8 api_minor; 51 + u8 api_patch; 52 + }; 53 + LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_get_ver); 54 + 55 + /** 56 + * struct libie_aqc_driver_ver - Used in command send driver version 57 + * (indirect 0x0002) 58 + * @major_ver: driver major version 59 + * @minor_ver: driver minor version 60 + * @build_ver: driver build version 61 + * @subbuild_ver: driver subbuild version 62 + * @reserved: for feature use 63 + * @addr_high: high part of response address buff 64 + * @addr_low: low part of response address buff 65 + */ 66 + struct libie_aqc_driver_ver { 67 + u8 major_ver; 68 + u8 minor_ver; 69 + u8 build_ver; 70 + u8 subbuild_ver; 71 + u8 reserved[4]; 72 + __le32 addr_high; 73 + __le32 addr_low; 74 + }; 75 + LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_driver_ver); 76 + 77 + enum libie_aq_res_id { 78 + LIBIE_AQC_RES_ID_NVM = 1, 79 + LIBIE_AQC_RES_ID_SDP = 2, 80 + LIBIE_AQC_RES_ID_CHNG_LOCK = 3, 81 + LIBIE_AQC_RES_ID_GLBL_LOCK = 4, 82 + }; 83 + 84 + enum libie_aq_res_access_type { 85 + LIBIE_AQC_RES_ACCESS_READ = 1, 86 + LIBIE_AQC_RES_ACCESS_WRITE = 2, 87 + }; 88 + 89 + #define LIBIE_AQ_RES_NVM_READ_DFLT_TIMEOUT_MS 3000 90 + #define LIBIE_AQ_RES_NVM_WRITE_DFLT_TIMEOUT_MS 180000 91 + #define LIBIE_AQ_RES_CHNG_LOCK_DFLT_TIMEOUT_MS 1000 92 + #define LIBIE_AQ_RES_GLBL_LOCK_DFLT_TIMEOUT_MS 3000 93 + 94 + #define LIBIE_AQ_RES_GLBL_SUCCESS 0 95 + #define LIBIE_AQ_RES_GLBL_IN_PROG 1 96 + #define LIBIE_AQ_RES_GLBL_DONE 2 97 + 98 + /** 99 + * struct libie_aqc_req_res - Request resource ownership 100 + * @res_id: resource ID (look at enum definition above) 101 + * @access_type: read or write (enum definition above) 102 + * @timeout: Upon successful completion, FW writes this value and driver is 103 + * expected to release resource before timeout. This value is provided in 104 + * milliseconds. 105 + * @res_number: for SDP, this is the pin ID of the SDP 106 + * @status: status only used for LIBIE_AQC_RES_ID_GLBL_LOCK, for others reserved 107 + * @reserved: reserved for future use 108 + * 109 + * Used in commands: 110 + * request resource ownership (direct 0x0008) 111 + * request resource ownership (direct 0x0009) 112 + */ 113 + struct libie_aqc_req_res { 114 + __le16 res_id; 115 + __le16 access_type; 116 + 117 + __le32 timeout; 118 + __le32 res_number; 119 + __le16 status; 120 + u8 reserved[2]; 121 + }; 122 + LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_req_res); 123 + 124 + /** 125 + * struct libie_aqc_list_caps - Getting capabilities 126 + * @cmd_flags: command flags 127 + * @pf_index: index of PF to get caps from 128 + * @reserved: reserved for future use 129 + * @count: number of capabilities records 130 + * @addr_high: high part of response address buff 131 + * @addr_low: low part of response address buff 132 + * 133 + * Used in commands: 134 + * get function capabilities (indirect 0x000A) 135 + * get device capabilities (indirect 0x000B) 136 + */ 137 + struct libie_aqc_list_caps { 138 + u8 cmd_flags; 139 + u8 pf_index; 140 + u8 reserved[2]; 141 + __le32 count; 142 + __le32 addr_high; 143 + __le32 addr_low; 144 + }; 145 + LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_list_caps); 146 + 147 + /* Device/Function buffer entry, repeated per reported capability */ 148 + #define LIBIE_AQC_CAPS_VALID_FUNCTIONS 0x0005 149 + #define LIBIE_AQC_CAPS_SRIOV 0x0012 150 + #define LIBIE_AQC_CAPS_VF 0x0013 151 + #define LIBIE_AQC_CAPS_VSI 0x0017 152 + #define LIBIE_AQC_CAPS_DCB 0x0018 153 + #define LIBIE_AQC_CAPS_RSS 0x0040 154 + #define LIBIE_AQC_CAPS_RXQS 0x0041 155 + #define LIBIE_AQC_CAPS_TXQS 0x0042 156 + #define LIBIE_AQC_CAPS_MSIX 0x0043 157 + #define LIBIE_AQC_CAPS_FD 0x0045 158 + #define LIBIE_AQC_CAPS_1588 0x0046 159 + #define LIBIE_AQC_CAPS_MAX_MTU 0x0047 160 + #define LIBIE_AQC_CAPS_NVM_VER 0x0048 161 + #define LIBIE_AQC_CAPS_PENDING_NVM_VER 0x0049 162 + #define LIBIE_AQC_CAPS_OROM_VER 0x004A 163 + #define LIBIE_AQC_CAPS_PENDING_OROM_VER 0x004B 164 + #define LIBIE_AQC_CAPS_NET_VER 0x004C 165 + #define LIBIE_AQC_CAPS_PENDING_NET_VER 0x004D 166 + #define LIBIE_AQC_CAPS_RDMA 0x0051 167 + #define LIBIE_AQC_CAPS_SENSOR_READING 0x0067 168 + #define LIBIE_AQC_CAPS_PCIE_RESET_AVOIDANCE 0x0076 169 + #define LIBIE_AQC_CAPS_POST_UPDATE_RESET_RESTRICT 0x0077 170 + #define LIBIE_AQC_CAPS_NVM_MGMT 0x0080 171 + #define LIBIE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE 0x0085 172 + #define LIBIE_AQC_CAPS_NAC_TOPOLOGY 0x0087 173 + #define LIBIE_AQC_CAPS_FW_LAG_SUPPORT 0x0092 174 + #define LIBIE_AQC_BIT_ROCEV2_LAG 0x01 175 + #define LIBIE_AQC_BIT_SRIOV_LAG 0x02 176 + 177 + /** 178 + * struct libie_aqc_list_caps_elem - Getting list of caps elements 179 + * @cap: one from the defines list above 180 + * @major_ver: major version 181 + * @minor_ver: minor version 182 + * @number: number of resources described by this capability 183 + * @logical_id: logical ID, only meaningful for some types of resources 184 + * @phys_id: physical ID, only meaningful for some types of resources 185 + * @rsvd1: reserved for future use 186 + * @rsvd2: reserved for future use 187 + */ 188 + struct libie_aqc_list_caps_elem { 189 + __le16 cap; 190 + 191 + u8 major_ver; 192 + u8 minor_ver; 193 + __le32 number; 194 + __le32 logical_id; 195 + __le32 phys_id; 196 + __le64 rsvd1; 197 + __le64 rsvd2; 198 + }; 199 + LIBIE_CHECK_STRUCT_LEN(32, libie_aqc_list_caps_elem); 200 + 201 + /** 202 + * struct libie_aq_desc - Admin Queue (AQ) descriptor 203 + * @flags: LIBIE_AQ_FLAG_* flags 204 + * @opcode: AQ command opcode 205 + * @datalen: length in bytes of indirect/external data buffer 206 + * @retval: return value from firmware 207 + * @cookie_high: opaque data high-half 208 + * @cookie_low: opaque data low-half 209 + * @params: command-specific parameters 210 + * 211 + * Descriptor format for commands the driver posts on the Admin Transmit Queue 212 + * (ATQ). The firmware writes back onto the command descriptor and returns 213 + * the result of the command. Asynchronous events that are not an immediate 214 + * result of the command are written to the Admin Receive Queue (ARQ) using 215 + * the same descriptor format. Descriptors are in little-endian notation with 216 + * 32-bit words. 217 + */ 218 + struct libie_aq_desc { 219 + __le16 flags; 220 + __le16 opcode; 221 + __le16 datalen; 222 + __le16 retval; 223 + __le32 cookie_high; 224 + __le32 cookie_low; 225 + union { 226 + u8 raw[16]; 227 + struct libie_aqc_generic generic; 228 + struct libie_aqc_get_ver get_ver; 229 + struct libie_aqc_driver_ver driver_ver; 230 + struct libie_aqc_req_res res_owner; 231 + struct libie_aqc_list_caps get_cap; 232 + } params; 233 + }; 234 + LIBIE_CHECK_STRUCT_LEN(32, libie_aq_desc); 235 + 236 + /* FW defined boundary for a large buffer, 4k >= Large buffer > 512 bytes */ 237 + #define LIBIE_AQ_LG_BUF 512 238 + 239 + #define LIBIE_AQ_FLAG_DD BIT(0) /* 0x1 */ 240 + #define LIBIE_AQ_FLAG_CMP BIT(1) /* 0x2 */ 241 + #define LIBIE_AQ_FLAG_ERR BIT(2) /* 0x4 */ 242 + #define LIBIE_AQ_FLAG_LB BIT(9) /* 0x200 */ 243 + #define LIBIE_AQ_FLAG_RD BIT(10) /* 0x400 */ 244 + #define LIBIE_AQ_FLAG_BUF BIT(12) /* 0x1000 */ 245 + #define LIBIE_AQ_FLAG_SI BIT(13) /* 0x2000 */ 246 + 247 + /* error codes */ 248 + enum libie_aq_err { 249 + LIBIE_AQ_RC_OK = 0, /* Success */ 250 + LIBIE_AQ_RC_EPERM = 1, /* Operation not permitted */ 251 + LIBIE_AQ_RC_ENOENT = 2, /* No such element */ 252 + LIBIE_AQ_RC_ESRCH = 3, /* Bad opcode */ 253 + LIBIE_AQ_RC_EAGAIN = 8, /* Try again */ 254 + LIBIE_AQ_RC_ENOMEM = 9, /* Out of memory */ 255 + LIBIE_AQ_RC_EBUSY = 12, /* Device or resource busy */ 256 + LIBIE_AQ_RC_EEXIST = 13, /* Object already exists */ 257 + LIBIE_AQ_RC_EINVAL = 14, /* Invalid argument */ 258 + LIBIE_AQ_RC_ENOSPC = 16, /* No space left or allocation failure */ 259 + LIBIE_AQ_RC_ENOSYS = 17, /* Function not implemented */ 260 + LIBIE_AQ_RC_EMODE = 21, /* Op not allowed in current dev mode */ 261 + LIBIE_AQ_RC_ENOSEC = 24, /* Missing security manifest */ 262 + LIBIE_AQ_RC_EBADSIG = 25, /* Bad RSA signature */ 263 + LIBIE_AQ_RC_ESVN = 26, /* SVN number prohibits this package */ 264 + LIBIE_AQ_RC_EBADMAN = 27, /* Manifest hash mismatch */ 265 + LIBIE_AQ_RC_EBADBUF = 28, /* Buffer hash mismatches manifest */ 266 + }; 267 + 268 + static inline void *libie_aq_raw(struct libie_aq_desc *desc) 269 + { 270 + return &desc->params.raw; 271 + } 272 + 273 + #endif /* __LIBIE_ADMINQ_H */