Commit 80754bbc authored by Sergey Nemov's avatar Sergey Nemov Committed by Jeff Kirsher

iavf: change iavf_status_code to iavf_status

Instead of typedefing the enum iavf_status_code with iavf_status,
just shorten the enum itself and get rid of typedef.
Signed-off-by: default avatarSergey Nemov <sergey.nemov@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 8be454c9
...@@ -402,7 +402,7 @@ void iavf_enable_vlan_stripping(struct iavf_adapter *adapter); ...@@ -402,7 +402,7 @@ void iavf_enable_vlan_stripping(struct iavf_adapter *adapter);
void iavf_disable_vlan_stripping(struct iavf_adapter *adapter); void iavf_disable_vlan_stripping(struct iavf_adapter *adapter);
void iavf_virtchnl_completion(struct iavf_adapter *adapter, void iavf_virtchnl_completion(struct iavf_adapter *adapter,
enum virtchnl_ops v_opcode, enum virtchnl_ops v_opcode,
iavf_status v_retval, u8 *msg, u16 msglen); enum iavf_status v_retval, u8 *msg, u16 msglen);
int iavf_config_rss(struct iavf_adapter *adapter); int iavf_config_rss(struct iavf_adapter *adapter);
int iavf_lan_add_device(struct iavf_adapter *adapter); int iavf_lan_add_device(struct iavf_adapter *adapter);
int iavf_lan_del_device(struct iavf_adapter *adapter); int iavf_lan_del_device(struct iavf_adapter *adapter);
......
...@@ -32,9 +32,9 @@ static void i40e_adminq_init_regs(struct iavf_hw *hw) ...@@ -32,9 +32,9 @@ static void i40e_adminq_init_regs(struct iavf_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 iavf_status i40e_alloc_adminq_asq_ring(struct iavf_hw *hw) static enum iavf_status i40e_alloc_adminq_asq_ring(struct iavf_hw *hw)
{ {
iavf_status ret_code; enum iavf_status ret_code;
ret_code = iavf_allocate_dma_mem(hw, &hw->aq.asq.desc_buf, ret_code = iavf_allocate_dma_mem(hw, &hw->aq.asq.desc_buf,
i40e_mem_atq_ring, i40e_mem_atq_ring,
...@@ -59,9 +59,9 @@ static iavf_status i40e_alloc_adminq_asq_ring(struct iavf_hw *hw) ...@@ -59,9 +59,9 @@ static iavf_status i40e_alloc_adminq_asq_ring(struct iavf_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 iavf_status i40e_alloc_adminq_arq_ring(struct iavf_hw *hw) static enum iavf_status i40e_alloc_adminq_arq_ring(struct iavf_hw *hw)
{ {
iavf_status ret_code; enum iavf_status ret_code;
ret_code = iavf_allocate_dma_mem(hw, &hw->aq.arq.desc_buf, ret_code = iavf_allocate_dma_mem(hw, &hw->aq.arq.desc_buf,
i40e_mem_arq_ring, i40e_mem_arq_ring,
...@@ -100,11 +100,11 @@ static void i40e_free_adminq_arq(struct iavf_hw *hw) ...@@ -100,11 +100,11 @@ static void i40e_free_adminq_arq(struct iavf_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 iavf_status i40e_alloc_arq_bufs(struct iavf_hw *hw) static enum iavf_status i40e_alloc_arq_bufs(struct iavf_hw *hw)
{ {
struct i40e_aq_desc *desc; struct i40e_aq_desc *desc;
struct iavf_dma_mem *bi; struct iavf_dma_mem *bi;
iavf_status ret_code; enum iavf_status 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
...@@ -168,10 +168,10 @@ static iavf_status i40e_alloc_arq_bufs(struct iavf_hw *hw) ...@@ -168,10 +168,10 @@ static iavf_status i40e_alloc_arq_bufs(struct iavf_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 iavf_status i40e_alloc_asq_bufs(struct iavf_hw *hw) static enum iavf_status i40e_alloc_asq_bufs(struct iavf_hw *hw)
{ {
struct iavf_dma_mem *bi; struct iavf_dma_mem *bi;
iavf_status ret_code; enum iavf_status 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 */
...@@ -253,9 +253,9 @@ static void i40e_free_asq_bufs(struct iavf_hw *hw) ...@@ -253,9 +253,9 @@ static void i40e_free_asq_bufs(struct iavf_hw *hw)
* *
* Configure base address and length registers for the transmit queue * Configure base address and length registers for the transmit queue
**/ **/
static iavf_status i40e_config_asq_regs(struct iavf_hw *hw) static enum iavf_status i40e_config_asq_regs(struct iavf_hw *hw)
{ {
iavf_status ret_code = 0; enum iavf_status ret_code = 0;
u32 reg = 0; u32 reg = 0;
/* Clear Head and Tail */ /* Clear Head and Tail */
...@@ -282,9 +282,9 @@ static iavf_status i40e_config_asq_regs(struct iavf_hw *hw) ...@@ -282,9 +282,9 @@ static iavf_status i40e_config_asq_regs(struct iavf_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 iavf_status i40e_config_arq_regs(struct iavf_hw *hw) static enum iavf_status i40e_config_arq_regs(struct iavf_hw *hw)
{ {
iavf_status ret_code = 0; enum iavf_status ret_code = 0;
u32 reg = 0; u32 reg = 0;
/* Clear Head and Tail */ /* Clear Head and Tail */
...@@ -321,9 +321,9 @@ static iavf_status i40e_config_arq_regs(struct iavf_hw *hw) ...@@ -321,9 +321,9 @@ static iavf_status i40e_config_arq_regs(struct iavf_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 iavf_status i40e_init_asq(struct iavf_hw *hw) static enum iavf_status i40e_init_asq(struct iavf_hw *hw)
{ {
iavf_status ret_code = 0; enum iavf_status ret_code = 0;
if (hw->aq.asq.count > 0) { if (hw->aq.asq.count > 0) {
/* queue already initialized */ /* queue already initialized */
...@@ -380,9 +380,9 @@ static iavf_status i40e_init_asq(struct iavf_hw *hw) ...@@ -380,9 +380,9 @@ static iavf_status i40e_init_asq(struct iavf_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 iavf_status i40e_init_arq(struct iavf_hw *hw) static enum iavf_status i40e_init_arq(struct iavf_hw *hw)
{ {
iavf_status ret_code = 0; enum iavf_status ret_code = 0;
if (hw->aq.arq.count > 0) { if (hw->aq.arq.count > 0) {
/* queue already initialized */ /* queue already initialized */
...@@ -432,9 +432,9 @@ static iavf_status i40e_init_arq(struct iavf_hw *hw) ...@@ -432,9 +432,9 @@ static iavf_status i40e_init_arq(struct iavf_hw *hw)
* *
* The main shutdown routine for the Admin Send Queue * The main shutdown routine for the Admin Send Queue
**/ **/
static iavf_status i40e_shutdown_asq(struct iavf_hw *hw) static enum iavf_status i40e_shutdown_asq(struct iavf_hw *hw)
{ {
iavf_status ret_code = 0; enum iavf_status ret_code = 0;
mutex_lock(&hw->aq.asq_mutex); mutex_lock(&hw->aq.asq_mutex);
...@@ -466,9 +466,9 @@ static iavf_status i40e_shutdown_asq(struct iavf_hw *hw) ...@@ -466,9 +466,9 @@ static iavf_status i40e_shutdown_asq(struct iavf_hw *hw)
* *
* The main shutdown routine for the Admin Receive Queue * The main shutdown routine for the Admin Receive Queue
**/ **/
static iavf_status i40e_shutdown_arq(struct iavf_hw *hw) static enum iavf_status i40e_shutdown_arq(struct iavf_hw *hw)
{ {
iavf_status ret_code = 0; enum iavf_status ret_code = 0;
mutex_lock(&hw->aq.arq_mutex); mutex_lock(&hw->aq.arq_mutex);
...@@ -505,9 +505,9 @@ static iavf_status i40e_shutdown_arq(struct iavf_hw *hw) ...@@ -505,9 +505,9 @@ static iavf_status i40e_shutdown_arq(struct iavf_hw *hw)
* - hw->aq.arq_buf_size * - hw->aq.arq_buf_size
* - hw->aq.asq_buf_size * - hw->aq.asq_buf_size
**/ **/
iavf_status iavf_init_adminq(struct iavf_hw *hw) enum iavf_status iavf_init_adminq(struct iavf_hw *hw)
{ {
iavf_status ret_code; enum iavf_status 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) ||
...@@ -549,9 +549,9 @@ iavf_status iavf_init_adminq(struct iavf_hw *hw) ...@@ -549,9 +549,9 @@ iavf_status iavf_init_adminq(struct iavf_hw *hw)
* iavf_shutdown_adminq - shutdown routine for the Admin Queue * iavf_shutdown_adminq - shutdown routine for the Admin Queue
* @hw: pointer to the hardware structure * @hw: pointer to the hardware structure
**/ **/
iavf_status iavf_shutdown_adminq(struct iavf_hw *hw) enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw)
{ {
iavf_status ret_code = 0; enum iavf_status ret_code = 0;
if (iavf_check_asq_alive(hw)) if (iavf_check_asq_alive(hw))
iavf_aq_queue_shutdown(hw, true); iavf_aq_queue_shutdown(hw, true);
...@@ -629,7 +629,8 @@ bool iavf_asq_done(struct iavf_hw *hw) ...@@ -629,7 +629,8 @@ bool iavf_asq_done(struct iavf_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
**/ **/
iavf_status iavf_asq_send_command(struct iavf_hw *hw, struct i40e_aq_desc *desc, enum iavf_status iavf_asq_send_command(struct iavf_hw *hw,
struct i40e_aq_desc *desc,
void *buff, /* can be NULL */ void *buff, /* can be NULL */
u16 buff_size, u16 buff_size,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
...@@ -638,7 +639,7 @@ iavf_status iavf_asq_send_command(struct iavf_hw *hw, struct i40e_aq_desc *desc, ...@@ -638,7 +639,7 @@ iavf_status iavf_asq_send_command(struct iavf_hw *hw, struct i40e_aq_desc *desc,
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;
iavf_status status = 0; enum iavf_status status = 0;
u16 retval = 0; u16 retval = 0;
u32 val = 0; u32 val = 0;
...@@ -841,13 +842,13 @@ void iavf_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc, u16 opcode) ...@@ -841,13 +842,13 @@ void iavf_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc, u16 opcode)
* 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'
**/ **/
iavf_status iavf_clean_arq_element(struct iavf_hw *hw, enum iavf_status iavf_clean_arq_element(struct iavf_hw *hw,
struct i40e_arq_event_info *e, struct i40e_arq_event_info *e,
u16 *pending) u16 *pending)
{ {
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;
iavf_status ret_code = 0; enum iavf_status ret_code = 0;
struct iavf_dma_mem *bi; struct iavf_dma_mem *bi;
u16 desc_idx; u16 desc_idx;
u16 datalen; u16 datalen;
......
...@@ -20,12 +20,15 @@ enum iavf_memory_type { ...@@ -20,12 +20,15 @@ enum iavf_memory_type {
}; };
/* prototype for functions used for dynamic memory allocation */ /* prototype for functions used for dynamic memory allocation */
iavf_status iavf_allocate_dma_mem(struct iavf_hw *hw, struct iavf_dma_mem *mem, enum iavf_status iavf_allocate_dma_mem(struct iavf_hw *hw,
struct iavf_dma_mem *mem,
enum iavf_memory_type type, enum iavf_memory_type type,
u64 size, u32 alignment); u64 size, u32 alignment);
iavf_status iavf_free_dma_mem(struct iavf_hw *hw, struct iavf_dma_mem *mem); enum iavf_status iavf_free_dma_mem(struct iavf_hw *hw,
iavf_status iavf_allocate_virt_mem(struct iavf_hw *hw, struct iavf_dma_mem *mem);
enum iavf_status iavf_allocate_virt_mem(struct iavf_hw *hw,
struct iavf_virt_mem *mem, u32 size); struct iavf_virt_mem *mem, u32 size);
iavf_status iavf_free_virt_mem(struct iavf_hw *hw, struct iavf_virt_mem *mem); enum iavf_status iavf_free_virt_mem(struct iavf_hw *hw,
struct iavf_virt_mem *mem);
#endif /* _IAVF_ALLOC_H_ */ #endif /* _IAVF_ALLOC_H_ */
...@@ -135,7 +135,7 @@ void iavf_notify_client_open(struct iavf_vsi *vsi) ...@@ -135,7 +135,7 @@ void iavf_notify_client_open(struct iavf_vsi *vsi)
static int iavf_client_release_qvlist(struct i40e_info *ldev) static int iavf_client_release_qvlist(struct i40e_info *ldev)
{ {
struct iavf_adapter *adapter = ldev->vf; struct iavf_adapter *adapter = ldev->vf;
iavf_status err; enum iavf_status err;
if (adapter->aq_required) if (adapter->aq_required)
return -EAGAIN; return -EAGAIN;
...@@ -420,7 +420,7 @@ static u32 iavf_client_virtchnl_send(struct i40e_info *ldev, ...@@ -420,7 +420,7 @@ static u32 iavf_client_virtchnl_send(struct i40e_info *ldev,
u8 *msg, u16 len) u8 *msg, u16 len)
{ {
struct iavf_adapter *adapter = ldev->vf; struct iavf_adapter *adapter = ldev->vf;
iavf_status err; enum iavf_status err;
if (adapter->aq_required) if (adapter->aq_required)
return -EAGAIN; return -EAGAIN;
...@@ -449,7 +449,7 @@ static int iavf_client_setup_qvlist(struct i40e_info *ldev, ...@@ -449,7 +449,7 @@ static int iavf_client_setup_qvlist(struct i40e_info *ldev,
struct virtchnl_iwarp_qvlist_info *v_qvlist_info; struct virtchnl_iwarp_qvlist_info *v_qvlist_info;
struct iavf_adapter *adapter = ldev->vf; struct iavf_adapter *adapter = ldev->vf;
struct i40e_qv_info *qv_info; struct i40e_qv_info *qv_info;
iavf_status err; enum iavf_status err;
u32 v_idx, i; u32 v_idx, i;
size_t msg_size; size_t msg_size;
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
* This function sets the mac type of the adapter based on the * This function sets the mac type of the adapter based on the
* vendor ID and device ID stored in the hw structure. * vendor ID and device ID stored in the hw structure.
**/ **/
iavf_status iavf_set_mac_type(struct iavf_hw *hw) enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)
{ {
iavf_status status = 0; enum iavf_status status = 0;
if (hw->vendor_id == PCI_VENDOR_ID_INTEL) { if (hw->vendor_id == PCI_VENDOR_ID_INTEL) {
switch (hw->device_id) { switch (hw->device_id) {
...@@ -104,7 +104,7 @@ const char *iavf_aq_str(struct iavf_hw *hw, enum i40e_admin_queue_err aq_err) ...@@ -104,7 +104,7 @@ const char *iavf_aq_str(struct iavf_hw *hw, enum i40e_admin_queue_err aq_err)
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* @stat_err: the status error code to convert * @stat_err: the status error code to convert
**/ **/
const char *iavf_stat_str(struct iavf_hw *hw, iavf_status stat_err) const char *iavf_stat_str(struct iavf_hw *hw, enum iavf_status stat_err)
{ {
switch (stat_err) { switch (stat_err) {
case 0: case 0:
...@@ -327,12 +327,12 @@ bool iavf_check_asq_alive(struct iavf_hw *hw) ...@@ -327,12 +327,12 @@ bool iavf_check_asq_alive(struct iavf_hw *hw)
* Tell the Firmware that we're shutting down the AdminQ and whether * Tell the Firmware that we're shutting down the AdminQ and whether
* or not the driver is unloading as well. * or not the driver is unloading as well.
**/ **/
iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading) enum iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading)
{ {
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_queue_shutdown *cmd = struct i40e_aqc_queue_shutdown *cmd =
(struct i40e_aqc_queue_shutdown *)&desc.params.raw; (struct i40e_aqc_queue_shutdown *)&desc.params.raw;
iavf_status status; enum iavf_status status;
iavf_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_queue_shutdown); iavf_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_queue_shutdown);
...@@ -354,12 +354,12 @@ iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading) ...@@ -354,12 +354,12 @@ iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading)
* *
* Internal function to get or set RSS look up table * Internal function to get or set RSS look up table
**/ **/
static iavf_status iavf_aq_get_set_rss_lut(struct iavf_hw *hw, static enum iavf_status iavf_aq_get_set_rss_lut(struct iavf_hw *hw,
u16 vsi_id, bool pf_lut, u16 vsi_id, bool pf_lut,
u8 *lut, u16 lut_size, u8 *lut, u16 lut_size,
bool set) bool set)
{ {
iavf_status status; enum iavf_status status;
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_get_set_rss_lut *cmd_resp = struct i40e_aqc_get_set_rss_lut *cmd_resp =
(struct i40e_aqc_get_set_rss_lut *)&desc.params.raw; (struct i40e_aqc_get_set_rss_lut *)&desc.params.raw;
...@@ -407,7 +407,7 @@ static iavf_status iavf_aq_get_set_rss_lut(struct iavf_hw *hw, ...@@ -407,7 +407,7 @@ static iavf_status iavf_aq_get_set_rss_lut(struct iavf_hw *hw,
* *
* get the RSS lookup table, PF or VSI type * get the RSS lookup table, PF or VSI type
**/ **/
iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 vsi_id, enum iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 vsi_id,
bool pf_lut, u8 *lut, u16 lut_size) bool pf_lut, u8 *lut, u16 lut_size)
{ {
return iavf_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, return iavf_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size,
...@@ -424,7 +424,7 @@ iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 vsi_id, ...@@ -424,7 +424,7 @@ iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 vsi_id,
* *
* set the RSS lookup table, PF or VSI type * set the RSS lookup table, PF or VSI type
**/ **/
iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 vsi_id, enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 vsi_id,
bool pf_lut, u8 *lut, u16 lut_size) bool pf_lut, u8 *lut, u16 lut_size)
{ {
return iavf_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, true); return iavf_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, true);
...@@ -439,12 +439,12 @@ iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 vsi_id, ...@@ -439,12 +439,12 @@ iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 vsi_id,
* *
* get the RSS key per VSI * get the RSS key per VSI
**/ **/
static static enum
iavf_status iavf_aq_get_set_rss_key(struct iavf_hw *hw, u16 vsi_id, iavf_status iavf_aq_get_set_rss_key(struct iavf_hw *hw, u16 vsi_id,
struct i40e_aqc_get_set_rss_key_data *key, struct i40e_aqc_get_set_rss_key_data *key,
bool set) bool set)
{ {
iavf_status status; enum iavf_status status;
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
struct i40e_aqc_get_set_rss_key *cmd_resp = struct i40e_aqc_get_set_rss_key *cmd_resp =
(struct i40e_aqc_get_set_rss_key *)&desc.params.raw; (struct i40e_aqc_get_set_rss_key *)&desc.params.raw;
...@@ -479,7 +479,7 @@ iavf_status iavf_aq_get_set_rss_key(struct iavf_hw *hw, u16 vsi_id, ...@@ -479,7 +479,7 @@ iavf_status iavf_aq_get_set_rss_key(struct iavf_hw *hw, u16 vsi_id,
* @key: pointer to key info struct * @key: pointer to key info struct
* *
**/ **/
iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 vsi_id, enum iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 vsi_id,
struct i40e_aqc_get_set_rss_key_data *key) struct i40e_aqc_get_set_rss_key_data *key)
{ {
return iavf_aq_get_set_rss_key(hw, vsi_id, key, false); return iavf_aq_get_set_rss_key(hw, vsi_id, key, false);
...@@ -493,7 +493,7 @@ iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 vsi_id, ...@@ -493,7 +493,7 @@ iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 vsi_id,
* *
* set the RSS key per VSI * set the RSS key per VSI
**/ **/
iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 vsi_id, enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 vsi_id,
struct i40e_aqc_get_set_rss_key_data *key) struct i40e_aqc_get_set_rss_key_data *key)
{ {
return iavf_aq_get_set_rss_key(hw, vsi_id, key, true); return iavf_aq_get_set_rss_key(hw, vsi_id, key, true);
...@@ -877,14 +877,15 @@ struct iavf_rx_ptype_decoded iavf_ptype_lookup[] = { ...@@ -877,14 +877,15 @@ struct iavf_rx_ptype_decoded iavf_ptype_lookup[] = {
* is sent asynchronously, i.e. iavf_asq_send_command() does not wait for * is sent asynchronously, i.e. iavf_asq_send_command() does not wait for
* completion before returning. * completion before returning.
**/ **/
iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw, enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,
enum virtchnl_ops v_opcode, enum virtchnl_ops v_opcode,
iavf_status v_retval, u8 *msg, u16 msglen, enum iavf_status v_retval,
u8 *msg, u16 msglen,
struct i40e_asq_cmd_details *cmd_details) struct i40e_asq_cmd_details *cmd_details)
{ {
struct i40e_asq_cmd_details details; struct i40e_asq_cmd_details details;
struct i40e_aq_desc desc; struct i40e_aq_desc desc;
iavf_status status; enum iavf_status status;
iavf_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_send_msg_to_pf); iavf_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_send_msg_to_pf);
desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_SI); desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_SI);
...@@ -948,7 +949,7 @@ void iavf_vf_parse_hw_config(struct iavf_hw *hw, ...@@ -948,7 +949,7 @@ void iavf_vf_parse_hw_config(struct iavf_hw *hw,
* as none will be forthcoming. Immediately after calling this function, * as none will be forthcoming. Immediately after calling this function,
* the admin queue should be shut down and (optionally) reinitialized. * the admin queue should be shut down and (optionally) reinitialized.
**/ **/
iavf_status iavf_vf_reset(struct iavf_hw *hw) enum iavf_status iavf_vf_reset(struct iavf_hw *hw)
{ {
return iavf_aq_send_msg_to_pf(hw, VIRTCHNL_OP_RESET_VF, return iavf_aq_send_msg_to_pf(hw, VIRTCHNL_OP_RESET_VF,
0, NULL, 0, NULL); 0, NULL, 0, NULL);
......
...@@ -66,7 +66,7 @@ static struct workqueue_struct *iavf_wq; ...@@ -66,7 +66,7 @@ static struct workqueue_struct *iavf_wq;
* @size: size of memory requested * @size: size of memory requested
* @alignment: what to align the allocation to * @alignment: what to align the allocation to
**/ **/
iavf_status iavf_allocate_dma_mem_d(struct iavf_hw *hw, enum iavf_status iavf_allocate_dma_mem_d(struct iavf_hw *hw,
struct iavf_dma_mem *mem, struct iavf_dma_mem *mem,
u64 size, u32 alignment) u64 size, u32 alignment)
{ {
...@@ -89,7 +89,8 @@ iavf_status iavf_allocate_dma_mem_d(struct iavf_hw *hw, ...@@ -89,7 +89,8 @@ iavf_status iavf_allocate_dma_mem_d(struct iavf_hw *hw,
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* @mem: ptr to mem struct to free * @mem: ptr to mem struct to free
**/ **/
iavf_status iavf_free_dma_mem_d(struct iavf_hw *hw, struct iavf_dma_mem *mem) enum iavf_status iavf_free_dma_mem_d(struct iavf_hw *hw,
struct iavf_dma_mem *mem)
{ {
struct iavf_adapter *adapter = (struct iavf_adapter *)hw->back; struct iavf_adapter *adapter = (struct iavf_adapter *)hw->back;
...@@ -106,7 +107,7 @@ iavf_status iavf_free_dma_mem_d(struct iavf_hw *hw, struct iavf_dma_mem *mem) ...@@ -106,7 +107,7 @@ iavf_status iavf_free_dma_mem_d(struct iavf_hw *hw, struct iavf_dma_mem *mem)
* @mem: ptr to mem struct to fill out * @mem: ptr to mem struct to fill out
* @size: size of memory requested * @size: size of memory requested
**/ **/
iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw, enum iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw,
struct iavf_virt_mem *mem, u32 size) struct iavf_virt_mem *mem, u32 size)
{ {
if (!mem) if (!mem)
...@@ -126,7 +127,8 @@ iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw, ...@@ -126,7 +127,8 @@ iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw,
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* @mem: ptr to mem struct to free * @mem: ptr to mem struct to free
**/ **/
iavf_status iavf_free_virt_mem_d(struct iavf_hw *hw, struct iavf_virt_mem *mem) enum iavf_status iavf_free_virt_mem_d(struct iavf_hw *hw,
struct iavf_virt_mem *mem)
{ {
if (!mem) if (!mem)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -2022,7 +2024,7 @@ static void iavf_adminq_task(struct work_struct *work) ...@@ -2022,7 +2024,7 @@ static void iavf_adminq_task(struct work_struct *work)
struct iavf_hw *hw = &adapter->hw; struct iavf_hw *hw = &adapter->hw;
struct i40e_arq_event_info event; struct i40e_arq_event_info event;
enum virtchnl_ops v_op; enum virtchnl_ops v_op;
iavf_status ret, v_ret; enum iavf_status ret, v_ret;
u32 val, oldval; u32 val, oldval;
u16 pending; u16 pending;
...@@ -2037,7 +2039,7 @@ static void iavf_adminq_task(struct work_struct *work) ...@@ -2037,7 +2039,7 @@ static void iavf_adminq_task(struct work_struct *work)
do { do {
ret = iavf_clean_arq_element(hw, &event, &pending); ret = iavf_clean_arq_element(hw, &event, &pending);
v_op = (enum virtchnl_ops)le32_to_cpu(event.desc.cookie_high); v_op = (enum virtchnl_ops)le32_to_cpu(event.desc.cookie_high);
v_ret = (iavf_status)le32_to_cpu(event.desc.cookie_low); v_ret = (enum iavf_status)le32_to_cpu(event.desc.cookie_low);
if (ret || !v_op) if (ret || !v_op)
break; /* No event to process or error cleaning ARQ */ break; /* No event to process or error cleaning ARQ */
......
...@@ -48,5 +48,4 @@ struct iavf_virt_mem { ...@@ -48,5 +48,4 @@ struct iavf_virt_mem {
extern void iavf_debug_d(void *hw, u32 mask, char *fmt_str, ...) extern void iavf_debug_d(void *hw, u32 mask, char *fmt_str, ...)
__printf(3, 4); __printf(3, 4);
typedef enum iavf_status_code iavf_status;
#endif /* _IAVF_OSDEP_H_ */ #endif /* _IAVF_OSDEP_H_ */
...@@ -16,13 +16,14 @@ ...@@ -16,13 +16,14 @@
*/ */
/* adminq functions */ /* adminq functions */
iavf_status iavf_init_adminq(struct iavf_hw *hw); enum iavf_status iavf_init_adminq(struct iavf_hw *hw);
iavf_status iavf_shutdown_adminq(struct iavf_hw *hw); enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw);
void i40e_adminq_init_ring_data(struct iavf_hw *hw); void i40e_adminq_init_ring_data(struct iavf_hw *hw);
iavf_status iavf_clean_arq_element(struct iavf_hw *hw, enum iavf_status iavf_clean_arq_element(struct iavf_hw *hw,
struct i40e_arq_event_info *e, struct i40e_arq_event_info *e,
u16 *events_pending); u16 *events_pending);
iavf_status iavf_asq_send_command(struct iavf_hw *hw, struct i40e_aq_desc *desc, enum iavf_status iavf_asq_send_command(struct iavf_hw *hw,
struct i40e_aq_desc *desc,
void *buff, /* can be NULL */ void *buff, /* can be NULL */
u16 buff_size, u16 buff_size,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
...@@ -35,20 +36,20 @@ void iavf_debug_aq(struct iavf_hw *hw, enum iavf_debug_mask mask, ...@@ -35,20 +36,20 @@ void iavf_debug_aq(struct iavf_hw *hw, enum iavf_debug_mask mask,
void i40e_idle_aq(struct iavf_hw *hw); void i40e_idle_aq(struct iavf_hw *hw);
void iavf_resume_aq(struct iavf_hw *hw); void iavf_resume_aq(struct iavf_hw *hw);
bool iavf_check_asq_alive(struct iavf_hw *hw); bool iavf_check_asq_alive(struct iavf_hw *hw);
iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading); enum iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading);
const char *iavf_aq_str(struct iavf_hw *hw, enum i40e_admin_queue_err aq_err); const char *iavf_aq_str(struct iavf_hw *hw, enum i40e_admin_queue_err aq_err);
const char *iavf_stat_str(struct iavf_hw *hw, iavf_status stat_err); const char *iavf_stat_str(struct iavf_hw *hw, enum iavf_status stat_err);
iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 seid, enum iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 seid,
bool pf_lut, u8 *lut, u16 lut_size); bool pf_lut, u8 *lut, u16 lut_size);
iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid, enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid,
bool pf_lut, u8 *lut, u16 lut_size); bool pf_lut, u8 *lut, u16 lut_size);
iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 seid, enum iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 seid,
struct i40e_aqc_get_set_rss_key_data *key); struct i40e_aqc_get_set_rss_key_data *key);
iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid, enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
struct i40e_aqc_get_set_rss_key_data *key); struct i40e_aqc_get_set_rss_key_data *key);
iavf_status iavf_set_mac_type(struct iavf_hw *hw); enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[]; extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
...@@ -59,9 +60,10 @@ static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype) ...@@ -59,9 +60,10 @@ static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
void iavf_vf_parse_hw_config(struct iavf_hw *hw, void iavf_vf_parse_hw_config(struct iavf_hw *hw,
struct virtchnl_vf_resource *msg); struct virtchnl_vf_resource *msg);
iavf_status iavf_vf_reset(struct iavf_hw *hw); enum iavf_status iavf_vf_reset(struct iavf_hw *hw);
iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw, enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,
enum virtchnl_ops v_opcode, enum virtchnl_ops v_opcode,
iavf_status v_retval, u8 *msg, u16 msglen, enum iavf_status v_retval,
u8 *msg, u16 msglen,
struct i40e_asq_cmd_details *cmd_details); struct i40e_asq_cmd_details *cmd_details);
#endif /* _IAVF_PROTOTYPE_H_ */ #endif /* _IAVF_PROTOTYPE_H_ */
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#define _IAVF_STATUS_H_ #define _IAVF_STATUS_H_
/* Error Codes */ /* Error Codes */
enum iavf_status_code { enum iavf_status {
I40E_SUCCESS = 0, I40E_SUCCESS = 0,
I40E_ERR_NVM = -1, I40E_ERR_NVM = -1,
I40E_ERR_NVM_CHECKSUM = -2, I40E_ERR_NVM_CHECKSUM = -2,
......
...@@ -22,7 +22,7 @@ static int iavf_send_pf_msg(struct iavf_adapter *adapter, ...@@ -22,7 +22,7 @@ static int iavf_send_pf_msg(struct iavf_adapter *adapter,
enum virtchnl_ops op, u8 *msg, u16 len) enum virtchnl_ops op, u8 *msg, u16 len)
{ {
struct iavf_hw *hw = &adapter->hw; struct iavf_hw *hw = &adapter->hw;
iavf_status err; enum iavf_status err;
if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED) if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED)
return 0; /* nothing to see here, move along */ return 0; /* nothing to see here, move along */
...@@ -69,7 +69,7 @@ int iavf_verify_api_ver(struct iavf_adapter *adapter) ...@@ -69,7 +69,7 @@ int iavf_verify_api_ver(struct iavf_adapter *adapter)
struct iavf_hw *hw = &adapter->hw; struct iavf_hw *hw = &adapter->hw;
struct i40e_arq_event_info event; struct i40e_arq_event_info event;
enum virtchnl_ops op; enum virtchnl_ops op;
iavf_status err; enum iavf_status err;
event.buf_len = IAVF_MAX_AQ_BUF_SIZE; event.buf_len = IAVF_MAX_AQ_BUF_SIZE;
event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL); event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);
...@@ -92,7 +92,7 @@ int iavf_verify_api_ver(struct iavf_adapter *adapter) ...@@ -92,7 +92,7 @@ int iavf_verify_api_ver(struct iavf_adapter *adapter)
} }
err = (iavf_status)le32_to_cpu(event.desc.cookie_low); err = (enum iavf_status)le32_to_cpu(event.desc.cookie_low);
if (err) if (err)
goto out_alloc; goto out_alloc;
...@@ -191,7 +191,7 @@ int iavf_get_vf_config(struct iavf_adapter *adapter) ...@@ -191,7 +191,7 @@ int iavf_get_vf_config(struct iavf_adapter *adapter)
struct iavf_hw *hw = &adapter->hw; struct iavf_hw *hw = &adapter->hw;
struct i40e_arq_event_info event; struct i40e_arq_event_info event;
enum virtchnl_ops op; enum virtchnl_ops op;
iavf_status err; enum iavf_status err;
u16 len; u16 len;
len = sizeof(struct virtchnl_vf_resource) + len = sizeof(struct virtchnl_vf_resource) +
...@@ -216,7 +216,7 @@ int iavf_get_vf_config(struct iavf_adapter *adapter) ...@@ -216,7 +216,7 @@ int iavf_get_vf_config(struct iavf_adapter *adapter)
break; break;
} }
err = (iavf_status)le32_to_cpu(event.desc.cookie_low); err = (enum iavf_status)le32_to_cpu(event.desc.cookie_low);
memcpy(adapter->vf_res, event.msg_buf, min(event.msg_len, len)); memcpy(adapter->vf_res, event.msg_buf, min(event.msg_len, len));
/* some PFs send more queues than we should have so validate that /* some PFs send more queues than we should have so validate that
...@@ -1184,8 +1184,8 @@ void iavf_request_reset(struct iavf_adapter *adapter) ...@@ -1184,8 +1184,8 @@ void iavf_request_reset(struct iavf_adapter *adapter)
* This function handles the reply messages. * This function handles the reply messages.
**/ **/
void iavf_virtchnl_completion(struct iavf_adapter *adapter, void iavf_virtchnl_completion(struct iavf_adapter *adapter,
enum virtchnl_ops v_opcode, iavf_status v_retval, enum virtchnl_ops v_opcode,
u8 *msg, u16 msglen) enum iavf_status v_retval, u8 *msg, u16 msglen)
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment