Skip to content

Commit

Permalink
iavf: rename functions and structs to new name
Browse files Browse the repository at this point in the history
This basically begins the internal portion of the rename of i40evf to iavf,
by renaming many of the functions, structs, variables and defines.

Most of the changes were made mechanically, which introduces some
alignment issues.

Signed-off-by: Jesse Brandeburg <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
  • Loading branch information
jbrandeb authored and Jeff Kirsher committed Sep 18, 2018
1 parent ee61022 commit 129cf89
Show file tree
Hide file tree
Showing 14 changed files with 1,665 additions and 1,691 deletions.
56 changes: 28 additions & 28 deletions drivers/net/ethernet/intel/iavf/i40e_adminq.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ static i40e_status i40e_shutdown_arq(struct i40e_hw *hw)
}

/**
* i40evf_init_adminq - main initialization routine for Admin Queue
* iavf_init_adminq - main initialization routine for Admin Queue
* @hw: pointer to the hardware structure
*
* Prior to calling this function, drivers *MUST* set the following fields
Expand All @@ -505,7 +505,7 @@ static i40e_status i40e_shutdown_arq(struct i40e_hw *hw)
* - hw->aq.arq_buf_size
* - hw->aq.asq_buf_size
**/
i40e_status i40evf_init_adminq(struct i40e_hw *hw)
i40e_status iavf_init_adminq(struct i40e_hw *hw)
{
i40e_status ret_code;

Expand Down Expand Up @@ -546,15 +546,15 @@ i40e_status i40evf_init_adminq(struct i40e_hw *hw)
}

/**
* i40evf_shutdown_adminq - shutdown routine for the Admin Queue
* iavf_shutdown_adminq - shutdown routine for the Admin Queue
* @hw: pointer to the hardware structure
**/
i40e_status i40evf_shutdown_adminq(struct i40e_hw *hw)
i40e_status iavf_shutdown_adminq(struct i40e_hw *hw)
{
i40e_status ret_code = 0;

if (i40evf_check_asq_alive(hw))
i40evf_aq_queue_shutdown(hw, true);
if (iavf_check_asq_alive(hw))
iavf_aq_queue_shutdown(hw, true);

i40e_shutdown_asq(hw);
i40e_shutdown_arq(hw);
Expand Down Expand Up @@ -604,13 +604,13 @@ static u16 i40e_clean_asq(struct i40e_hw *hw)
}

/**
* i40evf_asq_done - check if FW has processed the Admin Send Queue
* iavf_asq_done - check if FW has processed the Admin Send Queue
* @hw: pointer to the hw struct
*
* Returns true if the firmware has processed all descriptors on the
* admin send queue. Returns false if there are still requests pending.
**/
bool i40evf_asq_done(struct i40e_hw *hw)
bool iavf_asq_done(struct i40e_hw *hw)
{
/* AQ designers suggest use of head for better
* timing reliability than DD bit
Expand All @@ -620,7 +620,7 @@ bool i40evf_asq_done(struct i40e_hw *hw)
}

/**
* i40evf_asq_send_command - send command to Admin Queue
* iavf_asq_send_command - send command to Admin Queue
* @hw: pointer to the hw struct
* @desc: prefilled descriptor describing the command (non DMA mem)
* @buff: buffer to use for indirect commands
Expand All @@ -630,11 +630,11 @@ bool i40evf_asq_done(struct i40e_hw *hw)
* This is the main send command driver routine for the Admin Queue send
* queue. It runs the queue, cleans the queue, etc
**/
i40e_status i40evf_asq_send_command(struct i40e_hw *hw,
struct i40e_aq_desc *desc,
void *buff, /* can be NULL */
u16 buff_size,
struct i40e_asq_cmd_details *cmd_details)
i40e_status iavf_asq_send_command(struct i40e_hw *hw,
struct i40e_aq_desc *desc,
void *buff, /* can be NULL */
u16 buff_size,
struct i40e_asq_cmd_details *cmd_details)
{
i40e_status status = 0;
struct i40e_dma_mem *dma_buff = NULL;
Expand Down Expand Up @@ -741,8 +741,8 @@ i40e_status i40evf_asq_send_command(struct i40e_hw *hw,

/* bump the tail */
i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: desc and buffer:\n");
i40evf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring,
buff, buff_size);
iavf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring,
buff, buff_size);
(hw->aq.asq.next_to_use)++;
if (hw->aq.asq.next_to_use == hw->aq.asq.count)
hw->aq.asq.next_to_use = 0;
Expand All @@ -759,15 +759,15 @@ i40e_status i40evf_asq_send_command(struct i40e_hw *hw,
/* AQ designers suggest use of head for better
* timing reliability than DD bit
*/
if (i40evf_asq_done(hw))
if (iavf_asq_done(hw))
break;
udelay(50);
total_delay += 50;
} while (total_delay < hw->aq.asq_cmd_timeout);
}

/* if ready, copy the desc back to temp */
if (i40evf_asq_done(hw)) {
if (iavf_asq_done(hw)) {
*desc = *desc_on_ring;
if (buff != NULL)
memcpy(buff, dma_buff->va, buff_size);
Expand All @@ -793,8 +793,8 @@ i40e_status i40evf_asq_send_command(struct i40e_hw *hw,

i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
"AQTX: desc and buffer writeback:\n");
i40evf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff,
buff_size);
iavf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff,
buff_size);

/* save writeback aq if requested */
if (details->wb_desc)
Expand All @@ -820,13 +820,13 @@ i40e_status i40evf_asq_send_command(struct i40e_hw *hw,
}

/**
* i40evf_fill_default_direct_cmd_desc - AQ descriptor helper function
* iavf_fill_default_direct_cmd_desc - AQ descriptor helper function
* @desc: pointer to the temp descriptor (non DMA mem)
* @opcode: the opcode can be used to decide which flags to turn off or on
*
* Fill the desc with default values
**/
void i40evf_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc,
void iavf_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc,
u16 opcode)
{
/* zero out the desc */
Expand All @@ -836,7 +836,7 @@ void i40evf_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc,
}

/**
* i40evf_clean_arq_element
* iavf_clean_arq_element
* @hw: pointer to the hw struct
* @e: event info from the receive descriptor, includes any buffers
* @pending: number of events that could be left to process
Expand All @@ -845,9 +845,9 @@ void i40evf_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc,
* the contents through e. It can also return how many events are
* left to process through 'pending'
**/
i40e_status i40evf_clean_arq_element(struct i40e_hw *hw,
struct i40e_arq_event_info *e,
u16 *pending)
i40e_status iavf_clean_arq_element(struct i40e_hw *hw,
struct i40e_arq_event_info *e,
u16 *pending)
{
i40e_status ret_code = 0;
u16 ntc = hw->aq.arq.next_to_clean;
Expand Down Expand Up @@ -902,8 +902,8 @@ i40e_status i40evf_clean_arq_element(struct i40e_hw *hw,
e->msg_len);

i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n");
i40evf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf,
hw->aq.arq_buf_size);
iavf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf,
hw->aq.arq_buf_size);

/* Restore the original datalen and buffer address in the desc,
* FW updates datalen to indicate the event message
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ethernet/intel/iavf/i40e_adminq.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ static inline int i40e_aq_rc_to_posix(int aq_ret, int aq_rc)
#define I40E_AQ_LARGE_BUF 512
#define I40E_ASQ_CMD_TIMEOUT 250000 /* usecs */

void i40evf_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc,
u16 opcode);
void iavf_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc, u16 opcode);

#endif /* _I40E_ADMINQ_H_ */
Loading

0 comments on commit 129cf89

Please sign in to comment.