提交 75da437a 编写于 作者: J Jakub Kicinski

Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2023-02-09 (i40e)

Jan removes i40e_status from the driver; replacing them with standard
kernel error codes.

Kees Cook replaces 0-length array with flexible array.

* '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
  net/i40e: Replace 0-length array with flexible array
  i40e: use ERR_PTR error print in i40e messages
  i40e: use int for i40e_status
  i40e: Remove string printing for i40e_status
  i40e: Remove unused i40e status codes
====================

Link: https://lore.kernel.org/r/20230209172536.3595838-1-anthony.l.nguyen@intel.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
...@@ -177,7 +177,7 @@ enum i40e_interrupt_policy { ...@@ -177,7 +177,7 @@ enum i40e_interrupt_policy {
struct i40e_lump_tracking { struct i40e_lump_tracking {
u16 num_entries; u16 num_entries;
u16 list[0]; u16 list[];
#define I40E_PILE_VALID_BIT 0x8000 #define I40E_PILE_VALID_BIT 0x8000
#define I40E_IWARP_IRQ_PILE_ID (I40E_PILE_VALID_BIT - 2) #define I40E_IWARP_IRQ_PILE_ID (I40E_PILE_VALID_BIT - 2)
}; };
...@@ -1288,9 +1288,9 @@ void i40e_ptp_stop(struct i40e_pf *pf); ...@@ -1288,9 +1288,9 @@ void i40e_ptp_stop(struct i40e_pf *pf);
int i40e_ptp_alloc_pins(struct i40e_pf *pf); int i40e_ptp_alloc_pins(struct i40e_pf *pf);
int i40e_update_adq_vsi_queues(struct i40e_vsi *vsi, int vsi_offset); int i40e_update_adq_vsi_queues(struct i40e_vsi *vsi, int vsi_offset);
int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi *vsi); int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi *vsi);
i40e_status i40e_get_partition_bw_setting(struct i40e_pf *pf); int i40e_get_partition_bw_setting(struct i40e_pf *pf);
i40e_status i40e_set_partition_bw_setting(struct i40e_pf *pf); int i40e_set_partition_bw_setting(struct i40e_pf *pf);
i40e_status i40e_commit_partition_bw_setting(struct i40e_pf *pf); int i40e_commit_partition_bw_setting(struct i40e_pf *pf);
void i40e_print_link_message(struct i40e_vsi *vsi, bool isup); void i40e_print_link_message(struct i40e_vsi *vsi, bool isup);
void i40e_set_fec_in_flags(u8 fec_cfg, u32 *flags); void i40e_set_fec_in_flags(u8 fec_cfg, u32 *flags);
......
...@@ -47,9 +47,9 @@ static void i40e_adminq_init_regs(struct i40e_hw *hw) ...@@ -47,9 +47,9 @@ static void i40e_adminq_init_regs(struct i40e_hw *hw)
* i40e_alloc_adminq_asq_ring - Allocate Admin Queue send rings * i40e_alloc_adminq_asq_ring - Allocate Admin Queue send rings
* @hw: pointer to the hardware structure * @hw: pointer to the hardware structure
**/ **/
static i40e_status i40e_alloc_adminq_asq_ring(struct i40e_hw *hw) static int i40e_alloc_adminq_asq_ring(struct i40e_hw *hw)
{ {
i40e_status ret_code; int ret_code;
ret_code = i40e_allocate_dma_mem(hw, &hw->aq.asq.desc_buf, ret_code = i40e_allocate_dma_mem(hw, &hw->aq.asq.desc_buf,
i40e_mem_atq_ring, i40e_mem_atq_ring,
...@@ -74,9 +74,9 @@ static i40e_status i40e_alloc_adminq_asq_ring(struct i40e_hw *hw) ...@@ -74,9 +74,9 @@ static i40e_status i40e_alloc_adminq_asq_ring(struct i40e_hw *hw)
* i40e_alloc_adminq_arq_ring - Allocate Admin Queue receive rings * i40e_alloc_adminq_arq_ring - Allocate Admin Queue receive rings
* @hw: pointer to the hardware structure * @hw: pointer to the hardware structure
**/ **/
static i40e_status i40e_alloc_adminq_arq_ring(struct i40e_hw *hw) static int i40e_alloc_adminq_arq_ring(struct i40e_hw *hw)
{ {
i40e_status ret_code; int ret_code;
ret_code = i40e_allocate_dma_mem(hw, &hw->aq.arq.desc_buf, ret_code = i40e_allocate_dma_mem(hw, &hw->aq.arq.desc_buf,
i40e_mem_arq_ring, i40e_mem_arq_ring,
...@@ -115,11 +115,11 @@ static void i40e_free_adminq_arq(struct i40e_hw *hw) ...@@ -115,11 +115,11 @@ static void i40e_free_adminq_arq(struct i40e_hw *hw)
* i40e_alloc_arq_bufs - Allocate pre-posted buffers for the receive queue * i40e_alloc_arq_bufs - Allocate pre-posted buffers for the receive queue
* @hw: pointer to the hardware structure * @hw: pointer to the hardware structure
**/ **/
static i40e_status i40e_alloc_arq_bufs(struct i40e_hw *hw) static int i40e_alloc_arq_bufs(struct i40e_hw *hw)
{ {
i40e_status ret_code;
struct i40e_aq_desc *desc; struct i40e_aq_desc *desc;
struct i40e_dma_mem *bi; struct i40e_dma_mem *bi;
int ret_code;
int i; int i;
/* We'll be allocating the buffer info memory first, then we can /* We'll be allocating the buffer info memory first, then we can
...@@ -182,10 +182,10 @@ static i40e_status i40e_alloc_arq_bufs(struct i40e_hw *hw) ...@@ -182,10 +182,10 @@ static i40e_status i40e_alloc_arq_bufs(struct i40e_hw *hw)
* i40e_alloc_asq_bufs - Allocate empty buffer structs for the send queue * i40e_alloc_asq_bufs - Allocate empty buffer structs for the send queue
* @hw: pointer to the hardware structure * @hw: pointer to the hardware structure
**/ **/
static i40e_status i40e_alloc_asq_bufs(struct i40e_hw *hw) static int i40e_alloc_asq_bufs(struct i40e_hw *hw)
{ {
i40e_status ret_code;
struct i40e_dma_mem *bi; struct i40e_dma_mem *bi;
int ret_code;
int i; int i;
/* No mapped memory needed yet, just the buffer info structures */ /* No mapped memory needed yet, just the buffer info structures */
...@@ -266,9 +266,9 @@ static void i40e_free_asq_bufs(struct i40e_hw *hw) ...@@ -266,9 +266,9 @@ static void i40e_free_asq_bufs(struct i40e_hw *hw)
* *
* Configure base address and length registers for the transmit queue * Configure base address and length registers for the transmit queue
**/ **/
static i40e_status i40e_config_asq_regs(struct i40e_hw *hw) static int i40e_config_asq_regs(struct i40e_hw *hw)
{ {
i40e_status ret_code = 0; int ret_code = 0;
u32 reg = 0; u32 reg = 0;
/* Clear Head and Tail */ /* Clear Head and Tail */
...@@ -295,9 +295,9 @@ static i40e_status i40e_config_asq_regs(struct i40e_hw *hw) ...@@ -295,9 +295,9 @@ static i40e_status i40e_config_asq_regs(struct i40e_hw *hw)
* *
* Configure base address and length registers for the receive (event queue) * Configure base address and length registers for the receive (event queue)
**/ **/
static i40e_status i40e_config_arq_regs(struct i40e_hw *hw) static int i40e_config_arq_regs(struct i40e_hw *hw)
{ {
i40e_status ret_code = 0; int ret_code = 0;
u32 reg = 0; u32 reg = 0;
/* Clear Head and Tail */ /* Clear Head and Tail */
...@@ -334,9 +334,9 @@ static i40e_status i40e_config_arq_regs(struct i40e_hw *hw) ...@@ -334,9 +334,9 @@ static i40e_status i40e_config_arq_regs(struct i40e_hw *hw)
* Do *NOT* hold the lock when calling this as the memory allocation routines * Do *NOT* hold the lock when calling this as the memory allocation routines
* called are not going to be atomic context safe * called are not going to be atomic context safe
**/ **/
static i40e_status i40e_init_asq(struct i40e_hw *hw) static int i40e_init_asq(struct i40e_hw *hw)
{ {
i40e_status ret_code = 0; int ret_code = 0;
if (hw->aq.asq.count > 0) { if (hw->aq.asq.count > 0) {
/* queue already initialized */ /* queue already initialized */
...@@ -393,9 +393,9 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw) ...@@ -393,9 +393,9 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw)
* Do *NOT* hold the lock when calling this as the memory allocation routines * Do *NOT* hold the lock when calling this as the memory allocation routines
* called are not going to be atomic context safe * called are not going to be atomic context safe
**/ **/
static i40e_status i40e_init_arq(struct i40e_hw *hw) static int i40e_init_arq(struct i40e_hw *hw)
{ {
i40e_status ret_code = 0; int ret_code = 0;
if (hw->aq.arq.count > 0) { if (hw->aq.arq.count > 0) {
/* queue already initialized */ /* queue already initialized */
...@@ -445,9 +445,9 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw) ...@@ -445,9 +445,9 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw)
* *
* The main shutdown routine for the Admin Send Queue * The main shutdown routine for the Admin Send Queue
**/ **/
static i40e_status i40e_shutdown_asq(struct i40e_hw *hw) static int i40e_shutdown_asq(struct i40e_hw *hw)
{ {
i40e_status ret_code = 0; int ret_code = 0;
mutex_lock(&hw->aq.asq_mutex); mutex_lock(&hw->aq.asq_mutex);
...@@ -479,9 +479,9 @@ static i40e_status i40e_shutdown_asq(struct i40e_hw *hw) ...@@ -479,9 +479,9 @@ static i40e_status i40e_shutdown_asq(struct i40e_hw *hw)
* *
* The main shutdown routine for the Admin Receive Queue * The main shutdown routine for the Admin Receive Queue
**/ **/
static i40e_status i40e_shutdown_arq(struct i40e_hw *hw) static int i40e_shutdown_arq(struct i40e_hw *hw)
{ {
i40e_status ret_code = 0; int ret_code = 0;
mutex_lock(&hw->aq.arq_mutex); mutex_lock(&hw->aq.arq_mutex);
...@@ -582,12 +582,12 @@ static void i40e_set_hw_flags(struct i40e_hw *hw) ...@@ -582,12 +582,12 @@ static void i40e_set_hw_flags(struct i40e_hw *hw)
* - hw->aq.arq_buf_size * - hw->aq.arq_buf_size
* - hw->aq.asq_buf_size * - hw->aq.asq_buf_size
**/ **/
i40e_status i40e_init_adminq(struct i40e_hw *hw) int i40e_init_adminq(struct i40e_hw *hw)
{ {
u16 cfg_ptr, oem_hi, oem_lo; u16 cfg_ptr, oem_hi, oem_lo;
u16 eetrack_lo, eetrack_hi; u16 eetrack_lo, eetrack_hi;
i40e_status ret_code;
int retry = 0; int retry = 0;
int ret_code;
/* verify input for valid configuration */ /* verify input for valid configuration */
if ((hw->aq.num_arq_entries == 0) || if ((hw->aq.num_arq_entries == 0) ||
...@@ -780,7 +780,7 @@ static bool i40e_asq_done(struct i40e_hw *hw) ...@@ -780,7 +780,7 @@ static bool i40e_asq_done(struct i40e_hw *hw)
* This is the main send command driver routine for the Admin Queue send * This is the main send command driver routine for the Admin Queue send
* queue. It runs the queue, cleans the queue, etc * queue. It runs the queue, cleans the queue, etc
**/ **/
static i40e_status static int
i40e_asq_send_command_atomic_exec(struct i40e_hw *hw, i40e_asq_send_command_atomic_exec(struct i40e_hw *hw,
struct i40e_aq_desc *desc, struct i40e_aq_desc *desc,
void *buff, /* can be NULL */ void *buff, /* can be NULL */
...@@ -788,12 +788,12 @@ i40e_asq_send_command_atomic_exec(struct i40e_hw *hw, ...@@ -788,12 +788,12 @@ i40e_asq_send_command_atomic_exec(struct i40e_hw *hw,
struct i40e_asq_cmd_details *cmd_details, struct i40e_asq_cmd_details *cmd_details,
bool is_atomic_context) bool is_atomic_context)
{ {
i40e_status status = 0;
struct i40e_dma_mem *dma_buff = NULL; struct i40e_dma_mem *dma_buff = NULL;
struct i40e_asq_cmd_details *details; struct i40e_asq_cmd_details *details;
struct i40e_aq_desc *desc_on_ring; struct i40e_aq_desc *desc_on_ring;
bool cmd_completed = false; bool cmd_completed = false;
u16 retval = 0; u16 retval = 0;
int status = 0;
u32 val = 0; u32 val = 0;
if (hw->aq.asq.count == 0) { if (hw->aq.asq.count == 0) {
...@@ -984,7 +984,7 @@ i40e_asq_send_command_atomic_exec(struct i40e_hw *hw, ...@@ -984,7 +984,7 @@ i40e_asq_send_command_atomic_exec(struct i40e_hw *hw,
* Acquires the lock and calls the main send command execution * Acquires the lock and calls the main send command execution
* routine. * routine.
**/ **/
i40e_status int
i40e_asq_send_command_atomic(struct i40e_hw *hw, i40e_asq_send_command_atomic(struct i40e_hw *hw,
struct i40e_aq_desc *desc, struct i40e_aq_desc *desc,
void *buff, /* can be NULL */ void *buff, /* can be NULL */
...@@ -992,7 +992,7 @@ i40e_asq_send_command_atomic(struct i40e_hw *hw, ...@@ -992,7 +992,7 @@ i40e_asq_send_command_atomic(struct i40e_hw *hw,
struct i40e_asq_cmd_details *cmd_details, struct i40e_asq_cmd_details *cmd_details,
bool is_atomic_context) bool is_atomic_context)
{ {
i40e_status status; int status;
mutex_lock(&hw->aq.asq_mutex); mutex_lock(&hw->aq.asq_mutex);
status = i40e_asq_send_command_atomic_exec(hw, desc, buff, buff_size, status = i40e_asq_send_command_atomic_exec(hw, desc, buff, buff_size,
...@@ -1003,7 +1003,7 @@ i40e_asq_send_command_atomic(struct i40e_hw *hw, ...@@ -1003,7 +1003,7 @@ i40e_asq_send_command_atomic(struct i40e_hw *hw,
return status; return status;
} }
i40e_status int
i40e_asq_send_command(struct i40e_hw *hw, struct i40e_aq_desc *desc, i40e_asq_send_command(struct i40e_hw *hw, struct i40e_aq_desc *desc,
void *buff, /* can be NULL */ u16 buff_size, void *buff, /* can be NULL */ u16 buff_size,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -1026,7 +1026,7 @@ i40e_asq_send_command(struct i40e_hw *hw, struct i40e_aq_desc *desc, ...@@ -1026,7 +1026,7 @@ i40e_asq_send_command(struct i40e_hw *hw, struct i40e_aq_desc *desc,
* routine. Returns the last Admin Queue status in aq_status * routine. Returns the last Admin Queue status in aq_status
* to avoid race conditions in access to hw->aq.asq_last_status. * to avoid race conditions in access to hw->aq.asq_last_status.
**/ **/
i40e_status int
i40e_asq_send_command_atomic_v2(struct i40e_hw *hw, i40e_asq_send_command_atomic_v2(struct i40e_hw *hw,
struct i40e_aq_desc *desc, struct i40e_aq_desc *desc,
void *buff, /* can be NULL */ void *buff, /* can be NULL */
...@@ -1035,7 +1035,7 @@ i40e_asq_send_command_atomic_v2(struct i40e_hw *hw, ...@@ -1035,7 +1035,7 @@ i40e_asq_send_command_atomic_v2(struct i40e_hw *hw,
bool is_atomic_context, bool is_atomic_context,
enum i40e_admin_queue_err *aq_status) enum i40e_admin_queue_err *aq_status)
{ {
i40e_status status; int status;
mutex_lock(&hw->aq.asq_mutex); mutex_lock(&hw->aq.asq_mutex);
status = i40e_asq_send_command_atomic_exec(hw, desc, buff, status = i40e_asq_send_command_atomic_exec(hw, desc, buff,
...@@ -1048,7 +1048,7 @@ i40e_asq_send_command_atomic_v2(struct i40e_hw *hw, ...@@ -1048,7 +1048,7 @@ i40e_asq_send_command_atomic_v2(struct i40e_hw *hw,
return status; return status;
} }
i40e_status int
i40e_asq_send_command_v2(struct i40e_hw *hw, struct i40e_aq_desc *desc, i40e_asq_send_command_v2(struct i40e_hw *hw, struct i40e_aq_desc *desc,
void *buff, /* can be NULL */ u16 buff_size, void *buff, /* can be NULL */ u16 buff_size,
struct i40e_asq_cmd_details *cmd_details, struct i40e_asq_cmd_details *cmd_details,
...@@ -1084,14 +1084,14 @@ void i40e_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc, ...@@ -1084,14 +1084,14 @@ void i40e_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc,
* the contents through e. It can also return how many events are * the contents through e. It can also return how many events are
* left to process through 'pending' * left to process through 'pending'
**/ **/
i40e_status i40e_clean_arq_element(struct i40e_hw *hw, int i40e_clean_arq_element(struct i40e_hw *hw,
struct i40e_arq_event_info *e, struct i40e_arq_event_info *e,
u16 *pending) u16 *pending)
{ {
i40e_status ret_code = 0;
u16 ntc = hw->aq.arq.next_to_clean; u16 ntc = hw->aq.arq.next_to_clean;
struct i40e_aq_desc *desc; struct i40e_aq_desc *desc;
struct i40e_dma_mem *bi; struct i40e_dma_mem *bi;
int ret_code = 0;
u16 desc_idx; u16 desc_idx;
u16 datalen; u16 datalen;
u16 flags; u16 flags;
......
...@@ -20,16 +20,16 @@ enum i40e_memory_type { ...@@ -20,16 +20,16 @@ enum i40e_memory_type {
}; };
/* prototype for functions used for dynamic memory allocation */ /* prototype for functions used for dynamic memory allocation */
i40e_status i40e_allocate_dma_mem(struct i40e_hw *hw, int i40e_allocate_dma_mem(struct i40e_hw *hw,
struct i40e_dma_mem *mem, struct i40e_dma_mem *mem,
enum i40e_memory_type type, enum i40e_memory_type type,
u64 size, u32 alignment); u64 size, u32 alignment);
i40e_status i40e_free_dma_mem(struct i40e_hw *hw, int i40e_free_dma_mem(struct i40e_hw *hw,
struct i40e_dma_mem *mem); struct i40e_dma_mem *mem);
i40e_status i40e_allocate_virt_mem(struct i40e_hw *hw, int i40e_allocate_virt_mem(struct i40e_hw *hw,
struct i40e_virt_mem *mem, struct i40e_virt_mem *mem,
u32 size); u32 size);
i40e_status i40e_free_virt_mem(struct i40e_hw *hw, int i40e_free_virt_mem(struct i40e_hw *hw,
struct i40e_virt_mem *mem); struct i40e_virt_mem *mem);
#endif /* _I40E_ALLOC_H_ */ #endif /* _I40E_ALLOC_H_ */
...@@ -541,7 +541,7 @@ static int i40e_client_virtchnl_send(struct i40e_info *ldev, ...@@ -541,7 +541,7 @@ static int i40e_client_virtchnl_send(struct i40e_info *ldev,
{ {
struct i40e_pf *pf = ldev->pf; struct i40e_pf *pf = ldev->pf;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status err; int err;
err = i40e_aq_send_msg_to_vf(hw, vf_id, VIRTCHNL_OP_RDMA, err = i40e_aq_send_msg_to_vf(hw, vf_id, VIRTCHNL_OP_RDMA,
0, msg, len, NULL); 0, msg, len, NULL);
...@@ -674,7 +674,7 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev, ...@@ -674,7 +674,7 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev,
struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi]; struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
struct i40e_vsi_context ctxt; struct i40e_vsi_context ctxt;
bool update = true; bool update = true;
i40e_status err; int err;
/* TODO: for now do not allow setting VF's VSI setting */ /* TODO: for now do not allow setting VF's VSI setting */
if (is_vf) if (is_vf)
...@@ -686,8 +686,8 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev, ...@@ -686,8 +686,8 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev,
ctxt.flags = I40E_AQ_VSI_TYPE_PF; ctxt.flags = I40E_AQ_VSI_TYPE_PF;
if (err) { if (err) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't get PF vsi config, err %s aq_err %s\n", "couldn't get PF vsi config, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, err), ERR_PTR(err),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
return -ENOENT; return -ENOENT;
...@@ -714,8 +714,8 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev, ...@@ -714,8 +714,8 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev,
err = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL); err = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
if (err) { if (err) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"update VSI ctxt for PE failed, err %s aq_err %s\n", "update VSI ctxt for PE failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, err), ERR_PTR(err),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
} }
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
* This function sets the mac type of the adapter based on the * This function sets the mac type of the adapter based on the
* vendor ID and device ID stored in the hw structure. * vendor ID and device ID stored in the hw structure.
**/ **/
i40e_status i40e_set_mac_type(struct i40e_hw *hw) int i40e_set_mac_type(struct i40e_hw *hw)
{ {
i40e_status status = 0; int status = 0;
if (hw->vendor_id == PCI_VENDOR_ID_INTEL) { if (hw->vendor_id == PCI_VENDOR_ID_INTEL) {
switch (hw->device_id) { switch (hw->device_id) {
...@@ -124,154 +124,6 @@ const char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err) ...@@ -124,154 +124,6 @@ const char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err)
return hw->err_str; return hw->err_str;
} }
/**
* i40e_stat_str - convert status err code to a string
* @hw: pointer to the HW structure
* @stat_err: the status error code to convert
**/
const char *i40e_stat_str(struct i40e_hw *hw, i40e_status stat_err)
{
switch (stat_err) {
case 0:
return "OK";
case I40E_ERR_NVM:
return "I40E_ERR_NVM";
case I40E_ERR_NVM_CHECKSUM:
return "I40E_ERR_NVM_CHECKSUM";
case I40E_ERR_PHY:
return "I40E_ERR_PHY";
case I40E_ERR_CONFIG:
return "I40E_ERR_CONFIG";
case I40E_ERR_PARAM:
return "I40E_ERR_PARAM";
case I40E_ERR_MAC_TYPE:
return "I40E_ERR_MAC_TYPE";
case I40E_ERR_UNKNOWN_PHY:
return "I40E_ERR_UNKNOWN_PHY";
case I40E_ERR_LINK_SETUP:
return "I40E_ERR_LINK_SETUP";
case I40E_ERR_ADAPTER_STOPPED:
return "I40E_ERR_ADAPTER_STOPPED";
case I40E_ERR_INVALID_MAC_ADDR:
return "I40E_ERR_INVALID_MAC_ADDR";
case I40E_ERR_DEVICE_NOT_SUPPORTED:
return "I40E_ERR_DEVICE_NOT_SUPPORTED";
case I40E_ERR_PRIMARY_REQUESTS_PENDING:
return "I40E_ERR_PRIMARY_REQUESTS_PENDING";
case I40E_ERR_INVALID_LINK_SETTINGS:
return "I40E_ERR_INVALID_LINK_SETTINGS";
case I40E_ERR_AUTONEG_NOT_COMPLETE:
return "I40E_ERR_AUTONEG_NOT_COMPLETE";
case I40E_ERR_RESET_FAILED:
return "I40E_ERR_RESET_FAILED";
case I40E_ERR_SWFW_SYNC:
return "I40E_ERR_SWFW_SYNC";
case I40E_ERR_NO_AVAILABLE_VSI:
return "I40E_ERR_NO_AVAILABLE_VSI";
case I40E_ERR_NO_MEMORY:
return "I40E_ERR_NO_MEMORY";
case I40E_ERR_BAD_PTR:
return "I40E_ERR_BAD_PTR";
case I40E_ERR_RING_FULL:
return "I40E_ERR_RING_FULL";
case I40E_ERR_INVALID_PD_ID:
return "I40E_ERR_INVALID_PD_ID";
case I40E_ERR_INVALID_QP_ID:
return "I40E_ERR_INVALID_QP_ID";
case I40E_ERR_INVALID_CQ_ID:
return "I40E_ERR_INVALID_CQ_ID";
case I40E_ERR_INVALID_CEQ_ID:
return "I40E_ERR_INVALID_CEQ_ID";
case I40E_ERR_INVALID_AEQ_ID:
return "I40E_ERR_INVALID_AEQ_ID";
case I40E_ERR_INVALID_SIZE:
return "I40E_ERR_INVALID_SIZE";
case I40E_ERR_INVALID_ARP_INDEX:
return "I40E_ERR_INVALID_ARP_INDEX";
case I40E_ERR_INVALID_FPM_FUNC_ID:
return "I40E_ERR_INVALID_FPM_FUNC_ID";
case I40E_ERR_QP_INVALID_MSG_SIZE:
return "I40E_ERR_QP_INVALID_MSG_SIZE";
case I40E_ERR_QP_TOOMANY_WRS_POSTED:
return "I40E_ERR_QP_TOOMANY_WRS_POSTED";
case I40E_ERR_INVALID_FRAG_COUNT:
return "I40E_ERR_INVALID_FRAG_COUNT";
case I40E_ERR_QUEUE_EMPTY:
return "I40E_ERR_QUEUE_EMPTY";
case I40E_ERR_INVALID_ALIGNMENT:
return "I40E_ERR_INVALID_ALIGNMENT";
case I40E_ERR_FLUSHED_QUEUE:
return "I40E_ERR_FLUSHED_QUEUE";
case I40E_ERR_INVALID_PUSH_PAGE_INDEX:
return "I40E_ERR_INVALID_PUSH_PAGE_INDEX";
case I40E_ERR_INVALID_IMM_DATA_SIZE:
return "I40E_ERR_INVALID_IMM_DATA_SIZE";
case I40E_ERR_TIMEOUT:
return "I40E_ERR_TIMEOUT";
case I40E_ERR_OPCODE_MISMATCH:
return "I40E_ERR_OPCODE_MISMATCH";
case I40E_ERR_CQP_COMPL_ERROR:
return "I40E_ERR_CQP_COMPL_ERROR";
case I40E_ERR_INVALID_VF_ID:
return "I40E_ERR_INVALID_VF_ID";
case I40E_ERR_INVALID_HMCFN_ID:
return "I40E_ERR_INVALID_HMCFN_ID";
case I40E_ERR_BACKING_PAGE_ERROR:
return "I40E_ERR_BACKING_PAGE_ERROR";
case I40E_ERR_NO_PBLCHUNKS_AVAILABLE:
return "I40E_ERR_NO_PBLCHUNKS_AVAILABLE";
case I40E_ERR_INVALID_PBLE_INDEX:
return "I40E_ERR_INVALID_PBLE_INDEX";
case I40E_ERR_INVALID_SD_INDEX:
return "I40E_ERR_INVALID_SD_INDEX";
case I40E_ERR_INVALID_PAGE_DESC_INDEX:
return "I40E_ERR_INVALID_PAGE_DESC_INDEX";
case I40E_ERR_INVALID_SD_TYPE:
return "I40E_ERR_INVALID_SD_TYPE";
case I40E_ERR_MEMCPY_FAILED:
return "I40E_ERR_MEMCPY_FAILED";
case I40E_ERR_INVALID_HMC_OBJ_INDEX:
return "I40E_ERR_INVALID_HMC_OBJ_INDEX";
case I40E_ERR_INVALID_HMC_OBJ_COUNT:
return "I40E_ERR_INVALID_HMC_OBJ_COUNT";
case I40E_ERR_INVALID_SRQ_ARM_LIMIT:
return "I40E_ERR_INVALID_SRQ_ARM_LIMIT";
case I40E_ERR_SRQ_ENABLED:
return "I40E_ERR_SRQ_ENABLED";
case I40E_ERR_ADMIN_QUEUE_ERROR:
return "I40E_ERR_ADMIN_QUEUE_ERROR";
case I40E_ERR_ADMIN_QUEUE_TIMEOUT:
return "I40E_ERR_ADMIN_QUEUE_TIMEOUT";
case I40E_ERR_BUF_TOO_SHORT:
return "I40E_ERR_BUF_TOO_SHORT";
case I40E_ERR_ADMIN_QUEUE_FULL:
return "I40E_ERR_ADMIN_QUEUE_FULL";
case I40E_ERR_ADMIN_QUEUE_NO_WORK:
return "I40E_ERR_ADMIN_QUEUE_NO_WORK";
case I40E_ERR_BAD_IWARP_CQE:
return "I40E_ERR_BAD_IWARP_CQE";
case I40E_ERR_NVM_BLANK_MODE:
return "I40E_ERR_NVM_BLANK_MODE";
case I40E_ERR_NOT_IMPLEMENTED:
return "I40E_ERR_NOT_IMPLEMENTED";
case I40E_ERR_PE_DOORBELL_NOT_ENABLED:
return "I40E_ERR_PE_DOORBELL_NOT_ENABLED";
case I40E_ERR_DIAG_TEST_FAILED:
return "I40E_ERR_DIAG_TEST_FAILED";
case I40E_ERR_NOT_READY:
return "I40E_ERR_NOT_READY";
case I40E_NOT_SUPPORTED:
return "I40E_NOT_SUPPORTED";
case I40E_ERR_FIRMWARE_API_VERSION:
return "I40E_ERR_FIRMWARE_API_VERSION";
case I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR:
return "I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR";
}
snprintf(hw->err_str, sizeof(hw->err_str), "%d", stat_err);
return hw->err_str;
}
/** /**
* i40e_debug_aq * i40e_debug_aq
* @hw: debug mask related to admin queue * @hw: debug mask related to admin queue
...@@ -355,13 +207,13 @@ bool i40e_check_asq_alive(struct i40e_hw *hw) ...@@ -355,13 +207,13 @@ bool i40e_check_asq_alive(struct i40e_hw *hw)
* Tell the Firmware that we're shutting down the AdminQ and whether * Tell the Firmware that we're shutting down the AdminQ and whether
* or not the driver is unloading as well. * or not the driver is unloading as well.
**/ **/
i40e_status i40e_aq_queue_shutdown(struct i40e_hw *hw, int i40e_aq_queue_shutdown(struct i40e_hw *hw,
bool unloading) bool unloading)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_queue_shutdown *cmd = struct i40e_aqc_queue_shutdown *cmd =
(struct i40e_aqc_queue_shutdown *)&desc.params.raw; (struct i40e_aqc_queue_shutdown *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_queue_shutdown); i40e_aqc_opc_queue_shutdown);
...@@ -384,15 +236,15 @@ i40e_status i40e_aq_queue_shutdown(struct i40e_hw *hw, ...@@ -384,15 +236,15 @@ i40e_status i40e_aq_queue_shutdown(struct i40e_hw *hw,
* *
* Internal function to get or set RSS look up table * Internal function to get or set RSS look up table
**/ **/
static i40e_status i40e_aq_get_set_rss_lut(struct i40e_hw *hw, static int i40e_aq_get_set_rss_lut(struct i40e_hw *hw,
u16 vsi_id, bool pf_lut, u16 vsi_id, bool pf_lut,
u8 *lut, u16 lut_size, u8 *lut, u16 lut_size,
bool set) bool set)
{ {
i40e_status status;
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_get_set_rss_lut *cmd_resp = struct i40e_aqc_get_set_rss_lut *cmd_resp =
(struct i40e_aqc_get_set_rss_lut *)&desc.params.raw; (struct i40e_aqc_get_set_rss_lut *)&desc.params.raw;
int status;
if (set) if (set)
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
...@@ -437,7 +289,7 @@ static i40e_status i40e_aq_get_set_rss_lut(struct i40e_hw *hw, ...@@ -437,7 +289,7 @@ static i40e_status i40e_aq_get_set_rss_lut(struct i40e_hw *hw,
* *
* get the RSS lookup table, PF or VSI type * get the RSS lookup table, PF or VSI type
**/ **/
i40e_status i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 vsi_id, int i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 vsi_id,
bool pf_lut, u8 *lut, u16 lut_size) bool pf_lut, u8 *lut, u16 lut_size)
{ {
return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size,
...@@ -454,7 +306,7 @@ i40e_status i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 vsi_id, ...@@ -454,7 +306,7 @@ i40e_status i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 vsi_id,
* *
* set the RSS lookup table, PF or VSI type * set the RSS lookup table, PF or VSI type
**/ **/
i40e_status i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 vsi_id, int i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 vsi_id,
bool pf_lut, u8 *lut, u16 lut_size) bool pf_lut, u8 *lut, u16 lut_size)
{ {
return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, true); return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, true);
...@@ -469,16 +321,16 @@ i40e_status i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 vsi_id, ...@@ -469,16 +321,16 @@ i40e_status i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 vsi_id,
* *
* get the RSS key per VSI * get the RSS key per VSI
**/ **/
static i40e_status i40e_aq_get_set_rss_key(struct i40e_hw *hw, static int i40e_aq_get_set_rss_key(struct i40e_hw *hw,
u16 vsi_id, u16 vsi_id,
struct i40e_aqc_get_set_rss_key_data *key, struct i40e_aqc_get_set_rss_key_data *key,
bool set) bool set)
{ {
i40e_status status;
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_get_set_rss_key *cmd_resp = struct i40e_aqc_get_set_rss_key *cmd_resp =
(struct i40e_aqc_get_set_rss_key *)&desc.params.raw; (struct i40e_aqc_get_set_rss_key *)&desc.params.raw;
u16 key_size = sizeof(struct i40e_aqc_get_set_rss_key_data); u16 key_size = sizeof(struct i40e_aqc_get_set_rss_key_data);
int status;
if (set) if (set)
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
...@@ -509,7 +361,7 @@ static i40e_status i40e_aq_get_set_rss_key(struct i40e_hw *hw, ...@@ -509,7 +361,7 @@ static i40e_status i40e_aq_get_set_rss_key(struct i40e_hw *hw,
* @key: pointer to key info struct * @key: pointer to key info struct
* *
**/ **/
i40e_status i40e_aq_get_rss_key(struct i40e_hw *hw, int i40e_aq_get_rss_key(struct i40e_hw *hw,
u16 vsi_id, u16 vsi_id,
struct i40e_aqc_get_set_rss_key_data *key) struct i40e_aqc_get_set_rss_key_data *key)
{ {
...@@ -524,7 +376,7 @@ i40e_status i40e_aq_get_rss_key(struct i40e_hw *hw, ...@@ -524,7 +376,7 @@ i40e_status i40e_aq_get_rss_key(struct i40e_hw *hw,
* *
* set the RSS key per VSI * set the RSS key per VSI
**/ **/
i40e_status i40e_aq_set_rss_key(struct i40e_hw *hw, int i40e_aq_set_rss_key(struct i40e_hw *hw,
u16 vsi_id, u16 vsi_id,
struct i40e_aqc_get_set_rss_key_data *key) struct i40e_aqc_get_set_rss_key_data *key)
{ {
...@@ -796,10 +648,10 @@ struct i40e_rx_ptype_decoded i40e_ptype_lookup[BIT(8)] = { ...@@ -796,10 +648,10 @@ struct i40e_rx_ptype_decoded i40e_ptype_lookup[BIT(8)] = {
* hw_addr, back, device_id, vendor_id, subsystem_device_id, * hw_addr, back, device_id, vendor_id, subsystem_device_id,
* subsystem_vendor_id, and revision_id * subsystem_vendor_id, and revision_id
**/ **/
i40e_status i40e_init_shared_code(struct i40e_hw *hw) int i40e_init_shared_code(struct i40e_hw *hw)
{ {
i40e_status status = 0;
u32 port, ari, func_rid; u32 port, ari, func_rid;
int status = 0;
i40e_set_mac_type(hw); i40e_set_mac_type(hw);
...@@ -836,7 +688,8 @@ i40e_status i40e_init_shared_code(struct i40e_hw *hw) ...@@ -836,7 +688,8 @@ i40e_status i40e_init_shared_code(struct i40e_hw *hw)
* @addrs: the requestor's mac addr store * @addrs: the requestor's mac addr store
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
static i40e_status i40e_aq_mac_address_read(struct i40e_hw *hw, static int
i40e_aq_mac_address_read(struct i40e_hw *hw,
u16 *flags, u16 *flags,
struct i40e_aqc_mac_address_read_data *addrs, struct i40e_aqc_mac_address_read_data *addrs,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -844,7 +697,7 @@ static i40e_status i40e_aq_mac_address_read(struct i40e_hw *hw, ...@@ -844,7 +697,7 @@ static i40e_status i40e_aq_mac_address_read(struct i40e_hw *hw,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_mac_address_read *cmd_data = struct i40e_aqc_mac_address_read *cmd_data =
(struct i40e_aqc_mac_address_read *)&desc.params.raw; (struct i40e_aqc_mac_address_read *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_mac_address_read); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_mac_address_read);
desc.flags |= cpu_to_le16(I40E_AQ_FLAG_BUF); desc.flags |= cpu_to_le16(I40E_AQ_FLAG_BUF);
...@@ -863,14 +716,14 @@ static i40e_status i40e_aq_mac_address_read(struct i40e_hw *hw, ...@@ -863,14 +716,14 @@ static i40e_status i40e_aq_mac_address_read(struct i40e_hw *hw,
* @mac_addr: address to write * @mac_addr: address to write
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_mac_address_write(struct i40e_hw *hw, int i40e_aq_mac_address_write(struct i40e_hw *hw,
u16 flags, u8 *mac_addr, u16 flags, u8 *mac_addr,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_mac_address_write *cmd_data = struct i40e_aqc_mac_address_write *cmd_data =
(struct i40e_aqc_mac_address_write *)&desc.params.raw; (struct i40e_aqc_mac_address_write *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_mac_address_write); i40e_aqc_opc_mac_address_write);
...@@ -893,11 +746,11 @@ i40e_status i40e_aq_mac_address_write(struct i40e_hw *hw, ...@@ -893,11 +746,11 @@ i40e_status i40e_aq_mac_address_write(struct i40e_hw *hw,
* *
* Reads the adapter's MAC address from register * Reads the adapter's MAC address from register
**/ **/
i40e_status i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr) int i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr)
{ {
struct i40e_aqc_mac_address_read_data addrs; struct i40e_aqc_mac_address_read_data addrs;
i40e_status status;
u16 flags = 0; u16 flags = 0;
int status;
status = i40e_aq_mac_address_read(hw, &flags, &addrs, NULL); status = i40e_aq_mac_address_read(hw, &flags, &addrs, NULL);
...@@ -914,11 +767,11 @@ i40e_status i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr) ...@@ -914,11 +767,11 @@ i40e_status i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr)
* *
* Reads the adapter's Port MAC address * Reads the adapter's Port MAC address
**/ **/
i40e_status i40e_get_port_mac_addr(struct i40e_hw *hw, u8 *mac_addr) int i40e_get_port_mac_addr(struct i40e_hw *hw, u8 *mac_addr)
{ {
struct i40e_aqc_mac_address_read_data addrs; struct i40e_aqc_mac_address_read_data addrs;
i40e_status status;
u16 flags = 0; u16 flags = 0;
int status;
status = i40e_aq_mac_address_read(hw, &flags, &addrs, NULL); status = i40e_aq_mac_address_read(hw, &flags, &addrs, NULL);
if (status) if (status)
...@@ -972,13 +825,13 @@ void i40e_pre_tx_queue_cfg(struct i40e_hw *hw, u32 queue, bool enable) ...@@ -972,13 +825,13 @@ void i40e_pre_tx_queue_cfg(struct i40e_hw *hw, u32 queue, bool enable)
* *
* Reads the part number string from the EEPROM. * Reads the part number string from the EEPROM.
**/ **/
i40e_status i40e_read_pba_string(struct i40e_hw *hw, u8 *pba_num, int i40e_read_pba_string(struct i40e_hw *hw, u8 *pba_num,
u32 pba_num_size) u32 pba_num_size)
{ {
i40e_status status = 0;
u16 pba_word = 0; u16 pba_word = 0;
u16 pba_size = 0; u16 pba_size = 0;
u16 pba_ptr = 0; u16 pba_ptr = 0;
int status = 0;
u16 i = 0; u16 i = 0;
status = i40e_read_nvm_word(hw, I40E_SR_PBA_FLAGS, &pba_word); status = i40e_read_nvm_word(hw, I40E_SR_PBA_FLAGS, &pba_word);
...@@ -1087,7 +940,7 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw) ...@@ -1087,7 +940,7 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
* @hw: pointer to the hardware structure * @hw: pointer to the hardware structure
* @retry_limit: how many times to retry before failure * @retry_limit: how many times to retry before failure
**/ **/
static i40e_status i40e_poll_globr(struct i40e_hw *hw, static int i40e_poll_globr(struct i40e_hw *hw,
u32 retry_limit) u32 retry_limit)
{ {
u32 cnt, reg = 0; u32 cnt, reg = 0;
...@@ -1114,7 +967,7 @@ static i40e_status i40e_poll_globr(struct i40e_hw *hw, ...@@ -1114,7 +967,7 @@ static i40e_status i40e_poll_globr(struct i40e_hw *hw,
* Assuming someone else has triggered a global reset, * Assuming someone else has triggered a global reset,
* assure the global reset is complete and then reset the PF * assure the global reset is complete and then reset the PF
**/ **/
i40e_status i40e_pf_reset(struct i40e_hw *hw) int i40e_pf_reset(struct i40e_hw *hw)
{ {
u32 cnt = 0; u32 cnt = 0;
u32 cnt1 = 0; u32 cnt1 = 0;
...@@ -1453,15 +1306,16 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink) ...@@ -1453,15 +1306,16 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
* *
* Returns the various PHY abilities supported on the Port. * Returns the various PHY abilities supported on the Port.
**/ **/
i40e_status i40e_aq_get_phy_capabilities(struct i40e_hw *hw, int
i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
bool qualified_modules, bool report_init, bool qualified_modules, bool report_init,
struct i40e_aq_get_phy_abilities_resp *abilities, struct i40e_aq_get_phy_abilities_resp *abilities,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc;
i40e_status status;
u16 abilities_size = sizeof(struct i40e_aq_get_phy_abilities_resp); u16 abilities_size = sizeof(struct i40e_aq_get_phy_abilities_resp);
u16 max_delay = I40E_MAX_PHY_TIMEOUT, total_delay = 0; u16 max_delay = I40E_MAX_PHY_TIMEOUT, total_delay = 0;
struct i40e_aq_desc desc;
int status;
if (!abilities) if (!abilities)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -1532,14 +1386,14 @@ i40e_status i40e_aq_get_phy_capabilities(struct i40e_hw *hw, ...@@ -1532,14 +1386,14 @@ i40e_status i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
* of the PHY Config parameters. This status will be indicated by the * of the PHY Config parameters. This status will be indicated by the
* command response. * command response.
**/ **/
enum i40e_status_code i40e_aq_set_phy_config(struct i40e_hw *hw, int i40e_aq_set_phy_config(struct i40e_hw *hw,
struct i40e_aq_set_phy_config *config, struct i40e_aq_set_phy_config *config,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aq_set_phy_config *cmd = struct i40e_aq_set_phy_config *cmd =
(struct i40e_aq_set_phy_config *)&desc.params.raw; (struct i40e_aq_set_phy_config *)&desc.params.raw;
enum i40e_status_code status; int status;
if (!config) if (!config)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -1554,7 +1408,7 @@ enum i40e_status_code i40e_aq_set_phy_config(struct i40e_hw *hw, ...@@ -1554,7 +1408,7 @@ enum i40e_status_code i40e_aq_set_phy_config(struct i40e_hw *hw,
return status; return status;
} }
static noinline_for_stack enum i40e_status_code static noinline_for_stack int
i40e_set_fc_status(struct i40e_hw *hw, i40e_set_fc_status(struct i40e_hw *hw,
struct i40e_aq_get_phy_abilities_resp *abilities, struct i40e_aq_get_phy_abilities_resp *abilities,
bool atomic_restart) bool atomic_restart)
...@@ -1612,11 +1466,11 @@ i40e_set_fc_status(struct i40e_hw *hw, ...@@ -1612,11 +1466,11 @@ i40e_set_fc_status(struct i40e_hw *hw,
* *
* Set the requested flow control mode using set_phy_config. * Set the requested flow control mode using set_phy_config.
**/ **/
enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures, int i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,
bool atomic_restart) bool atomic_restart)
{ {
struct i40e_aq_get_phy_abilities_resp abilities; struct i40e_aq_get_phy_abilities_resp abilities;
enum i40e_status_code status; int status;
*aq_failures = 0x0; *aq_failures = 0x0;
...@@ -1655,13 +1509,13 @@ enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures, ...@@ -1655,13 +1509,13 @@ enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,
* *
* Tell the firmware that the driver is taking over from PXE * Tell the firmware that the driver is taking over from PXE
**/ **/
i40e_status i40e_aq_clear_pxe_mode(struct i40e_hw *hw, int i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
i40e_status status;
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_clear_pxe *cmd = struct i40e_aqc_clear_pxe *cmd =
(struct i40e_aqc_clear_pxe *)&desc.params.raw; (struct i40e_aqc_clear_pxe *)&desc.params.raw;
int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_clear_pxe_mode); i40e_aqc_opc_clear_pxe_mode);
...@@ -1683,14 +1537,14 @@ i40e_status i40e_aq_clear_pxe_mode(struct i40e_hw *hw, ...@@ -1683,14 +1537,14 @@ i40e_status i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
* *
* Sets up the link and restarts the Auto-Negotiation over the link. * Sets up the link and restarts the Auto-Negotiation over the link.
**/ **/
i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw, int i40e_aq_set_link_restart_an(struct i40e_hw *hw,
bool enable_link, bool enable_link,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_set_link_restart_an *cmd = struct i40e_aqc_set_link_restart_an *cmd =
(struct i40e_aqc_set_link_restart_an *)&desc.params.raw; (struct i40e_aqc_set_link_restart_an *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_link_restart_an); i40e_aqc_opc_set_link_restart_an);
...@@ -1715,7 +1569,7 @@ i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw, ...@@ -1715,7 +1569,7 @@ i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw,
* *
* Returns the link status of the adapter. * Returns the link status of the adapter.
**/ **/
i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, int i40e_aq_get_link_info(struct i40e_hw *hw,
bool enable_lse, struct i40e_link_status *link, bool enable_lse, struct i40e_link_status *link,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
...@@ -1723,9 +1577,9 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, ...@@ -1723,9 +1577,9 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
struct i40e_aqc_get_link_status *resp = struct i40e_aqc_get_link_status *resp =
(struct i40e_aqc_get_link_status *)&desc.params.raw; (struct i40e_aqc_get_link_status *)&desc.params.raw;
struct i40e_link_status *hw_link_info = &hw->phy.link_info; struct i40e_link_status *hw_link_info = &hw->phy.link_info;
i40e_status status;
bool tx_pause, rx_pause; bool tx_pause, rx_pause;
u16 command_flags; u16 command_flags;
int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_get_link_status); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_get_link_status);
...@@ -1811,14 +1665,14 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, ...@@ -1811,14 +1665,14 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
* *
* Set link interrupt mask. * Set link interrupt mask.
**/ **/
i40e_status i40e_aq_set_phy_int_mask(struct i40e_hw *hw, int i40e_aq_set_phy_int_mask(struct i40e_hw *hw,
u16 mask, u16 mask,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_set_phy_int_mask *cmd = struct i40e_aqc_set_phy_int_mask *cmd =
(struct i40e_aqc_set_phy_int_mask *)&desc.params.raw; (struct i40e_aqc_set_phy_int_mask *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_phy_int_mask); i40e_aqc_opc_set_phy_int_mask);
...@@ -1838,7 +1692,7 @@ i40e_status i40e_aq_set_phy_int_mask(struct i40e_hw *hw, ...@@ -1838,7 +1692,7 @@ i40e_status i40e_aq_set_phy_int_mask(struct i40e_hw *hw,
* *
* Enable/disable loopback on a given port * Enable/disable loopback on a given port
*/ */
i40e_status i40e_aq_set_mac_loopback(struct i40e_hw *hw, bool ena_lpbk, int i40e_aq_set_mac_loopback(struct i40e_hw *hw, bool ena_lpbk,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
...@@ -1864,13 +1718,13 @@ i40e_status i40e_aq_set_mac_loopback(struct i40e_hw *hw, bool ena_lpbk, ...@@ -1864,13 +1718,13 @@ i40e_status i40e_aq_set_mac_loopback(struct i40e_hw *hw, bool ena_lpbk,
* *
* Reset the external PHY. * Reset the external PHY.
**/ **/
i40e_status i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags, int i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_set_phy_debug *cmd = struct i40e_aqc_set_phy_debug *cmd =
(struct i40e_aqc_set_phy_debug *)&desc.params.raw; (struct i40e_aqc_set_phy_debug *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_phy_debug); i40e_aqc_opc_set_phy_debug);
...@@ -1905,7 +1759,7 @@ static bool i40e_is_aq_api_ver_ge(struct i40e_adminq_info *aq, u16 maj, ...@@ -1905,7 +1759,7 @@ static bool i40e_is_aq_api_ver_ge(struct i40e_adminq_info *aq, u16 maj,
* *
* Add a VSI context to the hardware. * Add a VSI context to the hardware.
**/ **/
i40e_status i40e_aq_add_vsi(struct i40e_hw *hw, int i40e_aq_add_vsi(struct i40e_hw *hw,
struct i40e_vsi_context *vsi_ctx, struct i40e_vsi_context *vsi_ctx,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
...@@ -1915,7 +1769,7 @@ i40e_status i40e_aq_add_vsi(struct i40e_hw *hw, ...@@ -1915,7 +1769,7 @@ i40e_status i40e_aq_add_vsi(struct i40e_hw *hw,
struct i40e_aqc_add_get_update_vsi_completion *resp = struct i40e_aqc_add_get_update_vsi_completion *resp =
(struct i40e_aqc_add_get_update_vsi_completion *) (struct i40e_aqc_add_get_update_vsi_completion *)
&desc.params.raw; &desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_add_vsi); i40e_aqc_opc_add_vsi);
...@@ -1949,7 +1803,7 @@ i40e_status i40e_aq_add_vsi(struct i40e_hw *hw, ...@@ -1949,7 +1803,7 @@ i40e_status i40e_aq_add_vsi(struct i40e_hw *hw,
* @seid: vsi number * @seid: vsi number
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw, int i40e_aq_set_default_vsi(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
...@@ -1957,7 +1811,7 @@ i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw, ...@@ -1957,7 +1811,7 @@ i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw,
struct i40e_aqc_set_vsi_promiscuous_modes *cmd = struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
(struct i40e_aqc_set_vsi_promiscuous_modes *) (struct i40e_aqc_set_vsi_promiscuous_modes *)
&desc.params.raw; &desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_vsi_promiscuous_modes); i40e_aqc_opc_set_vsi_promiscuous_modes);
...@@ -1977,7 +1831,7 @@ i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw, ...@@ -1977,7 +1831,7 @@ i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw,
* @seid: vsi number * @seid: vsi number
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_clear_default_vsi(struct i40e_hw *hw, int i40e_aq_clear_default_vsi(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
...@@ -1985,7 +1839,7 @@ i40e_status i40e_aq_clear_default_vsi(struct i40e_hw *hw, ...@@ -1985,7 +1839,7 @@ i40e_status i40e_aq_clear_default_vsi(struct i40e_hw *hw,
struct i40e_aqc_set_vsi_promiscuous_modes *cmd = struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
(struct i40e_aqc_set_vsi_promiscuous_modes *) (struct i40e_aqc_set_vsi_promiscuous_modes *)
&desc.params.raw; &desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_vsi_promiscuous_modes); i40e_aqc_opc_set_vsi_promiscuous_modes);
...@@ -2007,7 +1861,7 @@ i40e_status i40e_aq_clear_default_vsi(struct i40e_hw *hw, ...@@ -2007,7 +1861,7 @@ i40e_status i40e_aq_clear_default_vsi(struct i40e_hw *hw,
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
* @rx_only_promisc: flag to decide if egress traffic gets mirrored in promisc * @rx_only_promisc: flag to decide if egress traffic gets mirrored in promisc
**/ **/
i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, int i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
u16 seid, bool set, u16 seid, bool set,
struct i40e_asq_cmd_details *cmd_details, struct i40e_asq_cmd_details *cmd_details,
bool rx_only_promisc) bool rx_only_promisc)
...@@ -2015,8 +1869,8 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, ...@@ -2015,8 +1869,8 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_set_vsi_promiscuous_modes *cmd = struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
(struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw;
i40e_status status;
u16 flags = 0; u16 flags = 0;
int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_vsi_promiscuous_modes); i40e_aqc_opc_set_vsi_promiscuous_modes);
...@@ -2047,14 +1901,15 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, ...@@ -2047,14 +1901,15 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
* @set: set multicast promiscuous enable/disable * @set: set multicast promiscuous enable/disable
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw, int i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw,
u16 seid, bool set, struct i40e_asq_cmd_details *cmd_details) u16 seid, bool set,
struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_set_vsi_promiscuous_modes *cmd = struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
(struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw;
i40e_status status;
u16 flags = 0; u16 flags = 0;
int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_vsi_promiscuous_modes); i40e_aqc_opc_set_vsi_promiscuous_modes);
...@@ -2080,7 +1935,7 @@ i40e_status i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw, ...@@ -2080,7 +1935,7 @@ i40e_status i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw,
* @vid: The VLAN tag filter - capture any multicast packet with this VLAN tag * @vid: The VLAN tag filter - capture any multicast packet with this VLAN tag
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw, int i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw,
u16 seid, bool enable, u16 seid, bool enable,
u16 vid, u16 vid,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -2088,8 +1943,8 @@ enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw, ...@@ -2088,8 +1943,8 @@ enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_set_vsi_promiscuous_modes *cmd = struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
(struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw;
enum i40e_status_code status;
u16 flags = 0; u16 flags = 0;
int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_vsi_promiscuous_modes); i40e_aqc_opc_set_vsi_promiscuous_modes);
...@@ -2116,7 +1971,7 @@ enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw, ...@@ -2116,7 +1971,7 @@ enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw,
* @vid: The VLAN tag filter - capture any unicast packet with this VLAN tag * @vid: The VLAN tag filter - capture any unicast packet with this VLAN tag
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, int i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,
u16 seid, bool enable, u16 seid, bool enable,
u16 vid, u16 vid,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -2124,8 +1979,8 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, ...@@ -2124,8 +1979,8 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_set_vsi_promiscuous_modes *cmd = struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
(struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw;
enum i40e_status_code status;
u16 flags = 0; u16 flags = 0;
int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_vsi_promiscuous_modes); i40e_aqc_opc_set_vsi_promiscuous_modes);
...@@ -2158,15 +2013,15 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, ...@@ -2158,15 +2013,15 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,
* @vid: The VLAN tag filter - capture any broadcast packet with this VLAN tag * @vid: The VLAN tag filter - capture any broadcast packet with this VLAN tag
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_set_vsi_bc_promisc_on_vlan(struct i40e_hw *hw, int i40e_aq_set_vsi_bc_promisc_on_vlan(struct i40e_hw *hw,
u16 seid, bool enable, u16 vid, u16 seid, bool enable, u16 vid,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_set_vsi_promiscuous_modes *cmd = struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
(struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw;
i40e_status status;
u16 flags = 0; u16 flags = 0;
int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_vsi_promiscuous_modes); i40e_aqc_opc_set_vsi_promiscuous_modes);
...@@ -2193,14 +2048,14 @@ i40e_status i40e_aq_set_vsi_bc_promisc_on_vlan(struct i40e_hw *hw, ...@@ -2193,14 +2048,14 @@ i40e_status i40e_aq_set_vsi_bc_promisc_on_vlan(struct i40e_hw *hw,
* *
* Set or clear the broadcast promiscuous flag (filter) for a given VSI. * Set or clear the broadcast promiscuous flag (filter) for a given VSI.
**/ **/
i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw, int i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,
u16 seid, bool set_filter, u16 seid, bool set_filter,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_set_vsi_promiscuous_modes *cmd = struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
(struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_vsi_promiscuous_modes); i40e_aqc_opc_set_vsi_promiscuous_modes);
...@@ -2226,15 +2081,15 @@ i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw, ...@@ -2226,15 +2081,15 @@ i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,
* @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw, int i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw,
u16 seid, bool enable, u16 seid, bool enable,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_set_vsi_promiscuous_modes *cmd = struct i40e_aqc_set_vsi_promiscuous_modes *cmd =
(struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw;
i40e_status status;
u16 flags = 0; u16 flags = 0;
int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_vsi_promiscuous_modes); i40e_aqc_opc_set_vsi_promiscuous_modes);
...@@ -2256,7 +2111,7 @@ i40e_status i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw, ...@@ -2256,7 +2111,7 @@ i40e_status i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw,
* @vsi_ctx: pointer to a vsi context struct * @vsi_ctx: pointer to a vsi context struct
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw, int i40e_aq_get_vsi_params(struct i40e_hw *hw,
struct i40e_vsi_context *vsi_ctx, struct i40e_vsi_context *vsi_ctx,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
...@@ -2266,7 +2121,7 @@ i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw, ...@@ -2266,7 +2121,7 @@ i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw,
struct i40e_aqc_add_get_update_vsi_completion *resp = struct i40e_aqc_add_get_update_vsi_completion *resp =
(struct i40e_aqc_add_get_update_vsi_completion *) (struct i40e_aqc_add_get_update_vsi_completion *)
&desc.params.raw; &desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_get_vsi_parameters); i40e_aqc_opc_get_vsi_parameters);
...@@ -2298,7 +2153,7 @@ i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw, ...@@ -2298,7 +2153,7 @@ i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw,
* *
* Update a VSI context. * Update a VSI context.
**/ **/
i40e_status i40e_aq_update_vsi_params(struct i40e_hw *hw, int i40e_aq_update_vsi_params(struct i40e_hw *hw,
struct i40e_vsi_context *vsi_ctx, struct i40e_vsi_context *vsi_ctx,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
...@@ -2308,7 +2163,7 @@ i40e_status i40e_aq_update_vsi_params(struct i40e_hw *hw, ...@@ -2308,7 +2163,7 @@ i40e_status i40e_aq_update_vsi_params(struct i40e_hw *hw,
struct i40e_aqc_add_get_update_vsi_completion *resp = struct i40e_aqc_add_get_update_vsi_completion *resp =
(struct i40e_aqc_add_get_update_vsi_completion *) (struct i40e_aqc_add_get_update_vsi_completion *)
&desc.params.raw; &desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_update_vsi_parameters); i40e_aqc_opc_update_vsi_parameters);
...@@ -2336,7 +2191,7 @@ i40e_status i40e_aq_update_vsi_params(struct i40e_hw *hw, ...@@ -2336,7 +2191,7 @@ i40e_status i40e_aq_update_vsi_params(struct i40e_hw *hw,
* *
* Fill the buf with switch configuration returned from AdminQ command * Fill the buf with switch configuration returned from AdminQ command
**/ **/
i40e_status i40e_aq_get_switch_config(struct i40e_hw *hw, int i40e_aq_get_switch_config(struct i40e_hw *hw,
struct i40e_aqc_get_switch_config_resp *buf, struct i40e_aqc_get_switch_config_resp *buf,
u16 buf_size, u16 *start_seid, u16 buf_size, u16 *start_seid,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -2344,7 +2199,7 @@ i40e_status i40e_aq_get_switch_config(struct i40e_hw *hw, ...@@ -2344,7 +2199,7 @@ i40e_status i40e_aq_get_switch_config(struct i40e_hw *hw,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_switch_seid *scfg = struct i40e_aqc_switch_seid *scfg =
(struct i40e_aqc_switch_seid *)&desc.params.raw; (struct i40e_aqc_switch_seid *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_get_switch_config); i40e_aqc_opc_get_switch_config);
...@@ -2370,7 +2225,7 @@ i40e_status i40e_aq_get_switch_config(struct i40e_hw *hw, ...@@ -2370,7 +2225,7 @@ i40e_status i40e_aq_get_switch_config(struct i40e_hw *hw,
* *
* Set switch configuration bits * Set switch configuration bits
**/ **/
enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw, int i40e_aq_set_switch_config(struct i40e_hw *hw,
u16 flags, u16 flags,
u16 valid_flags, u8 mode, u16 valid_flags, u8 mode,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -2378,7 +2233,7 @@ enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw, ...@@ -2378,7 +2233,7 @@ enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_set_switch_config *scfg = struct i40e_aqc_set_switch_config *scfg =
(struct i40e_aqc_set_switch_config *)&desc.params.raw; (struct i40e_aqc_set_switch_config *)&desc.params.raw;
enum i40e_status_code status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_switch_config); i40e_aqc_opc_set_switch_config);
...@@ -2407,7 +2262,7 @@ enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw, ...@@ -2407,7 +2262,7 @@ enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw,
* *
* Get the firmware version from the admin queue commands * Get the firmware version from the admin queue commands
**/ **/
i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw, int i40e_aq_get_firmware_version(struct i40e_hw *hw,
u16 *fw_major_version, u16 *fw_minor_version, u16 *fw_major_version, u16 *fw_minor_version,
u32 *fw_build, u32 *fw_build,
u16 *api_major_version, u16 *api_minor_version, u16 *api_major_version, u16 *api_minor_version,
...@@ -2416,7 +2271,7 @@ i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw, ...@@ -2416,7 +2271,7 @@ i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_get_version *resp = struct i40e_aqc_get_version *resp =
(struct i40e_aqc_get_version *)&desc.params.raw; (struct i40e_aqc_get_version *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_get_version); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_get_version);
...@@ -2446,14 +2301,14 @@ i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw, ...@@ -2446,14 +2301,14 @@ i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw,
* *
* Send the driver version to the firmware * Send the driver version to the firmware
**/ **/
i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw, int i40e_aq_send_driver_version(struct i40e_hw *hw,
struct i40e_driver_version *dv, struct i40e_driver_version *dv,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_driver_version *cmd = struct i40e_aqc_driver_version *cmd =
(struct i40e_aqc_driver_version *)&desc.params.raw; (struct i40e_aqc_driver_version *)&desc.params.raw;
i40e_status status; int status;
u16 len; u16 len;
if (dv == NULL) if (dv == NULL)
...@@ -2488,9 +2343,9 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw, ...@@ -2488,9 +2343,9 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw,
* *
* Side effect: LinkStatusEvent reporting becomes enabled * Side effect: LinkStatusEvent reporting becomes enabled
**/ **/
i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up) int i40e_get_link_status(struct i40e_hw *hw, bool *link_up)
{ {
i40e_status status = 0; int status = 0;
if (hw->phy.get_link_info) { if (hw->phy.get_link_info) {
status = i40e_update_link_info(hw); status = i40e_update_link_info(hw);
...@@ -2509,10 +2364,10 @@ i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up) ...@@ -2509,10 +2364,10 @@ i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up)
* i40e_update_link_info - update status of the HW network link * i40e_update_link_info - update status of the HW network link
* @hw: pointer to the hw struct * @hw: pointer to the hw struct
**/ **/
noinline_for_stack i40e_status i40e_update_link_info(struct i40e_hw *hw) noinline_for_stack int i40e_update_link_info(struct i40e_hw *hw)
{ {
struct i40e_aq_get_phy_abilities_resp abilities; struct i40e_aq_get_phy_abilities_resp abilities;
i40e_status status = 0; int status = 0;
status = i40e_aq_get_link_info(hw, true, NULL, NULL); status = i40e_aq_get_link_info(hw, true, NULL, NULL);
if (status) if (status)
...@@ -2559,7 +2414,7 @@ noinline_for_stack i40e_status i40e_update_link_info(struct i40e_hw *hw) ...@@ -2559,7 +2414,7 @@ noinline_for_stack i40e_status i40e_update_link_info(struct i40e_hw *hw)
* This asks the FW to add a VEB between the uplink and downlink * This asks the FW to add a VEB between the uplink and downlink
* elements. If the uplink SEID is 0, this will be a floating VEB. * elements. If the uplink SEID is 0, this will be a floating VEB.
**/ **/
i40e_status i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid, int i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid,
u16 downlink_seid, u8 enabled_tc, u16 downlink_seid, u8 enabled_tc,
bool default_port, u16 *veb_seid, bool default_port, u16 *veb_seid,
bool enable_stats, bool enable_stats,
...@@ -2570,8 +2425,8 @@ i40e_status i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid, ...@@ -2570,8 +2425,8 @@ i40e_status i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid,
(struct i40e_aqc_add_veb *)&desc.params.raw; (struct i40e_aqc_add_veb *)&desc.params.raw;
struct i40e_aqc_add_veb_completion *resp = struct i40e_aqc_add_veb_completion *resp =
(struct i40e_aqc_add_veb_completion *)&desc.params.raw; (struct i40e_aqc_add_veb_completion *)&desc.params.raw;
i40e_status status;
u16 veb_flags = 0; u16 veb_flags = 0;
int status;
/* SEIDs need to either both be set or both be 0 for floating VEB */ /* SEIDs need to either both be set or both be 0 for floating VEB */
if (!!uplink_seid != !!downlink_seid) if (!!uplink_seid != !!downlink_seid)
...@@ -2617,7 +2472,7 @@ i40e_status i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid, ...@@ -2617,7 +2472,7 @@ i40e_status i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid,
* This retrieves the parameters for a particular VEB, specified by * This retrieves the parameters for a particular VEB, specified by
* uplink_seid, and returns them to the caller. * uplink_seid, and returns them to the caller.
**/ **/
i40e_status i40e_aq_get_veb_parameters(struct i40e_hw *hw, int i40e_aq_get_veb_parameters(struct i40e_hw *hw,
u16 veb_seid, u16 *switch_id, u16 veb_seid, u16 *switch_id,
bool *floating, u16 *statistic_index, bool *floating, u16 *statistic_index,
u16 *vebs_used, u16 *vebs_free, u16 *vebs_used, u16 *vebs_free,
...@@ -2627,7 +2482,7 @@ i40e_status i40e_aq_get_veb_parameters(struct i40e_hw *hw, ...@@ -2627,7 +2482,7 @@ i40e_status i40e_aq_get_veb_parameters(struct i40e_hw *hw,
struct i40e_aqc_get_veb_parameters_completion *cmd_resp = struct i40e_aqc_get_veb_parameters_completion *cmd_resp =
(struct i40e_aqc_get_veb_parameters_completion *) (struct i40e_aqc_get_veb_parameters_completion *)
&desc.params.raw; &desc.params.raw;
i40e_status status; int status;
if (veb_seid == 0) if (veb_seid == 0)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -2711,7 +2566,7 @@ i40e_prepare_add_macvlan(struct i40e_aqc_add_macvlan_element_data *mv_list, ...@@ -2711,7 +2566,7 @@ i40e_prepare_add_macvlan(struct i40e_aqc_add_macvlan_element_data *mv_list,
* *
* Add MAC/VLAN addresses to the HW filtering * Add MAC/VLAN addresses to the HW filtering
**/ **/
i40e_status int
i40e_aq_add_macvlan(struct i40e_hw *hw, u16 seid, i40e_aq_add_macvlan(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_add_macvlan_element_data *mv_list, struct i40e_aqc_add_macvlan_element_data *mv_list,
u16 count, struct i40e_asq_cmd_details *cmd_details) u16 count, struct i40e_asq_cmd_details *cmd_details)
...@@ -2743,7 +2598,7 @@ i40e_aq_add_macvlan(struct i40e_hw *hw, u16 seid, ...@@ -2743,7 +2598,7 @@ i40e_aq_add_macvlan(struct i40e_hw *hw, u16 seid,
* It also calls _v2 versions of asq_send_command functions to * It also calls _v2 versions of asq_send_command functions to
* get the aq_status on the stack. * get the aq_status on the stack.
**/ **/
i40e_status int
i40e_aq_add_macvlan_v2(struct i40e_hw *hw, u16 seid, i40e_aq_add_macvlan_v2(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_add_macvlan_element_data *mv_list, struct i40e_aqc_add_macvlan_element_data *mv_list,
u16 count, struct i40e_asq_cmd_details *cmd_details, u16 count, struct i40e_asq_cmd_details *cmd_details,
...@@ -2771,15 +2626,16 @@ i40e_aq_add_macvlan_v2(struct i40e_hw *hw, u16 seid, ...@@ -2771,15 +2626,16 @@ i40e_aq_add_macvlan_v2(struct i40e_hw *hw, u16 seid,
* *
* Remove MAC/VLAN addresses from the HW filtering * Remove MAC/VLAN addresses from the HW filtering
**/ **/
i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 seid, int
i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_remove_macvlan_element_data *mv_list, struct i40e_aqc_remove_macvlan_element_data *mv_list,
u16 count, struct i40e_asq_cmd_details *cmd_details) u16 count, struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_macvlan *cmd = struct i40e_aqc_macvlan *cmd =
(struct i40e_aqc_macvlan *)&desc.params.raw; (struct i40e_aqc_macvlan *)&desc.params.raw;
i40e_status status;
u16 buf_size; u16 buf_size;
int status;
if (count == 0 || !mv_list || !hw) if (count == 0 || !mv_list || !hw)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -2818,7 +2674,7 @@ i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 seid, ...@@ -2818,7 +2674,7 @@ i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 seid,
* It also calls _v2 versions of asq_send_command functions to * It also calls _v2 versions of asq_send_command functions to
* get the aq_status on the stack. * get the aq_status on the stack.
**/ **/
i40e_status int
i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid, i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_remove_macvlan_element_data *mv_list, struct i40e_aqc_remove_macvlan_element_data *mv_list,
u16 count, struct i40e_asq_cmd_details *cmd_details, u16 count, struct i40e_asq_cmd_details *cmd_details,
...@@ -2866,7 +2722,7 @@ i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid, ...@@ -2866,7 +2722,7 @@ i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid,
* Add/Delete a mirror rule to a specific switch. Mirror rules are supported for * Add/Delete a mirror rule to a specific switch. Mirror rules are supported for
* VEBs/VEPA elements only * VEBs/VEPA elements only
**/ **/
static i40e_status i40e_mirrorrule_op(struct i40e_hw *hw, static int i40e_mirrorrule_op(struct i40e_hw *hw,
u16 opcode, u16 sw_seid, u16 rule_type, u16 id, u16 opcode, u16 sw_seid, u16 rule_type, u16 id,
u16 count, __le16 *mr_list, u16 count, __le16 *mr_list,
struct i40e_asq_cmd_details *cmd_details, struct i40e_asq_cmd_details *cmd_details,
...@@ -2877,8 +2733,8 @@ static i40e_status i40e_mirrorrule_op(struct i40e_hw *hw, ...@@ -2877,8 +2733,8 @@ static i40e_status i40e_mirrorrule_op(struct i40e_hw *hw,
(struct i40e_aqc_add_delete_mirror_rule *)&desc.params.raw; (struct i40e_aqc_add_delete_mirror_rule *)&desc.params.raw;
struct i40e_aqc_add_delete_mirror_rule_completion *resp = struct i40e_aqc_add_delete_mirror_rule_completion *resp =
(struct i40e_aqc_add_delete_mirror_rule_completion *)&desc.params.raw; (struct i40e_aqc_add_delete_mirror_rule_completion *)&desc.params.raw;
i40e_status status;
u16 buf_size; u16 buf_size;
int status;
buf_size = count * sizeof(*mr_list); buf_size = count * sizeof(*mr_list);
...@@ -2926,8 +2782,9 @@ static i40e_status i40e_mirrorrule_op(struct i40e_hw *hw, ...@@ -2926,8 +2782,9 @@ static i40e_status i40e_mirrorrule_op(struct i40e_hw *hw,
* *
* Add mirror rule. Mirror rules are supported for VEBs or VEPA elements only * Add mirror rule. Mirror rules are supported for VEBs or VEPA elements only
**/ **/
i40e_status i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid, int i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
u16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list, u16 rule_type, u16 dest_vsi, u16 count,
__le16 *mr_list,
struct i40e_asq_cmd_details *cmd_details, struct i40e_asq_cmd_details *cmd_details,
u16 *rule_id, u16 *rules_used, u16 *rules_free) u16 *rule_id, u16 *rules_used, u16 *rules_free)
{ {
...@@ -2957,8 +2814,9 @@ i40e_status i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid, ...@@ -2957,8 +2814,9 @@ i40e_status i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
* *
* Delete a mirror rule. Mirror rules are supported for VEBs/VEPA elements only * Delete a mirror rule. Mirror rules are supported for VEBs/VEPA elements only
**/ **/
i40e_status i40e_aq_delete_mirrorrule(struct i40e_hw *hw, u16 sw_seid, int i40e_aq_delete_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
u16 rule_type, u16 rule_id, u16 count, __le16 *mr_list, u16 rule_type, u16 rule_id, u16 count,
__le16 *mr_list,
struct i40e_asq_cmd_details *cmd_details, struct i40e_asq_cmd_details *cmd_details,
u16 *rules_used, u16 *rules_free) u16 *rules_used, u16 *rules_free)
{ {
...@@ -2989,14 +2847,14 @@ i40e_status i40e_aq_delete_mirrorrule(struct i40e_hw *hw, u16 sw_seid, ...@@ -2989,14 +2847,14 @@ i40e_status i40e_aq_delete_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
* *
* send msg to vf * send msg to vf
**/ **/
i40e_status i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid, int i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid,
u32 v_opcode, u32 v_retval, u8 *msg, u16 msglen, u32 v_opcode, u32 v_retval, u8 *msg, u16 msglen,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_pf_vf_message *cmd = struct i40e_aqc_pf_vf_message *cmd =
(struct i40e_aqc_pf_vf_message *)&desc.params.raw; (struct i40e_aqc_pf_vf_message *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_send_msg_to_vf); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_send_msg_to_vf);
cmd->id = cpu_to_le32(vfid); cmd->id = cpu_to_le32(vfid);
...@@ -3024,14 +2882,14 @@ i40e_status i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid, ...@@ -3024,14 +2882,14 @@ i40e_status i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid,
* *
* Read the register using the admin queue commands * Read the register using the admin queue commands
**/ **/
i40e_status i40e_aq_debug_read_register(struct i40e_hw *hw, int i40e_aq_debug_read_register(struct i40e_hw *hw,
u32 reg_addr, u64 *reg_val, u32 reg_addr, u64 *reg_val,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_debug_reg_read_write *cmd_resp = struct i40e_aqc_debug_reg_read_write *cmd_resp =
(struct i40e_aqc_debug_reg_read_write *)&desc.params.raw; (struct i40e_aqc_debug_reg_read_write *)&desc.params.raw;
i40e_status status; int status;
if (reg_val == NULL) if (reg_val == NULL)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -3059,14 +2917,14 @@ i40e_status i40e_aq_debug_read_register(struct i40e_hw *hw, ...@@ -3059,14 +2917,14 @@ i40e_status i40e_aq_debug_read_register(struct i40e_hw *hw,
* *
* Write to a register using the admin queue commands * Write to a register using the admin queue commands
**/ **/
i40e_status i40e_aq_debug_write_register(struct i40e_hw *hw, int i40e_aq_debug_write_register(struct i40e_hw *hw,
u32 reg_addr, u64 reg_val, u32 reg_addr, u64 reg_val,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_debug_reg_read_write *cmd = struct i40e_aqc_debug_reg_read_write *cmd =
(struct i40e_aqc_debug_reg_read_write *)&desc.params.raw; (struct i40e_aqc_debug_reg_read_write *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_debug_write_reg); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_debug_write_reg);
...@@ -3090,7 +2948,7 @@ i40e_status i40e_aq_debug_write_register(struct i40e_hw *hw, ...@@ -3090,7 +2948,7 @@ i40e_status i40e_aq_debug_write_register(struct i40e_hw *hw,
* *
* requests common resource using the admin queue commands * requests common resource using the admin queue commands
**/ **/
i40e_status i40e_aq_request_resource(struct i40e_hw *hw, int i40e_aq_request_resource(struct i40e_hw *hw,
enum i40e_aq_resources_ids resource, enum i40e_aq_resources_ids resource,
enum i40e_aq_resource_access_type access, enum i40e_aq_resource_access_type access,
u8 sdp_number, u64 *timeout, u8 sdp_number, u64 *timeout,
...@@ -3099,7 +2957,7 @@ i40e_status i40e_aq_request_resource(struct i40e_hw *hw, ...@@ -3099,7 +2957,7 @@ i40e_status i40e_aq_request_resource(struct i40e_hw *hw,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_request_resource *cmd_resp = struct i40e_aqc_request_resource *cmd_resp =
(struct i40e_aqc_request_resource *)&desc.params.raw; (struct i40e_aqc_request_resource *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_request_resource); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_request_resource);
...@@ -3129,7 +2987,7 @@ i40e_status i40e_aq_request_resource(struct i40e_hw *hw, ...@@ -3129,7 +2987,7 @@ i40e_status i40e_aq_request_resource(struct i40e_hw *hw,
* *
* release common resource using the admin queue commands * release common resource using the admin queue commands
**/ **/
i40e_status i40e_aq_release_resource(struct i40e_hw *hw, int i40e_aq_release_resource(struct i40e_hw *hw,
enum i40e_aq_resources_ids resource, enum i40e_aq_resources_ids resource,
u8 sdp_number, u8 sdp_number,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -3137,7 +2995,7 @@ i40e_status i40e_aq_release_resource(struct i40e_hw *hw, ...@@ -3137,7 +2995,7 @@ i40e_status i40e_aq_release_resource(struct i40e_hw *hw,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_request_resource *cmd = struct i40e_aqc_request_resource *cmd =
(struct i40e_aqc_request_resource *)&desc.params.raw; (struct i40e_aqc_request_resource *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_release_resource); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_release_resource);
...@@ -3161,7 +3019,7 @@ i40e_status i40e_aq_release_resource(struct i40e_hw *hw, ...@@ -3161,7 +3019,7 @@ i40e_status i40e_aq_release_resource(struct i40e_hw *hw,
* *
* Read the NVM using the admin queue commands * Read the NVM using the admin queue commands
**/ **/
i40e_status i40e_aq_read_nvm(struct i40e_hw *hw, u8 module_pointer, int i40e_aq_read_nvm(struct i40e_hw *hw, u8 module_pointer,
u32 offset, u16 length, void *data, u32 offset, u16 length, void *data,
bool last_command, bool last_command,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -3169,7 +3027,7 @@ i40e_status i40e_aq_read_nvm(struct i40e_hw *hw, u8 module_pointer, ...@@ -3169,7 +3027,7 @@ i40e_status i40e_aq_read_nvm(struct i40e_hw *hw, u8 module_pointer,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_nvm_update *cmd = struct i40e_aqc_nvm_update *cmd =
(struct i40e_aqc_nvm_update *)&desc.params.raw; (struct i40e_aqc_nvm_update *)&desc.params.raw;
i40e_status status; int status;
/* In offset the highest byte must be zeroed. */ /* In offset the highest byte must be zeroed. */
if (offset & 0xFF000000) { if (offset & 0xFF000000) {
...@@ -3207,14 +3065,14 @@ i40e_status i40e_aq_read_nvm(struct i40e_hw *hw, u8 module_pointer, ...@@ -3207,14 +3065,14 @@ i40e_status i40e_aq_read_nvm(struct i40e_hw *hw, u8 module_pointer,
* *
* Erase the NVM sector using the admin queue commands * Erase the NVM sector using the admin queue commands
**/ **/
i40e_status i40e_aq_erase_nvm(struct i40e_hw *hw, u8 module_pointer, int i40e_aq_erase_nvm(struct i40e_hw *hw, u8 module_pointer,
u32 offset, u16 length, bool last_command, u32 offset, u16 length, bool last_command,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_nvm_update *cmd = struct i40e_aqc_nvm_update *cmd =
(struct i40e_aqc_nvm_update *)&desc.params.raw; (struct i40e_aqc_nvm_update *)&desc.params.raw;
i40e_status status; int status;
/* In offset the highest byte must be zeroed. */ /* In offset the highest byte must be zeroed. */
if (offset & 0xFF000000) { if (offset & 0xFF000000) {
...@@ -3255,8 +3113,8 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff, ...@@ -3255,8 +3113,8 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
u32 number, logical_id, phys_id; u32 number, logical_id, phys_id;
struct i40e_hw_capabilities *p; struct i40e_hw_capabilities *p;
u16 id, ocp_cfg_word0; u16 id, ocp_cfg_word0;
i40e_status status;
u8 major_rev; u8 major_rev;
int status;
u32 i = 0; u32 i = 0;
cap = (struct i40e_aqc_list_capabilities_element_resp *) buff; cap = (struct i40e_aqc_list_capabilities_element_resp *) buff;
...@@ -3497,14 +3355,14 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff, ...@@ -3497,14 +3355,14 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
* *
* Get the device capabilities descriptions from the firmware * Get the device capabilities descriptions from the firmware
**/ **/
i40e_status i40e_aq_discover_capabilities(struct i40e_hw *hw, int i40e_aq_discover_capabilities(struct i40e_hw *hw,
void *buff, u16 buff_size, u16 *data_size, void *buff, u16 buff_size, u16 *data_size,
enum i40e_admin_queue_opc list_type_opc, enum i40e_admin_queue_opc list_type_opc,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aqc_list_capabilites *cmd; struct i40e_aqc_list_capabilites *cmd;
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
i40e_status status = 0; int status = 0;
cmd = (struct i40e_aqc_list_capabilites *)&desc.params.raw; cmd = (struct i40e_aqc_list_capabilites *)&desc.params.raw;
...@@ -3546,7 +3404,7 @@ i40e_status i40e_aq_discover_capabilities(struct i40e_hw *hw, ...@@ -3546,7 +3404,7 @@ i40e_status i40e_aq_discover_capabilities(struct i40e_hw *hw,
* *
* Update the NVM using the admin queue commands * Update the NVM using the admin queue commands
**/ **/
i40e_status i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer, int i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
u32 offset, u16 length, void *data, u32 offset, u16 length, void *data,
bool last_command, u8 preservation_flags, bool last_command, u8 preservation_flags,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -3554,7 +3412,7 @@ i40e_status i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer, ...@@ -3554,7 +3412,7 @@ i40e_status i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_nvm_update *cmd = struct i40e_aqc_nvm_update *cmd =
(struct i40e_aqc_nvm_update *)&desc.params.raw; (struct i40e_aqc_nvm_update *)&desc.params.raw;
i40e_status status; int status;
/* In offset the highest byte must be zeroed. */ /* In offset the highest byte must be zeroed. */
if (offset & 0xFF000000) { if (offset & 0xFF000000) {
...@@ -3599,13 +3457,13 @@ i40e_status i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer, ...@@ -3599,13 +3457,13 @@ i40e_status i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
* *
* Rearrange NVM structure, available only for transition FW * Rearrange NVM structure, available only for transition FW
**/ **/
i40e_status i40e_aq_rearrange_nvm(struct i40e_hw *hw, int i40e_aq_rearrange_nvm(struct i40e_hw *hw,
u8 rearrange_nvm, u8 rearrange_nvm,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aqc_nvm_update *cmd; struct i40e_aqc_nvm_update *cmd;
i40e_status status;
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
int status;
cmd = (struct i40e_aqc_nvm_update *)&desc.params.raw; cmd = (struct i40e_aqc_nvm_update *)&desc.params.raw;
...@@ -3639,7 +3497,7 @@ i40e_status i40e_aq_rearrange_nvm(struct i40e_hw *hw, ...@@ -3639,7 +3497,7 @@ i40e_status i40e_aq_rearrange_nvm(struct i40e_hw *hw,
* *
* Requests the complete LLDP MIB (entire packet). * Requests the complete LLDP MIB (entire packet).
**/ **/
i40e_status i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type, int i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type,
u8 mib_type, void *buff, u16 buff_size, u8 mib_type, void *buff, u16 buff_size,
u16 *local_len, u16 *remote_len, u16 *local_len, u16 *remote_len,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -3649,7 +3507,7 @@ i40e_status i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type, ...@@ -3649,7 +3507,7 @@ i40e_status i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type,
(struct i40e_aqc_lldp_get_mib *)&desc.params.raw; (struct i40e_aqc_lldp_get_mib *)&desc.params.raw;
struct i40e_aqc_lldp_get_mib *resp = struct i40e_aqc_lldp_get_mib *resp =
(struct i40e_aqc_lldp_get_mib *)&desc.params.raw; (struct i40e_aqc_lldp_get_mib *)&desc.params.raw;
i40e_status status; int status;
if (buff_size == 0 || !buff) if (buff_size == 0 || !buff)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -3689,14 +3547,14 @@ i40e_status i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type, ...@@ -3689,14 +3547,14 @@ i40e_status i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type,
* *
* Set the LLDP MIB. * Set the LLDP MIB.
**/ **/
enum i40e_status_code int
i40e_aq_set_lldp_mib(struct i40e_hw *hw, i40e_aq_set_lldp_mib(struct i40e_hw *hw,
u8 mib_type, void *buff, u16 buff_size, u8 mib_type, void *buff, u16 buff_size,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aqc_lldp_set_local_mib *cmd; struct i40e_aqc_lldp_set_local_mib *cmd;
enum i40e_status_code status;
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
int status;
cmd = (struct i40e_aqc_lldp_set_local_mib *)&desc.params.raw; cmd = (struct i40e_aqc_lldp_set_local_mib *)&desc.params.raw;
if (buff_size == 0 || !buff) if (buff_size == 0 || !buff)
...@@ -3728,14 +3586,14 @@ i40e_aq_set_lldp_mib(struct i40e_hw *hw, ...@@ -3728,14 +3586,14 @@ i40e_aq_set_lldp_mib(struct i40e_hw *hw,
* Enable or Disable posting of an event on ARQ when LLDP MIB * Enable or Disable posting of an event on ARQ when LLDP MIB
* associated with the interface changes * associated with the interface changes
**/ **/
i40e_status i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw, int i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw,
bool enable_update, bool enable_update,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_lldp_update_mib *cmd = struct i40e_aqc_lldp_update_mib *cmd =
(struct i40e_aqc_lldp_update_mib *)&desc.params.raw; (struct i40e_aqc_lldp_update_mib *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_update_mib); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_update_mib);
...@@ -3757,14 +3615,14 @@ i40e_status i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw, ...@@ -3757,14 +3615,14 @@ i40e_status i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw,
* Restore LLDP Agent factory settings if @restore set to True. In other case * Restore LLDP Agent factory settings if @restore set to True. In other case
* only returns factory setting in AQ response. * only returns factory setting in AQ response.
**/ **/
enum i40e_status_code int
i40e_aq_restore_lldp(struct i40e_hw *hw, u8 *setting, bool restore, i40e_aq_restore_lldp(struct i40e_hw *hw, u8 *setting, bool restore,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_lldp_restore *cmd = struct i40e_aqc_lldp_restore *cmd =
(struct i40e_aqc_lldp_restore *)&desc.params.raw; (struct i40e_aqc_lldp_restore *)&desc.params.raw;
i40e_status status; int status;
if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT)) { if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT)) {
i40e_debug(hw, I40E_DEBUG_ALL, i40e_debug(hw, I40E_DEBUG_ALL,
...@@ -3794,14 +3652,14 @@ i40e_aq_restore_lldp(struct i40e_hw *hw, u8 *setting, bool restore, ...@@ -3794,14 +3652,14 @@ i40e_aq_restore_lldp(struct i40e_hw *hw, u8 *setting, bool restore,
* *
* Stop or Shutdown the embedded LLDP Agent * Stop or Shutdown the embedded LLDP Agent
**/ **/
i40e_status i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent, int i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent,
bool persist, bool persist,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_lldp_stop *cmd = struct i40e_aqc_lldp_stop *cmd =
(struct i40e_aqc_lldp_stop *)&desc.params.raw; (struct i40e_aqc_lldp_stop *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_stop); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_stop);
...@@ -3829,13 +3687,13 @@ i40e_status i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent, ...@@ -3829,13 +3687,13 @@ i40e_status i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent,
* *
* Start the embedded LLDP Agent on all ports. * Start the embedded LLDP Agent on all ports.
**/ **/
i40e_status i40e_aq_start_lldp(struct i40e_hw *hw, bool persist, int i40e_aq_start_lldp(struct i40e_hw *hw, bool persist,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_lldp_start *cmd = struct i40e_aqc_lldp_start *cmd =
(struct i40e_aqc_lldp_start *)&desc.params.raw; (struct i40e_aqc_lldp_start *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_start); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_start);
...@@ -3861,14 +3719,14 @@ i40e_status i40e_aq_start_lldp(struct i40e_hw *hw, bool persist, ...@@ -3861,14 +3719,14 @@ i40e_status i40e_aq_start_lldp(struct i40e_hw *hw, bool persist,
* @dcb_enable: True if DCB configuration needs to be applied * @dcb_enable: True if DCB configuration needs to be applied
* *
**/ **/
enum i40e_status_code int
i40e_aq_set_dcb_parameters(struct i40e_hw *hw, bool dcb_enable, i40e_aq_set_dcb_parameters(struct i40e_hw *hw, bool dcb_enable,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_set_dcb_parameters *cmd = struct i40e_aqc_set_dcb_parameters *cmd =
(struct i40e_aqc_set_dcb_parameters *)&desc.params.raw; (struct i40e_aqc_set_dcb_parameters *)&desc.params.raw;
i40e_status status; int status;
if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE)) if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE))
return I40E_ERR_DEVICE_NOT_SUPPORTED; return I40E_ERR_DEVICE_NOT_SUPPORTED;
...@@ -3894,12 +3752,12 @@ i40e_aq_set_dcb_parameters(struct i40e_hw *hw, bool dcb_enable, ...@@ -3894,12 +3752,12 @@ i40e_aq_set_dcb_parameters(struct i40e_hw *hw, bool dcb_enable,
* *
* Get CEE DCBX mode operational configuration from firmware * Get CEE DCBX mode operational configuration from firmware
**/ **/
i40e_status i40e_aq_get_cee_dcb_config(struct i40e_hw *hw, int i40e_aq_get_cee_dcb_config(struct i40e_hw *hw,
void *buff, u16 buff_size, void *buff, u16 buff_size,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
i40e_status status; int status;
if (buff_size == 0 || !buff) if (buff_size == 0 || !buff)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -3925,7 +3783,7 @@ i40e_status i40e_aq_get_cee_dcb_config(struct i40e_hw *hw, ...@@ -3925,7 +3783,7 @@ i40e_status i40e_aq_get_cee_dcb_config(struct i40e_hw *hw,
* and this function will call cpu_to_le16 to convert from Host byte order to * and this function will call cpu_to_le16 to convert from Host byte order to
* Little Endian order. * Little Endian order.
**/ **/
i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw, int i40e_aq_add_udp_tunnel(struct i40e_hw *hw,
u16 udp_port, u8 protocol_index, u16 udp_port, u8 protocol_index,
u8 *filter_index, u8 *filter_index,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -3935,7 +3793,7 @@ i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw, ...@@ -3935,7 +3793,7 @@ i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw,
(struct i40e_aqc_add_udp_tunnel *)&desc.params.raw; (struct i40e_aqc_add_udp_tunnel *)&desc.params.raw;
struct i40e_aqc_del_udp_tunnel_completion *resp = struct i40e_aqc_del_udp_tunnel_completion *resp =
(struct i40e_aqc_del_udp_tunnel_completion *)&desc.params.raw; (struct i40e_aqc_del_udp_tunnel_completion *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_add_udp_tunnel); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_add_udp_tunnel);
...@@ -3956,13 +3814,13 @@ i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw, ...@@ -3956,13 +3814,13 @@ i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw,
* @index: filter index * @index: filter index
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index, int i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_remove_udp_tunnel *cmd = struct i40e_aqc_remove_udp_tunnel *cmd =
(struct i40e_aqc_remove_udp_tunnel *)&desc.params.raw; (struct i40e_aqc_remove_udp_tunnel *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_del_udp_tunnel); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_del_udp_tunnel);
...@@ -3981,13 +3839,13 @@ i40e_status i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index, ...@@ -3981,13 +3839,13 @@ i40e_status i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index,
* *
* This deletes a switch element from the switch. * This deletes a switch element from the switch.
**/ **/
i40e_status i40e_aq_delete_element(struct i40e_hw *hw, u16 seid, int i40e_aq_delete_element(struct i40e_hw *hw, u16 seid,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_switch_seid *cmd = struct i40e_aqc_switch_seid *cmd =
(struct i40e_aqc_switch_seid *)&desc.params.raw; (struct i40e_aqc_switch_seid *)&desc.params.raw;
i40e_status status; int status;
if (seid == 0) if (seid == 0)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -4011,11 +3869,11 @@ i40e_status i40e_aq_delete_element(struct i40e_hw *hw, u16 seid, ...@@ -4011,11 +3869,11 @@ i40e_status i40e_aq_delete_element(struct i40e_hw *hw, u16 seid,
* recomputed and modified. The retval field in the descriptor * recomputed and modified. The retval field in the descriptor
* will be set to 0 when RPB is modified. * will be set to 0 when RPB is modified.
**/ **/
i40e_status i40e_aq_dcb_updated(struct i40e_hw *hw, int i40e_aq_dcb_updated(struct i40e_hw *hw,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_dcb_updated); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_dcb_updated);
...@@ -4035,7 +3893,7 @@ i40e_status i40e_aq_dcb_updated(struct i40e_hw *hw, ...@@ -4035,7 +3893,7 @@ i40e_status i40e_aq_dcb_updated(struct i40e_hw *hw,
* *
* Generic command handler for Tx scheduler AQ commands * Generic command handler for Tx scheduler AQ commands
**/ **/
static i40e_status i40e_aq_tx_sched_cmd(struct i40e_hw *hw, u16 seid, static int i40e_aq_tx_sched_cmd(struct i40e_hw *hw, u16 seid,
void *buff, u16 buff_size, void *buff, u16 buff_size,
enum i40e_admin_queue_opc opcode, enum i40e_admin_queue_opc opcode,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -4043,7 +3901,7 @@ static i40e_status i40e_aq_tx_sched_cmd(struct i40e_hw *hw, u16 seid, ...@@ -4043,7 +3901,7 @@ static i40e_status i40e_aq_tx_sched_cmd(struct i40e_hw *hw, u16 seid,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_tx_sched_ind *cmd = struct i40e_aqc_tx_sched_ind *cmd =
(struct i40e_aqc_tx_sched_ind *)&desc.params.raw; (struct i40e_aqc_tx_sched_ind *)&desc.params.raw;
i40e_status status; int status;
bool cmd_param_flag = false; bool cmd_param_flag = false;
switch (opcode) { switch (opcode) {
...@@ -4093,14 +3951,14 @@ static i40e_status i40e_aq_tx_sched_cmd(struct i40e_hw *hw, u16 seid, ...@@ -4093,14 +3951,14 @@ static i40e_status i40e_aq_tx_sched_cmd(struct i40e_hw *hw, u16 seid,
* @max_credit: Max BW limit credits * @max_credit: Max BW limit credits
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_config_vsi_bw_limit(struct i40e_hw *hw, int i40e_aq_config_vsi_bw_limit(struct i40e_hw *hw,
u16 seid, u16 credit, u8 max_credit, u16 seid, u16 credit, u8 max_credit,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_configure_vsi_bw_limit *cmd = struct i40e_aqc_configure_vsi_bw_limit *cmd =
(struct i40e_aqc_configure_vsi_bw_limit *)&desc.params.raw; (struct i40e_aqc_configure_vsi_bw_limit *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_configure_vsi_bw_limit); i40e_aqc_opc_configure_vsi_bw_limit);
...@@ -4121,7 +3979,7 @@ i40e_status i40e_aq_config_vsi_bw_limit(struct i40e_hw *hw, ...@@ -4121,7 +3979,7 @@ i40e_status i40e_aq_config_vsi_bw_limit(struct i40e_hw *hw,
* @bw_data: Buffer holding enabled TCs, relative TC BW limit/credits * @bw_data: Buffer holding enabled TCs, relative TC BW limit/credits
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_config_vsi_tc_bw(struct i40e_hw *hw, int i40e_aq_config_vsi_tc_bw(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_configure_vsi_tc_bw_data *bw_data, struct i40e_aqc_configure_vsi_tc_bw_data *bw_data,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -4139,7 +3997,8 @@ i40e_status i40e_aq_config_vsi_tc_bw(struct i40e_hw *hw, ...@@ -4139,7 +3997,8 @@ i40e_status i40e_aq_config_vsi_tc_bw(struct i40e_hw *hw,
* @opcode: Tx scheduler AQ command opcode * @opcode: Tx scheduler AQ command opcode
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_config_switch_comp_ets(struct i40e_hw *hw, int
i40e_aq_config_switch_comp_ets(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_configure_switching_comp_ets_data *ets_data, struct i40e_aqc_configure_switching_comp_ets_data *ets_data,
enum i40e_admin_queue_opc opcode, enum i40e_admin_queue_opc opcode,
...@@ -4156,7 +4015,8 @@ i40e_status i40e_aq_config_switch_comp_ets(struct i40e_hw *hw, ...@@ -4156,7 +4015,8 @@ i40e_status i40e_aq_config_switch_comp_ets(struct i40e_hw *hw,
* @bw_data: Buffer holding enabled TCs, relative/absolute TC BW limit/credits * @bw_data: Buffer holding enabled TCs, relative/absolute TC BW limit/credits
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_config_switch_comp_bw_config(struct i40e_hw *hw, int
i40e_aq_config_switch_comp_bw_config(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_configure_switching_comp_bw_config_data *bw_data, struct i40e_aqc_configure_switching_comp_bw_config_data *bw_data,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -4173,7 +4033,8 @@ i40e_status i40e_aq_config_switch_comp_bw_config(struct i40e_hw *hw, ...@@ -4173,7 +4033,8 @@ i40e_status i40e_aq_config_switch_comp_bw_config(struct i40e_hw *hw,
* @bw_data: Buffer to hold VSI BW configuration * @bw_data: Buffer to hold VSI BW configuration
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_query_vsi_bw_config(struct i40e_hw *hw, int
i40e_aq_query_vsi_bw_config(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_query_vsi_bw_config_resp *bw_data, struct i40e_aqc_query_vsi_bw_config_resp *bw_data,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -4190,7 +4051,8 @@ i40e_status i40e_aq_query_vsi_bw_config(struct i40e_hw *hw, ...@@ -4190,7 +4051,8 @@ i40e_status i40e_aq_query_vsi_bw_config(struct i40e_hw *hw,
* @bw_data: Buffer to hold VSI BW configuration per TC * @bw_data: Buffer to hold VSI BW configuration per TC
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_query_vsi_ets_sla_config(struct i40e_hw *hw, int
i40e_aq_query_vsi_ets_sla_config(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_query_vsi_ets_sla_config_resp *bw_data, struct i40e_aqc_query_vsi_ets_sla_config_resp *bw_data,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -4207,7 +4069,8 @@ i40e_status i40e_aq_query_vsi_ets_sla_config(struct i40e_hw *hw, ...@@ -4207,7 +4069,8 @@ i40e_status i40e_aq_query_vsi_ets_sla_config(struct i40e_hw *hw,
* @bw_data: Buffer to hold switching component's per TC BW config * @bw_data: Buffer to hold switching component's per TC BW config
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_query_switch_comp_ets_config(struct i40e_hw *hw, int
i40e_aq_query_switch_comp_ets_config(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_query_switching_comp_ets_config_resp *bw_data, struct i40e_aqc_query_switching_comp_ets_config_resp *bw_data,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -4224,7 +4087,8 @@ i40e_status i40e_aq_query_switch_comp_ets_config(struct i40e_hw *hw, ...@@ -4224,7 +4087,8 @@ i40e_status i40e_aq_query_switch_comp_ets_config(struct i40e_hw *hw,
* @bw_data: Buffer to hold current ETS configuration for the Physical Port * @bw_data: Buffer to hold current ETS configuration for the Physical Port
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_query_port_ets_config(struct i40e_hw *hw, int
i40e_aq_query_port_ets_config(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_query_port_ets_config_resp *bw_data, struct i40e_aqc_query_port_ets_config_resp *bw_data,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -4241,7 +4105,8 @@ i40e_status i40e_aq_query_port_ets_config(struct i40e_hw *hw, ...@@ -4241,7 +4105,8 @@ i40e_status i40e_aq_query_port_ets_config(struct i40e_hw *hw,
* @bw_data: Buffer to hold switching component's BW configuration * @bw_data: Buffer to hold switching component's BW configuration
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
i40e_status i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw, int
i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_query_switching_comp_bw_config_resp *bw_data, struct i40e_aqc_query_switching_comp_bw_config_resp *bw_data,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -4263,7 +4128,8 @@ i40e_status i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw, ...@@ -4263,7 +4128,8 @@ i40e_status i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw,
* Returns 0 if the values passed are valid and within * Returns 0 if the values passed are valid and within
* range else returns an error. * range else returns an error.
**/ **/
static i40e_status i40e_validate_filter_settings(struct i40e_hw *hw, static int
i40e_validate_filter_settings(struct i40e_hw *hw,
struct i40e_filter_control_settings *settings) struct i40e_filter_control_settings *settings)
{ {
u32 fcoe_cntx_size, fcoe_filt_size; u32 fcoe_cntx_size, fcoe_filt_size;
...@@ -4350,11 +4216,11 @@ static i40e_status i40e_validate_filter_settings(struct i40e_hw *hw, ...@@ -4350,11 +4216,11 @@ static i40e_status i40e_validate_filter_settings(struct i40e_hw *hw,
* for a single PF. It is expected that these settings are programmed * for a single PF. It is expected that these settings are programmed
* at the driver initialization time. * at the driver initialization time.
**/ **/
i40e_status i40e_set_filter_control(struct i40e_hw *hw, int i40e_set_filter_control(struct i40e_hw *hw,
struct i40e_filter_control_settings *settings) struct i40e_filter_control_settings *settings)
{ {
i40e_status ret = 0;
u32 hash_lut_size = 0; u32 hash_lut_size = 0;
int ret = 0;
u32 val; u32 val;
if (!settings) if (!settings)
...@@ -4424,7 +4290,7 @@ i40e_status i40e_set_filter_control(struct i40e_hw *hw, ...@@ -4424,7 +4290,7 @@ i40e_status i40e_set_filter_control(struct i40e_hw *hw,
* In return it will update the total number of perfect filter count in * In return it will update the total number of perfect filter count in
* the stats member. * the stats member.
**/ **/
i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw, int i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,
u8 *mac_addr, u16 ethtype, u16 flags, u8 *mac_addr, u16 ethtype, u16 flags,
u16 vsi_seid, u16 queue, bool is_add, u16 vsi_seid, u16 queue, bool is_add,
struct i40e_control_filter_stats *stats, struct i40e_control_filter_stats *stats,
...@@ -4437,7 +4303,7 @@ i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw, ...@@ -4437,7 +4303,7 @@ i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,
struct i40e_aqc_add_remove_control_packet_filter_completion *resp = struct i40e_aqc_add_remove_control_packet_filter_completion *resp =
(struct i40e_aqc_add_remove_control_packet_filter_completion *) (struct i40e_aqc_add_remove_control_packet_filter_completion *)
&desc.params.raw; &desc.params.raw;
i40e_status status; int status;
if (vsi_seid == 0) if (vsi_seid == 0)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -4483,7 +4349,7 @@ void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw, ...@@ -4483,7 +4349,7 @@ void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw,
I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP | I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP |
I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX; I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX;
u16 ethtype = I40E_FLOW_CONTROL_ETHTYPE; u16 ethtype = I40E_FLOW_CONTROL_ETHTYPE;
i40e_status status; int status;
status = i40e_aq_add_rem_control_packet_filter(hw, NULL, ethtype, flag, status = i40e_aq_add_rem_control_packet_filter(hw, NULL, ethtype, flag,
seid, 0, true, NULL, seid, 0, true, NULL,
...@@ -4505,14 +4371,14 @@ void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw, ...@@ -4505,14 +4371,14 @@ void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw,
* is not passed then only register at 'reg_addr0' is read. * is not passed then only register at 'reg_addr0' is read.
* *
**/ **/
static i40e_status i40e_aq_alternate_read(struct i40e_hw *hw, static int i40e_aq_alternate_read(struct i40e_hw *hw,
u32 reg_addr0, u32 *reg_val0, u32 reg_addr0, u32 *reg_val0,
u32 reg_addr1, u32 *reg_val1) u32 reg_addr1, u32 *reg_val1)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_alternate_write *cmd_resp = struct i40e_aqc_alternate_write *cmd_resp =
(struct i40e_aqc_alternate_write *)&desc.params.raw; (struct i40e_aqc_alternate_write *)&desc.params.raw;
i40e_status status; int status;
if (!reg_val0) if (!reg_val0)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -4541,12 +4407,12 @@ static i40e_status i40e_aq_alternate_read(struct i40e_hw *hw, ...@@ -4541,12 +4407,12 @@ static i40e_status i40e_aq_alternate_read(struct i40e_hw *hw,
* *
* Suspend port's Tx traffic * Suspend port's Tx traffic
**/ **/
i40e_status i40e_aq_suspend_port_tx(struct i40e_hw *hw, u16 seid, int i40e_aq_suspend_port_tx(struct i40e_hw *hw, u16 seid,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aqc_tx_sched_ind *cmd; struct i40e_aqc_tx_sched_ind *cmd;
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
i40e_status status; int status;
cmd = (struct i40e_aqc_tx_sched_ind *)&desc.params.raw; cmd = (struct i40e_aqc_tx_sched_ind *)&desc.params.raw;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_suspend_port_tx); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_suspend_port_tx);
...@@ -4563,11 +4429,11 @@ i40e_status i40e_aq_suspend_port_tx(struct i40e_hw *hw, u16 seid, ...@@ -4563,11 +4429,11 @@ i40e_status i40e_aq_suspend_port_tx(struct i40e_hw *hw, u16 seid,
* *
* Resume port's Tx traffic * Resume port's Tx traffic
**/ **/
i40e_status i40e_aq_resume_port_tx(struct i40e_hw *hw, int i40e_aq_resume_port_tx(struct i40e_hw *hw,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_resume_port_tx); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_resume_port_tx);
...@@ -4637,7 +4503,7 @@ void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status) ...@@ -4637,7 +4503,7 @@ void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status)
* Dump internal FW/HW data for debug purposes. * Dump internal FW/HW data for debug purposes.
* *
**/ **/
i40e_status i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, int i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,
u8 table_id, u32 start_index, u16 buff_size, u8 table_id, u32 start_index, u16 buff_size,
void *buff, u16 *ret_buff_size, void *buff, u16 *ret_buff_size,
u8 *ret_next_table, u32 *ret_next_index, u8 *ret_next_table, u32 *ret_next_index,
...@@ -4648,7 +4514,7 @@ i40e_status i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, ...@@ -4648,7 +4514,7 @@ i40e_status i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,
(struct i40e_aqc_debug_dump_internals *)&desc.params.raw; (struct i40e_aqc_debug_dump_internals *)&desc.params.raw;
struct i40e_aqc_debug_dump_internals *resp = struct i40e_aqc_debug_dump_internals *resp =
(struct i40e_aqc_debug_dump_internals *)&desc.params.raw; (struct i40e_aqc_debug_dump_internals *)&desc.params.raw;
i40e_status status; int status;
if (buff_size == 0 || !buff) if (buff_size == 0 || !buff)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -4689,12 +4555,12 @@ i40e_status i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, ...@@ -4689,12 +4555,12 @@ i40e_status i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,
* *
* Read bw from the alternate ram for the given pf * Read bw from the alternate ram for the given pf
**/ **/
i40e_status i40e_read_bw_from_alt_ram(struct i40e_hw *hw, int i40e_read_bw_from_alt_ram(struct i40e_hw *hw,
u32 *max_bw, u32 *min_bw, u32 *max_bw, u32 *min_bw,
bool *min_valid, bool *max_valid) bool *min_valid, bool *max_valid)
{ {
i40e_status status;
u32 max_bw_addr, min_bw_addr; u32 max_bw_addr, min_bw_addr;
int status;
/* Calculate the address of the min/max bw registers */ /* Calculate the address of the min/max bw registers */
max_bw_addr = I40E_ALT_STRUCT_FIRST_PF_OFFSET + max_bw_addr = I40E_ALT_STRUCT_FIRST_PF_OFFSET +
...@@ -4729,13 +4595,14 @@ i40e_status i40e_read_bw_from_alt_ram(struct i40e_hw *hw, ...@@ -4729,13 +4595,14 @@ i40e_status i40e_read_bw_from_alt_ram(struct i40e_hw *hw,
* *
* Configure partitions guaranteed/max bw * Configure partitions guaranteed/max bw
**/ **/
i40e_status i40e_aq_configure_partition_bw(struct i40e_hw *hw, int
i40e_aq_configure_partition_bw(struct i40e_hw *hw,
struct i40e_aqc_configure_partition_bw_data *bw_data, struct i40e_aqc_configure_partition_bw_data *bw_data,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
i40e_status status;
struct i40e_aq_desc desc;
u16 bwd_size = sizeof(*bw_data); u16 bwd_size = sizeof(*bw_data);
struct i40e_aq_desc desc;
int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_configure_partition_bw); i40e_aqc_opc_configure_partition_bw);
...@@ -4764,11 +4631,11 @@ i40e_status i40e_aq_configure_partition_bw(struct i40e_hw *hw, ...@@ -4764,11 +4631,11 @@ i40e_status i40e_aq_configure_partition_bw(struct i40e_hw *hw,
* *
* Reads specified PHY register value * Reads specified PHY register value
**/ **/
i40e_status i40e_read_phy_register_clause22(struct i40e_hw *hw, int i40e_read_phy_register_clause22(struct i40e_hw *hw,
u16 reg, u8 phy_addr, u16 *value) u16 reg, u8 phy_addr, u16 *value)
{ {
i40e_status status = I40E_ERR_TIMEOUT;
u8 port_num = (u8)hw->func_caps.mdio_port_num; u8 port_num = (u8)hw->func_caps.mdio_port_num;
int status = I40E_ERR_TIMEOUT;
u32 command = 0; u32 command = 0;
u16 retry = 1000; u16 retry = 1000;
...@@ -4809,11 +4676,11 @@ i40e_status i40e_read_phy_register_clause22(struct i40e_hw *hw, ...@@ -4809,11 +4676,11 @@ i40e_status i40e_read_phy_register_clause22(struct i40e_hw *hw,
* *
* Writes specified PHY register value * Writes specified PHY register value
**/ **/
i40e_status i40e_write_phy_register_clause22(struct i40e_hw *hw, int i40e_write_phy_register_clause22(struct i40e_hw *hw,
u16 reg, u8 phy_addr, u16 value) u16 reg, u8 phy_addr, u16 value)
{ {
i40e_status status = I40E_ERR_TIMEOUT;
u8 port_num = (u8)hw->func_caps.mdio_port_num; u8 port_num = (u8)hw->func_caps.mdio_port_num;
int status = I40E_ERR_TIMEOUT;
u32 command = 0; u32 command = 0;
u16 retry = 1000; u16 retry = 1000;
...@@ -4850,13 +4717,13 @@ i40e_status i40e_write_phy_register_clause22(struct i40e_hw *hw, ...@@ -4850,13 +4717,13 @@ i40e_status i40e_write_phy_register_clause22(struct i40e_hw *hw,
* *
* Reads specified PHY register value * Reads specified PHY register value
**/ **/
i40e_status i40e_read_phy_register_clause45(struct i40e_hw *hw, int i40e_read_phy_register_clause45(struct i40e_hw *hw,
u8 page, u16 reg, u8 phy_addr, u16 *value) u8 page, u16 reg, u8 phy_addr, u16 *value)
{ {
i40e_status status = I40E_ERR_TIMEOUT; u8 port_num = hw->func_caps.mdio_port_num;
int status = I40E_ERR_TIMEOUT;
u32 command = 0; u32 command = 0;
u16 retry = 1000; u16 retry = 1000;
u8 port_num = hw->func_caps.mdio_port_num;
command = (reg << I40E_GLGEN_MSCA_MDIADD_SHIFT) | command = (reg << I40E_GLGEN_MSCA_MDIADD_SHIFT) |
(page << I40E_GLGEN_MSCA_DEVADD_SHIFT) | (page << I40E_GLGEN_MSCA_DEVADD_SHIFT) |
...@@ -4924,13 +4791,13 @@ i40e_status i40e_read_phy_register_clause45(struct i40e_hw *hw, ...@@ -4924,13 +4791,13 @@ i40e_status i40e_read_phy_register_clause45(struct i40e_hw *hw,
* *
* Writes value to specified PHY register * Writes value to specified PHY register
**/ **/
i40e_status i40e_write_phy_register_clause45(struct i40e_hw *hw, int i40e_write_phy_register_clause45(struct i40e_hw *hw,
u8 page, u16 reg, u8 phy_addr, u16 value) u8 page, u16 reg, u8 phy_addr, u16 value)
{ {
i40e_status status = I40E_ERR_TIMEOUT;
u32 command = 0;
u16 retry = 1000;
u8 port_num = hw->func_caps.mdio_port_num; u8 port_num = hw->func_caps.mdio_port_num;
int status = I40E_ERR_TIMEOUT;
u16 retry = 1000;
u32 command = 0;
command = (reg << I40E_GLGEN_MSCA_MDIADD_SHIFT) | command = (reg << I40E_GLGEN_MSCA_MDIADD_SHIFT) |
(page << I40E_GLGEN_MSCA_DEVADD_SHIFT) | (page << I40E_GLGEN_MSCA_DEVADD_SHIFT) |
...@@ -4991,10 +4858,10 @@ i40e_status i40e_write_phy_register_clause45(struct i40e_hw *hw, ...@@ -4991,10 +4858,10 @@ i40e_status i40e_write_phy_register_clause45(struct i40e_hw *hw,
* *
* Writes value to specified PHY register * Writes value to specified PHY register
**/ **/
i40e_status i40e_write_phy_register(struct i40e_hw *hw, int i40e_write_phy_register(struct i40e_hw *hw,
u8 page, u16 reg, u8 phy_addr, u16 value) u8 page, u16 reg, u8 phy_addr, u16 value)
{ {
i40e_status status; int status;
switch (hw->device_id) { switch (hw->device_id) {
case I40E_DEV_ID_1G_BASE_T_X722: case I40E_DEV_ID_1G_BASE_T_X722:
...@@ -5030,10 +4897,10 @@ i40e_status i40e_write_phy_register(struct i40e_hw *hw, ...@@ -5030,10 +4897,10 @@ i40e_status i40e_write_phy_register(struct i40e_hw *hw,
* *
* Reads specified PHY register value * Reads specified PHY register value
**/ **/
i40e_status i40e_read_phy_register(struct i40e_hw *hw, int i40e_read_phy_register(struct i40e_hw *hw,
u8 page, u16 reg, u8 phy_addr, u16 *value) u8 page, u16 reg, u8 phy_addr, u16 *value)
{ {
i40e_status status; int status;
switch (hw->device_id) { switch (hw->device_id) {
case I40E_DEV_ID_1G_BASE_T_X722: case I40E_DEV_ID_1G_BASE_T_X722:
...@@ -5082,17 +4949,17 @@ u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num) ...@@ -5082,17 +4949,17 @@ u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num)
* *
* Blinks PHY link LED * Blinks PHY link LED
**/ **/
i40e_status i40e_blink_phy_link_led(struct i40e_hw *hw, int i40e_blink_phy_link_led(struct i40e_hw *hw,
u32 time, u32 interval) u32 time, u32 interval)
{ {
i40e_status status = 0;
u32 i;
u16 led_ctl;
u16 gpio_led_port;
u16 led_reg;
u16 led_addr = I40E_PHY_LED_PROV_REG_1; u16 led_addr = I40E_PHY_LED_PROV_REG_1;
u16 gpio_led_port;
u8 phy_addr = 0; u8 phy_addr = 0;
int status = 0;
u16 led_ctl;
u8 port_num; u8 port_num;
u16 led_reg;
u32 i;
i = rd32(hw, I40E_PFGEN_PORTNUM); i = rd32(hw, I40E_PFGEN_PORTNUM);
port_num = (u8)(i & I40E_PFGEN_PORTNUM_PORT_NUM_MASK); port_num = (u8)(i & I40E_PFGEN_PORTNUM_PORT_NUM_MASK);
...@@ -5154,12 +5021,12 @@ i40e_status i40e_blink_phy_link_led(struct i40e_hw *hw, ...@@ -5154,12 +5021,12 @@ i40e_status i40e_blink_phy_link_led(struct i40e_hw *hw,
* @led_addr: LED register address * @led_addr: LED register address
* @reg_val: read register value * @reg_val: read register value
**/ **/
static enum i40e_status_code i40e_led_get_reg(struct i40e_hw *hw, u16 led_addr, static int i40e_led_get_reg(struct i40e_hw *hw, u16 led_addr,
u32 *reg_val) u32 *reg_val)
{ {
enum i40e_status_code status;
u8 phy_addr = 0; u8 phy_addr = 0;
u8 port_num; u8 port_num;
int status;
u32 i; u32 i;
*reg_val = 0; *reg_val = 0;
...@@ -5188,12 +5055,12 @@ static enum i40e_status_code i40e_led_get_reg(struct i40e_hw *hw, u16 led_addr, ...@@ -5188,12 +5055,12 @@ static enum i40e_status_code i40e_led_get_reg(struct i40e_hw *hw, u16 led_addr,
* @led_addr: LED register address * @led_addr: LED register address
* @reg_val: register value to write * @reg_val: register value to write
**/ **/
static enum i40e_status_code i40e_led_set_reg(struct i40e_hw *hw, u16 led_addr, static int i40e_led_set_reg(struct i40e_hw *hw, u16 led_addr,
u32 reg_val) u32 reg_val)
{ {
enum i40e_status_code status;
u8 phy_addr = 0; u8 phy_addr = 0;
u8 port_num; u8 port_num;
int status;
u32 i; u32 i;
if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) { if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) {
...@@ -5223,17 +5090,17 @@ static enum i40e_status_code i40e_led_set_reg(struct i40e_hw *hw, u16 led_addr, ...@@ -5223,17 +5090,17 @@ static enum i40e_status_code i40e_led_set_reg(struct i40e_hw *hw, u16 led_addr,
* @val: original value of register to use * @val: original value of register to use
* *
**/ **/
i40e_status i40e_led_get_phy(struct i40e_hw *hw, u16 *led_addr, int i40e_led_get_phy(struct i40e_hw *hw, u16 *led_addr,
u16 *val) u16 *val)
{ {
i40e_status status = 0;
u16 gpio_led_port; u16 gpio_led_port;
u8 phy_addr = 0; u8 phy_addr = 0;
u16 reg_val; u32 reg_val_aq;
int status = 0;
u16 temp_addr; u16 temp_addr;
u16 reg_val;
u8 port_num; u8 port_num;
u32 i; u32 i;
u32 reg_val_aq;
if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) { if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) {
status = status =
...@@ -5278,12 +5145,12 @@ i40e_status i40e_led_get_phy(struct i40e_hw *hw, u16 *led_addr, ...@@ -5278,12 +5145,12 @@ i40e_status i40e_led_get_phy(struct i40e_hw *hw, u16 *led_addr,
* Set led's on or off when controlled by the PHY * Set led's on or off when controlled by the PHY
* *
**/ **/
i40e_status i40e_led_set_phy(struct i40e_hw *hw, bool on, int i40e_led_set_phy(struct i40e_hw *hw, bool on,
u16 led_addr, u32 mode) u16 led_addr, u32 mode)
{ {
i40e_status status = 0;
u32 led_ctl = 0; u32 led_ctl = 0;
u32 led_reg = 0; u32 led_reg = 0;
int status = 0;
status = i40e_led_get_reg(hw, led_addr, &led_reg); status = i40e_led_get_reg(hw, led_addr, &led_reg);
if (status) if (status)
...@@ -5327,14 +5194,14 @@ i40e_status i40e_led_set_phy(struct i40e_hw *hw, bool on, ...@@ -5327,14 +5194,14 @@ i40e_status i40e_led_set_phy(struct i40e_hw *hw, bool on,
* Use the firmware to read the Rx control register, * Use the firmware to read the Rx control register,
* especially useful if the Rx unit is under heavy pressure * especially useful if the Rx unit is under heavy pressure
**/ **/
i40e_status i40e_aq_rx_ctl_read_register(struct i40e_hw *hw, int i40e_aq_rx_ctl_read_register(struct i40e_hw *hw,
u32 reg_addr, u32 *reg_val, u32 reg_addr, u32 *reg_val,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_rx_ctl_reg_read_write *cmd_resp = struct i40e_aqc_rx_ctl_reg_read_write *cmd_resp =
(struct i40e_aqc_rx_ctl_reg_read_write *)&desc.params.raw; (struct i40e_aqc_rx_ctl_reg_read_write *)&desc.params.raw;
i40e_status status; int status;
if (!reg_val) if (!reg_val)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -5358,8 +5225,8 @@ i40e_status i40e_aq_rx_ctl_read_register(struct i40e_hw *hw, ...@@ -5358,8 +5225,8 @@ i40e_status i40e_aq_rx_ctl_read_register(struct i40e_hw *hw,
**/ **/
u32 i40e_read_rx_ctl(struct i40e_hw *hw, u32 reg_addr) u32 i40e_read_rx_ctl(struct i40e_hw *hw, u32 reg_addr)
{ {
i40e_status status = 0;
bool use_register; bool use_register;
int status = 0;
int retry = 5; int retry = 5;
u32 val = 0; u32 val = 0;
...@@ -5393,14 +5260,14 @@ u32 i40e_read_rx_ctl(struct i40e_hw *hw, u32 reg_addr) ...@@ -5393,14 +5260,14 @@ u32 i40e_read_rx_ctl(struct i40e_hw *hw, u32 reg_addr)
* Use the firmware to write to an Rx control register, * Use the firmware to write to an Rx control register,
* especially useful if the Rx unit is under heavy pressure * especially useful if the Rx unit is under heavy pressure
**/ **/
i40e_status i40e_aq_rx_ctl_write_register(struct i40e_hw *hw, int i40e_aq_rx_ctl_write_register(struct i40e_hw *hw,
u32 reg_addr, u32 reg_val, u32 reg_addr, u32 reg_val,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_rx_ctl_reg_read_write *cmd = struct i40e_aqc_rx_ctl_reg_read_write *cmd =
(struct i40e_aqc_rx_ctl_reg_read_write *)&desc.params.raw; (struct i40e_aqc_rx_ctl_reg_read_write *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_rx_ctl_reg_write); i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_rx_ctl_reg_write);
...@@ -5420,8 +5287,8 @@ i40e_status i40e_aq_rx_ctl_write_register(struct i40e_hw *hw, ...@@ -5420,8 +5287,8 @@ i40e_status i40e_aq_rx_ctl_write_register(struct i40e_hw *hw,
**/ **/
void i40e_write_rx_ctl(struct i40e_hw *hw, u32 reg_addr, u32 reg_val) void i40e_write_rx_ctl(struct i40e_hw *hw, u32 reg_addr, u32 reg_val)
{ {
i40e_status status = 0;
bool use_register; bool use_register;
int status = 0;
int retry = 5; int retry = 5;
use_register = (((hw->aq.api_maj_ver == 1) && use_register = (((hw->aq.api_maj_ver == 1) &&
...@@ -5483,7 +5350,7 @@ static void i40e_mdio_if_number_selection(struct i40e_hw *hw, bool set_mdio, ...@@ -5483,7 +5350,7 @@ static void i40e_mdio_if_number_selection(struct i40e_hw *hw, bool set_mdio,
* NOTE: In common cases MDIO I/F number should not be changed, thats why you * NOTE: In common cases MDIO I/F number should not be changed, thats why you
* may use simple wrapper i40e_aq_set_phy_register. * may use simple wrapper i40e_aq_set_phy_register.
**/ **/
enum i40e_status_code i40e_aq_set_phy_register_ext(struct i40e_hw *hw, int i40e_aq_set_phy_register_ext(struct i40e_hw *hw,
u8 phy_select, u8 dev_addr, bool page_change, u8 phy_select, u8 dev_addr, bool page_change,
bool set_mdio, u8 mdio_num, bool set_mdio, u8 mdio_num,
u32 reg_addr, u32 reg_val, u32 reg_addr, u32 reg_val,
...@@ -5492,7 +5359,7 @@ enum i40e_status_code i40e_aq_set_phy_register_ext(struct i40e_hw *hw, ...@@ -5492,7 +5359,7 @@ enum i40e_status_code i40e_aq_set_phy_register_ext(struct i40e_hw *hw,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_phy_register_access *cmd = struct i40e_aqc_phy_register_access *cmd =
(struct i40e_aqc_phy_register_access *)&desc.params.raw; (struct i40e_aqc_phy_register_access *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_set_phy_register); i40e_aqc_opc_set_phy_register);
...@@ -5528,7 +5395,7 @@ enum i40e_status_code i40e_aq_set_phy_register_ext(struct i40e_hw *hw, ...@@ -5528,7 +5395,7 @@ enum i40e_status_code i40e_aq_set_phy_register_ext(struct i40e_hw *hw,
* NOTE: In common cases MDIO I/F number should not be changed, thats why you * NOTE: In common cases MDIO I/F number should not be changed, thats why you
* may use simple wrapper i40e_aq_get_phy_register. * may use simple wrapper i40e_aq_get_phy_register.
**/ **/
enum i40e_status_code i40e_aq_get_phy_register_ext(struct i40e_hw *hw, int i40e_aq_get_phy_register_ext(struct i40e_hw *hw,
u8 phy_select, u8 dev_addr, bool page_change, u8 phy_select, u8 dev_addr, bool page_change,
bool set_mdio, u8 mdio_num, bool set_mdio, u8 mdio_num,
u32 reg_addr, u32 *reg_val, u32 reg_addr, u32 *reg_val,
...@@ -5537,7 +5404,7 @@ enum i40e_status_code i40e_aq_get_phy_register_ext(struct i40e_hw *hw, ...@@ -5537,7 +5404,7 @@ enum i40e_status_code i40e_aq_get_phy_register_ext(struct i40e_hw *hw,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_phy_register_access *cmd = struct i40e_aqc_phy_register_access *cmd =
(struct i40e_aqc_phy_register_access *)&desc.params.raw; (struct i40e_aqc_phy_register_access *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_get_phy_register); i40e_aqc_opc_get_phy_register);
...@@ -5568,8 +5435,7 @@ enum i40e_status_code i40e_aq_get_phy_register_ext(struct i40e_hw *hw, ...@@ -5568,8 +5435,7 @@ enum i40e_status_code i40e_aq_get_phy_register_ext(struct i40e_hw *hw,
* @error_info: returns error information * @error_info: returns error information
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
enum int i40e_aq_write_ddp(struct i40e_hw *hw, void *buff,
i40e_status_code i40e_aq_write_ddp(struct i40e_hw *hw, void *buff,
u16 buff_size, u32 track_id, u16 buff_size, u32 track_id,
u32 *error_offset, u32 *error_info, u32 *error_offset, u32 *error_info,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -5579,7 +5445,7 @@ i40e_status_code i40e_aq_write_ddp(struct i40e_hw *hw, void *buff, ...@@ -5579,7 +5445,7 @@ i40e_status_code i40e_aq_write_ddp(struct i40e_hw *hw, void *buff,
(struct i40e_aqc_write_personalization_profile *) (struct i40e_aqc_write_personalization_profile *)
&desc.params.raw; &desc.params.raw;
struct i40e_aqc_write_ddp_resp *resp; struct i40e_aqc_write_ddp_resp *resp;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_write_personalization_profile); i40e_aqc_opc_write_personalization_profile);
...@@ -5612,15 +5478,14 @@ i40e_status_code i40e_aq_write_ddp(struct i40e_hw *hw, void *buff, ...@@ -5612,15 +5478,14 @@ i40e_status_code i40e_aq_write_ddp(struct i40e_hw *hw, void *buff,
* @flags: AdminQ command flags * @flags: AdminQ command flags
* @cmd_details: pointer to command details structure or NULL * @cmd_details: pointer to command details structure or NULL
**/ **/
enum int i40e_aq_get_ddp_list(struct i40e_hw *hw, void *buff,
i40e_status_code i40e_aq_get_ddp_list(struct i40e_hw *hw, void *buff,
u16 buff_size, u8 flags, u16 buff_size, u8 flags,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_get_applied_profiles *cmd = struct i40e_aqc_get_applied_profiles *cmd =
(struct i40e_aqc_get_applied_profiles *)&desc.params.raw; (struct i40e_aqc_get_applied_profiles *)&desc.params.raw;
i40e_status status; int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_get_personalization_profile_list); i40e_aqc_opc_get_personalization_profile_list);
...@@ -5719,14 +5584,13 @@ i40e_find_section_in_profile(u32 section_type, ...@@ -5719,14 +5584,13 @@ i40e_find_section_in_profile(u32 section_type,
* @hw: pointer to the hw struct * @hw: pointer to the hw struct
* @aq: command buffer containing all data to execute AQ * @aq: command buffer containing all data to execute AQ
**/ **/
static enum static int i40e_ddp_exec_aq_section(struct i40e_hw *hw,
i40e_status_code i40e_ddp_exec_aq_section(struct i40e_hw *hw,
struct i40e_profile_aq_section *aq) struct i40e_profile_aq_section *aq)
{ {
i40e_status status;
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
u8 *msg = NULL; u8 *msg = NULL;
u16 msglen; u16 msglen;
int status;
i40e_fill_default_direct_cmd_desc(&desc, aq->opcode); i40e_fill_default_direct_cmd_desc(&desc, aq->opcode);
desc.flags |= cpu_to_le16(aq->flags); desc.flags |= cpu_to_le16(aq->flags);
...@@ -5766,14 +5630,14 @@ i40e_status_code i40e_ddp_exec_aq_section(struct i40e_hw *hw, ...@@ -5766,14 +5630,14 @@ i40e_status_code i40e_ddp_exec_aq_section(struct i40e_hw *hw,
* *
* Validates supported devices and profile's sections. * Validates supported devices and profile's sections.
*/ */
static enum i40e_status_code static int
i40e_validate_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile, i40e_validate_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,
u32 track_id, bool rollback) u32 track_id, bool rollback)
{ {
struct i40e_profile_section_header *sec = NULL; struct i40e_profile_section_header *sec = NULL;
i40e_status status = 0;
struct i40e_section_table *sec_tbl; struct i40e_section_table *sec_tbl;
u32 vendor_dev_id; u32 vendor_dev_id;
int status = 0;
u32 dev_cnt; u32 dev_cnt;
u32 sec_off; u32 sec_off;
u32 i; u32 i;
...@@ -5831,16 +5695,16 @@ i40e_validate_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile, ...@@ -5831,16 +5695,16 @@ i40e_validate_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,
* *
* Handles the download of a complete package. * Handles the download of a complete package.
*/ */
enum i40e_status_code int
i40e_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile, i40e_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,
u32 track_id) u32 track_id)
{ {
i40e_status status = 0;
struct i40e_section_table *sec_tbl;
struct i40e_profile_section_header *sec = NULL; struct i40e_profile_section_header *sec = NULL;
struct i40e_profile_aq_section *ddp_aq; struct i40e_profile_aq_section *ddp_aq;
u32 section_size = 0; struct i40e_section_table *sec_tbl;
u32 offset = 0, info = 0; u32 offset = 0, info = 0;
u32 section_size = 0;
int status = 0;
u32 sec_off; u32 sec_off;
u32 i; u32 i;
...@@ -5894,15 +5758,15 @@ i40e_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile, ...@@ -5894,15 +5758,15 @@ i40e_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,
* *
* Rolls back previously loaded package. * Rolls back previously loaded package.
*/ */
enum i40e_status_code int
i40e_rollback_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile, i40e_rollback_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,
u32 track_id) u32 track_id)
{ {
struct i40e_profile_section_header *sec = NULL; struct i40e_profile_section_header *sec = NULL;
i40e_status status = 0;
struct i40e_section_table *sec_tbl; struct i40e_section_table *sec_tbl;
u32 offset = 0, info = 0; u32 offset = 0, info = 0;
u32 section_size = 0; u32 section_size = 0;
int status = 0;
u32 sec_off; u32 sec_off;
int i; int i;
...@@ -5946,15 +5810,15 @@ i40e_rollback_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile, ...@@ -5946,15 +5810,15 @@ i40e_rollback_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,
* *
* Register a profile to the list of loaded profiles. * Register a profile to the list of loaded profiles.
*/ */
enum i40e_status_code int
i40e_add_pinfo_to_list(struct i40e_hw *hw, i40e_add_pinfo_to_list(struct i40e_hw *hw,
struct i40e_profile_segment *profile, struct i40e_profile_segment *profile,
u8 *profile_info_sec, u32 track_id) u8 *profile_info_sec, u32 track_id)
{ {
i40e_status status = 0;
struct i40e_profile_section_header *sec = NULL; struct i40e_profile_section_header *sec = NULL;
struct i40e_profile_info *pinfo; struct i40e_profile_info *pinfo;
u32 offset = 0, info = 0; u32 offset = 0, info = 0;
int status = 0;
sec = (struct i40e_profile_section_header *)profile_info_sec; sec = (struct i40e_profile_section_header *)profile_info_sec;
sec->tbl_size = 1; sec->tbl_size = 1;
...@@ -5988,7 +5852,7 @@ i40e_add_pinfo_to_list(struct i40e_hw *hw, ...@@ -5988,7 +5852,7 @@ i40e_add_pinfo_to_list(struct i40e_hw *hw,
* of the function. * of the function.
* *
**/ **/
enum i40e_status_code int
i40e_aq_add_cloud_filters(struct i40e_hw *hw, u16 seid, i40e_aq_add_cloud_filters(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_cloud_filters_element_data *filters, struct i40e_aqc_cloud_filters_element_data *filters,
u8 filter_count) u8 filter_count)
...@@ -5996,8 +5860,8 @@ i40e_aq_add_cloud_filters(struct i40e_hw *hw, u16 seid, ...@@ -5996,8 +5860,8 @@ i40e_aq_add_cloud_filters(struct i40e_hw *hw, u16 seid,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_add_remove_cloud_filters *cmd = struct i40e_aqc_add_remove_cloud_filters *cmd =
(struct i40e_aqc_add_remove_cloud_filters *)&desc.params.raw; (struct i40e_aqc_add_remove_cloud_filters *)&desc.params.raw;
enum i40e_status_code status;
u16 buff_len; u16 buff_len;
int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_add_cloud_filters); i40e_aqc_opc_add_cloud_filters);
...@@ -6025,7 +5889,7 @@ i40e_aq_add_cloud_filters(struct i40e_hw *hw, u16 seid, ...@@ -6025,7 +5889,7 @@ i40e_aq_add_cloud_filters(struct i40e_hw *hw, u16 seid,
* function. * function.
* *
**/ **/
enum i40e_status_code int
i40e_aq_add_cloud_filters_bb(struct i40e_hw *hw, u16 seid, i40e_aq_add_cloud_filters_bb(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_cloud_filters_element_bb *filters, struct i40e_aqc_cloud_filters_element_bb *filters,
u8 filter_count) u8 filter_count)
...@@ -6033,8 +5897,8 @@ i40e_aq_add_cloud_filters_bb(struct i40e_hw *hw, u16 seid, ...@@ -6033,8 +5897,8 @@ i40e_aq_add_cloud_filters_bb(struct i40e_hw *hw, u16 seid,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_add_remove_cloud_filters *cmd = struct i40e_aqc_add_remove_cloud_filters *cmd =
(struct i40e_aqc_add_remove_cloud_filters *)&desc.params.raw; (struct i40e_aqc_add_remove_cloud_filters *)&desc.params.raw;
i40e_status status;
u16 buff_len; u16 buff_len;
int status;
int i; int i;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
...@@ -6082,7 +5946,7 @@ i40e_aq_add_cloud_filters_bb(struct i40e_hw *hw, u16 seid, ...@@ -6082,7 +5946,7 @@ i40e_aq_add_cloud_filters_bb(struct i40e_hw *hw, u16 seid,
* of the function. * of the function.
* *
**/ **/
enum i40e_status_code int
i40e_aq_rem_cloud_filters(struct i40e_hw *hw, u16 seid, i40e_aq_rem_cloud_filters(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_cloud_filters_element_data *filters, struct i40e_aqc_cloud_filters_element_data *filters,
u8 filter_count) u8 filter_count)
...@@ -6090,8 +5954,8 @@ i40e_aq_rem_cloud_filters(struct i40e_hw *hw, u16 seid, ...@@ -6090,8 +5954,8 @@ i40e_aq_rem_cloud_filters(struct i40e_hw *hw, u16 seid,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_add_remove_cloud_filters *cmd = struct i40e_aqc_add_remove_cloud_filters *cmd =
(struct i40e_aqc_add_remove_cloud_filters *)&desc.params.raw; (struct i40e_aqc_add_remove_cloud_filters *)&desc.params.raw;
enum i40e_status_code status;
u16 buff_len; u16 buff_len;
int status;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
i40e_aqc_opc_remove_cloud_filters); i40e_aqc_opc_remove_cloud_filters);
...@@ -6119,7 +5983,7 @@ i40e_aq_rem_cloud_filters(struct i40e_hw *hw, u16 seid, ...@@ -6119,7 +5983,7 @@ i40e_aq_rem_cloud_filters(struct i40e_hw *hw, u16 seid,
* function. * function.
* *
**/ **/
enum i40e_status_code int
i40e_aq_rem_cloud_filters_bb(struct i40e_hw *hw, u16 seid, i40e_aq_rem_cloud_filters_bb(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_cloud_filters_element_bb *filters, struct i40e_aqc_cloud_filters_element_bb *filters,
u8 filter_count) u8 filter_count)
...@@ -6127,8 +5991,8 @@ i40e_aq_rem_cloud_filters_bb(struct i40e_hw *hw, u16 seid, ...@@ -6127,8 +5991,8 @@ i40e_aq_rem_cloud_filters_bb(struct i40e_hw *hw, u16 seid,
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_add_remove_cloud_filters *cmd = struct i40e_aqc_add_remove_cloud_filters *cmd =
(struct i40e_aqc_add_remove_cloud_filters *)&desc.params.raw; (struct i40e_aqc_add_remove_cloud_filters *)&desc.params.raw;
i40e_status status;
u16 buff_len; u16 buff_len;
int status;
int i; int i;
i40e_fill_default_direct_cmd_desc(&desc, i40e_fill_default_direct_cmd_desc(&desc,
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* *
* Get the DCBX status from the Firmware * Get the DCBX status from the Firmware
**/ **/
i40e_status i40e_get_dcbx_status(struct i40e_hw *hw, u16 *status) int i40e_get_dcbx_status(struct i40e_hw *hw, u16 *status)
{ {
u32 reg; u32 reg;
...@@ -497,15 +497,15 @@ static void i40e_parse_org_tlv(struct i40e_lldp_org_tlv *tlv, ...@@ -497,15 +497,15 @@ static void i40e_parse_org_tlv(struct i40e_lldp_org_tlv *tlv,
* *
* Parse DCB configuration from the LLDPDU * Parse DCB configuration from the LLDPDU
**/ **/
i40e_status i40e_lldp_to_dcb_config(u8 *lldpmib, int i40e_lldp_to_dcb_config(u8 *lldpmib,
struct i40e_dcbx_config *dcbcfg) struct i40e_dcbx_config *dcbcfg)
{ {
i40e_status ret = 0;
struct i40e_lldp_org_tlv *tlv; struct i40e_lldp_org_tlv *tlv;
u16 type;
u16 length;
u16 typelength; u16 typelength;
u16 offset = 0; u16 offset = 0;
int ret = 0;
u16 length;
u16 type;
if (!lldpmib || !dcbcfg) if (!lldpmib || !dcbcfg)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -551,12 +551,12 @@ i40e_status i40e_lldp_to_dcb_config(u8 *lldpmib, ...@@ -551,12 +551,12 @@ i40e_status i40e_lldp_to_dcb_config(u8 *lldpmib,
* *
* Query DCB configuration from the Firmware * Query DCB configuration from the Firmware
**/ **/
i40e_status i40e_aq_get_dcb_config(struct i40e_hw *hw, u8 mib_type, int i40e_aq_get_dcb_config(struct i40e_hw *hw, u8 mib_type,
u8 bridgetype, u8 bridgetype,
struct i40e_dcbx_config *dcbcfg) struct i40e_dcbx_config *dcbcfg)
{ {
i40e_status ret = 0;
struct i40e_virt_mem mem; struct i40e_virt_mem mem;
int ret = 0;
u8 *lldpmib; u8 *lldpmib;
/* Allocate the LLDPDU */ /* Allocate the LLDPDU */
...@@ -767,9 +767,9 @@ static void i40e_cee_to_dcb_config( ...@@ -767,9 +767,9 @@ static void i40e_cee_to_dcb_config(
* *
* Get IEEE mode DCB configuration from the Firmware * Get IEEE mode DCB configuration from the Firmware
**/ **/
static i40e_status i40e_get_ieee_dcb_config(struct i40e_hw *hw) static int i40e_get_ieee_dcb_config(struct i40e_hw *hw)
{ {
i40e_status ret = 0; int ret = 0;
/* IEEE mode */ /* IEEE mode */
hw->local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_IEEE; hw->local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_IEEE;
...@@ -797,11 +797,11 @@ static i40e_status i40e_get_ieee_dcb_config(struct i40e_hw *hw) ...@@ -797,11 +797,11 @@ static i40e_status i40e_get_ieee_dcb_config(struct i40e_hw *hw)
* *
* Get DCB configuration from the Firmware * Get DCB configuration from the Firmware
**/ **/
i40e_status i40e_get_dcb_config(struct i40e_hw *hw) int i40e_get_dcb_config(struct i40e_hw *hw)
{ {
i40e_status ret = 0;
struct i40e_aqc_get_cee_dcb_cfg_resp cee_cfg;
struct i40e_aqc_get_cee_dcb_cfg_v1_resp cee_v1_cfg; struct i40e_aqc_get_cee_dcb_cfg_v1_resp cee_v1_cfg;
struct i40e_aqc_get_cee_dcb_cfg_resp cee_cfg;
int ret = 0;
/* If Firmware version < v4.33 on X710/XL710, IEEE only */ /* If Firmware version < v4.33 on X710/XL710, IEEE only */
if ((hw->mac.type == I40E_MAC_XL710) && if ((hw->mac.type == I40E_MAC_XL710) &&
...@@ -867,11 +867,11 @@ i40e_status i40e_get_dcb_config(struct i40e_hw *hw) ...@@ -867,11 +867,11 @@ i40e_status i40e_get_dcb_config(struct i40e_hw *hw)
* *
* Update DCB configuration from the Firmware * Update DCB configuration from the Firmware
**/ **/
i40e_status i40e_init_dcb(struct i40e_hw *hw, bool enable_mib_change) int i40e_init_dcb(struct i40e_hw *hw, bool enable_mib_change)
{ {
i40e_status ret = 0;
struct i40e_lldp_variables lldp_cfg; struct i40e_lldp_variables lldp_cfg;
u8 adminstatus = 0; u8 adminstatus = 0;
int ret = 0;
if (!hw->func_caps.dcb) if (!hw->func_caps.dcb)
return I40E_NOT_SUPPORTED; return I40E_NOT_SUPPORTED;
...@@ -940,13 +940,13 @@ i40e_status i40e_init_dcb(struct i40e_hw *hw, bool enable_mib_change) ...@@ -940,13 +940,13 @@ i40e_status i40e_init_dcb(struct i40e_hw *hw, bool enable_mib_change)
* Get status of FW Link Layer Discovery Protocol (LLDP) Agent. * Get status of FW Link Layer Discovery Protocol (LLDP) Agent.
* Status of agent is reported via @lldp_status parameter. * Status of agent is reported via @lldp_status parameter.
**/ **/
enum i40e_status_code int
i40e_get_fw_lldp_status(struct i40e_hw *hw, i40e_get_fw_lldp_status(struct i40e_hw *hw,
enum i40e_get_fw_lldp_status_resp *lldp_status) enum i40e_get_fw_lldp_status_resp *lldp_status)
{ {
struct i40e_virt_mem mem; struct i40e_virt_mem mem;
i40e_status ret;
u8 *lldpmib; u8 *lldpmib;
int ret;
if (!lldp_status) if (!lldp_status)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -1238,13 +1238,13 @@ static void i40e_add_dcb_tlv(struct i40e_lldp_org_tlv *tlv, ...@@ -1238,13 +1238,13 @@ static void i40e_add_dcb_tlv(struct i40e_lldp_org_tlv *tlv,
* *
* Set DCB configuration to the Firmware * Set DCB configuration to the Firmware
**/ **/
i40e_status i40e_set_dcb_config(struct i40e_hw *hw) int i40e_set_dcb_config(struct i40e_hw *hw)
{ {
struct i40e_dcbx_config *dcbcfg; struct i40e_dcbx_config *dcbcfg;
struct i40e_virt_mem mem; struct i40e_virt_mem mem;
u8 mib_type, *lldpmib; u8 mib_type, *lldpmib;
i40e_status ret;
u16 miblen; u16 miblen;
int ret;
/* update the hw local config */ /* update the hw local config */
dcbcfg = &hw->local_dcbx_config; dcbcfg = &hw->local_dcbx_config;
...@@ -1274,7 +1274,7 @@ i40e_status i40e_set_dcb_config(struct i40e_hw *hw) ...@@ -1274,7 +1274,7 @@ i40e_status i40e_set_dcb_config(struct i40e_hw *hw)
* *
* send DCB configuration to FW * send DCB configuration to FW
**/ **/
i40e_status i40e_dcb_config_to_lldp(u8 *lldpmib, u16 *miblen, int i40e_dcb_config_to_lldp(u8 *lldpmib, u16 *miblen,
struct i40e_dcbx_config *dcbcfg) struct i40e_dcbx_config *dcbcfg)
{ {
u16 length, offset = 0, tlvid, typelength; u16 length, offset = 0, tlvid, typelength;
...@@ -1888,13 +1888,13 @@ void i40e_dcb_hw_rx_pb_config(struct i40e_hw *hw, ...@@ -1888,13 +1888,13 @@ void i40e_dcb_hw_rx_pb_config(struct i40e_hw *hw,
* *
* Reads the LLDP configuration data from NVM using passed addresses * Reads the LLDP configuration data from NVM using passed addresses
**/ **/
static i40e_status _i40e_read_lldp_cfg(struct i40e_hw *hw, static int _i40e_read_lldp_cfg(struct i40e_hw *hw,
struct i40e_lldp_variables *lldp_cfg, struct i40e_lldp_variables *lldp_cfg,
u8 module, u32 word_offset) u8 module, u32 word_offset)
{ {
u32 address, offset = (2 * word_offset); u32 address, offset = (2 * word_offset);
i40e_status ret;
__le16 raw_mem; __le16 raw_mem;
int ret;
u16 mem; u16 mem;
ret = i40e_acquire_nvm(hw, I40E_RESOURCE_READ); ret = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
...@@ -1950,10 +1950,10 @@ static i40e_status _i40e_read_lldp_cfg(struct i40e_hw *hw, ...@@ -1950,10 +1950,10 @@ static i40e_status _i40e_read_lldp_cfg(struct i40e_hw *hw,
* *
* Reads the LLDP configuration data from NVM * Reads the LLDP configuration data from NVM
**/ **/
i40e_status i40e_read_lldp_cfg(struct i40e_hw *hw, int i40e_read_lldp_cfg(struct i40e_hw *hw,
struct i40e_lldp_variables *lldp_cfg) struct i40e_lldp_variables *lldp_cfg)
{ {
i40e_status ret = 0; int ret = 0;
u32 mem; u32 mem;
if (!lldp_cfg) if (!lldp_cfg)
......
...@@ -264,20 +264,20 @@ void i40e_dcb_hw_calculate_pool_sizes(struct i40e_hw *hw, ...@@ -264,20 +264,20 @@ void i40e_dcb_hw_calculate_pool_sizes(struct i40e_hw *hw,
void i40e_dcb_hw_rx_pb_config(struct i40e_hw *hw, void i40e_dcb_hw_rx_pb_config(struct i40e_hw *hw,
struct i40e_rx_pb_config *old_pb_cfg, struct i40e_rx_pb_config *old_pb_cfg,
struct i40e_rx_pb_config *new_pb_cfg); struct i40e_rx_pb_config *new_pb_cfg);
i40e_status i40e_get_dcbx_status(struct i40e_hw *hw, int i40e_get_dcbx_status(struct i40e_hw *hw,
u16 *status); u16 *status);
i40e_status i40e_lldp_to_dcb_config(u8 *lldpmib, int i40e_lldp_to_dcb_config(u8 *lldpmib,
struct i40e_dcbx_config *dcbcfg); struct i40e_dcbx_config *dcbcfg);
i40e_status i40e_aq_get_dcb_config(struct i40e_hw *hw, u8 mib_type, int i40e_aq_get_dcb_config(struct i40e_hw *hw, u8 mib_type,
u8 bridgetype, u8 bridgetype,
struct i40e_dcbx_config *dcbcfg); struct i40e_dcbx_config *dcbcfg);
i40e_status i40e_get_dcb_config(struct i40e_hw *hw); int i40e_get_dcb_config(struct i40e_hw *hw);
i40e_status i40e_init_dcb(struct i40e_hw *hw, int i40e_init_dcb(struct i40e_hw *hw,
bool enable_mib_change); bool enable_mib_change);
enum i40e_status_code int
i40e_get_fw_lldp_status(struct i40e_hw *hw, i40e_get_fw_lldp_status(struct i40e_hw *hw,
enum i40e_get_fw_lldp_status_resp *lldp_status); enum i40e_get_fw_lldp_status_resp *lldp_status);
i40e_status i40e_set_dcb_config(struct i40e_hw *hw); int i40e_set_dcb_config(struct i40e_hw *hw);
i40e_status i40e_dcb_config_to_lldp(u8 *lldpmib, u16 *miblen, int i40e_dcb_config_to_lldp(u8 *lldpmib, u16 *miblen,
struct i40e_dcbx_config *dcbcfg); struct i40e_dcbx_config *dcbcfg);
#endif /* _I40E_DCB_H_ */ #endif /* _I40E_DCB_H_ */
...@@ -135,8 +135,8 @@ static int i40e_dcbnl_ieee_setets(struct net_device *netdev, ...@@ -135,8 +135,8 @@ static int i40e_dcbnl_ieee_setets(struct net_device *netdev,
ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Failed setting DCB ETS configuration err %s aq_err %s\n", "Failed setting DCB ETS configuration err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return -EINVAL; return -EINVAL;
} }
...@@ -174,8 +174,8 @@ static int i40e_dcbnl_ieee_setpfc(struct net_device *netdev, ...@@ -174,8 +174,8 @@ static int i40e_dcbnl_ieee_setpfc(struct net_device *netdev,
ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Failed setting DCB PFC configuration err %s aq_err %s\n", "Failed setting DCB PFC configuration err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return -EINVAL; return -EINVAL;
} }
...@@ -225,8 +225,8 @@ static int i40e_dcbnl_ieee_setapp(struct net_device *netdev, ...@@ -225,8 +225,8 @@ static int i40e_dcbnl_ieee_setapp(struct net_device *netdev,
ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Failed setting DCB configuration err %s aq_err %s\n", "Failed setting DCB configuration err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return -EINVAL; return -EINVAL;
} }
...@@ -290,8 +290,8 @@ static int i40e_dcbnl_ieee_delapp(struct net_device *netdev, ...@@ -290,8 +290,8 @@ static int i40e_dcbnl_ieee_delapp(struct net_device *netdev,
ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Failed setting DCB configuration err %s aq_err %s\n", "Failed setting DCB configuration err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return -EINVAL; return -EINVAL;
} }
......
...@@ -36,7 +36,7 @@ static int i40e_ddp_does_profile_exist(struct i40e_hw *hw, ...@@ -36,7 +36,7 @@ static int i40e_ddp_does_profile_exist(struct i40e_hw *hw,
{ {
struct i40e_ddp_profile_list *profile_list; struct i40e_ddp_profile_list *profile_list;
u8 buff[I40E_PROFILE_LIST_SIZE]; u8 buff[I40E_PROFILE_LIST_SIZE];
i40e_status status; int status;
int i; int i;
status = i40e_aq_get_ddp_list(hw, buff, I40E_PROFILE_LIST_SIZE, 0, status = i40e_aq_get_ddp_list(hw, buff, I40E_PROFILE_LIST_SIZE, 0,
...@@ -91,7 +91,7 @@ static int i40e_ddp_does_profile_overlap(struct i40e_hw *hw, ...@@ -91,7 +91,7 @@ static int i40e_ddp_does_profile_overlap(struct i40e_hw *hw,
{ {
struct i40e_ddp_profile_list *profile_list; struct i40e_ddp_profile_list *profile_list;
u8 buff[I40E_PROFILE_LIST_SIZE]; u8 buff[I40E_PROFILE_LIST_SIZE];
i40e_status status; int status;
int i; int i;
status = i40e_aq_get_ddp_list(hw, buff, I40E_PROFILE_LIST_SIZE, 0, status = i40e_aq_get_ddp_list(hw, buff, I40E_PROFILE_LIST_SIZE, 0,
...@@ -117,14 +117,14 @@ static int i40e_ddp_does_profile_overlap(struct i40e_hw *hw, ...@@ -117,14 +117,14 @@ static int i40e_ddp_does_profile_overlap(struct i40e_hw *hw,
* *
* Register a profile to the list of loaded profiles. * Register a profile to the list of loaded profiles.
*/ */
static enum i40e_status_code static int
i40e_add_pinfo(struct i40e_hw *hw, struct i40e_profile_segment *profile, i40e_add_pinfo(struct i40e_hw *hw, struct i40e_profile_segment *profile,
u8 *profile_info_sec, u32 track_id) u8 *profile_info_sec, u32 track_id)
{ {
struct i40e_profile_section_header *sec; struct i40e_profile_section_header *sec;
struct i40e_profile_info *pinfo; struct i40e_profile_info *pinfo;
i40e_status status;
u32 offset = 0, info = 0; u32 offset = 0, info = 0;
int status;
sec = (struct i40e_profile_section_header *)profile_info_sec; sec = (struct i40e_profile_section_header *)profile_info_sec;
sec->tbl_size = 1; sec->tbl_size = 1;
...@@ -157,14 +157,14 @@ i40e_add_pinfo(struct i40e_hw *hw, struct i40e_profile_segment *profile, ...@@ -157,14 +157,14 @@ i40e_add_pinfo(struct i40e_hw *hw, struct i40e_profile_segment *profile,
* *
* Removes DDP profile from the NIC. * Removes DDP profile from the NIC.
**/ **/
static enum i40e_status_code static int
i40e_del_pinfo(struct i40e_hw *hw, struct i40e_profile_segment *profile, i40e_del_pinfo(struct i40e_hw *hw, struct i40e_profile_segment *profile,
u8 *profile_info_sec, u32 track_id) u8 *profile_info_sec, u32 track_id)
{ {
struct i40e_profile_section_header *sec; struct i40e_profile_section_header *sec;
struct i40e_profile_info *pinfo; struct i40e_profile_info *pinfo;
i40e_status status;
u32 offset = 0, info = 0; u32 offset = 0, info = 0;
int status;
sec = (struct i40e_profile_section_header *)profile_info_sec; sec = (struct i40e_profile_section_header *)profile_info_sec;
sec->tbl_size = 1; sec->tbl_size = 1;
...@@ -270,12 +270,12 @@ int i40e_ddp_load(struct net_device *netdev, const u8 *data, size_t size, ...@@ -270,12 +270,12 @@ int i40e_ddp_load(struct net_device *netdev, const u8 *data, size_t size,
struct i40e_profile_segment *profile_hdr; struct i40e_profile_segment *profile_hdr;
struct i40e_profile_info pinfo; struct i40e_profile_info pinfo;
struct i40e_package_header *pkg_hdr; struct i40e_package_header *pkg_hdr;
i40e_status status;
struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_vsi *vsi = np->vsi; struct i40e_vsi *vsi = np->vsi;
struct i40e_pf *pf = vsi->back; struct i40e_pf *pf = vsi->back;
u32 track_id; u32 track_id;
int istatus; int istatus;
int status;
pkg_hdr = (struct i40e_package_header *)data; pkg_hdr = (struct i40e_package_header *)data;
if (!i40e_ddp_is_pkg_hdr_valid(netdev, pkg_hdr, size)) if (!i40e_ddp_is_pkg_hdr_valid(netdev, pkg_hdr, size))
......
...@@ -918,9 +918,9 @@ static ssize_t i40e_dbg_command_write(struct file *filp, ...@@ -918,9 +918,9 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
dev_info(&pf->pdev->dev, "deleting relay %d\n", veb_seid); dev_info(&pf->pdev->dev, "deleting relay %d\n", veb_seid);
i40e_veb_release(pf->veb[i]); i40e_veb_release(pf->veb[i]);
} else if (strncmp(cmd_buf, "add pvid", 8) == 0) { } else if (strncmp(cmd_buf, "add pvid", 8) == 0) {
i40e_status ret;
u16 vid;
unsigned int v; unsigned int v;
int ret;
u16 vid;
cnt = sscanf(&cmd_buf[8], "%i %u", &vsi_seid, &v); cnt = sscanf(&cmd_buf[8], "%i %u", &vsi_seid, &v);
if (cnt != 2) { if (cnt != 2) {
...@@ -1284,7 +1284,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp, ...@@ -1284,7 +1284,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
} }
} else if (strncmp(cmd_buf, "send aq_cmd", 11) == 0) { } else if (strncmp(cmd_buf, "send aq_cmd", 11) == 0) {
struct i40e_aq_desc *desc; struct i40e_aq_desc *desc;
i40e_status ret; int ret;
desc = kzalloc(sizeof(struct i40e_aq_desc), GFP_KERNEL); desc = kzalloc(sizeof(struct i40e_aq_desc), GFP_KERNEL);
if (!desc) if (!desc)
...@@ -1330,9 +1330,9 @@ static ssize_t i40e_dbg_command_write(struct file *filp, ...@@ -1330,9 +1330,9 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
desc = NULL; desc = NULL;
} else if (strncmp(cmd_buf, "send indirect aq_cmd", 20) == 0) { } else if (strncmp(cmd_buf, "send indirect aq_cmd", 20) == 0) {
struct i40e_aq_desc *desc; struct i40e_aq_desc *desc;
i40e_status ret;
u16 buffer_len; u16 buffer_len;
u8 *buff; u8 *buff;
int ret;
desc = kzalloc(sizeof(struct i40e_aq_desc), GFP_KERNEL); desc = kzalloc(sizeof(struct i40e_aq_desc), GFP_KERNEL);
if (!desc) if (!desc)
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* @reg: reg to be tested * @reg: reg to be tested
* @mask: bits to be touched * @mask: bits to be touched
**/ **/
static i40e_status i40e_diag_reg_pattern_test(struct i40e_hw *hw, static int i40e_diag_reg_pattern_test(struct i40e_hw *hw,
u32 reg, u32 mask) u32 reg, u32 mask)
{ {
static const u32 patterns[] = { static const u32 patterns[] = {
...@@ -74,9 +74,9 @@ struct i40e_diag_reg_test_info i40e_reg_list[] = { ...@@ -74,9 +74,9 @@ struct i40e_diag_reg_test_info i40e_reg_list[] = {
* *
* Perform registers diagnostic test * Perform registers diagnostic test
**/ **/
i40e_status i40e_diag_reg_test(struct i40e_hw *hw) int i40e_diag_reg_test(struct i40e_hw *hw)
{ {
i40e_status ret_code = 0; int ret_code = 0;
u32 reg, mask; u32 reg, mask;
u32 i, j; u32 i, j;
...@@ -114,9 +114,9 @@ i40e_status i40e_diag_reg_test(struct i40e_hw *hw) ...@@ -114,9 +114,9 @@ i40e_status i40e_diag_reg_test(struct i40e_hw *hw)
* *
* Perform EEPROM diagnostic test * Perform EEPROM diagnostic test
**/ **/
i40e_status i40e_diag_eeprom_test(struct i40e_hw *hw) int i40e_diag_eeprom_test(struct i40e_hw *hw)
{ {
i40e_status ret_code; int ret_code;
u16 reg_val; u16 reg_val;
/* read NVM control word and if NVM valid, validate EEPROM checksum*/ /* read NVM control word and if NVM valid, validate EEPROM checksum*/
......
...@@ -22,7 +22,7 @@ struct i40e_diag_reg_test_info { ...@@ -22,7 +22,7 @@ struct i40e_diag_reg_test_info {
extern struct i40e_diag_reg_test_info i40e_reg_list[]; extern struct i40e_diag_reg_test_info i40e_reg_list[];
i40e_status i40e_diag_reg_test(struct i40e_hw *hw); int i40e_diag_reg_test(struct i40e_hw *hw);
i40e_status i40e_diag_eeprom_test(struct i40e_hw *hw); int i40e_diag_eeprom_test(struct i40e_hw *hw);
#endif /* _I40E_DIAG_H_ */ #endif /* _I40E_DIAG_H_ */
...@@ -1226,8 +1226,8 @@ static int i40e_set_link_ksettings(struct net_device *netdev, ...@@ -1226,8 +1226,8 @@ static int i40e_set_link_ksettings(struct net_device *netdev,
struct i40e_vsi *vsi = np->vsi; struct i40e_vsi *vsi = np->vsi;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
bool autoneg_changed = false; bool autoneg_changed = false;
i40e_status status = 0;
int timeout = 50; int timeout = 50;
int status = 0;
int err = 0; int err = 0;
__u32 speed; __u32 speed;
u8 autoneg; u8 autoneg;
...@@ -1455,8 +1455,8 @@ static int i40e_set_link_ksettings(struct net_device *netdev, ...@@ -1455,8 +1455,8 @@ static int i40e_set_link_ksettings(struct net_device *netdev,
status = i40e_aq_set_phy_config(hw, &config, NULL); status = i40e_aq_set_phy_config(hw, &config, NULL);
if (status) { if (status) {
netdev_info(netdev, netdev_info(netdev,
"Set phy config failed, err %s aq_err %s\n", "Set phy config failed, err %pe aq_err %s\n",
i40e_stat_str(hw, status), ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
err = -EAGAIN; err = -EAGAIN;
goto done; goto done;
...@@ -1465,8 +1465,8 @@ static int i40e_set_link_ksettings(struct net_device *netdev, ...@@ -1465,8 +1465,8 @@ static int i40e_set_link_ksettings(struct net_device *netdev,
status = i40e_update_link_info(hw); status = i40e_update_link_info(hw);
if (status) if (status)
netdev_dbg(netdev, netdev_dbg(netdev,
"Updating link info failed with err %s aq_err %s\n", "Updating link info failed with err %pe aq_err %s\n",
i40e_stat_str(hw, status), ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
} else { } else {
...@@ -1485,7 +1485,7 @@ static int i40e_set_fec_cfg(struct net_device *netdev, u8 fec_cfg) ...@@ -1485,7 +1485,7 @@ static int i40e_set_fec_cfg(struct net_device *netdev, u8 fec_cfg)
struct i40e_aq_get_phy_abilities_resp abilities; struct i40e_aq_get_phy_abilities_resp abilities;
struct i40e_pf *pf = np->vsi->back; struct i40e_pf *pf = np->vsi->back;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status status = 0; int status = 0;
u32 flags = 0; u32 flags = 0;
int err = 0; int err = 0;
...@@ -1517,8 +1517,8 @@ static int i40e_set_fec_cfg(struct net_device *netdev, u8 fec_cfg) ...@@ -1517,8 +1517,8 @@ static int i40e_set_fec_cfg(struct net_device *netdev, u8 fec_cfg)
status = i40e_aq_set_phy_config(hw, &config, NULL); status = i40e_aq_set_phy_config(hw, &config, NULL);
if (status) { if (status) {
netdev_info(netdev, netdev_info(netdev,
"Set phy config failed, err %s aq_err %s\n", "Set phy config failed, err %pe aq_err %s\n",
i40e_stat_str(hw, status), ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
err = -EAGAIN; err = -EAGAIN;
goto done; goto done;
...@@ -1531,8 +1531,8 @@ static int i40e_set_fec_cfg(struct net_device *netdev, u8 fec_cfg) ...@@ -1531,8 +1531,8 @@ static int i40e_set_fec_cfg(struct net_device *netdev, u8 fec_cfg)
* (e.g. no physical connection etc.) * (e.g. no physical connection etc.)
*/ */
netdev_dbg(netdev, netdev_dbg(netdev,
"Updating link info failed with err %s aq_err %s\n", "Updating link info failed with err %pe aq_err %s\n",
i40e_stat_str(hw, status), ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
} }
...@@ -1547,7 +1547,7 @@ static int i40e_get_fec_param(struct net_device *netdev, ...@@ -1547,7 +1547,7 @@ static int i40e_get_fec_param(struct net_device *netdev,
struct i40e_aq_get_phy_abilities_resp abilities; struct i40e_aq_get_phy_abilities_resp abilities;
struct i40e_pf *pf = np->vsi->back; struct i40e_pf *pf = np->vsi->back;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status status = 0; int status = 0;
int err = 0; int err = 0;
u8 fec_cfg; u8 fec_cfg;
...@@ -1634,12 +1634,12 @@ static int i40e_nway_reset(struct net_device *netdev) ...@@ -1634,12 +1634,12 @@ static int i40e_nway_reset(struct net_device *netdev)
struct i40e_pf *pf = np->vsi->back; struct i40e_pf *pf = np->vsi->back;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
bool link_up = hw->phy.link_info.link_info & I40E_AQ_LINK_UP; bool link_up = hw->phy.link_info.link_info & I40E_AQ_LINK_UP;
i40e_status ret = 0; int ret = 0;
ret = i40e_aq_set_link_restart_an(hw, link_up, NULL); ret = i40e_aq_set_link_restart_an(hw, link_up, NULL);
if (ret) { if (ret) {
netdev_info(netdev, "link restart failed, err %s aq_err %s\n", netdev_info(netdev, "link restart failed, err %pe aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
return -EIO; return -EIO;
} }
...@@ -1699,9 +1699,9 @@ static int i40e_set_pauseparam(struct net_device *netdev, ...@@ -1699,9 +1699,9 @@ static int i40e_set_pauseparam(struct net_device *netdev,
struct i40e_link_status *hw_link_info = &hw->phy.link_info; struct i40e_link_status *hw_link_info = &hw->phy.link_info;
struct i40e_dcbx_config *dcbx_cfg = &hw->local_dcbx_config; struct i40e_dcbx_config *dcbx_cfg = &hw->local_dcbx_config;
bool link_up = hw_link_info->link_info & I40E_AQ_LINK_UP; bool link_up = hw_link_info->link_info & I40E_AQ_LINK_UP;
i40e_status status;
u8 aq_failures; u8 aq_failures;
int err = 0; int err = 0;
int status;
u32 is_an; u32 is_an;
/* Changing the port's flow control is not supported if this isn't the /* Changing the port's flow control is not supported if this isn't the
...@@ -1755,20 +1755,20 @@ static int i40e_set_pauseparam(struct net_device *netdev, ...@@ -1755,20 +1755,20 @@ static int i40e_set_pauseparam(struct net_device *netdev,
status = i40e_set_fc(hw, &aq_failures, link_up); status = i40e_set_fc(hw, &aq_failures, link_up);
if (aq_failures & I40E_SET_FC_AQ_FAIL_GET) { if (aq_failures & I40E_SET_FC_AQ_FAIL_GET) {
netdev_info(netdev, "Set fc failed on the get_phy_capabilities call with err %s aq_err %s\n", netdev_info(netdev, "Set fc failed on the get_phy_capabilities call with err %pe aq_err %s\n",
i40e_stat_str(hw, status), ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
err = -EAGAIN; err = -EAGAIN;
} }
if (aq_failures & I40E_SET_FC_AQ_FAIL_SET) { if (aq_failures & I40E_SET_FC_AQ_FAIL_SET) {
netdev_info(netdev, "Set fc failed on the set_phy_config call with err %s aq_err %s\n", netdev_info(netdev, "Set fc failed on the set_phy_config call with err %pe aq_err %s\n",
i40e_stat_str(hw, status), ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
err = -EAGAIN; err = -EAGAIN;
} }
if (aq_failures & I40E_SET_FC_AQ_FAIL_UPDATE) { if (aq_failures & I40E_SET_FC_AQ_FAIL_UPDATE) {
netdev_info(netdev, "Set fc failed on the get_link_info call with err %s aq_err %s\n", netdev_info(netdev, "Set fc failed on the get_link_info call with err %pe aq_err %s\n",
i40e_stat_str(hw, status), ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
err = -EAGAIN; err = -EAGAIN;
} }
...@@ -2583,8 +2583,8 @@ static u64 i40e_link_test(struct net_device *netdev, u64 *data) ...@@ -2583,8 +2583,8 @@ static u64 i40e_link_test(struct net_device *netdev, u64 *data)
{ {
struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_pf *pf = np->vsi->back; struct i40e_pf *pf = np->vsi->back;
i40e_status status;
bool link_up = false; bool link_up = false;
int status;
netif_info(pf, hw, netdev, "link test\n"); netif_info(pf, hw, netdev, "link test\n");
status = i40e_get_link_status(&pf->hw, &link_up); status = i40e_get_link_status(&pf->hw, &link_up);
...@@ -2807,11 +2807,11 @@ static int i40e_set_phys_id(struct net_device *netdev, ...@@ -2807,11 +2807,11 @@ static int i40e_set_phys_id(struct net_device *netdev,
enum ethtool_phys_id_state state) enum ethtool_phys_id_state state)
{ {
struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_netdev_priv *np = netdev_priv(netdev);
i40e_status ret = 0;
struct i40e_pf *pf = np->vsi->back; struct i40e_pf *pf = np->vsi->back;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
int blink_freq = 2; int blink_freq = 2;
u16 temp_status; u16 temp_status;
int ret = 0;
switch (state) { switch (state) {
case ETHTOOL_ID_ACTIVE: case ETHTOOL_ID_ACTIVE:
...@@ -5247,7 +5247,7 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags) ...@@ -5247,7 +5247,7 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
struct i40e_vsi *vsi = np->vsi; struct i40e_vsi *vsi = np->vsi;
struct i40e_pf *pf = vsi->back; struct i40e_pf *pf = vsi->back;
u32 reset_needed = 0; u32 reset_needed = 0;
i40e_status status; int status;
u32 i, j; u32 i, j;
orig_flags = READ_ONCE(pf->flags); orig_flags = READ_ONCE(pf->flags);
...@@ -5362,8 +5362,8 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags) ...@@ -5362,8 +5362,8 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
0, NULL); 0, NULL);
if (ret && pf->hw.aq.asq_last_status != I40E_AQ_RC_ESRCH) { if (ret && pf->hw.aq.asq_last_status != I40E_AQ_RC_ESRCH) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't set switch config bits, err %s aq_err %s\n", "couldn't set switch config bits, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
/* not a fatal problem, just keep going */ /* not a fatal problem, just keep going */
...@@ -5435,9 +5435,8 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags) ...@@ -5435,9 +5435,8 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
return -EBUSY; return -EBUSY;
default: default:
dev_warn(&pf->pdev->dev, dev_warn(&pf->pdev->dev,
"Starting FW LLDP agent failed: error: %s, %s\n", "Starting FW LLDP agent failed: error: %pe, %s\n",
i40e_stat_str(&pf->hw, ERR_PTR(status),
status),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
adq_err)); adq_err));
return -EINVAL; return -EINVAL;
...@@ -5477,8 +5476,8 @@ static int i40e_get_module_info(struct net_device *netdev, ...@@ -5477,8 +5476,8 @@ static int i40e_get_module_info(struct net_device *netdev,
u32 sff8472_comp = 0; u32 sff8472_comp = 0;
u32 sff8472_swap = 0; u32 sff8472_swap = 0;
u32 sff8636_rev = 0; u32 sff8636_rev = 0;
i40e_status status;
u32 type = 0; u32 type = 0;
int status;
/* Check if firmware supports reading module EEPROM. */ /* Check if firmware supports reading module EEPROM. */
if (!(hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE)) { if (!(hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE)) {
...@@ -5582,8 +5581,8 @@ static int i40e_get_module_eeprom(struct net_device *netdev, ...@@ -5582,8 +5581,8 @@ static int i40e_get_module_eeprom(struct net_device *netdev,
struct i40e_pf *pf = vsi->back; struct i40e_pf *pf = vsi->back;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
bool is_sfp = false; bool is_sfp = false;
i40e_status status;
u32 value = 0; u32 value = 0;
int status;
int i; int i;
if (!ee || !ee->len || !data) if (!ee || !ee->len || !data)
...@@ -5624,10 +5623,10 @@ static int i40e_get_eee(struct net_device *netdev, struct ethtool_eee *edata) ...@@ -5624,10 +5623,10 @@ static int i40e_get_eee(struct net_device *netdev, struct ethtool_eee *edata)
{ {
struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_aq_get_phy_abilities_resp phy_cfg; struct i40e_aq_get_phy_abilities_resp phy_cfg;
enum i40e_status_code status = 0;
struct i40e_vsi *vsi = np->vsi; struct i40e_vsi *vsi = np->vsi;
struct i40e_pf *pf = vsi->back; struct i40e_pf *pf = vsi->back;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
int status = 0;
/* Get initial PHY capabilities */ /* Get initial PHY capabilities */
status = i40e_aq_get_phy_capabilities(hw, false, true, &phy_cfg, NULL); status = i40e_aq_get_phy_capabilities(hw, false, true, &phy_cfg, NULL);
...@@ -5689,11 +5688,11 @@ static int i40e_set_eee(struct net_device *netdev, struct ethtool_eee *edata) ...@@ -5689,11 +5688,11 @@ static int i40e_set_eee(struct net_device *netdev, struct ethtool_eee *edata)
{ {
struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_aq_get_phy_abilities_resp abilities; struct i40e_aq_get_phy_abilities_resp abilities;
enum i40e_status_code status = I40E_SUCCESS;
struct i40e_aq_set_phy_config config; struct i40e_aq_set_phy_config config;
struct i40e_vsi *vsi = np->vsi; struct i40e_vsi *vsi = np->vsi;
struct i40e_pf *pf = vsi->back; struct i40e_pf *pf = vsi->back;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
int status = I40E_SUCCESS;
__le16 eee_capability; __le16 eee_capability;
/* Deny parameters we don't support */ /* Deny parameters we don't support */
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* @type: what type of segment descriptor we're manipulating * @type: what type of segment descriptor we're manipulating
* @direct_mode_sz: size to alloc in direct mode * @direct_mode_sz: size to alloc in direct mode
**/ **/
i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw, int i40e_add_sd_table_entry(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info, struct i40e_hmc_info *hmc_info,
u32 sd_index, u32 sd_index,
enum i40e_sd_entry_type type, enum i40e_sd_entry_type type,
...@@ -26,8 +26,8 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw, ...@@ -26,8 +26,8 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw,
enum i40e_memory_type mem_type __attribute__((unused)); enum i40e_memory_type mem_type __attribute__((unused));
struct i40e_hmc_sd_entry *sd_entry; struct i40e_hmc_sd_entry *sd_entry;
bool dma_mem_alloc_done = false; bool dma_mem_alloc_done = false;
int ret_code = I40E_SUCCESS;
struct i40e_dma_mem mem; struct i40e_dma_mem mem;
i40e_status ret_code = I40E_SUCCESS;
u64 alloc_len; u64 alloc_len;
if (NULL == hmc_info->sd_table.sd_entry) { if (NULL == hmc_info->sd_table.sd_entry) {
...@@ -106,19 +106,19 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw, ...@@ -106,19 +106,19 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw,
* aligned on 4K boundary and zeroed memory. * aligned on 4K boundary and zeroed memory.
* 2. It should be 4K in size. * 2. It should be 4K in size.
**/ **/
i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw, int i40e_add_pd_table_entry(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info, struct i40e_hmc_info *hmc_info,
u32 pd_index, u32 pd_index,
struct i40e_dma_mem *rsrc_pg) struct i40e_dma_mem *rsrc_pg)
{ {
i40e_status ret_code = 0;
struct i40e_hmc_pd_table *pd_table; struct i40e_hmc_pd_table *pd_table;
struct i40e_hmc_pd_entry *pd_entry; struct i40e_hmc_pd_entry *pd_entry;
struct i40e_dma_mem mem; struct i40e_dma_mem mem;
struct i40e_dma_mem *page = &mem; struct i40e_dma_mem *page = &mem;
u32 sd_idx, rel_pd_idx; u32 sd_idx, rel_pd_idx;
u64 *pd_addr; int ret_code = 0;
u64 page_desc; u64 page_desc;
u64 *pd_addr;
if (pd_index / I40E_HMC_PD_CNT_IN_SD >= hmc_info->sd_table.sd_cnt) { if (pd_index / I40E_HMC_PD_CNT_IN_SD >= hmc_info->sd_table.sd_cnt) {
ret_code = I40E_ERR_INVALID_PAGE_DESC_INDEX; ret_code = I40E_ERR_INVALID_PAGE_DESC_INDEX;
...@@ -185,15 +185,15 @@ i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw, ...@@ -185,15 +185,15 @@ i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,
* 1. Caller can deallocate the memory used by backing storage after this * 1. Caller can deallocate the memory used by backing storage after this
* function returns. * function returns.
**/ **/
i40e_status i40e_remove_pd_bp(struct i40e_hw *hw, int i40e_remove_pd_bp(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info, struct i40e_hmc_info *hmc_info,
u32 idx) u32 idx)
{ {
i40e_status ret_code = 0;
struct i40e_hmc_pd_entry *pd_entry; struct i40e_hmc_pd_entry *pd_entry;
struct i40e_hmc_pd_table *pd_table; struct i40e_hmc_pd_table *pd_table;
struct i40e_hmc_sd_entry *sd_entry; struct i40e_hmc_sd_entry *sd_entry;
u32 sd_idx, rel_pd_idx; u32 sd_idx, rel_pd_idx;
int ret_code = 0;
u64 *pd_addr; u64 *pd_addr;
/* calculate index */ /* calculate index */
...@@ -241,11 +241,11 @@ i40e_status i40e_remove_pd_bp(struct i40e_hw *hw, ...@@ -241,11 +241,11 @@ i40e_status i40e_remove_pd_bp(struct i40e_hw *hw,
* @hmc_info: pointer to the HMC configuration information structure * @hmc_info: pointer to the HMC configuration information structure
* @idx: the page index * @idx: the page index
**/ **/
i40e_status i40e_prep_remove_sd_bp(struct i40e_hmc_info *hmc_info, int i40e_prep_remove_sd_bp(struct i40e_hmc_info *hmc_info,
u32 idx) u32 idx)
{ {
i40e_status ret_code = 0;
struct i40e_hmc_sd_entry *sd_entry; struct i40e_hmc_sd_entry *sd_entry;
int ret_code = 0;
/* get the entry and decrease its ref counter */ /* get the entry and decrease its ref counter */
sd_entry = &hmc_info->sd_table.sd_entry[idx]; sd_entry = &hmc_info->sd_table.sd_entry[idx];
...@@ -269,7 +269,7 @@ i40e_status i40e_prep_remove_sd_bp(struct i40e_hmc_info *hmc_info, ...@@ -269,7 +269,7 @@ i40e_status i40e_prep_remove_sd_bp(struct i40e_hmc_info *hmc_info,
* @idx: the page index * @idx: the page index
* @is_pf: used to distinguish between VF and PF * @is_pf: used to distinguish between VF and PF
**/ **/
i40e_status i40e_remove_sd_bp_new(struct i40e_hw *hw, int i40e_remove_sd_bp_new(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info, struct i40e_hmc_info *hmc_info,
u32 idx, bool is_pf) u32 idx, bool is_pf)
{ {
...@@ -290,11 +290,11 @@ i40e_status i40e_remove_sd_bp_new(struct i40e_hw *hw, ...@@ -290,11 +290,11 @@ i40e_status i40e_remove_sd_bp_new(struct i40e_hw *hw,
* @hmc_info: pointer to the HMC configuration information structure * @hmc_info: pointer to the HMC configuration information structure
* @idx: segment descriptor index to find the relevant page descriptor * @idx: segment descriptor index to find the relevant page descriptor
**/ **/
i40e_status i40e_prep_remove_pd_page(struct i40e_hmc_info *hmc_info, int i40e_prep_remove_pd_page(struct i40e_hmc_info *hmc_info,
u32 idx) u32 idx)
{ {
i40e_status ret_code = 0;
struct i40e_hmc_sd_entry *sd_entry; struct i40e_hmc_sd_entry *sd_entry;
int ret_code = 0;
sd_entry = &hmc_info->sd_table.sd_entry[idx]; sd_entry = &hmc_info->sd_table.sd_entry[idx];
...@@ -318,7 +318,7 @@ i40e_status i40e_prep_remove_pd_page(struct i40e_hmc_info *hmc_info, ...@@ -318,7 +318,7 @@ i40e_status i40e_prep_remove_pd_page(struct i40e_hmc_info *hmc_info,
* @idx: segment descriptor index to find the relevant page descriptor * @idx: segment descriptor index to find the relevant page descriptor
* @is_pf: used to distinguish between VF and PF * @is_pf: used to distinguish between VF and PF
**/ **/
i40e_status i40e_remove_pd_page_new(struct i40e_hw *hw, int i40e_remove_pd_page_new(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info, struct i40e_hmc_info *hmc_info,
u32 idx, bool is_pf) u32 idx, bool is_pf)
{ {
......
...@@ -187,27 +187,27 @@ struct i40e_hmc_info { ...@@ -187,27 +187,27 @@ struct i40e_hmc_info {
/* add one more to the limit to correct our range */ \ /* add one more to the limit to correct our range */ \
*(pd_limit) += 1; \ *(pd_limit) += 1; \
} }
i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw,
int i40e_add_sd_table_entry(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info, struct i40e_hmc_info *hmc_info,
u32 sd_index, u32 sd_index,
enum i40e_sd_entry_type type, enum i40e_sd_entry_type type,
u64 direct_mode_sz); u64 direct_mode_sz);
int i40e_add_pd_table_entry(struct i40e_hw *hw,
i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info, struct i40e_hmc_info *hmc_info,
u32 pd_index, u32 pd_index,
struct i40e_dma_mem *rsrc_pg); struct i40e_dma_mem *rsrc_pg);
i40e_status i40e_remove_pd_bp(struct i40e_hw *hw, int i40e_remove_pd_bp(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info, struct i40e_hmc_info *hmc_info,
u32 idx); u32 idx);
i40e_status i40e_prep_remove_sd_bp(struct i40e_hmc_info *hmc_info, int i40e_prep_remove_sd_bp(struct i40e_hmc_info *hmc_info,
u32 idx); u32 idx);
i40e_status i40e_remove_sd_bp_new(struct i40e_hw *hw, int i40e_remove_sd_bp_new(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info, struct i40e_hmc_info *hmc_info,
u32 idx, bool is_pf); u32 idx, bool is_pf);
i40e_status i40e_prep_remove_pd_page(struct i40e_hmc_info *hmc_info, int i40e_prep_remove_pd_page(struct i40e_hmc_info *hmc_info,
u32 idx); u32 idx);
i40e_status i40e_remove_pd_page_new(struct i40e_hw *hw, int i40e_remove_pd_page_new(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info, struct i40e_hmc_info *hmc_info,
u32 idx, bool is_pf); u32 idx, bool is_pf);
......
...@@ -74,12 +74,12 @@ static u64 i40e_calculate_l2fpm_size(u32 txq_num, u32 rxq_num, ...@@ -74,12 +74,12 @@ static u64 i40e_calculate_l2fpm_size(u32 txq_num, u32 rxq_num,
* Assumptions: * Assumptions:
* - HMC Resource Profile has been selected before calling this function. * - HMC Resource Profile has been selected before calling this function.
**/ **/
i40e_status i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num, int i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
u32 rxq_num, u32 fcoe_cntx_num, u32 rxq_num, u32 fcoe_cntx_num,
u32 fcoe_filt_num) u32 fcoe_filt_num)
{ {
struct i40e_hmc_obj_info *obj, *full_obj; struct i40e_hmc_obj_info *obj, *full_obj;
i40e_status ret_code = 0; int ret_code = 0;
u64 l2fpm_size; u64 l2fpm_size;
u32 size_exp; u32 size_exp;
...@@ -229,11 +229,11 @@ i40e_status i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num, ...@@ -229,11 +229,11 @@ i40e_status i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
* 1. caller can deallocate the memory used by pd after this function * 1. caller can deallocate the memory used by pd after this function
* returns. * returns.
**/ **/
static i40e_status i40e_remove_pd_page(struct i40e_hw *hw, static int i40e_remove_pd_page(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info, struct i40e_hmc_info *hmc_info,
u32 idx) u32 idx)
{ {
i40e_status ret_code = 0; int ret_code = 0;
if (!i40e_prep_remove_pd_page(hmc_info, idx)) if (!i40e_prep_remove_pd_page(hmc_info, idx))
ret_code = i40e_remove_pd_page_new(hw, hmc_info, idx, true); ret_code = i40e_remove_pd_page_new(hw, hmc_info, idx, true);
...@@ -256,11 +256,11 @@ static i40e_status i40e_remove_pd_page(struct i40e_hw *hw, ...@@ -256,11 +256,11 @@ static i40e_status i40e_remove_pd_page(struct i40e_hw *hw,
* 1. caller can deallocate the memory used by backing storage after this * 1. caller can deallocate the memory used by backing storage after this
* function returns. * function returns.
**/ **/
static i40e_status i40e_remove_sd_bp(struct i40e_hw *hw, static int i40e_remove_sd_bp(struct i40e_hw *hw,
struct i40e_hmc_info *hmc_info, struct i40e_hmc_info *hmc_info,
u32 idx) u32 idx)
{ {
i40e_status ret_code = 0; int ret_code = 0;
if (!i40e_prep_remove_sd_bp(hmc_info, idx)) if (!i40e_prep_remove_sd_bp(hmc_info, idx))
ret_code = i40e_remove_sd_bp_new(hw, hmc_info, idx, true); ret_code = i40e_remove_sd_bp_new(hw, hmc_info, idx, true);
...@@ -276,15 +276,15 @@ static i40e_status i40e_remove_sd_bp(struct i40e_hw *hw, ...@@ -276,15 +276,15 @@ static i40e_status i40e_remove_sd_bp(struct i40e_hw *hw,
* This will allocate memory for PDs and backing pages and populate * This will allocate memory for PDs and backing pages and populate
* the sd and pd entries. * the sd and pd entries.
**/ **/
static i40e_status i40e_create_lan_hmc_object(struct i40e_hw *hw, static int i40e_create_lan_hmc_object(struct i40e_hw *hw,
struct i40e_hmc_lan_create_obj_info *info) struct i40e_hmc_lan_create_obj_info *info)
{ {
i40e_status ret_code = 0;
struct i40e_hmc_sd_entry *sd_entry; struct i40e_hmc_sd_entry *sd_entry;
u32 pd_idx1 = 0, pd_lmt1 = 0; u32 pd_idx1 = 0, pd_lmt1 = 0;
u32 pd_idx = 0, pd_lmt = 0; u32 pd_idx = 0, pd_lmt = 0;
bool pd_error = false; bool pd_error = false;
u32 sd_idx, sd_lmt; u32 sd_idx, sd_lmt;
int ret_code = 0;
u64 sd_size; u64 sd_size;
u32 i, j; u32 i, j;
...@@ -435,13 +435,13 @@ static i40e_status i40e_create_lan_hmc_object(struct i40e_hw *hw, ...@@ -435,13 +435,13 @@ static i40e_status i40e_create_lan_hmc_object(struct i40e_hw *hw,
* - This function will be called after i40e_init_lan_hmc() and before * - This function will be called after i40e_init_lan_hmc() and before
* any LAN/FCoE HMC objects can be created. * any LAN/FCoE HMC objects can be created.
**/ **/
i40e_status i40e_configure_lan_hmc(struct i40e_hw *hw, int i40e_configure_lan_hmc(struct i40e_hw *hw,
enum i40e_hmc_model model) enum i40e_hmc_model model)
{ {
struct i40e_hmc_lan_create_obj_info info; struct i40e_hmc_lan_create_obj_info info;
i40e_status ret_code = 0;
u8 hmc_fn_id = hw->hmc.hmc_fn_id; u8 hmc_fn_id = hw->hmc.hmc_fn_id;
struct i40e_hmc_obj_info *obj; struct i40e_hmc_obj_info *obj;
int ret_code = 0;
/* Initialize part of the create object info struct */ /* Initialize part of the create object info struct */
info.hmc_info = &hw->hmc; info.hmc_info = &hw->hmc;
...@@ -520,13 +520,13 @@ i40e_status i40e_configure_lan_hmc(struct i40e_hw *hw, ...@@ -520,13 +520,13 @@ i40e_status i40e_configure_lan_hmc(struct i40e_hw *hw,
* caller should deallocate memory allocated previously for * caller should deallocate memory allocated previously for
* book-keeping information about PDs and backing storage. * book-keeping information about PDs and backing storage.
**/ **/
static i40e_status i40e_delete_lan_hmc_object(struct i40e_hw *hw, static int i40e_delete_lan_hmc_object(struct i40e_hw *hw,
struct i40e_hmc_lan_delete_obj_info *info) struct i40e_hmc_lan_delete_obj_info *info)
{ {
i40e_status ret_code = 0;
struct i40e_hmc_pd_table *pd_table; struct i40e_hmc_pd_table *pd_table;
u32 pd_idx, pd_lmt, rel_pd_idx; u32 pd_idx, pd_lmt, rel_pd_idx;
u32 sd_idx, sd_lmt; u32 sd_idx, sd_lmt;
int ret_code = 0;
u32 i, j; u32 i, j;
if (NULL == info) { if (NULL == info) {
...@@ -632,10 +632,10 @@ static i40e_status i40e_delete_lan_hmc_object(struct i40e_hw *hw, ...@@ -632,10 +632,10 @@ static i40e_status i40e_delete_lan_hmc_object(struct i40e_hw *hw,
* This must be called by drivers as they are shutting down and being * This must be called by drivers as they are shutting down and being
* removed from the OS. * removed from the OS.
**/ **/
i40e_status i40e_shutdown_lan_hmc(struct i40e_hw *hw) int i40e_shutdown_lan_hmc(struct i40e_hw *hw)
{ {
struct i40e_hmc_lan_delete_obj_info info; struct i40e_hmc_lan_delete_obj_info info;
i40e_status ret_code; int ret_code;
info.hmc_info = &hw->hmc; info.hmc_info = &hw->hmc;
info.rsrc_type = I40E_HMC_LAN_FULL; info.rsrc_type = I40E_HMC_LAN_FULL;
...@@ -915,7 +915,7 @@ static void i40e_write_qword(u8 *hmc_bits, ...@@ -915,7 +915,7 @@ static void i40e_write_qword(u8 *hmc_bits,
* @context_bytes: pointer to the context bit array (DMA memory) * @context_bytes: pointer to the context bit array (DMA memory)
* @hmc_type: the type of HMC resource * @hmc_type: the type of HMC resource
**/ **/
static i40e_status i40e_clear_hmc_context(struct i40e_hw *hw, static int i40e_clear_hmc_context(struct i40e_hw *hw,
u8 *context_bytes, u8 *context_bytes,
enum i40e_hmc_lan_rsrc_type hmc_type) enum i40e_hmc_lan_rsrc_type hmc_type)
{ {
...@@ -931,7 +931,7 @@ static i40e_status i40e_clear_hmc_context(struct i40e_hw *hw, ...@@ -931,7 +931,7 @@ static i40e_status i40e_clear_hmc_context(struct i40e_hw *hw,
* @ce_info: a description of the struct to be filled * @ce_info: a description of the struct to be filled
* @dest: the struct to be filled * @dest: the struct to be filled
**/ **/
static i40e_status i40e_set_hmc_context(u8 *context_bytes, static int i40e_set_hmc_context(u8 *context_bytes,
struct i40e_context_ele *ce_info, struct i40e_context_ele *ce_info,
u8 *dest) u8 *dest)
{ {
...@@ -973,7 +973,7 @@ static i40e_status i40e_set_hmc_context(u8 *context_bytes, ...@@ -973,7 +973,7 @@ static i40e_status i40e_set_hmc_context(u8 *context_bytes,
* base pointer. This function is used for LAN Queue contexts. * base pointer. This function is used for LAN Queue contexts.
**/ **/
static static
i40e_status i40e_hmc_get_object_va(struct i40e_hw *hw, u8 **object_base, int i40e_hmc_get_object_va(struct i40e_hw *hw, u8 **object_base,
enum i40e_hmc_lan_rsrc_type rsrc_type, enum i40e_hmc_lan_rsrc_type rsrc_type,
u32 obj_idx) u32 obj_idx)
{ {
...@@ -982,9 +982,9 @@ i40e_status i40e_hmc_get_object_va(struct i40e_hw *hw, u8 **object_base, ...@@ -982,9 +982,9 @@ i40e_status i40e_hmc_get_object_va(struct i40e_hw *hw, u8 **object_base,
struct i40e_hmc_sd_entry *sd_entry; struct i40e_hmc_sd_entry *sd_entry;
struct i40e_hmc_pd_entry *pd_entry; struct i40e_hmc_pd_entry *pd_entry;
u32 pd_idx, pd_lmt, rel_pd_idx; u32 pd_idx, pd_lmt, rel_pd_idx;
i40e_status ret_code = 0;
u64 obj_offset_in_fpm; u64 obj_offset_in_fpm;
u32 sd_idx, sd_lmt; u32 sd_idx, sd_lmt;
int ret_code = 0;
if (NULL == hmc_info) { if (NULL == hmc_info) {
ret_code = I40E_ERR_BAD_PTR; ret_code = I40E_ERR_BAD_PTR;
...@@ -1042,11 +1042,11 @@ i40e_status i40e_hmc_get_object_va(struct i40e_hw *hw, u8 **object_base, ...@@ -1042,11 +1042,11 @@ i40e_status i40e_hmc_get_object_va(struct i40e_hw *hw, u8 **object_base,
* @hw: the hardware struct * @hw: the hardware struct
* @queue: the queue we care about * @queue: the queue we care about
**/ **/
i40e_status i40e_clear_lan_tx_queue_context(struct i40e_hw *hw, int i40e_clear_lan_tx_queue_context(struct i40e_hw *hw,
u16 queue) u16 queue)
{ {
i40e_status err;
u8 *context_bytes; u8 *context_bytes;
int err;
err = i40e_hmc_get_object_va(hw, &context_bytes, err = i40e_hmc_get_object_va(hw, &context_bytes,
I40E_HMC_LAN_TX, queue); I40E_HMC_LAN_TX, queue);
...@@ -1062,12 +1062,12 @@ i40e_status i40e_clear_lan_tx_queue_context(struct i40e_hw *hw, ...@@ -1062,12 +1062,12 @@ i40e_status i40e_clear_lan_tx_queue_context(struct i40e_hw *hw,
* @queue: the queue we care about * @queue: the queue we care about
* @s: the struct to be filled * @s: the struct to be filled
**/ **/
i40e_status i40e_set_lan_tx_queue_context(struct i40e_hw *hw, int i40e_set_lan_tx_queue_context(struct i40e_hw *hw,
u16 queue, u16 queue,
struct i40e_hmc_obj_txq *s) struct i40e_hmc_obj_txq *s)
{ {
i40e_status err;
u8 *context_bytes; u8 *context_bytes;
int err;
err = i40e_hmc_get_object_va(hw, &context_bytes, err = i40e_hmc_get_object_va(hw, &context_bytes,
I40E_HMC_LAN_TX, queue); I40E_HMC_LAN_TX, queue);
...@@ -1083,11 +1083,11 @@ i40e_status i40e_set_lan_tx_queue_context(struct i40e_hw *hw, ...@@ -1083,11 +1083,11 @@ i40e_status i40e_set_lan_tx_queue_context(struct i40e_hw *hw,
* @hw: the hardware struct * @hw: the hardware struct
* @queue: the queue we care about * @queue: the queue we care about
**/ **/
i40e_status i40e_clear_lan_rx_queue_context(struct i40e_hw *hw, int i40e_clear_lan_rx_queue_context(struct i40e_hw *hw,
u16 queue) u16 queue)
{ {
i40e_status err;
u8 *context_bytes; u8 *context_bytes;
int err;
err = i40e_hmc_get_object_va(hw, &context_bytes, err = i40e_hmc_get_object_va(hw, &context_bytes,
I40E_HMC_LAN_RX, queue); I40E_HMC_LAN_RX, queue);
...@@ -1103,12 +1103,12 @@ i40e_status i40e_clear_lan_rx_queue_context(struct i40e_hw *hw, ...@@ -1103,12 +1103,12 @@ i40e_status i40e_clear_lan_rx_queue_context(struct i40e_hw *hw,
* @queue: the queue we care about * @queue: the queue we care about
* @s: the struct to be filled * @s: the struct to be filled
**/ **/
i40e_status i40e_set_lan_rx_queue_context(struct i40e_hw *hw, int i40e_set_lan_rx_queue_context(struct i40e_hw *hw,
u16 queue, u16 queue,
struct i40e_hmc_obj_rxq *s) struct i40e_hmc_obj_rxq *s)
{ {
i40e_status err;
u8 *context_bytes; u8 *context_bytes;
int err;
err = i40e_hmc_get_object_va(hw, &context_bytes, err = i40e_hmc_get_object_va(hw, &context_bytes,
I40E_HMC_LAN_RX, queue); I40E_HMC_LAN_RX, queue);
......
...@@ -137,21 +137,21 @@ struct i40e_hmc_lan_delete_obj_info { ...@@ -137,21 +137,21 @@ struct i40e_hmc_lan_delete_obj_info {
u32 count; u32 count;
}; };
i40e_status i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num, int i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
u32 rxq_num, u32 fcoe_cntx_num, u32 rxq_num, u32 fcoe_cntx_num,
u32 fcoe_filt_num); u32 fcoe_filt_num);
i40e_status i40e_configure_lan_hmc(struct i40e_hw *hw, int i40e_configure_lan_hmc(struct i40e_hw *hw,
enum i40e_hmc_model model); enum i40e_hmc_model model);
i40e_status i40e_shutdown_lan_hmc(struct i40e_hw *hw); int i40e_shutdown_lan_hmc(struct i40e_hw *hw);
i40e_status i40e_clear_lan_tx_queue_context(struct i40e_hw *hw, int i40e_clear_lan_tx_queue_context(struct i40e_hw *hw,
u16 queue); u16 queue);
i40e_status i40e_set_lan_tx_queue_context(struct i40e_hw *hw, int i40e_set_lan_tx_queue_context(struct i40e_hw *hw,
u16 queue, u16 queue,
struct i40e_hmc_obj_txq *s); struct i40e_hmc_obj_txq *s);
i40e_status i40e_clear_lan_rx_queue_context(struct i40e_hw *hw, int i40e_clear_lan_rx_queue_context(struct i40e_hw *hw,
u16 queue); u16 queue);
i40e_status i40e_set_lan_rx_queue_context(struct i40e_hw *hw, int i40e_set_lan_rx_queue_context(struct i40e_hw *hw,
u16 queue, u16 queue,
struct i40e_hmc_obj_rxq *s); struct i40e_hmc_obj_rxq *s);
......
...@@ -1817,13 +1817,13 @@ static int i40e_set_mac(struct net_device *netdev, void *p) ...@@ -1817,13 +1817,13 @@ static int i40e_set_mac(struct net_device *netdev, void *p)
spin_unlock_bh(&vsi->mac_filter_hash_lock); spin_unlock_bh(&vsi->mac_filter_hash_lock);
if (vsi->type == I40E_VSI_MAIN) { if (vsi->type == I40E_VSI_MAIN) {
i40e_status ret; int ret;
ret = i40e_aq_mac_address_write(hw, I40E_AQC_WRITE_TYPE_LAA_WOL, ret = i40e_aq_mac_address_write(hw, I40E_AQC_WRITE_TYPE_LAA_WOL,
addr->sa_data, NULL); addr->sa_data, NULL);
if (ret) if (ret)
netdev_info(netdev, "Ignoring error from firmware on LAA update, status %s, AQ ret %s\n", netdev_info(netdev, "Ignoring error from firmware on LAA update, status %pe, AQ ret %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
} }
...@@ -1854,8 +1854,8 @@ static int i40e_config_rss_aq(struct i40e_vsi *vsi, const u8 *seed, ...@@ -1854,8 +1854,8 @@ static int i40e_config_rss_aq(struct i40e_vsi *vsi, const u8 *seed,
ret = i40e_aq_set_rss_key(hw, vsi->id, seed_dw); ret = i40e_aq_set_rss_key(hw, vsi->id, seed_dw);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Cannot set RSS key, err %s aq_err %s\n", "Cannot set RSS key, err %pe aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
return ret; return ret;
} }
...@@ -1866,8 +1866,8 @@ static int i40e_config_rss_aq(struct i40e_vsi *vsi, const u8 *seed, ...@@ -1866,8 +1866,8 @@ static int i40e_config_rss_aq(struct i40e_vsi *vsi, const u8 *seed,
ret = i40e_aq_set_rss_lut(hw, vsi->id, pf_lut, lut, lut_size); ret = i40e_aq_set_rss_lut(hw, vsi->id, pf_lut, lut, lut_size);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Cannot set RSS lut, err %s aq_err %s\n", "Cannot set RSS lut, err %pe aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
return ret; return ret;
} }
...@@ -2349,7 +2349,7 @@ void i40e_aqc_del_filters(struct i40e_vsi *vsi, const char *vsi_name, ...@@ -2349,7 +2349,7 @@ void i40e_aqc_del_filters(struct i40e_vsi *vsi, const char *vsi_name,
{ {
struct i40e_hw *hw = &vsi->back->hw; struct i40e_hw *hw = &vsi->back->hw;
enum i40e_admin_queue_err aq_status; enum i40e_admin_queue_err aq_status;
i40e_status aq_ret; int aq_ret;
aq_ret = i40e_aq_remove_macvlan_v2(hw, vsi->seid, list, num_del, NULL, aq_ret = i40e_aq_remove_macvlan_v2(hw, vsi->seid, list, num_del, NULL,
&aq_status); &aq_status);
...@@ -2358,8 +2358,8 @@ void i40e_aqc_del_filters(struct i40e_vsi *vsi, const char *vsi_name, ...@@ -2358,8 +2358,8 @@ void i40e_aqc_del_filters(struct i40e_vsi *vsi, const char *vsi_name,
if (aq_ret && !(aq_status == I40E_AQ_RC_ENOENT)) { if (aq_ret && !(aq_status == I40E_AQ_RC_ENOENT)) {
*retval = -EIO; *retval = -EIO;
dev_info(&vsi->back->pdev->dev, dev_info(&vsi->back->pdev->dev,
"ignoring delete macvlan error on %s, err %s, aq_err %s\n", "ignoring delete macvlan error on %s, err %pe, aq_err %s\n",
vsi_name, i40e_stat_str(hw, aq_ret), vsi_name, ERR_PTR(aq_ret),
i40e_aq_str(hw, aq_status)); i40e_aq_str(hw, aq_status));
} }
} }
...@@ -2423,13 +2423,13 @@ void i40e_aqc_add_filters(struct i40e_vsi *vsi, const char *vsi_name, ...@@ -2423,13 +2423,13 @@ void i40e_aqc_add_filters(struct i40e_vsi *vsi, const char *vsi_name,
* *
* Returns status indicating success or failure; * Returns status indicating success or failure;
**/ **/
static i40e_status static int
i40e_aqc_broadcast_filter(struct i40e_vsi *vsi, const char *vsi_name, i40e_aqc_broadcast_filter(struct i40e_vsi *vsi, const char *vsi_name,
struct i40e_mac_filter *f) struct i40e_mac_filter *f)
{ {
bool enable = f->state == I40E_FILTER_NEW; bool enable = f->state == I40E_FILTER_NEW;
struct i40e_hw *hw = &vsi->back->hw; struct i40e_hw *hw = &vsi->back->hw;
i40e_status aq_ret; int aq_ret;
if (f->vlan == I40E_VLAN_ANY) { if (f->vlan == I40E_VLAN_ANY) {
aq_ret = i40e_aq_set_vsi_broadcast(hw, aq_ret = i40e_aq_set_vsi_broadcast(hw,
...@@ -2468,7 +2468,7 @@ static int i40e_set_promiscuous(struct i40e_pf *pf, bool promisc) ...@@ -2468,7 +2468,7 @@ static int i40e_set_promiscuous(struct i40e_pf *pf, bool promisc)
{ {
struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi]; struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status aq_ret; int aq_ret;
if (vsi->type == I40E_VSI_MAIN && if (vsi->type == I40E_VSI_MAIN &&
pf->lan_veb != I40E_NO_VEB && pf->lan_veb != I40E_NO_VEB &&
...@@ -2488,8 +2488,8 @@ static int i40e_set_promiscuous(struct i40e_pf *pf, bool promisc) ...@@ -2488,8 +2488,8 @@ static int i40e_set_promiscuous(struct i40e_pf *pf, bool promisc)
NULL); NULL);
if (aq_ret) { if (aq_ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Set default VSI failed, err %s, aq_err %s\n", "Set default VSI failed, err %pe, aq_err %s\n",
i40e_stat_str(hw, aq_ret), ERR_PTR(aq_ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
} }
} else { } else {
...@@ -2500,8 +2500,8 @@ static int i40e_set_promiscuous(struct i40e_pf *pf, bool promisc) ...@@ -2500,8 +2500,8 @@ static int i40e_set_promiscuous(struct i40e_pf *pf, bool promisc)
true); true);
if (aq_ret) { if (aq_ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"set unicast promisc failed, err %s, aq_err %s\n", "set unicast promisc failed, err %pe, aq_err %s\n",
i40e_stat_str(hw, aq_ret), ERR_PTR(aq_ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
} }
aq_ret = i40e_aq_set_vsi_multicast_promiscuous( aq_ret = i40e_aq_set_vsi_multicast_promiscuous(
...@@ -2510,8 +2510,8 @@ static int i40e_set_promiscuous(struct i40e_pf *pf, bool promisc) ...@@ -2510,8 +2510,8 @@ static int i40e_set_promiscuous(struct i40e_pf *pf, bool promisc)
promisc, NULL); promisc, NULL);
if (aq_ret) { if (aq_ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"set multicast promisc failed, err %s, aq_err %s\n", "set multicast promisc failed, err %pe, aq_err %s\n",
i40e_stat_str(hw, aq_ret), ERR_PTR(aq_ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
} }
} }
...@@ -2541,12 +2541,12 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) ...@@ -2541,12 +2541,12 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
unsigned int vlan_filters = 0; unsigned int vlan_filters = 0;
char vsi_name[16] = "PF"; char vsi_name[16] = "PF";
int filter_list_len = 0; int filter_list_len = 0;
i40e_status aq_ret = 0;
u32 changed_flags = 0; u32 changed_flags = 0;
struct hlist_node *h; struct hlist_node *h;
struct i40e_pf *pf; struct i40e_pf *pf;
int num_add = 0; int num_add = 0;
int num_del = 0; int num_del = 0;
int aq_ret = 0;
int retval = 0; int retval = 0;
u16 cmd_flags; u16 cmd_flags;
int list_size; int list_size;
...@@ -2814,9 +2814,9 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) ...@@ -2814,9 +2814,9 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
retval = i40e_aq_rc_to_posix(aq_ret, retval = i40e_aq_rc_to_posix(aq_ret,
hw->aq.asq_last_status); hw->aq.asq_last_status);
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"set multi promisc failed on %s, err %s aq_err %s\n", "set multi promisc failed on %s, err %pe aq_err %s\n",
vsi_name, vsi_name,
i40e_stat_str(hw, aq_ret), ERR_PTR(aq_ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
} else { } else {
dev_info(&pf->pdev->dev, "%s allmulti mode.\n", dev_info(&pf->pdev->dev, "%s allmulti mode.\n",
...@@ -2834,10 +2834,10 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) ...@@ -2834,10 +2834,10 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
retval = i40e_aq_rc_to_posix(aq_ret, retval = i40e_aq_rc_to_posix(aq_ret,
hw->aq.asq_last_status); hw->aq.asq_last_status);
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Setting promiscuous %s failed on %s, err %s aq_err %s\n", "Setting promiscuous %s failed on %s, err %pe aq_err %s\n",
cur_promisc ? "on" : "off", cur_promisc ? "on" : "off",
vsi_name, vsi_name,
i40e_stat_str(hw, aq_ret), ERR_PTR(aq_ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
} }
} }
...@@ -2965,7 +2965,7 @@ int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) ...@@ -2965,7 +2965,7 @@ int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
void i40e_vlan_stripping_enable(struct i40e_vsi *vsi) void i40e_vlan_stripping_enable(struct i40e_vsi *vsi)
{ {
struct i40e_vsi_context ctxt; struct i40e_vsi_context ctxt;
i40e_status ret; int ret;
/* Don't modify stripping options if a port VLAN is active */ /* Don't modify stripping options if a port VLAN is active */
if (vsi->info.pvid) if (vsi->info.pvid)
...@@ -2985,8 +2985,8 @@ void i40e_vlan_stripping_enable(struct i40e_vsi *vsi) ...@@ -2985,8 +2985,8 @@ void i40e_vlan_stripping_enable(struct i40e_vsi *vsi)
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL); ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&vsi->back->pdev->dev, dev_info(&vsi->back->pdev->dev,
"update vlan stripping failed, err %s aq_err %s\n", "update vlan stripping failed, err %pe aq_err %s\n",
i40e_stat_str(&vsi->back->hw, ret), ERR_PTR(ret),
i40e_aq_str(&vsi->back->hw, i40e_aq_str(&vsi->back->hw,
vsi->back->hw.aq.asq_last_status)); vsi->back->hw.aq.asq_last_status));
} }
...@@ -2999,7 +2999,7 @@ void i40e_vlan_stripping_enable(struct i40e_vsi *vsi) ...@@ -2999,7 +2999,7 @@ void i40e_vlan_stripping_enable(struct i40e_vsi *vsi)
void i40e_vlan_stripping_disable(struct i40e_vsi *vsi) void i40e_vlan_stripping_disable(struct i40e_vsi *vsi)
{ {
struct i40e_vsi_context ctxt; struct i40e_vsi_context ctxt;
i40e_status ret; int ret;
/* Don't modify stripping options if a port VLAN is active */ /* Don't modify stripping options if a port VLAN is active */
if (vsi->info.pvid) if (vsi->info.pvid)
...@@ -3020,8 +3020,8 @@ void i40e_vlan_stripping_disable(struct i40e_vsi *vsi) ...@@ -3020,8 +3020,8 @@ void i40e_vlan_stripping_disable(struct i40e_vsi *vsi)
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL); ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&vsi->back->pdev->dev, dev_info(&vsi->back->pdev->dev,
"update vlan stripping failed, err %s aq_err %s\n", "update vlan stripping failed, err %pe aq_err %s\n",
i40e_stat_str(&vsi->back->hw, ret), ERR_PTR(ret),
i40e_aq_str(&vsi->back->hw, i40e_aq_str(&vsi->back->hw,
vsi->back->hw.aq.asq_last_status)); vsi->back->hw.aq.asq_last_status));
} }
...@@ -3252,7 +3252,7 @@ static void i40e_restore_vlan(struct i40e_vsi *vsi) ...@@ -3252,7 +3252,7 @@ static void i40e_restore_vlan(struct i40e_vsi *vsi)
int i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid) int i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid)
{ {
struct i40e_vsi_context ctxt; struct i40e_vsi_context ctxt;
i40e_status ret; int ret;
vsi->info.valid_sections = cpu_to_le16(I40E_AQ_VSI_PROP_VLAN_VALID); vsi->info.valid_sections = cpu_to_le16(I40E_AQ_VSI_PROP_VLAN_VALID);
vsi->info.pvid = cpu_to_le16(vid); vsi->info.pvid = cpu_to_le16(vid);
...@@ -3265,8 +3265,8 @@ int i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid) ...@@ -3265,8 +3265,8 @@ int i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid)
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL); ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&vsi->back->pdev->dev, dev_info(&vsi->back->pdev->dev,
"add pvid failed, err %s aq_err %s\n", "add pvid failed, err %pe aq_err %s\n",
i40e_stat_str(&vsi->back->hw, ret), ERR_PTR(ret),
i40e_aq_str(&vsi->back->hw, i40e_aq_str(&vsi->back->hw,
vsi->back->hw.aq.asq_last_status)); vsi->back->hw.aq.asq_last_status));
return -ENOENT; return -ENOENT;
...@@ -3429,8 +3429,8 @@ static int i40e_configure_tx_ring(struct i40e_ring *ring) ...@@ -3429,8 +3429,8 @@ static int i40e_configure_tx_ring(struct i40e_ring *ring)
u16 pf_q = vsi->base_queue + ring->queue_index; u16 pf_q = vsi->base_queue + ring->queue_index;
struct i40e_hw *hw = &vsi->back->hw; struct i40e_hw *hw = &vsi->back->hw;
struct i40e_hmc_obj_txq tx_ctx; struct i40e_hmc_obj_txq tx_ctx;
i40e_status err = 0;
u32 qtx_ctl = 0; u32 qtx_ctl = 0;
int err = 0;
if (ring_is_xdp(ring)) if (ring_is_xdp(ring))
ring->xsk_pool = i40e_xsk_pool(ring); ring->xsk_pool = i40e_xsk_pool(ring);
...@@ -3554,7 +3554,7 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring) ...@@ -3554,7 +3554,7 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
u16 pf_q = vsi->base_queue + ring->queue_index; u16 pf_q = vsi->base_queue + ring->queue_index;
struct i40e_hw *hw = &vsi->back->hw; struct i40e_hw *hw = &vsi->back->hw;
struct i40e_hmc_obj_rxq rx_ctx; struct i40e_hmc_obj_rxq rx_ctx;
i40e_status err = 0; int err = 0;
bool ok; bool ok;
int ret; int ret;
...@@ -5525,16 +5525,16 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi) ...@@ -5525,16 +5525,16 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi)
struct i40e_aqc_query_vsi_bw_config_resp bw_config = {0}; struct i40e_aqc_query_vsi_bw_config_resp bw_config = {0};
struct i40e_pf *pf = vsi->back; struct i40e_pf *pf = vsi->back;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status ret;
u32 tc_bw_max; u32 tc_bw_max;
int ret;
int i; int i;
/* Get the VSI level BW configuration */ /* Get the VSI level BW configuration */
ret = i40e_aq_query_vsi_bw_config(hw, vsi->seid, &bw_config, NULL); ret = i40e_aq_query_vsi_bw_config(hw, vsi->seid, &bw_config, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't get PF vsi bw config, err %s aq_err %s\n", "couldn't get PF vsi bw config, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return -EINVAL; return -EINVAL;
} }
...@@ -5544,8 +5544,8 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi) ...@@ -5544,8 +5544,8 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi)
NULL); NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't get PF vsi ets bw config, err %s aq_err %s\n", "couldn't get PF vsi ets bw config, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return -EINVAL; return -EINVAL;
} }
...@@ -5586,7 +5586,7 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc, ...@@ -5586,7 +5586,7 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc,
{ {
struct i40e_aqc_configure_vsi_tc_bw_data bw_data; struct i40e_aqc_configure_vsi_tc_bw_data bw_data;
struct i40e_pf *pf = vsi->back; struct i40e_pf *pf = vsi->back;
i40e_status ret; int ret;
int i; int i;
/* There is no need to reset BW when mqprio mode is on. */ /* There is no need to reset BW when mqprio mode is on. */
...@@ -5734,8 +5734,8 @@ int i40e_update_adq_vsi_queues(struct i40e_vsi *vsi, int vsi_offset) ...@@ -5734,8 +5734,8 @@ int i40e_update_adq_vsi_queues(struct i40e_vsi *vsi, int vsi_offset)
ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, "Update vsi config failed, err %s aq_err %s\n", dev_info(&pf->pdev->dev, "Update vsi config failed, err %pe aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
return ret; return ret;
} }
...@@ -5790,8 +5790,8 @@ static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc) ...@@ -5790,8 +5790,8 @@ static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
&bw_config, NULL); &bw_config, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Failed querying vsi bw info, err %s aq_err %s\n", "Failed querying vsi bw info, err %pe aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
goto out; goto out;
} }
...@@ -5857,8 +5857,8 @@ static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc) ...@@ -5857,8 +5857,8 @@ static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Update vsi tc config failed, err %s aq_err %s\n", "Update vsi tc config failed, err %pe aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
goto out; goto out;
} }
...@@ -5870,8 +5870,8 @@ static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc) ...@@ -5870,8 +5870,8 @@ static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
ret = i40e_vsi_get_bw_info(vsi); ret = i40e_vsi_get_bw_info(vsi);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Failed updating vsi bw info, err %s aq_err %s\n", "Failed updating vsi bw info, err %pe aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
goto out; goto out;
} }
...@@ -5962,8 +5962,8 @@ int i40e_set_bw_limit(struct i40e_vsi *vsi, u16 seid, u64 max_tx_rate) ...@@ -5962,8 +5962,8 @@ int i40e_set_bw_limit(struct i40e_vsi *vsi, u16 seid, u64 max_tx_rate)
I40E_MAX_BW_INACTIVE_ACCUM, NULL); I40E_MAX_BW_INACTIVE_ACCUM, NULL);
if (ret) if (ret)
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"Failed set tx rate (%llu Mbps) for vsi->seid %u, err %s aq_err %s\n", "Failed set tx rate (%llu Mbps) for vsi->seid %u, err %pe aq_err %s\n",
max_tx_rate, seid, i40e_stat_str(&pf->hw, ret), max_tx_rate, seid, ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return ret; return ret;
} }
...@@ -6038,8 +6038,8 @@ static void i40e_remove_queue_channels(struct i40e_vsi *vsi) ...@@ -6038,8 +6038,8 @@ static void i40e_remove_queue_channels(struct i40e_vsi *vsi)
last_aq_status = pf->hw.aq.asq_last_status; last_aq_status = pf->hw.aq.asq_last_status;
if (ret) if (ret)
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Failed to delete cloud filter, err %s aq_err %s\n", "Failed to delete cloud filter, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, last_aq_status)); i40e_aq_str(&pf->hw, last_aq_status));
kfree(cfilter); kfree(cfilter);
} }
...@@ -6173,8 +6173,8 @@ static int i40e_vsi_reconfig_rss(struct i40e_vsi *vsi, u16 rss_size) ...@@ -6173,8 +6173,8 @@ static int i40e_vsi_reconfig_rss(struct i40e_vsi *vsi, u16 rss_size)
ret = i40e_config_rss(vsi, seed, lut, vsi->rss_table_size); ret = i40e_config_rss(vsi, seed, lut, vsi->rss_table_size);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Cannot set RSS lut, err %s aq_err %s\n", "Cannot set RSS lut, err %pe aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
kfree(lut); kfree(lut);
return ret; return ret;
...@@ -6272,8 +6272,8 @@ static int i40e_add_channel(struct i40e_pf *pf, u16 uplink_seid, ...@@ -6272,8 +6272,8 @@ static int i40e_add_channel(struct i40e_pf *pf, u16 uplink_seid,
ret = i40e_aq_add_vsi(hw, &ctxt, NULL); ret = i40e_aq_add_vsi(hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"add new vsi failed, err %s aq_err %s\n", "add new vsi failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
return -ENOENT; return -ENOENT;
...@@ -6304,7 +6304,7 @@ static int i40e_channel_config_bw(struct i40e_vsi *vsi, struct i40e_channel *ch, ...@@ -6304,7 +6304,7 @@ static int i40e_channel_config_bw(struct i40e_vsi *vsi, struct i40e_channel *ch,
u8 *bw_share) u8 *bw_share)
{ {
struct i40e_aqc_configure_vsi_tc_bw_data bw_data; struct i40e_aqc_configure_vsi_tc_bw_data bw_data;
i40e_status ret; int ret;
int i; int i;
memset(&bw_data, 0, sizeof(bw_data)); memset(&bw_data, 0, sizeof(bw_data));
...@@ -6340,9 +6340,9 @@ static int i40e_channel_config_tx_ring(struct i40e_pf *pf, ...@@ -6340,9 +6340,9 @@ static int i40e_channel_config_tx_ring(struct i40e_pf *pf,
struct i40e_vsi *vsi, struct i40e_vsi *vsi,
struct i40e_channel *ch) struct i40e_channel *ch)
{ {
i40e_status ret;
int i;
u8 bw_share[I40E_MAX_TRAFFIC_CLASS] = {0}; u8 bw_share[I40E_MAX_TRAFFIC_CLASS] = {0};
int ret;
int i;
/* Enable ETS TCs with equal BW Share for now across all VSIs */ /* Enable ETS TCs with equal BW Share for now across all VSIs */
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) { for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
...@@ -6518,8 +6518,8 @@ static int i40e_validate_and_set_switch_mode(struct i40e_vsi *vsi) ...@@ -6518,8 +6518,8 @@ static int i40e_validate_and_set_switch_mode(struct i40e_vsi *vsi)
mode, NULL); mode, NULL);
if (ret && hw->aq.asq_last_status != I40E_AQ_RC_ESRCH) if (ret && hw->aq.asq_last_status != I40E_AQ_RC_ESRCH)
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"couldn't set switch config bits, err %s aq_err %s\n", "couldn't set switch config bits, err %pe aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, i40e_aq_str(hw,
hw->aq.asq_last_status)); hw->aq.asq_last_status));
...@@ -6719,8 +6719,8 @@ int i40e_veb_config_tc(struct i40e_veb *veb, u8 enabled_tc) ...@@ -6719,8 +6719,8 @@ int i40e_veb_config_tc(struct i40e_veb *veb, u8 enabled_tc)
&bw_data, NULL); &bw_data, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"VEB bw config failed, err %s aq_err %s\n", "VEB bw config failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
goto out; goto out;
} }
...@@ -6729,8 +6729,8 @@ int i40e_veb_config_tc(struct i40e_veb *veb, u8 enabled_tc) ...@@ -6729,8 +6729,8 @@ int i40e_veb_config_tc(struct i40e_veb *veb, u8 enabled_tc)
ret = i40e_veb_get_bw_info(veb); ret = i40e_veb_get_bw_info(veb);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Failed getting veb bw config, err %s aq_err %s\n", "Failed getting veb bw config, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
} }
...@@ -6813,8 +6813,8 @@ static int i40e_resume_port_tx(struct i40e_pf *pf) ...@@ -6813,8 +6813,8 @@ static int i40e_resume_port_tx(struct i40e_pf *pf)
ret = i40e_aq_resume_port_tx(hw, NULL); ret = i40e_aq_resume_port_tx(hw, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Resume Port Tx failed, err %s aq_err %s\n", "Resume Port Tx failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
/* Schedule PF reset to recover */ /* Schedule PF reset to recover */
set_bit(__I40E_PF_RESET_REQUESTED, pf->state); set_bit(__I40E_PF_RESET_REQUESTED, pf->state);
...@@ -6838,8 +6838,8 @@ static int i40e_suspend_port_tx(struct i40e_pf *pf) ...@@ -6838,8 +6838,8 @@ static int i40e_suspend_port_tx(struct i40e_pf *pf)
ret = i40e_aq_suspend_port_tx(hw, pf->mac_seid, NULL); ret = i40e_aq_suspend_port_tx(hw, pf->mac_seid, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Suspend Port Tx failed, err %s aq_err %s\n", "Suspend Port Tx failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
/* Schedule PF reset to recover */ /* Schedule PF reset to recover */
set_bit(__I40E_PF_RESET_REQUESTED, pf->state); set_bit(__I40E_PF_RESET_REQUESTED, pf->state);
...@@ -6878,8 +6878,8 @@ static int i40e_hw_set_dcb_config(struct i40e_pf *pf, ...@@ -6878,8 +6878,8 @@ static int i40e_hw_set_dcb_config(struct i40e_pf *pf,
ret = i40e_set_dcb_config(&pf->hw); ret = i40e_set_dcb_config(&pf->hw);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Set DCB Config failed, err %s aq_err %s\n", "Set DCB Config failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
goto out; goto out;
} }
...@@ -6995,8 +6995,8 @@ int i40e_hw_dcb_config(struct i40e_pf *pf, struct i40e_dcbx_config *new_cfg) ...@@ -6995,8 +6995,8 @@ int i40e_hw_dcb_config(struct i40e_pf *pf, struct i40e_dcbx_config *new_cfg)
i40e_aqc_opc_modify_switching_comp_ets, NULL); i40e_aqc_opc_modify_switching_comp_ets, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Modify Port ETS failed, err %s aq_err %s\n", "Modify Port ETS failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
goto out; goto out;
} }
...@@ -7033,8 +7033,8 @@ int i40e_hw_dcb_config(struct i40e_pf *pf, struct i40e_dcbx_config *new_cfg) ...@@ -7033,8 +7033,8 @@ int i40e_hw_dcb_config(struct i40e_pf *pf, struct i40e_dcbx_config *new_cfg)
ret = i40e_aq_dcb_updated(&pf->hw, NULL); ret = i40e_aq_dcb_updated(&pf->hw, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"DCB Updated failed, err %s aq_err %s\n", "DCB Updated failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
goto out; goto out;
} }
...@@ -7117,8 +7117,8 @@ int i40e_dcb_sw_default_config(struct i40e_pf *pf) ...@@ -7117,8 +7117,8 @@ int i40e_dcb_sw_default_config(struct i40e_pf *pf)
i40e_aqc_opc_enable_switching_comp_ets, NULL); i40e_aqc_opc_enable_switching_comp_ets, NULL);
if (err) { if (err) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Enable Port ETS failed, err %s aq_err %s\n", "Enable Port ETS failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, err), ERR_PTR(err),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
err = -ENOENT; err = -ENOENT;
goto out; goto out;
...@@ -7197,8 +7197,8 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf) ...@@ -7197,8 +7197,8 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf)
pf->flags |= I40E_FLAG_DISABLE_FW_LLDP; pf->flags |= I40E_FLAG_DISABLE_FW_LLDP;
} else { } else {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Query for DCB configuration failed, err %s aq_err %s\n", "Query for DCB configuration failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, err), ERR_PTR(err),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
} }
...@@ -7416,15 +7416,15 @@ static void i40e_vsi_reinit_locked(struct i40e_vsi *vsi) ...@@ -7416,15 +7416,15 @@ static void i40e_vsi_reinit_locked(struct i40e_vsi *vsi)
* @pf: board private structure * @pf: board private structure
* @is_up: whether the link state should be forced up or down * @is_up: whether the link state should be forced up or down
**/ **/
static i40e_status i40e_force_link_state(struct i40e_pf *pf, bool is_up) static int i40e_force_link_state(struct i40e_pf *pf, bool is_up)
{ {
struct i40e_aq_get_phy_abilities_resp abilities; struct i40e_aq_get_phy_abilities_resp abilities;
struct i40e_aq_set_phy_config config = {0}; struct i40e_aq_set_phy_config config = {0};
bool non_zero_phy_type = is_up; bool non_zero_phy_type = is_up;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status err;
u64 mask; u64 mask;
u8 speed; u8 speed;
int err;
/* Card might've been put in an unstable state by other drivers /* Card might've been put in an unstable state by other drivers
* and applications, which causes incorrect speed values being * and applications, which causes incorrect speed values being
...@@ -7436,8 +7436,8 @@ static i40e_status i40e_force_link_state(struct i40e_pf *pf, bool is_up) ...@@ -7436,8 +7436,8 @@ static i40e_status i40e_force_link_state(struct i40e_pf *pf, bool is_up)
NULL); NULL);
if (err) { if (err) {
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"failed to get phy cap., ret = %s last_status = %s\n", "failed to get phy cap., ret = %pe last_status = %s\n",
i40e_stat_str(hw, err), ERR_PTR(err),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
return err; return err;
} }
...@@ -7448,8 +7448,8 @@ static i40e_status i40e_force_link_state(struct i40e_pf *pf, bool is_up) ...@@ -7448,8 +7448,8 @@ static i40e_status i40e_force_link_state(struct i40e_pf *pf, bool is_up)
NULL); NULL);
if (err) { if (err) {
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"failed to get phy cap., ret = %s last_status = %s\n", "failed to get phy cap., ret = %pe last_status = %s\n",
i40e_stat_str(hw, err), ERR_PTR(err),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
return err; return err;
} }
...@@ -7493,8 +7493,8 @@ static i40e_status i40e_force_link_state(struct i40e_pf *pf, bool is_up) ...@@ -7493,8 +7493,8 @@ static i40e_status i40e_force_link_state(struct i40e_pf *pf, bool is_up)
if (err) { if (err) {
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"set phy config ret = %s last_status = %s\n", "set phy config ret = %pe last_status = %s\n",
i40e_stat_str(&pf->hw, err), ERR_PTR(err),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return err; return err;
} }
...@@ -7657,11 +7657,11 @@ static void i40e_vsi_set_default_tc_config(struct i40e_vsi *vsi) ...@@ -7657,11 +7657,11 @@ static void i40e_vsi_set_default_tc_config(struct i40e_vsi *vsi)
* This function deletes a mac filter on the channel VSI which serves as the * This function deletes a mac filter on the channel VSI which serves as the
* macvlan. Returns 0 on success. * macvlan. Returns 0 on success.
**/ **/
static i40e_status i40e_del_macvlan_filter(struct i40e_hw *hw, u16 seid, static int i40e_del_macvlan_filter(struct i40e_hw *hw, u16 seid,
const u8 *macaddr, int *aq_err) const u8 *macaddr, int *aq_err)
{ {
struct i40e_aqc_remove_macvlan_element_data element; struct i40e_aqc_remove_macvlan_element_data element;
i40e_status status; int status;
memset(&element, 0, sizeof(element)); memset(&element, 0, sizeof(element));
ether_addr_copy(element.mac_addr, macaddr); ether_addr_copy(element.mac_addr, macaddr);
...@@ -7683,12 +7683,12 @@ static i40e_status i40e_del_macvlan_filter(struct i40e_hw *hw, u16 seid, ...@@ -7683,12 +7683,12 @@ static i40e_status i40e_del_macvlan_filter(struct i40e_hw *hw, u16 seid,
* This function adds a mac filter on the channel VSI which serves as the * This function adds a mac filter on the channel VSI which serves as the
* macvlan. Returns 0 on success. * macvlan. Returns 0 on success.
**/ **/
static i40e_status i40e_add_macvlan_filter(struct i40e_hw *hw, u16 seid, static int i40e_add_macvlan_filter(struct i40e_hw *hw, u16 seid,
const u8 *macaddr, int *aq_err) const u8 *macaddr, int *aq_err)
{ {
struct i40e_aqc_add_macvlan_element_data element; struct i40e_aqc_add_macvlan_element_data element;
i40e_status status;
u16 cmd_flags = 0; u16 cmd_flags = 0;
int status;
ether_addr_copy(element.mac_addr, macaddr); ether_addr_copy(element.mac_addr, macaddr);
element.vlan_tag = 0; element.vlan_tag = 0;
...@@ -7834,8 +7834,8 @@ static int i40e_fwd_ring_up(struct i40e_vsi *vsi, struct net_device *vdev, ...@@ -7834,8 +7834,8 @@ static int i40e_fwd_ring_up(struct i40e_vsi *vsi, struct net_device *vdev,
rx_ring->netdev = NULL; rx_ring->netdev = NULL;
} }
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Error adding mac filter on macvlan err %s, aq_err %s\n", "Error adding mac filter on macvlan err %pe, aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, aq_err)); i40e_aq_str(hw, aq_err));
netdev_err(vdev, "L2fwd offload disabled to L2 filter error\n"); netdev_err(vdev, "L2fwd offload disabled to L2 filter error\n");
} }
...@@ -7907,8 +7907,8 @@ static int i40e_setup_macvlans(struct i40e_vsi *vsi, u16 macvlan_cnt, u16 qcnt, ...@@ -7907,8 +7907,8 @@ static int i40e_setup_macvlans(struct i40e_vsi *vsi, u16 macvlan_cnt, u16 qcnt,
ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Update vsi tc config failed, err %s aq_err %s\n", "Update vsi tc config failed, err %pe aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
return ret; return ret;
} }
...@@ -8123,8 +8123,8 @@ static void i40e_fwd_del(struct net_device *netdev, void *vdev) ...@@ -8123,8 +8123,8 @@ static void i40e_fwd_del(struct net_device *netdev, void *vdev)
ch->fwd = NULL; ch->fwd = NULL;
} else { } else {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Error deleting mac filter on macvlan err %s, aq_err %s\n", "Error deleting mac filter on macvlan err %pe, aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, aq_err)); i40e_aq_str(hw, aq_err));
} }
break; break;
...@@ -8875,8 +8875,8 @@ static int i40e_delete_clsflower(struct i40e_vsi *vsi, ...@@ -8875,8 +8875,8 @@ static int i40e_delete_clsflower(struct i40e_vsi *vsi,
kfree(filter); kfree(filter);
if (err) { if (err) {
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"Failed to delete cloud filter, err %s\n", "Failed to delete cloud filter, err %pe\n",
i40e_stat_str(&pf->hw, err)); ERR_PTR(err));
return i40e_aq_rc_to_posix(err, pf->hw.aq.asq_last_status); return i40e_aq_rc_to_posix(err, pf->hw.aq.asq_last_status);
} }
...@@ -9438,8 +9438,8 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, ...@@ -9438,8 +9438,8 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
pf->flags &= ~I40E_FLAG_DCB_CAPABLE; pf->flags &= ~I40E_FLAG_DCB_CAPABLE;
} else { } else {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Failed querying DCB configuration data from firmware, err %s aq_err %s\n", "Failed querying DCB configuration data from firmware, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
} }
...@@ -9887,8 +9887,8 @@ static void i40e_link_event(struct i40e_pf *pf) ...@@ -9887,8 +9887,8 @@ static void i40e_link_event(struct i40e_pf *pf)
{ {
struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi]; struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
u8 new_link_speed, old_link_speed; u8 new_link_speed, old_link_speed;
i40e_status status;
bool new_link, old_link; bool new_link, old_link;
int status;
#ifdef CONFIG_I40E_DCB #ifdef CONFIG_I40E_DCB
int err; int err;
#endif /* CONFIG_I40E_DCB */ #endif /* CONFIG_I40E_DCB */
...@@ -10099,9 +10099,9 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf) ...@@ -10099,9 +10099,9 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
struct i40e_arq_event_info event; struct i40e_arq_event_info event;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
u16 pending, i = 0; u16 pending, i = 0;
i40e_status ret;
u16 opcode; u16 opcode;
u32 oldval; u32 oldval;
int ret;
u32 val; u32 val;
/* Do not run clean AQ when PF reset fails */ /* Do not run clean AQ when PF reset fails */
...@@ -10265,8 +10265,8 @@ static void i40e_enable_pf_switch_lb(struct i40e_pf *pf) ...@@ -10265,8 +10265,8 @@ static void i40e_enable_pf_switch_lb(struct i40e_pf *pf)
ret = i40e_aq_get_vsi_params(&pf->hw, &ctxt, NULL); ret = i40e_aq_get_vsi_params(&pf->hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't get PF vsi config, err %s aq_err %s\n", "couldn't get PF vsi config, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return; return;
} }
...@@ -10277,8 +10277,8 @@ static void i40e_enable_pf_switch_lb(struct i40e_pf *pf) ...@@ -10277,8 +10277,8 @@ static void i40e_enable_pf_switch_lb(struct i40e_pf *pf)
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL); ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"update vsi switch failed, err %s aq_err %s\n", "update vsi switch failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
} }
} }
...@@ -10301,8 +10301,8 @@ static void i40e_disable_pf_switch_lb(struct i40e_pf *pf) ...@@ -10301,8 +10301,8 @@ static void i40e_disable_pf_switch_lb(struct i40e_pf *pf)
ret = i40e_aq_get_vsi_params(&pf->hw, &ctxt, NULL); ret = i40e_aq_get_vsi_params(&pf->hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't get PF vsi config, err %s aq_err %s\n", "couldn't get PF vsi config, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return; return;
} }
...@@ -10313,8 +10313,8 @@ static void i40e_disable_pf_switch_lb(struct i40e_pf *pf) ...@@ -10313,8 +10313,8 @@ static void i40e_disable_pf_switch_lb(struct i40e_pf *pf)
ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL); ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"update vsi switch failed, err %s aq_err %s\n", "update vsi switch failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
} }
} }
...@@ -10458,8 +10458,8 @@ static int i40e_get_capabilities(struct i40e_pf *pf, ...@@ -10458,8 +10458,8 @@ static int i40e_get_capabilities(struct i40e_pf *pf,
buf_len = data_size; buf_len = data_size;
} else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK || err) { } else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK || err) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"capability discovery failed, err %s aq_err %s\n", "capability discovery failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, err), ERR_PTR(err),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
return -ENODEV; return -ENODEV;
...@@ -10580,7 +10580,7 @@ static int i40e_rebuild_cloud_filters(struct i40e_vsi *vsi, u16 seid) ...@@ -10580,7 +10580,7 @@ static int i40e_rebuild_cloud_filters(struct i40e_vsi *vsi, u16 seid)
struct i40e_cloud_filter *cfilter; struct i40e_cloud_filter *cfilter;
struct i40e_pf *pf = vsi->back; struct i40e_pf *pf = vsi->back;
struct hlist_node *node; struct hlist_node *node;
i40e_status ret; int ret;
/* Add cloud filters back if they exist */ /* Add cloud filters back if they exist */
hlist_for_each_entry_safe(cfilter, node, &pf->cloud_filter_list, hlist_for_each_entry_safe(cfilter, node, &pf->cloud_filter_list,
...@@ -10596,8 +10596,8 @@ static int i40e_rebuild_cloud_filters(struct i40e_vsi *vsi, u16 seid) ...@@ -10596,8 +10596,8 @@ static int i40e_rebuild_cloud_filters(struct i40e_vsi *vsi, u16 seid)
if (ret) { if (ret) {
dev_dbg(&pf->pdev->dev, dev_dbg(&pf->pdev->dev,
"Failed to rebuild cloud filter, err %s aq_err %s\n", "Failed to rebuild cloud filter, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
return ret; return ret;
...@@ -10615,7 +10615,7 @@ static int i40e_rebuild_cloud_filters(struct i40e_vsi *vsi, u16 seid) ...@@ -10615,7 +10615,7 @@ static int i40e_rebuild_cloud_filters(struct i40e_vsi *vsi, u16 seid)
static int i40e_rebuild_channels(struct i40e_vsi *vsi) static int i40e_rebuild_channels(struct i40e_vsi *vsi)
{ {
struct i40e_channel *ch, *ch_tmp; struct i40e_channel *ch, *ch_tmp;
i40e_status ret; int ret;
if (list_empty(&vsi->ch_list)) if (list_empty(&vsi->ch_list))
return 0; return 0;
...@@ -10691,7 +10691,7 @@ static void i40e_clean_xps_state(struct i40e_vsi *vsi) ...@@ -10691,7 +10691,7 @@ static void i40e_clean_xps_state(struct i40e_vsi *vsi)
static void i40e_prep_for_reset(struct i40e_pf *pf) static void i40e_prep_for_reset(struct i40e_pf *pf)
{ {
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status ret = 0; int ret = 0;
u32 v; u32 v;
clear_bit(__I40E_RESET_INTR_RECEIVED, pf->state); clear_bit(__I40E_RESET_INTR_RECEIVED, pf->state);
...@@ -10796,7 +10796,7 @@ static void i40e_get_oem_version(struct i40e_hw *hw) ...@@ -10796,7 +10796,7 @@ static void i40e_get_oem_version(struct i40e_hw *hw)
static int i40e_reset(struct i40e_pf *pf) static int i40e_reset(struct i40e_pf *pf)
{ {
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status ret; int ret;
ret = i40e_pf_reset(hw); ret = i40e_pf_reset(hw);
if (ret) { if (ret) {
...@@ -10821,7 +10821,7 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) ...@@ -10821,7 +10821,7 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
const bool is_recovery_mode_reported = i40e_check_recovery_mode(pf); const bool is_recovery_mode_reported = i40e_check_recovery_mode(pf);
struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi]; struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status ret; int ret;
u32 val; u32 val;
int v; int v;
...@@ -10837,8 +10837,8 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) ...@@ -10837,8 +10837,8 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
/* rebuild the basics for the AdminQ, HMC, and initial HW switch */ /* rebuild the basics for the AdminQ, HMC, and initial HW switch */
ret = i40e_init_adminq(&pf->hw); ret = i40e_init_adminq(&pf->hw);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, "Rebuild AdminQ failed, err %s aq_err %s\n", dev_info(&pf->pdev->dev, "Rebuild AdminQ failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
goto clear_recovery; goto clear_recovery;
} }
...@@ -10949,8 +10949,8 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) ...@@ -10949,8 +10949,8 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
I40E_AQ_EVENT_MEDIA_NA | I40E_AQ_EVENT_MEDIA_NA |
I40E_AQ_EVENT_MODULE_QUAL_FAIL), NULL); I40E_AQ_EVENT_MODULE_QUAL_FAIL), NULL);
if (ret) if (ret)
dev_info(&pf->pdev->dev, "set phy mask fail, err %s aq_err %s\n", dev_info(&pf->pdev->dev, "set phy mask fail, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
/* Rebuild the VSIs and VEBs that existed before reset. /* Rebuild the VSIs and VEBs that existed before reset.
...@@ -11053,8 +11053,8 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) ...@@ -11053,8 +11053,8 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
msleep(75); msleep(75);
ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL); ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
if (ret) if (ret)
dev_info(&pf->pdev->dev, "link restart failed, err %s aq_err %s\n", dev_info(&pf->pdev->dev, "link restart failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
} }
...@@ -11082,9 +11082,9 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) ...@@ -11082,9 +11082,9 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
ret = i40e_set_promiscuous(pf, pf->cur_promisc); ret = i40e_set_promiscuous(pf, pf->cur_promisc);
if (ret) if (ret)
dev_warn(&pf->pdev->dev, dev_warn(&pf->pdev->dev,
"Failed to restore promiscuous setting: %s, err %s aq_err %s\n", "Failed to restore promiscuous setting: %s, err %pe aq_err %s\n",
pf->cur_promisc ? "on" : "off", pf->cur_promisc ? "on" : "off",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
i40e_reset_all_vfs(pf, true); i40e_reset_all_vfs(pf, true);
...@@ -12218,8 +12218,8 @@ static int i40e_get_rss_aq(struct i40e_vsi *vsi, const u8 *seed, ...@@ -12218,8 +12218,8 @@ static int i40e_get_rss_aq(struct i40e_vsi *vsi, const u8 *seed,
(struct i40e_aqc_get_set_rss_key_data *)seed); (struct i40e_aqc_get_set_rss_key_data *)seed);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Cannot get RSS key, err %s aq_err %s\n", "Cannot get RSS key, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
return ret; return ret;
...@@ -12232,8 +12232,8 @@ static int i40e_get_rss_aq(struct i40e_vsi *vsi, const u8 *seed, ...@@ -12232,8 +12232,8 @@ static int i40e_get_rss_aq(struct i40e_vsi *vsi, const u8 *seed,
ret = i40e_aq_get_rss_lut(hw, vsi->id, pf_lut, lut, lut_size); ret = i40e_aq_get_rss_lut(hw, vsi->id, pf_lut, lut, lut_size);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Cannot get RSS lut, err %s aq_err %s\n", "Cannot get RSS lut, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
return ret; return ret;
...@@ -12508,11 +12508,11 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count) ...@@ -12508,11 +12508,11 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)
* i40e_get_partition_bw_setting - Retrieve BW settings for this PF partition * i40e_get_partition_bw_setting - Retrieve BW settings for this PF partition
* @pf: board private structure * @pf: board private structure
**/ **/
i40e_status i40e_get_partition_bw_setting(struct i40e_pf *pf) int i40e_get_partition_bw_setting(struct i40e_pf *pf)
{ {
i40e_status status;
bool min_valid, max_valid; bool min_valid, max_valid;
u32 max_bw, min_bw; u32 max_bw, min_bw;
int status;
status = i40e_read_bw_from_alt_ram(&pf->hw, &max_bw, &min_bw, status = i40e_read_bw_from_alt_ram(&pf->hw, &max_bw, &min_bw,
&min_valid, &max_valid); &min_valid, &max_valid);
...@@ -12531,10 +12531,10 @@ i40e_status i40e_get_partition_bw_setting(struct i40e_pf *pf) ...@@ -12531,10 +12531,10 @@ i40e_status i40e_get_partition_bw_setting(struct i40e_pf *pf)
* i40e_set_partition_bw_setting - Set BW settings for this PF partition * i40e_set_partition_bw_setting - Set BW settings for this PF partition
* @pf: board private structure * @pf: board private structure
**/ **/
i40e_status i40e_set_partition_bw_setting(struct i40e_pf *pf) int i40e_set_partition_bw_setting(struct i40e_pf *pf)
{ {
struct i40e_aqc_configure_partition_bw_data bw_data; struct i40e_aqc_configure_partition_bw_data bw_data;
i40e_status status; int status;
memset(&bw_data, 0, sizeof(bw_data)); memset(&bw_data, 0, sizeof(bw_data));
...@@ -12553,12 +12553,12 @@ i40e_status i40e_set_partition_bw_setting(struct i40e_pf *pf) ...@@ -12553,12 +12553,12 @@ i40e_status i40e_set_partition_bw_setting(struct i40e_pf *pf)
* i40e_commit_partition_bw_setting - Commit BW settings for this PF partition * i40e_commit_partition_bw_setting - Commit BW settings for this PF partition
* @pf: board private structure * @pf: board private structure
**/ **/
i40e_status i40e_commit_partition_bw_setting(struct i40e_pf *pf) int i40e_commit_partition_bw_setting(struct i40e_pf *pf)
{ {
/* Commit temporary BW setting to permanent NVM image */ /* Commit temporary BW setting to permanent NVM image */
enum i40e_admin_queue_err last_aq_status; enum i40e_admin_queue_err last_aq_status;
i40e_status ret;
u16 nvm_word; u16 nvm_word;
int ret;
if (pf->hw.partition_id != 1) { if (pf->hw.partition_id != 1) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
...@@ -12573,8 +12573,8 @@ i40e_status i40e_commit_partition_bw_setting(struct i40e_pf *pf) ...@@ -12573,8 +12573,8 @@ i40e_status i40e_commit_partition_bw_setting(struct i40e_pf *pf)
last_aq_status = pf->hw.aq.asq_last_status; last_aq_status = pf->hw.aq.asq_last_status;
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Cannot acquire NVM for read access, err %s aq_err %s\n", "Cannot acquire NVM for read access, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, last_aq_status)); i40e_aq_str(&pf->hw, last_aq_status));
goto bw_commit_out; goto bw_commit_out;
} }
...@@ -12590,8 +12590,8 @@ i40e_status i40e_commit_partition_bw_setting(struct i40e_pf *pf) ...@@ -12590,8 +12590,8 @@ i40e_status i40e_commit_partition_bw_setting(struct i40e_pf *pf)
last_aq_status = pf->hw.aq.asq_last_status; last_aq_status = pf->hw.aq.asq_last_status;
i40e_release_nvm(&pf->hw); i40e_release_nvm(&pf->hw);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, "NVM read error, err %s aq_err %s\n", dev_info(&pf->pdev->dev, "NVM read error, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, last_aq_status)); i40e_aq_str(&pf->hw, last_aq_status));
goto bw_commit_out; goto bw_commit_out;
} }
...@@ -12604,8 +12604,8 @@ i40e_status i40e_commit_partition_bw_setting(struct i40e_pf *pf) ...@@ -12604,8 +12604,8 @@ i40e_status i40e_commit_partition_bw_setting(struct i40e_pf *pf)
last_aq_status = pf->hw.aq.asq_last_status; last_aq_status = pf->hw.aq.asq_last_status;
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"Cannot acquire NVM for write access, err %s aq_err %s\n", "Cannot acquire NVM for write access, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, last_aq_status)); i40e_aq_str(&pf->hw, last_aq_status));
goto bw_commit_out; goto bw_commit_out;
} }
...@@ -12624,8 +12624,8 @@ i40e_status i40e_commit_partition_bw_setting(struct i40e_pf *pf) ...@@ -12624,8 +12624,8 @@ i40e_status i40e_commit_partition_bw_setting(struct i40e_pf *pf)
i40e_release_nvm(&pf->hw); i40e_release_nvm(&pf->hw);
if (ret) if (ret)
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"BW settings NOT SAVED, err %s aq_err %s\n", "BW settings NOT SAVED, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, last_aq_status)); i40e_aq_str(&pf->hw, last_aq_status));
bw_commit_out: bw_commit_out:
...@@ -12646,7 +12646,7 @@ static bool i40e_is_total_port_shutdown_enabled(struct i40e_pf *pf) ...@@ -12646,7 +12646,7 @@ static bool i40e_is_total_port_shutdown_enabled(struct i40e_pf *pf)
#define I40E_LINK_BEHAVIOR_WORD_LENGTH 0x1 #define I40E_LINK_BEHAVIOR_WORD_LENGTH 0x1
#define I40E_LINK_BEHAVIOR_OS_FORCED_ENABLED BIT(0) #define I40E_LINK_BEHAVIOR_OS_FORCED_ENABLED BIT(0)
#define I40E_LINK_BEHAVIOR_PORT_BIT_LENGTH 4 #define I40E_LINK_BEHAVIOR_PORT_BIT_LENGTH 4
i40e_status read_status = I40E_SUCCESS; int read_status = I40E_SUCCESS;
u16 sr_emp_sr_settings_ptr = 0; u16 sr_emp_sr_settings_ptr = 0;
u16 features_enable = 0; u16 features_enable = 0;
u16 link_behavior = 0; u16 link_behavior = 0;
...@@ -12679,8 +12679,8 @@ static bool i40e_is_total_port_shutdown_enabled(struct i40e_pf *pf) ...@@ -12679,8 +12679,8 @@ static bool i40e_is_total_port_shutdown_enabled(struct i40e_pf *pf)
err_nvm: err_nvm:
dev_warn(&pf->pdev->dev, dev_warn(&pf->pdev->dev,
"total-port-shutdown feature is off due to read nvm error: %s\n", "total-port-shutdown feature is off due to read nvm error: %pe\n",
i40e_stat_str(&pf->hw, read_status)); ERR_PTR(read_status));
return ret; return ret;
} }
...@@ -13025,7 +13025,7 @@ static int i40e_udp_tunnel_set_port(struct net_device *netdev, ...@@ -13025,7 +13025,7 @@ static int i40e_udp_tunnel_set_port(struct net_device *netdev,
struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_hw *hw = &np->vsi->back->hw; struct i40e_hw *hw = &np->vsi->back->hw;
u8 type, filter_index; u8 type, filter_index;
i40e_status ret; int ret;
type = ti->type == UDP_TUNNEL_TYPE_VXLAN ? I40E_AQC_TUNNEL_TYPE_VXLAN : type = ti->type == UDP_TUNNEL_TYPE_VXLAN ? I40E_AQC_TUNNEL_TYPE_VXLAN :
I40E_AQC_TUNNEL_TYPE_NGE; I40E_AQC_TUNNEL_TYPE_NGE;
...@@ -13033,8 +13033,8 @@ static int i40e_udp_tunnel_set_port(struct net_device *netdev, ...@@ -13033,8 +13033,8 @@ static int i40e_udp_tunnel_set_port(struct net_device *netdev,
ret = i40e_aq_add_udp_tunnel(hw, ntohs(ti->port), type, &filter_index, ret = i40e_aq_add_udp_tunnel(hw, ntohs(ti->port), type, &filter_index,
NULL); NULL);
if (ret) { if (ret) {
netdev_info(netdev, "add UDP port failed, err %s aq_err %s\n", netdev_info(netdev, "add UDP port failed, err %pe aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
return -EIO; return -EIO;
} }
...@@ -13049,12 +13049,12 @@ static int i40e_udp_tunnel_unset_port(struct net_device *netdev, ...@@ -13049,12 +13049,12 @@ static int i40e_udp_tunnel_unset_port(struct net_device *netdev,
{ {
struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_hw *hw = &np->vsi->back->hw; struct i40e_hw *hw = &np->vsi->back->hw;
i40e_status ret; int ret;
ret = i40e_aq_del_udp_tunnel(hw, ti->hw_priv, NULL); ret = i40e_aq_del_udp_tunnel(hw, ti->hw_priv, NULL);
if (ret) { if (ret) {
netdev_info(netdev, "delete UDP port failed, err %s aq_err %s\n", netdev_info(netdev, "delete UDP port failed, err %pe aq_err %s\n",
i40e_stat_str(hw, ret), ERR_PTR(ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
return -EIO; return -EIO;
} }
...@@ -13947,8 +13947,8 @@ static int i40e_add_vsi(struct i40e_vsi *vsi) ...@@ -13947,8 +13947,8 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
ctxt.flags = I40E_AQ_VSI_TYPE_PF; ctxt.flags = I40E_AQ_VSI_TYPE_PF;
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't get PF vsi config, err %s aq_err %s\n", "couldn't get PF vsi config, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
return -ENOENT; return -ENOENT;
...@@ -13977,8 +13977,8 @@ static int i40e_add_vsi(struct i40e_vsi *vsi) ...@@ -13977,8 +13977,8 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"update vsi failed, err %s aq_err %s\n", "update vsi failed, err %d aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ret,
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
ret = -ENOENT; ret = -ENOENT;
...@@ -13997,8 +13997,8 @@ static int i40e_add_vsi(struct i40e_vsi *vsi) ...@@ -13997,8 +13997,8 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"update vsi failed, err %s aq_err %s\n", "update vsi failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
ret = -ENOENT; ret = -ENOENT;
...@@ -14020,9 +14020,9 @@ static int i40e_add_vsi(struct i40e_vsi *vsi) ...@@ -14020,9 +14020,9 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
* message and continue * message and continue
*/ */
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"failed to configure TCs for main VSI tc_map 0x%08x, err %s aq_err %s\n", "failed to configure TCs for main VSI tc_map 0x%08x, err %pe aq_err %s\n",
enabled_tc, enabled_tc,
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
} }
...@@ -14116,8 +14116,8 @@ static int i40e_add_vsi(struct i40e_vsi *vsi) ...@@ -14116,8 +14116,8 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
ret = i40e_aq_add_vsi(hw, &ctxt, NULL); ret = i40e_aq_add_vsi(hw, &ctxt, NULL);
if (ret) { if (ret) {
dev_info(&vsi->back->pdev->dev, dev_info(&vsi->back->pdev->dev,
"add vsi failed, err %s aq_err %s\n", "add vsi failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
ret = -ENOENT; ret = -ENOENT;
...@@ -14148,8 +14148,8 @@ static int i40e_add_vsi(struct i40e_vsi *vsi) ...@@ -14148,8 +14148,8 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
ret = i40e_vsi_get_bw_info(vsi); ret = i40e_vsi_get_bw_info(vsi);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't get vsi bw info, err %s aq_err %s\n", "couldn't get vsi bw info, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
/* VSI is already added so not tearing that up */ /* VSI is already added so not tearing that up */
ret = 0; ret = 0;
...@@ -14595,8 +14595,8 @@ static int i40e_veb_get_bw_info(struct i40e_veb *veb) ...@@ -14595,8 +14595,8 @@ static int i40e_veb_get_bw_info(struct i40e_veb *veb)
&bw_data, NULL); &bw_data, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"query veb bw config failed, err %s aq_err %s\n", "query veb bw config failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, hw->aq.asq_last_status)); i40e_aq_str(&pf->hw, hw->aq.asq_last_status));
goto out; goto out;
} }
...@@ -14605,8 +14605,8 @@ static int i40e_veb_get_bw_info(struct i40e_veb *veb) ...@@ -14605,8 +14605,8 @@ static int i40e_veb_get_bw_info(struct i40e_veb *veb)
&ets_data, NULL); &ets_data, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"query veb bw ets config failed, err %s aq_err %s\n", "query veb bw ets config failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, hw->aq.asq_last_status)); i40e_aq_str(&pf->hw, hw->aq.asq_last_status));
goto out; goto out;
} }
...@@ -14802,8 +14802,8 @@ static int i40e_add_veb(struct i40e_veb *veb, struct i40e_vsi *vsi) ...@@ -14802,8 +14802,8 @@ static int i40e_add_veb(struct i40e_veb *veb, struct i40e_vsi *vsi)
/* get a VEB from the hardware */ /* get a VEB from the hardware */
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't add VEB, err %s aq_err %s\n", "couldn't add VEB, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return -EPERM; return -EPERM;
} }
...@@ -14813,16 +14813,16 @@ static int i40e_add_veb(struct i40e_veb *veb, struct i40e_vsi *vsi) ...@@ -14813,16 +14813,16 @@ static int i40e_add_veb(struct i40e_veb *veb, struct i40e_vsi *vsi)
&veb->stats_idx, NULL, NULL, NULL); &veb->stats_idx, NULL, NULL, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't get VEB statistics idx, err %s aq_err %s\n", "couldn't get VEB statistics idx, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return -EPERM; return -EPERM;
} }
ret = i40e_veb_get_bw_info(veb); ret = i40e_veb_get_bw_info(veb);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't get VEB bw info, err %s aq_err %s\n", "couldn't get VEB bw info, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
i40e_aq_delete_element(&pf->hw, veb->seid, NULL); i40e_aq_delete_element(&pf->hw, veb->seid, NULL);
return -ENOENT; return -ENOENT;
...@@ -15032,8 +15032,8 @@ int i40e_fetch_switch_configuration(struct i40e_pf *pf, bool printconfig) ...@@ -15032,8 +15032,8 @@ int i40e_fetch_switch_configuration(struct i40e_pf *pf, bool printconfig)
&next_seid, NULL); &next_seid, NULL);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"get switch config failed err %s aq_err %s\n", "get switch config failed err %d aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ret,
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
kfree(aq_buf); kfree(aq_buf);
...@@ -15078,8 +15078,8 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acqui ...@@ -15078,8 +15078,8 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acqui
ret = i40e_fetch_switch_configuration(pf, false); ret = i40e_fetch_switch_configuration(pf, false);
if (ret) { if (ret) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't fetch switch config, err %s aq_err %s\n", "couldn't fetch switch config, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
return ret; return ret;
} }
...@@ -15105,8 +15105,8 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acqui ...@@ -15105,8 +15105,8 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acqui
NULL); NULL);
if (ret && pf->hw.aq.asq_last_status != I40E_AQ_RC_ESRCH) { if (ret && pf->hw.aq.asq_last_status != I40E_AQ_RC_ESRCH) {
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"couldn't set switch config bits, err %s aq_err %s\n", "couldn't set switch config bits, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, ret), ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
/* not a fatal problem, just keep going */ /* not a fatal problem, just keep going */
...@@ -15443,13 +15443,12 @@ static bool i40e_check_recovery_mode(struct i40e_pf *pf) ...@@ -15443,13 +15443,12 @@ static bool i40e_check_recovery_mode(struct i40e_pf *pf)
* *
* Return 0 on success, negative on failure. * Return 0 on success, negative on failure.
**/ **/
static i40e_status i40e_pf_loop_reset(struct i40e_pf *pf) static int i40e_pf_loop_reset(struct i40e_pf *pf)
{ {
/* wait max 10 seconds for PF reset to succeed */ /* wait max 10 seconds for PF reset to succeed */
const unsigned long time_end = jiffies + 10 * HZ; const unsigned long time_end = jiffies + 10 * HZ;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status ret; int ret;
ret = i40e_pf_reset(hw); ret = i40e_pf_reset(hw);
while (ret != I40E_SUCCESS && time_before(jiffies, time_end)) { while (ret != I40E_SUCCESS && time_before(jiffies, time_end)) {
...@@ -15495,9 +15494,9 @@ static bool i40e_check_fw_empr(struct i40e_pf *pf) ...@@ -15495,9 +15494,9 @@ static bool i40e_check_fw_empr(struct i40e_pf *pf)
* Return 0 if NIC is healthy or negative value when there are issues * Return 0 if NIC is healthy or negative value when there are issues
* with resets * with resets
**/ **/
static i40e_status i40e_handle_resets(struct i40e_pf *pf) static int i40e_handle_resets(struct i40e_pf *pf)
{ {
const i40e_status pfr = i40e_pf_loop_reset(pf); const int pfr = i40e_pf_loop_reset(pf);
const bool is_empr = i40e_check_fw_empr(pf); const bool is_empr = i40e_check_fw_empr(pf);
if (is_empr || pfr != I40E_SUCCESS) if (is_empr || pfr != I40E_SUCCESS)
...@@ -15634,13 +15633,15 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -15634,13 +15633,15 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct i40e_aq_get_phy_abilities_resp abilities; struct i40e_aq_get_phy_abilities_resp abilities;
#ifdef CONFIG_I40E_DCB #ifdef CONFIG_I40E_DCB
enum i40e_get_fw_lldp_status_resp lldp_status; enum i40e_get_fw_lldp_status_resp lldp_status;
i40e_status status;
#endif /* CONFIG_I40E_DCB */ #endif /* CONFIG_I40E_DCB */
struct i40e_pf *pf; struct i40e_pf *pf;
struct i40e_hw *hw; struct i40e_hw *hw;
static u16 pfs_found; static u16 pfs_found;
u16 wol_nvm_bits; u16 wol_nvm_bits;
u16 link_status; u16 link_status;
#ifdef CONFIG_I40E_DCB
int status;
#endif /* CONFIG_I40E_DCB */
int err; int err;
u32 val; u32 val;
u32 i; u32 i;
...@@ -16008,8 +16009,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -16008,8 +16009,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
I40E_AQ_EVENT_MEDIA_NA | I40E_AQ_EVENT_MEDIA_NA |
I40E_AQ_EVENT_MODULE_QUAL_FAIL), NULL); I40E_AQ_EVENT_MODULE_QUAL_FAIL), NULL);
if (err) if (err)
dev_info(&pf->pdev->dev, "set phy mask fail, err %s aq_err %s\n", dev_info(&pf->pdev->dev, "set phy mask fail, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, err), ERR_PTR(err),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
/* Reconfigure hardware for allowing smaller MSS in the case /* Reconfigure hardware for allowing smaller MSS in the case
...@@ -16027,8 +16028,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -16027,8 +16028,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
msleep(75); msleep(75);
err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL); err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
if (err) if (err)
dev_info(&pf->pdev->dev, "link restart failed, err %s aq_err %s\n", dev_info(&pf->pdev->dev, "link restart failed, err %pe aq_err %s\n",
i40e_stat_str(&pf->hw, err), ERR_PTR(err),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
} }
...@@ -16160,8 +16161,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -16160,8 +16161,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* get the requested speeds from the fw */ /* get the requested speeds from the fw */
err = i40e_aq_get_phy_capabilities(hw, false, false, &abilities, NULL); err = i40e_aq_get_phy_capabilities(hw, false, false, &abilities, NULL);
if (err) if (err)
dev_dbg(&pf->pdev->dev, "get requested speeds ret = %s last_status = %s\n", dev_dbg(&pf->pdev->dev, "get requested speeds ret = %pe last_status = %s\n",
i40e_stat_str(&pf->hw, err), ERR_PTR(err),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
pf->hw.phy.link_info.requested_speeds = abilities.link_speed; pf->hw.phy.link_info.requested_speeds = abilities.link_speed;
...@@ -16171,8 +16172,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -16171,8 +16172,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* get the supported phy types from the fw */ /* get the supported phy types from the fw */
err = i40e_aq_get_phy_capabilities(hw, false, true, &abilities, NULL); err = i40e_aq_get_phy_capabilities(hw, false, true, &abilities, NULL);
if (err) if (err)
dev_dbg(&pf->pdev->dev, "get supported phy types ret = %s last_status = %s\n", dev_dbg(&pf->pdev->dev, "get supported phy types ret = %pe last_status = %s\n",
i40e_stat_str(&pf->hw, err), ERR_PTR(err),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
/* make sure the MFS hasn't been set lower than the default */ /* make sure the MFS hasn't been set lower than the default */
...@@ -16242,7 +16243,7 @@ static void i40e_remove(struct pci_dev *pdev) ...@@ -16242,7 +16243,7 @@ static void i40e_remove(struct pci_dev *pdev)
{ {
struct i40e_pf *pf = pci_get_drvdata(pdev); struct i40e_pf *pf = pci_get_drvdata(pdev);
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status ret_code; int ret_code;
int i; int i;
i40e_dbg_pf_exit(pf); i40e_dbg_pf_exit(pf);
...@@ -16489,9 +16490,9 @@ static void i40e_pci_error_resume(struct pci_dev *pdev) ...@@ -16489,9 +16490,9 @@ static void i40e_pci_error_resume(struct pci_dev *pdev)
static void i40e_enable_mc_magic_wake(struct i40e_pf *pf) static void i40e_enable_mc_magic_wake(struct i40e_pf *pf)
{ {
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status ret;
u8 mac_addr[6]; u8 mac_addr[6];
u16 flags = 0; u16 flags = 0;
int ret;
/* Get current MAC address in case it's an LAA */ /* Get current MAC address in case it's an LAA */
if (pf->vsi[pf->lan_vsi] && pf->vsi[pf->lan_vsi]->netdev) { if (pf->vsi[pf->lan_vsi] && pf->vsi[pf->lan_vsi]->netdev) {
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
* in this file) as an equivalent of the FLASH part mapped into the SR. * in this file) as an equivalent of the FLASH part mapped into the SR.
* We are accessing FLASH always thru the Shadow RAM. * We are accessing FLASH always thru the Shadow RAM.
**/ **/
i40e_status i40e_init_nvm(struct i40e_hw *hw) int i40e_init_nvm(struct i40e_hw *hw)
{ {
struct i40e_nvm_info *nvm = &hw->nvm; struct i40e_nvm_info *nvm = &hw->nvm;
i40e_status ret_code = 0; int ret_code = 0;
u32 fla, gens; u32 fla, gens;
u8 sr_size; u8 sr_size;
...@@ -52,12 +52,12 @@ i40e_status i40e_init_nvm(struct i40e_hw *hw) ...@@ -52,12 +52,12 @@ i40e_status i40e_init_nvm(struct i40e_hw *hw)
* This function will request NVM ownership for reading * This function will request NVM ownership for reading
* via the proper Admin Command. * via the proper Admin Command.
**/ **/
i40e_status i40e_acquire_nvm(struct i40e_hw *hw, int i40e_acquire_nvm(struct i40e_hw *hw,
enum i40e_aq_resource_access_type access) enum i40e_aq_resource_access_type access)
{ {
i40e_status ret_code = 0;
u64 gtime, timeout; u64 gtime, timeout;
u64 time_left = 0; u64 time_left = 0;
int ret_code = 0;
if (hw->nvm.blank_nvm_mode) if (hw->nvm.blank_nvm_mode)
goto i40e_i40e_acquire_nvm_exit; goto i40e_i40e_acquire_nvm_exit;
...@@ -111,7 +111,7 @@ i40e_status i40e_acquire_nvm(struct i40e_hw *hw, ...@@ -111,7 +111,7 @@ i40e_status i40e_acquire_nvm(struct i40e_hw *hw,
**/ **/
void i40e_release_nvm(struct i40e_hw *hw) void i40e_release_nvm(struct i40e_hw *hw)
{ {
i40e_status ret_code = I40E_SUCCESS; int ret_code = I40E_SUCCESS;
u32 total_delay = 0; u32 total_delay = 0;
if (hw->nvm.blank_nvm_mode) if (hw->nvm.blank_nvm_mode)
...@@ -138,9 +138,9 @@ void i40e_release_nvm(struct i40e_hw *hw) ...@@ -138,9 +138,9 @@ void i40e_release_nvm(struct i40e_hw *hw)
* *
* Polls the SRCTL Shadow RAM register done bit. * Polls the SRCTL Shadow RAM register done bit.
**/ **/
static i40e_status i40e_poll_sr_srctl_done_bit(struct i40e_hw *hw) static int i40e_poll_sr_srctl_done_bit(struct i40e_hw *hw)
{ {
i40e_status ret_code = I40E_ERR_TIMEOUT; int ret_code = I40E_ERR_TIMEOUT;
u32 srctl, wait_cnt; u32 srctl, wait_cnt;
/* Poll the I40E_GLNVM_SRCTL until the done bit is set */ /* Poll the I40E_GLNVM_SRCTL until the done bit is set */
...@@ -165,10 +165,10 @@ static i40e_status i40e_poll_sr_srctl_done_bit(struct i40e_hw *hw) ...@@ -165,10 +165,10 @@ static i40e_status i40e_poll_sr_srctl_done_bit(struct i40e_hw *hw)
* *
* Reads one 16 bit word from the Shadow RAM using the GLNVM_SRCTL register. * Reads one 16 bit word from the Shadow RAM using the GLNVM_SRCTL register.
**/ **/
static i40e_status i40e_read_nvm_word_srctl(struct i40e_hw *hw, u16 offset, static int i40e_read_nvm_word_srctl(struct i40e_hw *hw, u16 offset,
u16 *data) u16 *data)
{ {
i40e_status ret_code = I40E_ERR_TIMEOUT; int ret_code = I40E_ERR_TIMEOUT;
u32 sr_reg; u32 sr_reg;
if (offset >= hw->nvm.sr_size) { if (offset >= hw->nvm.sr_size) {
...@@ -216,13 +216,13 @@ static i40e_status i40e_read_nvm_word_srctl(struct i40e_hw *hw, u16 offset, ...@@ -216,13 +216,13 @@ static i40e_status i40e_read_nvm_word_srctl(struct i40e_hw *hw, u16 offset,
* *
* Writes a 16 bit words buffer to the Shadow RAM using the admin command. * Writes a 16 bit words buffer to the Shadow RAM using the admin command.
**/ **/
static i40e_status i40e_read_nvm_aq(struct i40e_hw *hw, static int i40e_read_nvm_aq(struct i40e_hw *hw,
u8 module_pointer, u32 offset, u8 module_pointer, u32 offset,
u16 words, void *data, u16 words, void *data,
bool last_command) bool last_command)
{ {
i40e_status ret_code = I40E_ERR_NVM;
struct i40e_asq_cmd_details cmd_details; struct i40e_asq_cmd_details cmd_details;
int ret_code = I40E_ERR_NVM;
memset(&cmd_details, 0, sizeof(cmd_details)); memset(&cmd_details, 0, sizeof(cmd_details));
cmd_details.wb_desc = &hw->nvm_wb_desc; cmd_details.wb_desc = &hw->nvm_wb_desc;
...@@ -264,10 +264,10 @@ static i40e_status i40e_read_nvm_aq(struct i40e_hw *hw, ...@@ -264,10 +264,10 @@ static i40e_status i40e_read_nvm_aq(struct i40e_hw *hw,
* *
* Reads one 16 bit word from the Shadow RAM using the AdminQ * Reads one 16 bit word from the Shadow RAM using the AdminQ
**/ **/
static i40e_status i40e_read_nvm_word_aq(struct i40e_hw *hw, u16 offset, static int i40e_read_nvm_word_aq(struct i40e_hw *hw, u16 offset,
u16 *data) u16 *data)
{ {
i40e_status ret_code = I40E_ERR_TIMEOUT; int ret_code = I40E_ERR_TIMEOUT;
ret_code = i40e_read_nvm_aq(hw, 0x0, offset, 1, data, true); ret_code = i40e_read_nvm_aq(hw, 0x0, offset, 1, data, true);
*data = le16_to_cpu(*(__le16 *)data); *data = le16_to_cpu(*(__le16 *)data);
...@@ -286,7 +286,7 @@ static i40e_status i40e_read_nvm_word_aq(struct i40e_hw *hw, u16 offset, ...@@ -286,7 +286,7 @@ static i40e_status i40e_read_nvm_word_aq(struct i40e_hw *hw, u16 offset,
* Do not use this function except in cases where the nvm lock is already * Do not use this function except in cases where the nvm lock is already
* taken via i40e_acquire_nvm(). * taken via i40e_acquire_nvm().
**/ **/
static i40e_status __i40e_read_nvm_word(struct i40e_hw *hw, static int __i40e_read_nvm_word(struct i40e_hw *hw,
u16 offset, u16 *data) u16 offset, u16 *data)
{ {
if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE)
...@@ -303,10 +303,10 @@ static i40e_status __i40e_read_nvm_word(struct i40e_hw *hw, ...@@ -303,10 +303,10 @@ static i40e_status __i40e_read_nvm_word(struct i40e_hw *hw,
* *
* Reads one 16 bit word from the Shadow RAM. * Reads one 16 bit word from the Shadow RAM.
**/ **/
i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset, int i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
u16 *data) u16 *data)
{ {
i40e_status ret_code = 0; int ret_code = 0;
if (hw->flags & I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK) if (hw->flags & I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK)
ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ); ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
...@@ -330,17 +330,17 @@ i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset, ...@@ -330,17 +330,17 @@ i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
* @words_data_size: Words to read from NVM * @words_data_size: Words to read from NVM
* @data_ptr: Pointer to memory location where resulting buffer will be stored * @data_ptr: Pointer to memory location where resulting buffer will be stored
**/ **/
enum i40e_status_code i40e_read_nvm_module_data(struct i40e_hw *hw, int i40e_read_nvm_module_data(struct i40e_hw *hw,
u8 module_ptr, u8 module_ptr,
u16 module_offset, u16 module_offset,
u16 data_offset, u16 data_offset,
u16 words_data_size, u16 words_data_size,
u16 *data_ptr) u16 *data_ptr)
{ {
i40e_status status;
u16 specific_ptr = 0; u16 specific_ptr = 0;
u16 ptr_value = 0; u16 ptr_value = 0;
u32 offset = 0; u32 offset = 0;
int status;
if (module_ptr != 0) { if (module_ptr != 0) {
status = i40e_read_nvm_word(hw, module_ptr, &ptr_value); status = i40e_read_nvm_word(hw, module_ptr, &ptr_value);
...@@ -406,10 +406,10 @@ enum i40e_status_code i40e_read_nvm_module_data(struct i40e_hw *hw, ...@@ -406,10 +406,10 @@ enum i40e_status_code i40e_read_nvm_module_data(struct i40e_hw *hw,
* method. The buffer read is preceded by the NVM ownership take * method. The buffer read is preceded by the NVM ownership take
* and followed by the release. * and followed by the release.
**/ **/
static i40e_status i40e_read_nvm_buffer_srctl(struct i40e_hw *hw, u16 offset, static int i40e_read_nvm_buffer_srctl(struct i40e_hw *hw, u16 offset,
u16 *words, u16 *data) u16 *words, u16 *data)
{ {
i40e_status ret_code = 0; int ret_code = 0;
u16 index, word; u16 index, word;
/* Loop thru the selected region */ /* Loop thru the selected region */
...@@ -437,13 +437,13 @@ static i40e_status i40e_read_nvm_buffer_srctl(struct i40e_hw *hw, u16 offset, ...@@ -437,13 +437,13 @@ static i40e_status i40e_read_nvm_buffer_srctl(struct i40e_hw *hw, u16 offset,
* method. The buffer read is preceded by the NVM ownership take * method. The buffer read is preceded by the NVM ownership take
* and followed by the release. * and followed by the release.
**/ **/
static i40e_status i40e_read_nvm_buffer_aq(struct i40e_hw *hw, u16 offset, static int i40e_read_nvm_buffer_aq(struct i40e_hw *hw, u16 offset,
u16 *words, u16 *data) u16 *words, u16 *data)
{ {
i40e_status ret_code;
u16 read_size;
bool last_cmd = false; bool last_cmd = false;
u16 words_read = 0; u16 words_read = 0;
u16 read_size;
int ret_code;
u16 i = 0; u16 i = 0;
do { do {
...@@ -493,7 +493,7 @@ static i40e_status i40e_read_nvm_buffer_aq(struct i40e_hw *hw, u16 offset, ...@@ -493,7 +493,7 @@ static i40e_status i40e_read_nvm_buffer_aq(struct i40e_hw *hw, u16 offset,
* Reads 16 bit words (data buffer) from the SR using the i40e_read_nvm_srrd() * Reads 16 bit words (data buffer) from the SR using the i40e_read_nvm_srrd()
* method. * method.
**/ **/
static i40e_status __i40e_read_nvm_buffer(struct i40e_hw *hw, static int __i40e_read_nvm_buffer(struct i40e_hw *hw,
u16 offset, u16 *words, u16 offset, u16 *words,
u16 *data) u16 *data)
{ {
...@@ -514,10 +514,10 @@ static i40e_status __i40e_read_nvm_buffer(struct i40e_hw *hw, ...@@ -514,10 +514,10 @@ static i40e_status __i40e_read_nvm_buffer(struct i40e_hw *hw,
* method. The buffer read is preceded by the NVM ownership take * method. The buffer read is preceded by the NVM ownership take
* and followed by the release. * and followed by the release.
**/ **/
i40e_status i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset, int i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,
u16 *words, u16 *data) u16 *words, u16 *data)
{ {
i40e_status ret_code = 0; int ret_code = 0;
if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) { if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) {
ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ); ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
...@@ -544,12 +544,12 @@ i40e_status i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset, ...@@ -544,12 +544,12 @@ i40e_status i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,
* *
* Writes a 16 bit words buffer to the Shadow RAM using the admin command. * Writes a 16 bit words buffer to the Shadow RAM using the admin command.
**/ **/
static i40e_status i40e_write_nvm_aq(struct i40e_hw *hw, u8 module_pointer, static int i40e_write_nvm_aq(struct i40e_hw *hw, u8 module_pointer,
u32 offset, u16 words, void *data, u32 offset, u16 words, void *data,
bool last_command) bool last_command)
{ {
i40e_status ret_code = I40E_ERR_NVM;
struct i40e_asq_cmd_details cmd_details; struct i40e_asq_cmd_details cmd_details;
int ret_code = I40E_ERR_NVM;
memset(&cmd_details, 0, sizeof(cmd_details)); memset(&cmd_details, 0, sizeof(cmd_details));
cmd_details.wb_desc = &hw->nvm_wb_desc; cmd_details.wb_desc = &hw->nvm_wb_desc;
...@@ -594,14 +594,14 @@ static i40e_status i40e_write_nvm_aq(struct i40e_hw *hw, u8 module_pointer, ...@@ -594,14 +594,14 @@ static i40e_status i40e_write_nvm_aq(struct i40e_hw *hw, u8 module_pointer,
* is customer specific and unknown. Therefore, this function skips all maximum * is customer specific and unknown. Therefore, this function skips all maximum
* possible size of VPD (1kB). * possible size of VPD (1kB).
**/ **/
static i40e_status i40e_calc_nvm_checksum(struct i40e_hw *hw, static int i40e_calc_nvm_checksum(struct i40e_hw *hw,
u16 *checksum) u16 *checksum)
{ {
i40e_status ret_code;
struct i40e_virt_mem vmem; struct i40e_virt_mem vmem;
u16 pcie_alt_module = 0; u16 pcie_alt_module = 0;
u16 checksum_local = 0; u16 checksum_local = 0;
u16 vpd_module = 0; u16 vpd_module = 0;
int ret_code;
u16 *data; u16 *data;
u16 i = 0; u16 i = 0;
...@@ -675,11 +675,11 @@ static i40e_status i40e_calc_nvm_checksum(struct i40e_hw *hw, ...@@ -675,11 +675,11 @@ static i40e_status i40e_calc_nvm_checksum(struct i40e_hw *hw,
* on ARQ completion event reception by caller. * on ARQ completion event reception by caller.
* This function will commit SR to NVM. * This function will commit SR to NVM.
**/ **/
i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw) int i40e_update_nvm_checksum(struct i40e_hw *hw)
{ {
i40e_status ret_code;
u16 checksum;
__le16 le_sum; __le16 le_sum;
int ret_code;
u16 checksum;
ret_code = i40e_calc_nvm_checksum(hw, &checksum); ret_code = i40e_calc_nvm_checksum(hw, &checksum);
if (!ret_code) { if (!ret_code) {
...@@ -699,12 +699,12 @@ i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw) ...@@ -699,12 +699,12 @@ i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw)
* Performs checksum calculation and validates the NVM SW checksum. If the * Performs checksum calculation and validates the NVM SW checksum. If the
* caller does not need checksum, the value can be NULL. * caller does not need checksum, the value can be NULL.
**/ **/
i40e_status i40e_validate_nvm_checksum(struct i40e_hw *hw, int i40e_validate_nvm_checksum(struct i40e_hw *hw,
u16 *checksum) u16 *checksum)
{ {
i40e_status ret_code = 0;
u16 checksum_sr = 0;
u16 checksum_local = 0; u16 checksum_local = 0;
u16 checksum_sr = 0;
int ret_code = 0;
/* We must acquire the NVM lock in order to correctly synchronize the /* We must acquire the NVM lock in order to correctly synchronize the
* NVM accesses across multiple PFs. Without doing so it is possible * NVM accesses across multiple PFs. Without doing so it is possible
...@@ -733,34 +733,34 @@ i40e_status i40e_validate_nvm_checksum(struct i40e_hw *hw, ...@@ -733,34 +733,34 @@ i40e_status i40e_validate_nvm_checksum(struct i40e_hw *hw,
return ret_code; return ret_code;
} }
static i40e_status i40e_nvmupd_state_init(struct i40e_hw *hw, static int i40e_nvmupd_state_init(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno); u8 *bytes, int *perrno);
static i40e_status i40e_nvmupd_state_reading(struct i40e_hw *hw, static int i40e_nvmupd_state_reading(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno); u8 *bytes, int *perrno);
static i40e_status i40e_nvmupd_state_writing(struct i40e_hw *hw, static int i40e_nvmupd_state_writing(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *errno); u8 *bytes, int *errno);
static enum i40e_nvmupd_cmd i40e_nvmupd_validate_command(struct i40e_hw *hw, static enum i40e_nvmupd_cmd i40e_nvmupd_validate_command(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
int *perrno); int *perrno);
static i40e_status i40e_nvmupd_nvm_erase(struct i40e_hw *hw, static int i40e_nvmupd_nvm_erase(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
int *perrno); int *perrno);
static i40e_status i40e_nvmupd_nvm_write(struct i40e_hw *hw, static int i40e_nvmupd_nvm_write(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno); u8 *bytes, int *perrno);
static i40e_status i40e_nvmupd_nvm_read(struct i40e_hw *hw, static int i40e_nvmupd_nvm_read(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno); u8 *bytes, int *perrno);
static i40e_status i40e_nvmupd_exec_aq(struct i40e_hw *hw, static int i40e_nvmupd_exec_aq(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno); u8 *bytes, int *perrno);
static i40e_status i40e_nvmupd_get_aq_result(struct i40e_hw *hw, static int i40e_nvmupd_get_aq_result(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno); u8 *bytes, int *perrno);
static i40e_status i40e_nvmupd_get_aq_event(struct i40e_hw *hw, static int i40e_nvmupd_get_aq_event(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno); u8 *bytes, int *perrno);
static inline u8 i40e_nvmupd_get_module(u32 val) static inline u8 i40e_nvmupd_get_module(u32 val)
...@@ -807,12 +807,12 @@ static const char * const i40e_nvm_update_state_str[] = { ...@@ -807,12 +807,12 @@ static const char * const i40e_nvm_update_state_str[] = {
* *
* Dispatches command depending on what update state is current * Dispatches command depending on what update state is current
**/ **/
i40e_status i40e_nvmupd_command(struct i40e_hw *hw, int i40e_nvmupd_command(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno) u8 *bytes, int *perrno)
{ {
i40e_status status;
enum i40e_nvmupd_cmd upd_cmd; enum i40e_nvmupd_cmd upd_cmd;
int status;
/* assume success */ /* assume success */
*perrno = 0; *perrno = 0;
...@@ -923,12 +923,12 @@ i40e_status i40e_nvmupd_command(struct i40e_hw *hw, ...@@ -923,12 +923,12 @@ i40e_status i40e_nvmupd_command(struct i40e_hw *hw,
* Process legitimate commands of the Init state and conditionally set next * Process legitimate commands of the Init state and conditionally set next
* state. Reject all other commands. * state. Reject all other commands.
**/ **/
static i40e_status i40e_nvmupd_state_init(struct i40e_hw *hw, static int i40e_nvmupd_state_init(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno) u8 *bytes, int *perrno)
{ {
i40e_status status = 0;
enum i40e_nvmupd_cmd upd_cmd; enum i40e_nvmupd_cmd upd_cmd;
int status = 0;
upd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno); upd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno);
...@@ -1062,12 +1062,12 @@ static i40e_status i40e_nvmupd_state_init(struct i40e_hw *hw, ...@@ -1062,12 +1062,12 @@ static i40e_status i40e_nvmupd_state_init(struct i40e_hw *hw,
* NVM ownership is already held. Process legitimate commands and set any * NVM ownership is already held. Process legitimate commands and set any
* change in state; reject all other commands. * change in state; reject all other commands.
**/ **/
static i40e_status i40e_nvmupd_state_reading(struct i40e_hw *hw, static int i40e_nvmupd_state_reading(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno) u8 *bytes, int *perrno)
{ {
i40e_status status = 0;
enum i40e_nvmupd_cmd upd_cmd; enum i40e_nvmupd_cmd upd_cmd;
int status = 0;
upd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno); upd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno);
...@@ -1104,13 +1104,13 @@ static i40e_status i40e_nvmupd_state_reading(struct i40e_hw *hw, ...@@ -1104,13 +1104,13 @@ static i40e_status i40e_nvmupd_state_reading(struct i40e_hw *hw,
* NVM ownership is already held. Process legitimate commands and set any * NVM ownership is already held. Process legitimate commands and set any
* change in state; reject all other commands * change in state; reject all other commands
**/ **/
static i40e_status i40e_nvmupd_state_writing(struct i40e_hw *hw, static int i40e_nvmupd_state_writing(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno) u8 *bytes, int *perrno)
{ {
i40e_status status = 0;
enum i40e_nvmupd_cmd upd_cmd; enum i40e_nvmupd_cmd upd_cmd;
bool retry_attempt = false; bool retry_attempt = false;
int status = 0;
upd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno); upd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno);
...@@ -1187,8 +1187,8 @@ static i40e_status i40e_nvmupd_state_writing(struct i40e_hw *hw, ...@@ -1187,8 +1187,8 @@ static i40e_status i40e_nvmupd_state_writing(struct i40e_hw *hw,
*/ */
if (status && (hw->aq.asq_last_status == I40E_AQ_RC_EBUSY) && if (status && (hw->aq.asq_last_status == I40E_AQ_RC_EBUSY) &&
!retry_attempt) { !retry_attempt) {
i40e_status old_status = status;
u32 old_asq_status = hw->aq.asq_last_status; u32 old_asq_status = hw->aq.asq_last_status;
int old_status = status;
u32 gtime; u32 gtime;
gtime = rd32(hw, I40E_GLVFGEN_TIMER); gtime = rd32(hw, I40E_GLVFGEN_TIMER);
...@@ -1370,17 +1370,17 @@ static enum i40e_nvmupd_cmd i40e_nvmupd_validate_command(struct i40e_hw *hw, ...@@ -1370,17 +1370,17 @@ static enum i40e_nvmupd_cmd i40e_nvmupd_validate_command(struct i40e_hw *hw,
* *
* cmd structure contains identifiers and data buffer * cmd structure contains identifiers and data buffer
**/ **/
static i40e_status i40e_nvmupd_exec_aq(struct i40e_hw *hw, static int i40e_nvmupd_exec_aq(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno) u8 *bytes, int *perrno)
{ {
struct i40e_asq_cmd_details cmd_details; struct i40e_asq_cmd_details cmd_details;
i40e_status status;
struct i40e_aq_desc *aq_desc; struct i40e_aq_desc *aq_desc;
u32 buff_size = 0; u32 buff_size = 0;
u8 *buff = NULL; u8 *buff = NULL;
u32 aq_desc_len; u32 aq_desc_len;
u32 aq_data_len; u32 aq_data_len;
int status;
i40e_debug(hw, I40E_DEBUG_NVM, "NVMUPD: %s\n", __func__); i40e_debug(hw, I40E_DEBUG_NVM, "NVMUPD: %s\n", __func__);
if (cmd->offset == 0xffff) if (cmd->offset == 0xffff)
...@@ -1429,8 +1429,8 @@ static i40e_status i40e_nvmupd_exec_aq(struct i40e_hw *hw, ...@@ -1429,8 +1429,8 @@ static i40e_status i40e_nvmupd_exec_aq(struct i40e_hw *hw,
buff_size, &cmd_details); buff_size, &cmd_details);
if (status) { if (status) {
i40e_debug(hw, I40E_DEBUG_NVM, i40e_debug(hw, I40E_DEBUG_NVM,
"i40e_nvmupd_exec_aq err %s aq_err %s\n", "%s err %pe aq_err %s\n",
i40e_stat_str(hw, status), __func__, ERR_PTR(status),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
*perrno = i40e_aq_rc_to_posix(status, hw->aq.asq_last_status); *perrno = i40e_aq_rc_to_posix(status, hw->aq.asq_last_status);
return status; return status;
...@@ -1454,7 +1454,7 @@ static i40e_status i40e_nvmupd_exec_aq(struct i40e_hw *hw, ...@@ -1454,7 +1454,7 @@ static i40e_status i40e_nvmupd_exec_aq(struct i40e_hw *hw,
* *
* cmd structure contains identifiers and data buffer * cmd structure contains identifiers and data buffer
**/ **/
static i40e_status i40e_nvmupd_get_aq_result(struct i40e_hw *hw, static int i40e_nvmupd_get_aq_result(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno) u8 *bytes, int *perrno)
{ {
...@@ -1523,7 +1523,7 @@ static i40e_status i40e_nvmupd_get_aq_result(struct i40e_hw *hw, ...@@ -1523,7 +1523,7 @@ static i40e_status i40e_nvmupd_get_aq_result(struct i40e_hw *hw,
* *
* cmd structure contains identifiers and data buffer * cmd structure contains identifiers and data buffer
**/ **/
static i40e_status i40e_nvmupd_get_aq_event(struct i40e_hw *hw, static int i40e_nvmupd_get_aq_event(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno) u8 *bytes, int *perrno)
{ {
...@@ -1557,13 +1557,13 @@ static i40e_status i40e_nvmupd_get_aq_event(struct i40e_hw *hw, ...@@ -1557,13 +1557,13 @@ static i40e_status i40e_nvmupd_get_aq_event(struct i40e_hw *hw,
* *
* cmd structure contains identifiers and data buffer * cmd structure contains identifiers and data buffer
**/ **/
static i40e_status i40e_nvmupd_nvm_read(struct i40e_hw *hw, static int i40e_nvmupd_nvm_read(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno) u8 *bytes, int *perrno)
{ {
struct i40e_asq_cmd_details cmd_details; struct i40e_asq_cmd_details cmd_details;
i40e_status status;
u8 module, transaction; u8 module, transaction;
int status;
bool last; bool last;
transaction = i40e_nvmupd_get_transaction(cmd->config); transaction = i40e_nvmupd_get_transaction(cmd->config);
...@@ -1596,13 +1596,13 @@ static i40e_status i40e_nvmupd_nvm_read(struct i40e_hw *hw, ...@@ -1596,13 +1596,13 @@ static i40e_status i40e_nvmupd_nvm_read(struct i40e_hw *hw,
* *
* module, offset, data_size and data are in cmd structure * module, offset, data_size and data are in cmd structure
**/ **/
static i40e_status i40e_nvmupd_nvm_erase(struct i40e_hw *hw, static int i40e_nvmupd_nvm_erase(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
int *perrno) int *perrno)
{ {
i40e_status status = 0;
struct i40e_asq_cmd_details cmd_details; struct i40e_asq_cmd_details cmd_details;
u8 module, transaction; u8 module, transaction;
int status = 0;
bool last; bool last;
transaction = i40e_nvmupd_get_transaction(cmd->config); transaction = i40e_nvmupd_get_transaction(cmd->config);
...@@ -1636,14 +1636,14 @@ static i40e_status i40e_nvmupd_nvm_erase(struct i40e_hw *hw, ...@@ -1636,14 +1636,14 @@ static i40e_status i40e_nvmupd_nvm_erase(struct i40e_hw *hw,
* *
* module, offset, data_size and data are in cmd structure * module, offset, data_size and data are in cmd structure
**/ **/
static i40e_status i40e_nvmupd_nvm_write(struct i40e_hw *hw, static int i40e_nvmupd_nvm_write(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno) u8 *bytes, int *perrno)
{ {
i40e_status status = 0;
struct i40e_asq_cmd_details cmd_details; struct i40e_asq_cmd_details cmd_details;
u8 module, transaction; u8 module, transaction;
u8 preservation_flags; u8 preservation_flags;
int status = 0;
bool last; bool last;
transaction = i40e_nvmupd_get_transaction(cmd->config); transaction = i40e_nvmupd_get_transaction(cmd->config);
......
...@@ -56,5 +56,4 @@ do { \ ...@@ -56,5 +56,4 @@ do { \
(h)->bus.func, ##__VA_ARGS__); \ (h)->bus.func, ##__VA_ARGS__); \
} while (0) } while (0)
typedef enum i40e_status_code i40e_status;
#endif /* _I40E_OSDEP_H_ */ #endif /* _I40E_OSDEP_H_ */
...@@ -16,29 +16,29 @@ ...@@ -16,29 +16,29 @@
*/ */
/* adminq functions */ /* adminq functions */
i40e_status i40e_init_adminq(struct i40e_hw *hw); int i40e_init_adminq(struct i40e_hw *hw);
void i40e_shutdown_adminq(struct i40e_hw *hw); void i40e_shutdown_adminq(struct i40e_hw *hw);
void i40e_adminq_init_ring_data(struct i40e_hw *hw); void i40e_adminq_init_ring_data(struct i40e_hw *hw);
i40e_status i40e_clean_arq_element(struct i40e_hw *hw, int i40e_clean_arq_element(struct i40e_hw *hw,
struct i40e_arq_event_info *e, struct i40e_arq_event_info *e,
u16 *events_pending); u16 *events_pending);
i40e_status int
i40e_asq_send_command(struct i40e_hw *hw, struct i40e_aq_desc *desc, i40e_asq_send_command(struct i40e_hw *hw, struct i40e_aq_desc *desc,
void *buff, /* can be NULL */ u16 buff_size, void *buff, /* can be NULL */ u16 buff_size,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status int
i40e_asq_send_command_v2(struct i40e_hw *hw, i40e_asq_send_command_v2(struct i40e_hw *hw,
struct i40e_aq_desc *desc, struct i40e_aq_desc *desc,
void *buff, /* can be NULL */ void *buff, /* can be NULL */
u16 buff_size, u16 buff_size,
struct i40e_asq_cmd_details *cmd_details, struct i40e_asq_cmd_details *cmd_details,
enum i40e_admin_queue_err *aq_status); enum i40e_admin_queue_err *aq_status);
i40e_status int
i40e_asq_send_command_atomic(struct i40e_hw *hw, struct i40e_aq_desc *desc, i40e_asq_send_command_atomic(struct i40e_hw *hw, struct i40e_aq_desc *desc,
void *buff, /* can be NULL */ u16 buff_size, void *buff, /* can be NULL */ u16 buff_size,
struct i40e_asq_cmd_details *cmd_details, struct i40e_asq_cmd_details *cmd_details,
bool is_atomic_context); bool is_atomic_context);
i40e_status int
i40e_asq_send_command_atomic_v2(struct i40e_hw *hw, i40e_asq_send_command_atomic_v2(struct i40e_hw *hw,
struct i40e_aq_desc *desc, struct i40e_aq_desc *desc,
void *buff, /* can be NULL */ void *buff, /* can be NULL */
...@@ -53,327 +53,332 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, ...@@ -53,327 +53,332 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask,
void i40e_idle_aq(struct i40e_hw *hw); void i40e_idle_aq(struct i40e_hw *hw);
bool i40e_check_asq_alive(struct i40e_hw *hw); bool i40e_check_asq_alive(struct i40e_hw *hw);
i40e_status i40e_aq_queue_shutdown(struct i40e_hw *hw, bool unloading); int i40e_aq_queue_shutdown(struct i40e_hw *hw, bool unloading);
const char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err); const char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err);
const char *i40e_stat_str(struct i40e_hw *hw, i40e_status stat_err);
i40e_status i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 seid, int i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 seid,
bool pf_lut, u8 *lut, u16 lut_size); bool pf_lut, u8 *lut, u16 lut_size);
i40e_status i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 seid, int i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 seid,
bool pf_lut, u8 *lut, u16 lut_size); bool pf_lut, u8 *lut, u16 lut_size);
i40e_status i40e_aq_get_rss_key(struct i40e_hw *hw, int i40e_aq_get_rss_key(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_get_set_rss_key_data *key); struct i40e_aqc_get_set_rss_key_data *key);
i40e_status i40e_aq_set_rss_key(struct i40e_hw *hw, int i40e_aq_set_rss_key(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_get_set_rss_key_data *key); struct i40e_aqc_get_set_rss_key_data *key);
u32 i40e_led_get(struct i40e_hw *hw); u32 i40e_led_get(struct i40e_hw *hw);
void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink); void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink);
i40e_status i40e_led_set_phy(struct i40e_hw *hw, bool on, int i40e_led_set_phy(struct i40e_hw *hw, bool on,
u16 led_addr, u32 mode); u16 led_addr, u32 mode);
i40e_status i40e_led_get_phy(struct i40e_hw *hw, u16 *led_addr, int i40e_led_get_phy(struct i40e_hw *hw, u16 *led_addr,
u16 *val); u16 *val);
i40e_status i40e_blink_phy_link_led(struct i40e_hw *hw, int i40e_blink_phy_link_led(struct i40e_hw *hw,
u32 time, u32 interval); u32 time, u32 interval);
/* admin send queue commands */ /* admin send queue commands */
i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw, int i40e_aq_get_firmware_version(struct i40e_hw *hw,
u16 *fw_major_version, u16 *fw_minor_version, u16 *fw_major_version, u16 *fw_minor_version,
u32 *fw_build, u32 *fw_build,
u16 *api_major_version, u16 *api_minor_version, u16 *api_major_version, u16 *api_minor_version,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_debug_write_register(struct i40e_hw *hw, int i40e_aq_debug_write_register(struct i40e_hw *hw,
u32 reg_addr, u64 reg_val, u32 reg_addr, u64 reg_val,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_debug_read_register(struct i40e_hw *hw, int i40e_aq_debug_read_register(struct i40e_hw *hw,
u32 reg_addr, u64 *reg_val, u32 reg_addr, u64 *reg_val,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags, int i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_set_default_vsi(struct i40e_hw *hw, u16 vsi_id, int i40e_aq_set_default_vsi(struct i40e_hw *hw, u16 vsi_id,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_clear_default_vsi(struct i40e_hw *hw, u16 vsi_id, int i40e_aq_clear_default_vsi(struct i40e_hw *hw, u16 vsi_id,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code i40e_aq_get_phy_capabilities(struct i40e_hw *hw, int i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
bool qualified_modules, bool report_init, bool qualified_modules, bool report_init,
struct i40e_aq_get_phy_abilities_resp *abilities, struct i40e_aq_get_phy_abilities_resp *abilities,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code i40e_aq_set_phy_config(struct i40e_hw *hw, int i40e_aq_set_phy_config(struct i40e_hw *hw,
struct i40e_aq_set_phy_config *config, struct i40e_aq_set_phy_config *config,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures, int i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,
bool atomic_reset); bool atomic_reset);
i40e_status i40e_aq_set_mac_loopback(struct i40e_hw *hw, int i40e_aq_set_mac_loopback(struct i40e_hw *hw,
bool ena_lpbk, bool ena_lpbk,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_set_phy_int_mask(struct i40e_hw *hw, u16 mask, int i40e_aq_set_phy_int_mask(struct i40e_hw *hw, u16 mask,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_clear_pxe_mode(struct i40e_hw *hw, int i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw, int i40e_aq_set_link_restart_an(struct i40e_hw *hw,
bool enable_link, bool enable_link,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, int i40e_aq_get_link_info(struct i40e_hw *hw,
bool enable_lse, struct i40e_link_status *link, bool enable_lse, struct i40e_link_status *link,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_set_local_advt_reg(struct i40e_hw *hw, int i40e_aq_set_local_advt_reg(struct i40e_hw *hw,
u64 advt_reg, u64 advt_reg,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw, int i40e_aq_send_driver_version(struct i40e_hw *hw,
struct i40e_driver_version *dv, struct i40e_driver_version *dv,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_add_vsi(struct i40e_hw *hw, int i40e_aq_add_vsi(struct i40e_hw *hw,
struct i40e_vsi_context *vsi_ctx, struct i40e_vsi_context *vsi_ctx,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw, int i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,
u16 vsi_id, bool set_filter, u16 vsi_id, bool set_filter,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, int i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, u16 vsi_id, bool set,
u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details, struct i40e_asq_cmd_details *cmd_details,
bool rx_only_promisc); bool rx_only_promisc);
i40e_status i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw, int i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw, u16 vsi_id, bool set,
u16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw, int i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw,
u16 seid, bool enable, u16 seid, bool enable,
u16 vid, u16 vid,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, int i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,
u16 seid, bool enable, u16 seid, bool enable,
u16 vid, u16 vid,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_set_vsi_bc_promisc_on_vlan(struct i40e_hw *hw, int i40e_aq_set_vsi_bc_promisc_on_vlan(struct i40e_hw *hw,
u16 seid, bool enable, u16 vid, u16 seid, bool enable, u16 vid,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw, int i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw,
u16 seid, bool enable, u16 seid, bool enable,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw, int i40e_aq_get_vsi_params(struct i40e_hw *hw,
struct i40e_vsi_context *vsi_ctx, struct i40e_vsi_context *vsi_ctx,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_update_vsi_params(struct i40e_hw *hw, int i40e_aq_update_vsi_params(struct i40e_hw *hw,
struct i40e_vsi_context *vsi_ctx, struct i40e_vsi_context *vsi_ctx,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid, int i40e_aq_add_veb(struct i40e_hw *hw, u16 uplink_seid,
u16 downlink_seid, u8 enabled_tc, u16 downlink_seid, u8 enabled_tc,
bool default_port, u16 *pveb_seid, bool default_port, u16 *pveb_seid,
bool enable_stats, bool enable_stats,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_get_veb_parameters(struct i40e_hw *hw, int i40e_aq_get_veb_parameters(struct i40e_hw *hw,
u16 veb_seid, u16 *switch_id, bool *floating, u16 veb_seid, u16 *switch_id, bool *floating,
u16 *statistic_index, u16 *vebs_used, u16 *statistic_index, u16 *vebs_used,
u16 *vebs_free, u16 *vebs_free,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_add_macvlan(struct i40e_hw *hw, u16 vsi_id, int i40e_aq_add_macvlan(struct i40e_hw *hw, u16 vsi_id,
struct i40e_aqc_add_macvlan_element_data *mv_list, struct i40e_aqc_add_macvlan_element_data *mv_list,
u16 count, struct i40e_asq_cmd_details *cmd_details); u16 count, struct i40e_asq_cmd_details *cmd_details);
i40e_status int
i40e_aq_add_macvlan_v2(struct i40e_hw *hw, u16 seid, i40e_aq_add_macvlan_v2(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_add_macvlan_element_data *mv_list, struct i40e_aqc_add_macvlan_element_data *mv_list,
u16 count, struct i40e_asq_cmd_details *cmd_details, u16 count, struct i40e_asq_cmd_details *cmd_details,
enum i40e_admin_queue_err *aq_status); enum i40e_admin_queue_err *aq_status);
i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 vsi_id, int i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 vsi_id,
struct i40e_aqc_remove_macvlan_element_data *mv_list, struct i40e_aqc_remove_macvlan_element_data *mv_list,
u16 count, struct i40e_asq_cmd_details *cmd_details); u16 count, struct i40e_asq_cmd_details *cmd_details);
i40e_status int
i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid, i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_remove_macvlan_element_data *mv_list, struct i40e_aqc_remove_macvlan_element_data *mv_list,
u16 count, struct i40e_asq_cmd_details *cmd_details, u16 count, struct i40e_asq_cmd_details *cmd_details,
enum i40e_admin_queue_err *aq_status); enum i40e_admin_queue_err *aq_status);
i40e_status i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid, int i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
u16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list, u16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list,
struct i40e_asq_cmd_details *cmd_details, struct i40e_asq_cmd_details *cmd_details,
u16 *rule_id, u16 *rules_used, u16 *rules_free); u16 *rule_id, u16 *rules_used, u16 *rules_free);
i40e_status i40e_aq_delete_mirrorrule(struct i40e_hw *hw, u16 sw_seid, int i40e_aq_delete_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
u16 rule_type, u16 rule_id, u16 count, __le16 *mr_list, u16 rule_type, u16 rule_id, u16 count, __le16 *mr_list,
struct i40e_asq_cmd_details *cmd_details, struct i40e_asq_cmd_details *cmd_details,
u16 *rules_used, u16 *rules_free); u16 *rules_used, u16 *rules_free);
i40e_status i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid, int i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid,
u32 v_opcode, u32 v_retval, u8 *msg, u16 msglen, u32 v_opcode, u32 v_retval, u8 *msg, u16 msglen,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_get_switch_config(struct i40e_hw *hw, int i40e_aq_get_switch_config(struct i40e_hw *hw,
struct i40e_aqc_get_switch_config_resp *buf, struct i40e_aqc_get_switch_config_resp *buf,
u16 buf_size, u16 *start_seid, u16 buf_size, u16 *start_seid,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw, int i40e_aq_set_switch_config(struct i40e_hw *hw,
u16 flags, u16 flags,
u16 valid_flags, u8 mode, u16 valid_flags, u8 mode,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_request_resource(struct i40e_hw *hw, int i40e_aq_request_resource(struct i40e_hw *hw,
enum i40e_aq_resources_ids resource, enum i40e_aq_resources_ids resource,
enum i40e_aq_resource_access_type access, enum i40e_aq_resource_access_type access,
u8 sdp_number, u64 *timeout, u8 sdp_number, u64 *timeout,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_release_resource(struct i40e_hw *hw, int i40e_aq_release_resource(struct i40e_hw *hw,
enum i40e_aq_resources_ids resource, enum i40e_aq_resources_ids resource,
u8 sdp_number, u8 sdp_number,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_read_nvm(struct i40e_hw *hw, u8 module_pointer, int i40e_aq_read_nvm(struct i40e_hw *hw, u8 module_pointer,
u32 offset, u16 length, void *data, u32 offset, u16 length, void *data,
bool last_command, bool last_command,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_erase_nvm(struct i40e_hw *hw, u8 module_pointer, int i40e_aq_erase_nvm(struct i40e_hw *hw, u8 module_pointer,
u32 offset, u16 length, bool last_command, u32 offset, u16 length, bool last_command,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_discover_capabilities(struct i40e_hw *hw, int i40e_aq_discover_capabilities(struct i40e_hw *hw,
void *buff, u16 buff_size, u16 *data_size, void *buff, u16 buff_size, u16 *data_size,
enum i40e_admin_queue_opc list_type_opc, enum i40e_admin_queue_opc list_type_opc,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer, int i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer,
u32 offset, u16 length, void *data, u32 offset, u16 length, void *data,
bool last_command, u8 preservation_flags, bool last_command, u8 preservation_flags,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_rearrange_nvm(struct i40e_hw *hw, int i40e_aq_rearrange_nvm(struct i40e_hw *hw,
u8 rearrange_nvm, u8 rearrange_nvm,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type, int i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type,
u8 mib_type, void *buff, u16 buff_size, u8 mib_type, void *buff, u16 buff_size,
u16 *local_len, u16 *remote_len, u16 *local_len, u16 *remote_len,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code int
i40e_aq_set_lldp_mib(struct i40e_hw *hw, i40e_aq_set_lldp_mib(struct i40e_hw *hw,
u8 mib_type, void *buff, u16 buff_size, u8 mib_type, void *buff, u16 buff_size,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw, int i40e_aq_cfg_lldp_mib_change_event(struct i40e_hw *hw,
bool enable_update, bool enable_update,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code int
i40e_aq_restore_lldp(struct i40e_hw *hw, u8 *setting, bool restore, i40e_aq_restore_lldp(struct i40e_hw *hw, u8 *setting, bool restore,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent, int i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent,
bool persist, bool persist,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_set_dcb_parameters(struct i40e_hw *hw, int i40e_aq_set_dcb_parameters(struct i40e_hw *hw,
bool dcb_enable, bool dcb_enable,
struct i40e_asq_cmd_details struct i40e_asq_cmd_details
*cmd_details); *cmd_details);
i40e_status i40e_aq_start_lldp(struct i40e_hw *hw, bool persist, int i40e_aq_start_lldp(struct i40e_hw *hw, bool persist,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_get_cee_dcb_config(struct i40e_hw *hw, int i40e_aq_get_cee_dcb_config(struct i40e_hw *hw,
void *buff, u16 buff_size, void *buff, u16 buff_size,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_add_udp_tunnel(struct i40e_hw *hw, int i40e_aq_add_udp_tunnel(struct i40e_hw *hw,
u16 udp_port, u8 protocol_index, u16 udp_port, u8 protocol_index,
u8 *filter_index, u8 *filter_index,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index, int i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_delete_element(struct i40e_hw *hw, u16 seid, int i40e_aq_delete_element(struct i40e_hw *hw, u16 seid,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_mac_address_write(struct i40e_hw *hw, int i40e_aq_mac_address_write(struct i40e_hw *hw,
u16 flags, u8 *mac_addr, u16 flags, u8 *mac_addr,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_config_vsi_bw_limit(struct i40e_hw *hw, int i40e_aq_config_vsi_bw_limit(struct i40e_hw *hw,
u16 seid, u16 credit, u8 max_credit, u16 seid, u16 credit, u8 max_credit,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_dcb_updated(struct i40e_hw *hw, int i40e_aq_dcb_updated(struct i40e_hw *hw,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_config_switch_comp_bw_limit(struct i40e_hw *hw, int i40e_aq_config_switch_comp_bw_limit(struct i40e_hw *hw,
u16 seid, u16 credit, u8 max_bw, u16 seid, u16 credit, u8 max_bw,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_config_vsi_tc_bw(struct i40e_hw *hw, u16 seid, int i40e_aq_config_vsi_tc_bw(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_configure_vsi_tc_bw_data *bw_data, struct i40e_aqc_configure_vsi_tc_bw_data *bw_data,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_config_switch_comp_ets(struct i40e_hw *hw, int
i40e_aq_config_switch_comp_ets(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_configure_switching_comp_ets_data *ets_data, struct i40e_aqc_configure_switching_comp_ets_data *ets_data,
enum i40e_admin_queue_opc opcode, enum i40e_admin_queue_opc opcode,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_config_switch_comp_bw_config(struct i40e_hw *hw, int i40e_aq_config_switch_comp_bw_config(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_configure_switching_comp_bw_config_data *bw_data, struct i40e_aqc_configure_switching_comp_bw_config_data *bw_data,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_query_vsi_bw_config(struct i40e_hw *hw, int i40e_aq_query_vsi_bw_config(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_query_vsi_bw_config_resp *bw_data, struct i40e_aqc_query_vsi_bw_config_resp *bw_data,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_query_vsi_ets_sla_config(struct i40e_hw *hw, int
i40e_aq_query_vsi_ets_sla_config(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_query_vsi_ets_sla_config_resp *bw_data, struct i40e_aqc_query_vsi_ets_sla_config_resp *bw_data,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_query_switch_comp_ets_config(struct i40e_hw *hw, int
i40e_aq_query_switch_comp_ets_config(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_query_switching_comp_ets_config_resp *bw_data, struct i40e_aqc_query_switching_comp_ets_config_resp *bw_data,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_query_port_ets_config(struct i40e_hw *hw, int
i40e_aq_query_port_ets_config(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_query_port_ets_config_resp *bw_data, struct i40e_aqc_query_port_ets_config_resp *bw_data,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw, int
i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw,
u16 seid, u16 seid,
struct i40e_aqc_query_switching_comp_bw_config_resp *bw_data, struct i40e_aqc_query_switching_comp_bw_config_resp *bw_data,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_resume_port_tx(struct i40e_hw *hw, int i40e_aq_resume_port_tx(struct i40e_hw *hw,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code int
i40e_aq_add_cloud_filters_bb(struct i40e_hw *hw, u16 seid, i40e_aq_add_cloud_filters_bb(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_cloud_filters_element_bb *filters, struct i40e_aqc_cloud_filters_element_bb *filters,
u8 filter_count); u8 filter_count);
enum i40e_status_code int
i40e_aq_add_cloud_filters(struct i40e_hw *hw, u16 vsi, i40e_aq_add_cloud_filters(struct i40e_hw *hw, u16 vsi,
struct i40e_aqc_cloud_filters_element_data *filters, struct i40e_aqc_cloud_filters_element_data *filters,
u8 filter_count); u8 filter_count);
enum i40e_status_code int
i40e_aq_rem_cloud_filters(struct i40e_hw *hw, u16 vsi, i40e_aq_rem_cloud_filters(struct i40e_hw *hw, u16 vsi,
struct i40e_aqc_cloud_filters_element_data *filters, struct i40e_aqc_cloud_filters_element_data *filters,
u8 filter_count); u8 filter_count);
enum i40e_status_code int
i40e_aq_rem_cloud_filters_bb(struct i40e_hw *hw, u16 seid, i40e_aq_rem_cloud_filters_bb(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_cloud_filters_element_bb *filters, struct i40e_aqc_cloud_filters_element_bb *filters,
u8 filter_count); u8 filter_count);
i40e_status i40e_read_lldp_cfg(struct i40e_hw *hw, int i40e_read_lldp_cfg(struct i40e_hw *hw,
struct i40e_lldp_variables *lldp_cfg); struct i40e_lldp_variables *lldp_cfg);
enum i40e_status_code int
i40e_aq_suspend_port_tx(struct i40e_hw *hw, u16 seid, i40e_aq_suspend_port_tx(struct i40e_hw *hw, u16 seid,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
/* i40e_common */ /* i40e_common */
i40e_status i40e_init_shared_code(struct i40e_hw *hw); int i40e_init_shared_code(struct i40e_hw *hw);
i40e_status i40e_pf_reset(struct i40e_hw *hw); int i40e_pf_reset(struct i40e_hw *hw);
void i40e_clear_hw(struct i40e_hw *hw); void i40e_clear_hw(struct i40e_hw *hw);
void i40e_clear_pxe_mode(struct i40e_hw *hw); void i40e_clear_pxe_mode(struct i40e_hw *hw);
i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up); int i40e_get_link_status(struct i40e_hw *hw, bool *link_up);
i40e_status i40e_update_link_info(struct i40e_hw *hw); int i40e_update_link_info(struct i40e_hw *hw);
i40e_status i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr); int i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr);
i40e_status i40e_read_bw_from_alt_ram(struct i40e_hw *hw, int i40e_read_bw_from_alt_ram(struct i40e_hw *hw,
u32 *max_bw, u32 *min_bw, bool *min_valid, u32 *max_bw, u32 *min_bw, bool *min_valid,
bool *max_valid); bool *max_valid);
i40e_status i40e_aq_configure_partition_bw(struct i40e_hw *hw, int
i40e_aq_configure_partition_bw(struct i40e_hw *hw,
struct i40e_aqc_configure_partition_bw_data *bw_data, struct i40e_aqc_configure_partition_bw_data *bw_data,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_get_port_mac_addr(struct i40e_hw *hw, u8 *mac_addr); int i40e_get_port_mac_addr(struct i40e_hw *hw, u8 *mac_addr);
i40e_status i40e_read_pba_string(struct i40e_hw *hw, u8 *pba_num, int i40e_read_pba_string(struct i40e_hw *hw, u8 *pba_num,
u32 pba_num_size); u32 pba_num_size);
i40e_status i40e_validate_mac_addr(u8 *mac_addr); int i40e_validate_mac_addr(u8 *mac_addr);
void i40e_pre_tx_queue_cfg(struct i40e_hw *hw, u32 queue, bool enable); void i40e_pre_tx_queue_cfg(struct i40e_hw *hw, u32 queue, bool enable);
/* prototype for functions used for NVM access */ /* prototype for functions used for NVM access */
i40e_status i40e_init_nvm(struct i40e_hw *hw); int i40e_init_nvm(struct i40e_hw *hw);
i40e_status i40e_acquire_nvm(struct i40e_hw *hw, int i40e_acquire_nvm(struct i40e_hw *hw,
enum i40e_aq_resource_access_type access); enum i40e_aq_resource_access_type access);
void i40e_release_nvm(struct i40e_hw *hw); void i40e_release_nvm(struct i40e_hw *hw);
i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset, int i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
u16 *data); u16 *data);
enum i40e_status_code i40e_read_nvm_module_data(struct i40e_hw *hw, int i40e_read_nvm_module_data(struct i40e_hw *hw,
u8 module_ptr, u8 module_ptr,
u16 module_offset, u16 module_offset,
u16 data_offset, u16 data_offset,
u16 words_data_size, u16 words_data_size,
u16 *data_ptr); u16 *data_ptr);
i40e_status i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset, int i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,
u16 *words, u16 *data); u16 *words, u16 *data);
i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw); int i40e_update_nvm_checksum(struct i40e_hw *hw);
i40e_status i40e_validate_nvm_checksum(struct i40e_hw *hw, int i40e_validate_nvm_checksum(struct i40e_hw *hw,
u16 *checksum); u16 *checksum);
i40e_status i40e_nvmupd_command(struct i40e_hw *hw, int i40e_nvmupd_command(struct i40e_hw *hw,
struct i40e_nvm_access *cmd, struct i40e_nvm_access *cmd,
u8 *bytes, int *); u8 *bytes, int *errno);
void i40e_nvmupd_check_wait_event(struct i40e_hw *hw, u16 opcode, void i40e_nvmupd_check_wait_event(struct i40e_hw *hw, u16 opcode,
struct i40e_aq_desc *desc); struct i40e_aq_desc *desc);
void i40e_nvmupd_clear_wait_state(struct i40e_hw *hw); void i40e_nvmupd_clear_wait_state(struct i40e_hw *hw);
void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status); void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status);
i40e_status i40e_set_mac_type(struct i40e_hw *hw); int i40e_set_mac_type(struct i40e_hw *hw);
extern struct i40e_rx_ptype_decoded i40e_ptype_lookup[]; extern struct i40e_rx_ptype_decoded i40e_ptype_lookup[];
...@@ -422,41 +427,41 @@ i40e_virtchnl_link_speed(enum i40e_aq_link_speed link_speed) ...@@ -422,41 +427,41 @@ i40e_virtchnl_link_speed(enum i40e_aq_link_speed link_speed)
/* i40e_common for VF drivers*/ /* i40e_common for VF drivers*/
void i40e_vf_parse_hw_config(struct i40e_hw *hw, void i40e_vf_parse_hw_config(struct i40e_hw *hw,
struct virtchnl_vf_resource *msg); struct virtchnl_vf_resource *msg);
i40e_status i40e_vf_reset(struct i40e_hw *hw); int i40e_vf_reset(struct i40e_hw *hw);
i40e_status i40e_aq_send_msg_to_pf(struct i40e_hw *hw, int i40e_aq_send_msg_to_pf(struct i40e_hw *hw,
enum virtchnl_ops v_opcode, enum virtchnl_ops v_opcode,
i40e_status v_retval, int v_retval,
u8 *msg, u16 msglen, u8 *msg, u16 msglen,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_set_filter_control(struct i40e_hw *hw, int i40e_set_filter_control(struct i40e_hw *hw,
struct i40e_filter_control_settings *settings); struct i40e_filter_control_settings *settings);
i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw, int i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,
u8 *mac_addr, u16 ethtype, u16 flags, u8 *mac_addr, u16 ethtype, u16 flags,
u16 vsi_seid, u16 queue, bool is_add, u16 vsi_seid, u16 queue, bool is_add,
struct i40e_control_filter_stats *stats, struct i40e_control_filter_stats *stats,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, int i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,
u8 table_id, u32 start_index, u16 buff_size, u8 table_id, u32 start_index, u16 buff_size,
void *buff, u16 *ret_buff_size, void *buff, u16 *ret_buff_size,
u8 *ret_next_table, u32 *ret_next_index, u8 *ret_next_table, u32 *ret_next_index,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw, void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw,
u16 vsi_seid); u16 vsi_seid);
i40e_status i40e_aq_rx_ctl_read_register(struct i40e_hw *hw, int i40e_aq_rx_ctl_read_register(struct i40e_hw *hw,
u32 reg_addr, u32 *reg_val, u32 reg_addr, u32 *reg_val,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
u32 i40e_read_rx_ctl(struct i40e_hw *hw, u32 reg_addr); u32 i40e_read_rx_ctl(struct i40e_hw *hw, u32 reg_addr);
i40e_status i40e_aq_rx_ctl_write_register(struct i40e_hw *hw, int i40e_aq_rx_ctl_write_register(struct i40e_hw *hw,
u32 reg_addr, u32 reg_val, u32 reg_addr, u32 reg_val,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
void i40e_write_rx_ctl(struct i40e_hw *hw, u32 reg_addr, u32 reg_val); void i40e_write_rx_ctl(struct i40e_hw *hw, u32 reg_addr, u32 reg_val);
enum i40e_status_code int
i40e_aq_set_phy_register_ext(struct i40e_hw *hw, i40e_aq_set_phy_register_ext(struct i40e_hw *hw,
u8 phy_select, u8 dev_addr, bool page_change, u8 phy_select, u8 dev_addr, bool page_change,
bool set_mdio, u8 mdio_num, bool set_mdio, u8 mdio_num,
u32 reg_addr, u32 reg_val, u32 reg_addr, u32 reg_val,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
enum i40e_status_code int
i40e_aq_get_phy_register_ext(struct i40e_hw *hw, i40e_aq_get_phy_register_ext(struct i40e_hw *hw,
u8 phy_select, u8 dev_addr, bool page_change, u8 phy_select, u8 dev_addr, bool page_change,
bool set_mdio, u8 mdio_num, bool set_mdio, u8 mdio_num,
...@@ -469,27 +474,27 @@ i40e_aq_get_phy_register_ext(struct i40e_hw *hw, ...@@ -469,27 +474,27 @@ i40e_aq_get_phy_register_ext(struct i40e_hw *hw,
#define i40e_aq_get_phy_register(hw, ps, da, pc, ra, rv, cd) \ #define i40e_aq_get_phy_register(hw, ps, da, pc, ra, rv, cd) \
i40e_aq_get_phy_register_ext(hw, ps, da, pc, false, 0, ra, rv, cd) i40e_aq_get_phy_register_ext(hw, ps, da, pc, false, 0, ra, rv, cd)
i40e_status i40e_read_phy_register_clause22(struct i40e_hw *hw, int i40e_read_phy_register_clause22(struct i40e_hw *hw,
u16 reg, u8 phy_addr, u16 *value); u16 reg, u8 phy_addr, u16 *value);
i40e_status i40e_write_phy_register_clause22(struct i40e_hw *hw, int i40e_write_phy_register_clause22(struct i40e_hw *hw,
u16 reg, u8 phy_addr, u16 value); u16 reg, u8 phy_addr, u16 value);
i40e_status i40e_read_phy_register_clause45(struct i40e_hw *hw, int i40e_read_phy_register_clause45(struct i40e_hw *hw,
u8 page, u16 reg, u8 phy_addr, u16 *value); u8 page, u16 reg, u8 phy_addr, u16 *value);
i40e_status i40e_write_phy_register_clause45(struct i40e_hw *hw, int i40e_write_phy_register_clause45(struct i40e_hw *hw,
u8 page, u16 reg, u8 phy_addr, u16 value); u8 page, u16 reg, u8 phy_addr, u16 value);
i40e_status i40e_read_phy_register(struct i40e_hw *hw, u8 page, u16 reg, int i40e_read_phy_register(struct i40e_hw *hw, u8 page, u16 reg,
u8 phy_addr, u16 *value); u8 phy_addr, u16 *value);
i40e_status i40e_write_phy_register(struct i40e_hw *hw, u8 page, u16 reg, int i40e_write_phy_register(struct i40e_hw *hw, u8 page, u16 reg,
u8 phy_addr, u16 value); u8 phy_addr, u16 value);
u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num); u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num);
i40e_status i40e_blink_phy_link_led(struct i40e_hw *hw, int i40e_blink_phy_link_led(struct i40e_hw *hw,
u32 time, u32 interval); u32 time, u32 interval);
i40e_status i40e_aq_write_ddp(struct i40e_hw *hw, void *buff, int i40e_aq_write_ddp(struct i40e_hw *hw, void *buff,
u16 buff_size, u32 track_id, u16 buff_size, u32 track_id,
u32 *error_offset, u32 *error_info, u32 *error_offset, u32 *error_info,
struct i40e_asq_cmd_details * struct i40e_asq_cmd_details *
cmd_details); cmd_details);
i40e_status i40e_aq_get_ddp_list(struct i40e_hw *hw, void *buff, int i40e_aq_get_ddp_list(struct i40e_hw *hw, void *buff,
u16 buff_size, u8 flags, u16 buff_size, u8 flags,
struct i40e_asq_cmd_details * struct i40e_asq_cmd_details *
cmd_details); cmd_details);
...@@ -499,13 +504,13 @@ i40e_find_segment_in_package(u32 segment_type, ...@@ -499,13 +504,13 @@ i40e_find_segment_in_package(u32 segment_type,
struct i40e_profile_section_header * struct i40e_profile_section_header *
i40e_find_section_in_profile(u32 section_type, i40e_find_section_in_profile(u32 section_type,
struct i40e_profile_segment *profile); struct i40e_profile_segment *profile);
enum i40e_status_code int
i40e_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *i40e_seg, i40e_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *i40e_seg,
u32 track_id); u32 track_id);
enum i40e_status_code int
i40e_rollback_profile(struct i40e_hw *hw, struct i40e_profile_segment *i40e_seg, i40e_rollback_profile(struct i40e_hw *hw, struct i40e_profile_segment *i40e_seg,
u32 track_id); u32 track_id);
enum i40e_status_code int
i40e_add_pinfo_to_list(struct i40e_hw *hw, i40e_add_pinfo_to_list(struct i40e_hw *hw,
struct i40e_profile_segment *profile, struct i40e_profile_segment *profile,
u8 *profile_info_sec, u32 track_id); u8 *profile_info_sec, u32 track_id);
......
...@@ -9,65 +9,30 @@ enum i40e_status_code { ...@@ -9,65 +9,30 @@ enum i40e_status_code {
I40E_SUCCESS = 0, I40E_SUCCESS = 0,
I40E_ERR_NVM = -1, I40E_ERR_NVM = -1,
I40E_ERR_NVM_CHECKSUM = -2, I40E_ERR_NVM_CHECKSUM = -2,
I40E_ERR_PHY = -3,
I40E_ERR_CONFIG = -4, I40E_ERR_CONFIG = -4,
I40E_ERR_PARAM = -5, I40E_ERR_PARAM = -5,
I40E_ERR_MAC_TYPE = -6,
I40E_ERR_UNKNOWN_PHY = -7, I40E_ERR_UNKNOWN_PHY = -7,
I40E_ERR_LINK_SETUP = -8,
I40E_ERR_ADAPTER_STOPPED = -9,
I40E_ERR_INVALID_MAC_ADDR = -10, I40E_ERR_INVALID_MAC_ADDR = -10,
I40E_ERR_DEVICE_NOT_SUPPORTED = -11, I40E_ERR_DEVICE_NOT_SUPPORTED = -11,
I40E_ERR_PRIMARY_REQUESTS_PENDING = -12,
I40E_ERR_INVALID_LINK_SETTINGS = -13,
I40E_ERR_AUTONEG_NOT_COMPLETE = -14,
I40E_ERR_RESET_FAILED = -15, I40E_ERR_RESET_FAILED = -15,
I40E_ERR_SWFW_SYNC = -16,
I40E_ERR_NO_AVAILABLE_VSI = -17, I40E_ERR_NO_AVAILABLE_VSI = -17,
I40E_ERR_NO_MEMORY = -18, I40E_ERR_NO_MEMORY = -18,
I40E_ERR_BAD_PTR = -19, I40E_ERR_BAD_PTR = -19,
I40E_ERR_RING_FULL = -20,
I40E_ERR_INVALID_PD_ID = -21,
I40E_ERR_INVALID_QP_ID = -22,
I40E_ERR_INVALID_CQ_ID = -23,
I40E_ERR_INVALID_CEQ_ID = -24,
I40E_ERR_INVALID_AEQ_ID = -25,
I40E_ERR_INVALID_SIZE = -26, I40E_ERR_INVALID_SIZE = -26,
I40E_ERR_INVALID_ARP_INDEX = -27,
I40E_ERR_INVALID_FPM_FUNC_ID = -28,
I40E_ERR_QP_INVALID_MSG_SIZE = -29,
I40E_ERR_QP_TOOMANY_WRS_POSTED = -30,
I40E_ERR_INVALID_FRAG_COUNT = -31,
I40E_ERR_QUEUE_EMPTY = -32, I40E_ERR_QUEUE_EMPTY = -32,
I40E_ERR_INVALID_ALIGNMENT = -33,
I40E_ERR_FLUSHED_QUEUE = -34,
I40E_ERR_INVALID_PUSH_PAGE_INDEX = -35,
I40E_ERR_INVALID_IMM_DATA_SIZE = -36,
I40E_ERR_TIMEOUT = -37, I40E_ERR_TIMEOUT = -37,
I40E_ERR_OPCODE_MISMATCH = -38,
I40E_ERR_CQP_COMPL_ERROR = -39,
I40E_ERR_INVALID_VF_ID = -40,
I40E_ERR_INVALID_HMCFN_ID = -41,
I40E_ERR_BACKING_PAGE_ERROR = -42,
I40E_ERR_NO_PBLCHUNKS_AVAILABLE = -43,
I40E_ERR_INVALID_PBLE_INDEX = -44,
I40E_ERR_INVALID_SD_INDEX = -45, I40E_ERR_INVALID_SD_INDEX = -45,
I40E_ERR_INVALID_PAGE_DESC_INDEX = -46, I40E_ERR_INVALID_PAGE_DESC_INDEX = -46,
I40E_ERR_INVALID_SD_TYPE = -47, I40E_ERR_INVALID_SD_TYPE = -47,
I40E_ERR_MEMCPY_FAILED = -48,
I40E_ERR_INVALID_HMC_OBJ_INDEX = -49, I40E_ERR_INVALID_HMC_OBJ_INDEX = -49,
I40E_ERR_INVALID_HMC_OBJ_COUNT = -50, I40E_ERR_INVALID_HMC_OBJ_COUNT = -50,
I40E_ERR_INVALID_SRQ_ARM_LIMIT = -51,
I40E_ERR_SRQ_ENABLED = -52,
I40E_ERR_ADMIN_QUEUE_ERROR = -53, I40E_ERR_ADMIN_QUEUE_ERROR = -53,
I40E_ERR_ADMIN_QUEUE_TIMEOUT = -54, I40E_ERR_ADMIN_QUEUE_TIMEOUT = -54,
I40E_ERR_BUF_TOO_SHORT = -55, I40E_ERR_BUF_TOO_SHORT = -55,
I40E_ERR_ADMIN_QUEUE_FULL = -56, I40E_ERR_ADMIN_QUEUE_FULL = -56,
I40E_ERR_ADMIN_QUEUE_NO_WORK = -57, I40E_ERR_ADMIN_QUEUE_NO_WORK = -57,
I40E_ERR_BAD_IWARP_CQE = -58,
I40E_ERR_NVM_BLANK_MODE = -59, I40E_ERR_NVM_BLANK_MODE = -59,
I40E_ERR_NOT_IMPLEMENTED = -60, I40E_ERR_NOT_IMPLEMENTED = -60,
I40E_ERR_PE_DOORBELL_NOT_ENABLED = -61,
I40E_ERR_DIAG_TEST_FAILED = -62, I40E_ERR_DIAG_TEST_FAILED = -62,
I40E_ERR_NOT_READY = -63, I40E_ERR_NOT_READY = -63,
I40E_NOT_SUPPORTED = -64, I40E_NOT_SUPPORTED = -64,
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
**/ **/
static void i40e_vc_vf_broadcast(struct i40e_pf *pf, static void i40e_vc_vf_broadcast(struct i40e_pf *pf,
enum virtchnl_ops v_opcode, enum virtchnl_ops v_opcode,
i40e_status v_retval, u8 *msg, int v_retval, u8 *msg,
u16 msglen) u16 msglen)
{ {
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
...@@ -1247,13 +1247,13 @@ static void i40e_get_vlan_list_sync(struct i40e_vsi *vsi, u16 *num_vlans, ...@@ -1247,13 +1247,13 @@ static void i40e_get_vlan_list_sync(struct i40e_vsi *vsi, u16 *num_vlans,
* @vl: List of VLANs - apply filter for given VLANs * @vl: List of VLANs - apply filter for given VLANs
* @num_vlans: Number of elements in @vl * @num_vlans: Number of elements in @vl
**/ **/
static i40e_status static int
i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable, i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,
bool unicast_enable, s16 *vl, u16 num_vlans) bool unicast_enable, s16 *vl, u16 num_vlans)
{ {
i40e_status aq_ret, aq_tmp = 0;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
int aq_ret, aq_tmp = 0;
int i; int i;
/* No VLAN to set promisc on, set on VSI */ /* No VLAN to set promisc on, set on VSI */
...@@ -1265,9 +1265,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable, ...@@ -1265,9 +1265,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,
int aq_err = pf->hw.aq.asq_last_status; int aq_err = pf->hw.aq.asq_last_status;
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"VF %d failed to set multicast promiscuous mode err %s aq_err %s\n", "VF %d failed to set multicast promiscuous mode err %pe aq_err %s\n",
vf->vf_id, vf->vf_id,
i40e_stat_str(&pf->hw, aq_ret), ERR_PTR(aq_ret),
i40e_aq_str(&pf->hw, aq_err)); i40e_aq_str(&pf->hw, aq_err));
return aq_ret; return aq_ret;
...@@ -1281,9 +1281,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable, ...@@ -1281,9 +1281,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,
int aq_err = pf->hw.aq.asq_last_status; int aq_err = pf->hw.aq.asq_last_status;
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"VF %d failed to set unicast promiscuous mode err %s aq_err %s\n", "VF %d failed to set unicast promiscuous mode err %pe aq_err %s\n",
vf->vf_id, vf->vf_id,
i40e_stat_str(&pf->hw, aq_ret), ERR_PTR(aq_ret),
i40e_aq_str(&pf->hw, aq_err)); i40e_aq_str(&pf->hw, aq_err));
} }
...@@ -1298,9 +1298,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable, ...@@ -1298,9 +1298,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,
int aq_err = pf->hw.aq.asq_last_status; int aq_err = pf->hw.aq.asq_last_status;
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"VF %d failed to set multicast promiscuous mode err %s aq_err %s\n", "VF %d failed to set multicast promiscuous mode err %pe aq_err %s\n",
vf->vf_id, vf->vf_id,
i40e_stat_str(&pf->hw, aq_ret), ERR_PTR(aq_ret),
i40e_aq_str(&pf->hw, aq_err)); i40e_aq_str(&pf->hw, aq_err));
if (!aq_tmp) if (!aq_tmp)
...@@ -1314,9 +1314,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable, ...@@ -1314,9 +1314,9 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,
int aq_err = pf->hw.aq.asq_last_status; int aq_err = pf->hw.aq.asq_last_status;
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"VF %d failed to set unicast promiscuous mode err %s aq_err %s\n", "VF %d failed to set unicast promiscuous mode err %pe aq_err %s\n",
vf->vf_id, vf->vf_id,
i40e_stat_str(&pf->hw, aq_ret), ERR_PTR(aq_ret),
i40e_aq_str(&pf->hw, aq_err)); i40e_aq_str(&pf->hw, aq_err));
if (!aq_tmp) if (!aq_tmp)
...@@ -1340,13 +1340,13 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable, ...@@ -1340,13 +1340,13 @@ i40e_set_vsi_promisc(struct i40e_vf *vf, u16 seid, bool multi_enable,
* Called from the VF to configure the promiscuous mode of * Called from the VF to configure the promiscuous mode of
* VF vsis and from the VF reset path to reset promiscuous mode. * VF vsis and from the VF reset path to reset promiscuous mode.
**/ **/
static i40e_status i40e_config_vf_promiscuous_mode(struct i40e_vf *vf, static int i40e_config_vf_promiscuous_mode(struct i40e_vf *vf,
u16 vsi_id, u16 vsi_id,
bool allmulti, bool allmulti,
bool alluni) bool alluni)
{ {
i40e_status aq_ret = I40E_SUCCESS;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
int aq_ret = I40E_SUCCESS;
struct i40e_vsi *vsi; struct i40e_vsi *vsi;
u16 num_vlans; u16 num_vlans;
s16 *vl; s16 *vl;
...@@ -1956,7 +1956,7 @@ static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode, ...@@ -1956,7 +1956,7 @@ static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode,
struct i40e_pf *pf; struct i40e_pf *pf;
struct i40e_hw *hw; struct i40e_hw *hw;
int abs_vf_id; int abs_vf_id;
i40e_status aq_ret; int aq_ret;
/* validate the request */ /* validate the request */
if (!vf || vf->vf_id >= vf->pf->num_alloc_vfs) if (!vf || vf->vf_id >= vf->pf->num_alloc_vfs)
...@@ -1988,7 +1988,7 @@ static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode, ...@@ -1988,7 +1988,7 @@ static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode,
**/ **/
static int i40e_vc_send_resp_to_vf(struct i40e_vf *vf, static int i40e_vc_send_resp_to_vf(struct i40e_vf *vf,
enum virtchnl_ops opcode, enum virtchnl_ops opcode,
i40e_status retval) int retval)
{ {
return i40e_vc_send_msg_to_vf(vf, opcode, retval, NULL, 0); return i40e_vc_send_msg_to_vf(vf, opcode, retval, NULL, 0);
} }
...@@ -2092,9 +2092,9 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2092,9 +2092,9 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)
{ {
struct virtchnl_vf_resource *vfres = NULL; struct virtchnl_vf_resource *vfres = NULL;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
i40e_status aq_ret = 0;
struct i40e_vsi *vsi; struct i40e_vsi *vsi;
int num_vsis = 1; int num_vsis = 1;
int aq_ret = 0;
size_t len = 0; size_t len = 0;
int ret; int ret;
...@@ -2222,9 +2222,9 @@ static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2222,9 +2222,9 @@ static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf, u8 *msg)
struct virtchnl_promisc_info *info = struct virtchnl_promisc_info *info =
(struct virtchnl_promisc_info *)msg; (struct virtchnl_promisc_info *)msg;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
i40e_status aq_ret = 0;
bool allmulti = false; bool allmulti = false;
bool alluni = false; bool alluni = false;
int aq_ret = 0;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
aq_ret = I40E_ERR_PARAM; aq_ret = I40E_ERR_PARAM;
...@@ -2309,10 +2309,10 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2309,10 +2309,10 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)
struct virtchnl_queue_pair_info *qpi; struct virtchnl_queue_pair_info *qpi;
u16 vsi_id, vsi_queue_id = 0; u16 vsi_id, vsi_queue_id = 0;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
i40e_status aq_ret = 0;
int i, j = 0, idx = 0; int i, j = 0, idx = 0;
struct i40e_vsi *vsi; struct i40e_vsi *vsi;
u16 num_qps_all = 0; u16 num_qps_all = 0;
int aq_ret = 0;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
aq_ret = I40E_ERR_PARAM; aq_ret = I40E_ERR_PARAM;
...@@ -2459,8 +2459,8 @@ static int i40e_vc_config_irq_map_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2459,8 +2459,8 @@ static int i40e_vc_config_irq_map_msg(struct i40e_vf *vf, u8 *msg)
struct virtchnl_irq_map_info *irqmap_info = struct virtchnl_irq_map_info *irqmap_info =
(struct virtchnl_irq_map_info *)msg; (struct virtchnl_irq_map_info *)msg;
struct virtchnl_vector_map *map; struct virtchnl_vector_map *map;
int aq_ret = 0;
u16 vsi_id; u16 vsi_id;
i40e_status aq_ret = 0;
int i; int i;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
...@@ -2575,7 +2575,7 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2575,7 +2575,7 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg)
struct virtchnl_queue_select *vqs = struct virtchnl_queue_select *vqs =
(struct virtchnl_queue_select *)msg; (struct virtchnl_queue_select *)msg;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
i40e_status aq_ret = 0; int aq_ret = 0;
int i; int i;
if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) { if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
...@@ -2633,7 +2633,7 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2633,7 +2633,7 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg)
struct virtchnl_queue_select *vqs = struct virtchnl_queue_select *vqs =
(struct virtchnl_queue_select *)msg; (struct virtchnl_queue_select *)msg;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
i40e_status aq_ret = 0; int aq_ret = 0;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
aq_ret = I40E_ERR_PARAM; aq_ret = I40E_ERR_PARAM;
...@@ -2784,7 +2784,7 @@ static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2784,7 +2784,7 @@ static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg)
(struct virtchnl_queue_select *)msg; (struct virtchnl_queue_select *)msg;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_eth_stats stats; struct i40e_eth_stats stats;
i40e_status aq_ret = 0; int aq_ret = 0;
struct i40e_vsi *vsi; struct i40e_vsi *vsi;
memset(&stats, 0, sizeof(struct i40e_eth_stats)); memset(&stats, 0, sizeof(struct i40e_eth_stats));
...@@ -2927,7 +2927,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2927,7 +2927,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
(struct virtchnl_ether_addr_list *)msg; (struct virtchnl_ether_addr_list *)msg;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_vsi *vsi = NULL; struct i40e_vsi *vsi = NULL;
i40e_status ret = 0; int ret = 0;
int i; int i;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) || if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||
...@@ -2999,7 +2999,7 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2999,7 +2999,7 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
bool was_unimac_deleted = false; bool was_unimac_deleted = false;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_vsi *vsi = NULL; struct i40e_vsi *vsi = NULL;
i40e_status ret = 0; int ret = 0;
int i; int i;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) || if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||
...@@ -3072,7 +3072,7 @@ static int i40e_vc_add_vlan_msg(struct i40e_vf *vf, u8 *msg) ...@@ -3072,7 +3072,7 @@ static int i40e_vc_add_vlan_msg(struct i40e_vf *vf, u8 *msg)
(struct virtchnl_vlan_filter_list *)msg; (struct virtchnl_vlan_filter_list *)msg;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_vsi *vsi = NULL; struct i40e_vsi *vsi = NULL;
i40e_status aq_ret = 0; int aq_ret = 0;
int i; int i;
if ((vf->num_vlan >= I40E_VC_MAX_VLAN_PER_VF) && if ((vf->num_vlan >= I40E_VC_MAX_VLAN_PER_VF) &&
...@@ -3143,7 +3143,7 @@ static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg) ...@@ -3143,7 +3143,7 @@ static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg)
(struct virtchnl_vlan_filter_list *)msg; (struct virtchnl_vlan_filter_list *)msg;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_vsi *vsi = NULL; struct i40e_vsi *vsi = NULL;
i40e_status aq_ret = 0; int aq_ret = 0;
int i; int i;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) || if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||
...@@ -3199,7 +3199,7 @@ static int i40e_vc_rdma_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) ...@@ -3199,7 +3199,7 @@ static int i40e_vc_rdma_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
{ {
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
int abs_vf_id = vf->vf_id + pf->hw.func_caps.vf_base_id; int abs_vf_id = vf->vf_id + pf->hw.func_caps.vf_base_id;
i40e_status aq_ret = 0; int aq_ret = 0;
if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) || if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||
!test_bit(I40E_VF_STATE_RDMAENA, &vf->vf_states)) { !test_bit(I40E_VF_STATE_RDMAENA, &vf->vf_states)) {
...@@ -3228,7 +3228,7 @@ static int i40e_vc_rdma_qvmap_msg(struct i40e_vf *vf, u8 *msg, bool config) ...@@ -3228,7 +3228,7 @@ static int i40e_vc_rdma_qvmap_msg(struct i40e_vf *vf, u8 *msg, bool config)
{ {
struct virtchnl_rdma_qvlist_info *qvlist_info = struct virtchnl_rdma_qvlist_info *qvlist_info =
(struct virtchnl_rdma_qvlist_info *)msg; (struct virtchnl_rdma_qvlist_info *)msg;
i40e_status aq_ret = 0; int aq_ret = 0;
if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) || if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||
!test_bit(I40E_VF_STATE_RDMAENA, &vf->vf_states)) { !test_bit(I40E_VF_STATE_RDMAENA, &vf->vf_states)) {
...@@ -3264,7 +3264,7 @@ static int i40e_vc_config_rss_key(struct i40e_vf *vf, u8 *msg) ...@@ -3264,7 +3264,7 @@ static int i40e_vc_config_rss_key(struct i40e_vf *vf, u8 *msg)
(struct virtchnl_rss_key *)msg; (struct virtchnl_rss_key *)msg;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_vsi *vsi = NULL; struct i40e_vsi *vsi = NULL;
i40e_status aq_ret = 0; int aq_ret = 0;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) || if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||
!i40e_vc_isvalid_vsi_id(vf, vrk->vsi_id) || !i40e_vc_isvalid_vsi_id(vf, vrk->vsi_id) ||
...@@ -3294,7 +3294,7 @@ static int i40e_vc_config_rss_lut(struct i40e_vf *vf, u8 *msg) ...@@ -3294,7 +3294,7 @@ static int i40e_vc_config_rss_lut(struct i40e_vf *vf, u8 *msg)
(struct virtchnl_rss_lut *)msg; (struct virtchnl_rss_lut *)msg;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_vsi *vsi = NULL; struct i40e_vsi *vsi = NULL;
i40e_status aq_ret = 0; int aq_ret = 0;
u16 i; u16 i;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) || if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||
...@@ -3329,7 +3329,7 @@ static int i40e_vc_get_rss_hena(struct i40e_vf *vf, u8 *msg) ...@@ -3329,7 +3329,7 @@ static int i40e_vc_get_rss_hena(struct i40e_vf *vf, u8 *msg)
{ {
struct virtchnl_rss_hena *vrh = NULL; struct virtchnl_rss_hena *vrh = NULL;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
i40e_status aq_ret = 0; int aq_ret = 0;
int len = 0; int len = 0;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
...@@ -3366,7 +3366,7 @@ static int i40e_vc_set_rss_hena(struct i40e_vf *vf, u8 *msg) ...@@ -3366,7 +3366,7 @@ static int i40e_vc_set_rss_hena(struct i40e_vf *vf, u8 *msg)
(struct virtchnl_rss_hena *)msg; (struct virtchnl_rss_hena *)msg;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
i40e_status aq_ret = 0; int aq_ret = 0;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
aq_ret = I40E_ERR_PARAM; aq_ret = I40E_ERR_PARAM;
...@@ -3390,8 +3390,8 @@ static int i40e_vc_set_rss_hena(struct i40e_vf *vf, u8 *msg) ...@@ -3390,8 +3390,8 @@ static int i40e_vc_set_rss_hena(struct i40e_vf *vf, u8 *msg)
**/ **/
static int i40e_vc_enable_vlan_stripping(struct i40e_vf *vf, u8 *msg) static int i40e_vc_enable_vlan_stripping(struct i40e_vf *vf, u8 *msg)
{ {
i40e_status aq_ret = 0;
struct i40e_vsi *vsi; struct i40e_vsi *vsi;
int aq_ret = 0;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
aq_ret = I40E_ERR_PARAM; aq_ret = I40E_ERR_PARAM;
...@@ -3416,8 +3416,8 @@ static int i40e_vc_enable_vlan_stripping(struct i40e_vf *vf, u8 *msg) ...@@ -3416,8 +3416,8 @@ static int i40e_vc_enable_vlan_stripping(struct i40e_vf *vf, u8 *msg)
**/ **/
static int i40e_vc_disable_vlan_stripping(struct i40e_vf *vf, u8 *msg) static int i40e_vc_disable_vlan_stripping(struct i40e_vf *vf, u8 *msg)
{ {
i40e_status aq_ret = 0;
struct i40e_vsi *vsi; struct i40e_vsi *vsi;
int aq_ret = 0;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
aq_ret = I40E_ERR_PARAM; aq_ret = I40E_ERR_PARAM;
...@@ -3616,8 +3616,8 @@ static void i40e_del_all_cloud_filters(struct i40e_vf *vf) ...@@ -3616,8 +3616,8 @@ static void i40e_del_all_cloud_filters(struct i40e_vf *vf)
ret = i40e_add_del_cloud_filter(vsi, cfilter, false); ret = i40e_add_del_cloud_filter(vsi, cfilter, false);
if (ret) if (ret)
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"VF %d: Failed to delete cloud filter, err %s aq_err %s\n", "VF %d: Failed to delete cloud filter, err %pe aq_err %s\n",
vf->vf_id, i40e_stat_str(&pf->hw, ret), vf->vf_id, ERR_PTR(ret),
i40e_aq_str(&pf->hw, i40e_aq_str(&pf->hw,
pf->hw.aq.asq_last_status)); pf->hw.aq.asq_last_status));
...@@ -3643,7 +3643,7 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg) ...@@ -3643,7 +3643,7 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg)
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_vsi *vsi = NULL; struct i40e_vsi *vsi = NULL;
struct hlist_node *node; struct hlist_node *node;
i40e_status aq_ret = 0; int aq_ret = 0;
int i, ret; int i, ret;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
...@@ -3719,8 +3719,8 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg) ...@@ -3719,8 +3719,8 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg)
ret = i40e_add_del_cloud_filter(vsi, &cfilter, false); ret = i40e_add_del_cloud_filter(vsi, &cfilter, false);
if (ret) { if (ret) {
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"VF %d: Failed to delete cloud filter, err %s aq_err %s\n", "VF %d: Failed to delete cloud filter, err %pe aq_err %s\n",
vf->vf_id, i40e_stat_str(&pf->hw, ret), vf->vf_id, ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
goto err; goto err;
} }
...@@ -3774,7 +3774,7 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg) ...@@ -3774,7 +3774,7 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg)
struct i40e_cloud_filter *cfilter = NULL; struct i40e_cloud_filter *cfilter = NULL;
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_vsi *vsi = NULL; struct i40e_vsi *vsi = NULL;
i40e_status aq_ret = 0; int aq_ret = 0;
int i, ret; int i, ret;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
...@@ -3853,8 +3853,8 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg) ...@@ -3853,8 +3853,8 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg)
ret = i40e_add_del_cloud_filter(vsi, cfilter, true); ret = i40e_add_del_cloud_filter(vsi, cfilter, true);
if (ret) { if (ret) {
dev_err(&pf->pdev->dev, dev_err(&pf->pdev->dev,
"VF %d: Failed to add cloud filter, err %s aq_err %s\n", "VF %d: Failed to add cloud filter, err %pe aq_err %s\n",
vf->vf_id, i40e_stat_str(&pf->hw, ret), vf->vf_id, ERR_PTR(ret),
i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
goto err_free; goto err_free;
} }
...@@ -3883,7 +3883,7 @@ static int i40e_vc_add_qch_msg(struct i40e_vf *vf, u8 *msg) ...@@ -3883,7 +3883,7 @@ static int i40e_vc_add_qch_msg(struct i40e_vf *vf, u8 *msg)
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_link_status *ls = &pf->hw.phy.link_info; struct i40e_link_status *ls = &pf->hw.phy.link_info;
int i, adq_request_qps = 0; int i, adq_request_qps = 0;
i40e_status aq_ret = 0; int aq_ret = 0;
u64 speed = 0; u64 speed = 0;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
...@@ -3995,7 +3995,7 @@ static int i40e_vc_add_qch_msg(struct i40e_vf *vf, u8 *msg) ...@@ -3995,7 +3995,7 @@ static int i40e_vc_add_qch_msg(struct i40e_vf *vf, u8 *msg)
static int i40e_vc_del_qch_msg(struct i40e_vf *vf, u8 *msg) static int i40e_vc_del_qch_msg(struct i40e_vf *vf, u8 *msg)
{ {
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
i40e_status aq_ret = 0; int aq_ret = 0;
if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) { if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {
aq_ret = I40E_ERR_PARAM; aq_ret = I40E_ERR_PARAM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册