提交 5180ff13 编写于 作者: J Jan Sokolowski 提交者: Tony Nguyen

i40e: use int for i40e_status

To prepare for removal of i40e_status, change the variables
from i40e_status to int. This eases the transition when values
are changed to return standard int error codes over enum i40e_status.

As such changes often also change variable orders, a cleanup
is also applied here to make variables conform to RCT and
some lines are also reformatted where applicable.
Signed-off-by: NJan Sokolowski <jan.sokolowski@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
上级 5d968af2
...@@ -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)
......
...@@ -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,8 +1274,8 @@ i40e_status i40e_set_dcb_config(struct i40e_hw *hw) ...@@ -1274,8 +1274,8 @@ 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;
struct i40e_lldp_org_tlv *tlv; struct i40e_lldp_org_tlv *tlv;
...@@ -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_ */
...@@ -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,8 +10,8 @@ ...@@ -10,8 +10,8 @@
* @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[] = {
0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF 0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF
...@@ -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;
...@@ -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;
...@@ -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,7 +1634,7 @@ static int i40e_nway_reset(struct net_device *netdev) ...@@ -1634,7 +1634,7 @@ 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) {
...@@ -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
...@@ -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);
...@@ -5476,8 +5476,8 @@ static int i40e_get_module_info(struct net_device *netdev, ...@@ -5476,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)) {
...@@ -5581,8 +5581,8 @@ static int i40e_get_module_eeprom(struct net_device *netdev, ...@@ -5581,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)
...@@ -5623,10 +5623,10 @@ static int i40e_get_eee(struct net_device *netdev, struct ethtool_eee *edata) ...@@ -5623,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);
...@@ -5688,11 +5688,11 @@ static int i40e_set_eee(struct net_device *netdev, struct ethtool_eee *edata) ...@@ -5688,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,17 +17,17 @@ ...@@ -17,17 +17,17 @@
* @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,
u64 direct_mode_sz) u64 direct_mode_sz)
{ {
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,9 +269,9 @@ i40e_status i40e_prep_remove_sd_bp(struct i40e_hmc_info *hmc_info, ...@@ -269,9 +269,9 @@ 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)
{ {
struct i40e_hmc_sd_entry *sd_entry; struct i40e_hmc_sd_entry *sd_entry;
...@@ -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,9 +318,9 @@ i40e_status i40e_prep_remove_pd_page(struct i40e_hmc_info *hmc_info, ...@@ -318,9 +318,9 @@ 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)
{ {
struct i40e_hmc_sd_entry *sd_entry; struct i40e_hmc_sd_entry *sd_entry;
......
...@@ -187,28 +187,28 @@ struct i40e_hmc_info { ...@@ -187,28 +187,28 @@ 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,
struct i40e_hmc_info *hmc_info, int i40e_add_sd_table_entry(struct i40e_hw *hw,
u32 sd_index, struct i40e_hmc_info *hmc_info,
enum i40e_sd_entry_type type, u32 sd_index,
u64 direct_mode_sz); enum i40e_sd_entry_type type,
u64 direct_mode_sz);
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 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);
#endif /* _I40E_HMC_H_ */ #endif /* _I40E_HMC_H_ */
...@@ -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,9 +915,9 @@ static void i40e_write_qword(u8 *hmc_bits, ...@@ -915,9 +915,9 @@ 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)
{ {
/* clean the bit array */ /* clean the bit array */
memset(context_bytes, 0, (u32)hw->hmc.hmc_obj[hmc_type].size); memset(context_bytes, 0, (u32)hw->hmc.hmc_obj[hmc_type].size);
...@@ -931,9 +931,9 @@ static i40e_status i40e_clear_hmc_context(struct i40e_hw *hw, ...@@ -931,9 +931,9 @@ 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)
{ {
int f; int f;
...@@ -973,18 +973,18 @@ static i40e_status i40e_set_hmc_context(u8 *context_bytes, ...@@ -973,18 +973,18 @@ 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)
{ {
struct i40e_hmc_info *hmc_info = &hw->hmc; struct i40e_hmc_info *hmc_info = &hw->hmc;
u32 obj_offset_in_sd, obj_offset_in_pd; u32 obj_offset_in_sd, obj_offset_in_pd;
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,22 +137,22 @@ struct i40e_hmc_lan_delete_obj_info { ...@@ -137,22 +137,22 @@ 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);
#endif /* _I40E_LAN_HMC_H_ */ #endif /* _I40E_LAN_HMC_H_ */
...@@ -1817,7 +1817,7 @@ static int i40e_set_mac(struct net_device *netdev, void *p) ...@@ -1817,7 +1817,7 @@ 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);
...@@ -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);
...@@ -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 &&
...@@ -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;
...@@ -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)
...@@ -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)
...@@ -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);
...@@ -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,8 +5525,8 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi) ...@@ -5525,8 +5525,8 @@ 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 */
...@@ -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. */
...@@ -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++) {
...@@ -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
...@@ -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;
...@@ -9886,8 +9886,8 @@ static void i40e_link_event(struct i40e_pf *pf) ...@@ -9886,8 +9886,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 */
...@@ -10098,9 +10098,9 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf) ...@@ -10098,9 +10098,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 */
...@@ -10579,7 +10579,7 @@ static int i40e_rebuild_cloud_filters(struct i40e_vsi *vsi, u16 seid) ...@@ -10579,7 +10579,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,
...@@ -10614,7 +10614,7 @@ static int i40e_rebuild_cloud_filters(struct i40e_vsi *vsi, u16 seid) ...@@ -10614,7 +10614,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;
...@@ -10690,7 +10690,7 @@ static void i40e_clean_xps_state(struct i40e_vsi *vsi) ...@@ -10690,7 +10690,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);
...@@ -10795,7 +10795,7 @@ static void i40e_get_oem_version(struct i40e_hw *hw) ...@@ -10795,7 +10795,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) {
...@@ -10820,7 +10820,7 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) ...@@ -10820,7 +10820,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;
...@@ -12507,11 +12507,11 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count) ...@@ -12507,11 +12507,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);
...@@ -12530,10 +12530,10 @@ i40e_status i40e_get_partition_bw_setting(struct i40e_pf *pf) ...@@ -12530,10 +12530,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));
...@@ -12552,12 +12552,12 @@ i40e_status i40e_set_partition_bw_setting(struct i40e_pf *pf) ...@@ -12552,12 +12552,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,
...@@ -12645,7 +12645,7 @@ static bool i40e_is_total_port_shutdown_enabled(struct i40e_pf *pf) ...@@ -12645,7 +12645,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;
...@@ -13024,7 +13024,7 @@ static int i40e_udp_tunnel_set_port(struct net_device *netdev, ...@@ -13024,7 +13024,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;
...@@ -13048,7 +13048,7 @@ static int i40e_udp_tunnel_unset_port(struct net_device *netdev, ...@@ -13048,7 +13048,7 @@ 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) {
...@@ -15436,13 +15436,12 @@ static bool i40e_check_recovery_mode(struct i40e_pf *pf) ...@@ -15436,13 +15436,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)) {
...@@ -15488,9 +15487,9 @@ static bool i40e_check_fw_empr(struct i40e_pf *pf) ...@@ -15488,9 +15487,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)
...@@ -15627,13 +15626,15 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -15627,13 +15626,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;
...@@ -16235,7 +16236,7 @@ static void i40e_remove(struct pci_dev *pdev) ...@@ -16235,7 +16236,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);
...@@ -16482,9 +16483,9 @@ static void i40e_pci_error_resume(struct pci_dev *pdev) ...@@ -16482,9 +16483,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,8 +286,8 @@ static i40e_status i40e_read_nvm_word_aq(struct i40e_hw *hw, u16 offset, ...@@ -286,8 +286,8 @@ 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)
return i40e_read_nvm_word_aq(hw, offset, data); return i40e_read_nvm_word_aq(hw, offset, data);
...@@ -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,9 +493,9 @@ static i40e_status i40e_read_nvm_buffer_aq(struct i40e_hw *hw, u16 offset, ...@@ -493,9 +493,9 @@ 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)
{ {
if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE)
return i40e_read_nvm_buffer_aq(hw, offset, words, data); return i40e_read_nvm_buffer_aq(hw, offset, words, 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,36 +733,36 @@ i40e_status i40e_validate_nvm_checksum(struct i40e_hw *hw, ...@@ -733,36 +733,36 @@ 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)
{ {
return (u8)(val & I40E_NVM_MOD_PNT_MASK); return (u8)(val & I40E_NVM_MOD_PNT_MASK);
...@@ -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)
...@@ -1454,9 +1454,9 @@ static i40e_status i40e_nvmupd_exec_aq(struct i40e_hw *hw, ...@@ -1454,9 +1454,9 @@ 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)
{ {
u32 aq_total_len; u32 aq_total_len;
u32 aq_desc_len; u32 aq_desc_len;
...@@ -1523,9 +1523,9 @@ static i40e_status i40e_nvmupd_get_aq_result(struct i40e_hw *hw, ...@@ -1523,9 +1523,9 @@ 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)
{ {
u32 aq_total_len; u32 aq_total_len;
u32 aq_desc_len; u32 aq_desc_len;
...@@ -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_ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册