Commit f349daa5 authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by Jeff Kirsher
Browse files

iavf: rename i40e_hw to iavf_hw



Fix up the i40e_hw names to new name, including versions
inside other strings.

Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 83eafc49
Loading
Loading
Loading
Loading
+21 −22
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 *
 *  This assumes the alloc_asq and alloc_arq functions have already been called
 **/
static void i40e_adminq_init_regs(struct i40e_hw *hw)
static void i40e_adminq_init_regs(struct iavf_hw *hw)
{
	/* set head and tail registers in our local struct */
	hw->aq.asq.tail = IAVF_VF_ATQT1;
@@ -32,7 +32,7 @@ static void i40e_adminq_init_regs(struct i40e_hw *hw)
 *  i40e_alloc_adminq_asq_ring - Allocate Admin Queue send rings
 *  @hw: pointer to the hardware structure
 **/
static iavf_status i40e_alloc_adminq_asq_ring(struct i40e_hw *hw)
static iavf_status i40e_alloc_adminq_asq_ring(struct iavf_hw *hw)
{
	iavf_status ret_code;

@@ -59,7 +59,7 @@ static iavf_status i40e_alloc_adminq_asq_ring(struct i40e_hw *hw)
 *  i40e_alloc_adminq_arq_ring - Allocate Admin Queue receive rings
 *  @hw: pointer to the hardware structure
 **/
static iavf_status i40e_alloc_adminq_arq_ring(struct i40e_hw *hw)
static iavf_status i40e_alloc_adminq_arq_ring(struct iavf_hw *hw)
{
	iavf_status ret_code;

@@ -79,7 +79,7 @@ static iavf_status i40e_alloc_adminq_arq_ring(struct i40e_hw *hw)
 *  This assumes the posted send buffers have already been cleaned
 *  and de-allocated
 **/
static void i40e_free_adminq_asq(struct i40e_hw *hw)
static void i40e_free_adminq_asq(struct iavf_hw *hw)
{
	i40e_free_dma_mem(hw, &hw->aq.asq.desc_buf);
}
@@ -91,7 +91,7 @@ static void i40e_free_adminq_asq(struct i40e_hw *hw)
 *  This assumes the posted receive buffers have already been cleaned
 *  and de-allocated
 **/
static void i40e_free_adminq_arq(struct i40e_hw *hw)
static void i40e_free_adminq_arq(struct iavf_hw *hw)
{
	i40e_free_dma_mem(hw, &hw->aq.arq.desc_buf);
}
@@ -100,7 +100,7 @@ static void i40e_free_adminq_arq(struct i40e_hw *hw)
 *  i40e_alloc_arq_bufs - Allocate pre-posted buffers for the receive queue
 *  @hw: pointer to the hardware structure
 **/
static iavf_status i40e_alloc_arq_bufs(struct i40e_hw *hw)
static iavf_status i40e_alloc_arq_bufs(struct iavf_hw *hw)
{
	struct i40e_aq_desc *desc;
	struct i40e_dma_mem *bi;
@@ -168,7 +168,7 @@ unwind_alloc_arq_bufs:
 *  i40e_alloc_asq_bufs - Allocate empty buffer structs for the send queue
 *  @hw: pointer to the hardware structure
 **/
static iavf_status i40e_alloc_asq_bufs(struct i40e_hw *hw)
static iavf_status i40e_alloc_asq_bufs(struct iavf_hw *hw)
{
	struct i40e_dma_mem *bi;
	iavf_status ret_code;
@@ -209,7 +209,7 @@ unwind_alloc_asq_bufs:
 *  i40e_free_arq_bufs - Free receive queue buffer info elements
 *  @hw: pointer to the hardware structure
 **/
static void i40e_free_arq_bufs(struct i40e_hw *hw)
static void i40e_free_arq_bufs(struct iavf_hw *hw)
{
	int i;

@@ -228,7 +228,7 @@ static void i40e_free_arq_bufs(struct i40e_hw *hw)
 *  i40e_free_asq_bufs - Free send queue buffer info elements
 *  @hw: pointer to the hardware structure
 **/
static void i40e_free_asq_bufs(struct i40e_hw *hw)
static void i40e_free_asq_bufs(struct iavf_hw *hw)
{
	int i;

@@ -253,7 +253,7 @@ static void i40e_free_asq_bufs(struct i40e_hw *hw)
 *
 *  Configure base address and length registers for the transmit queue
 **/
static iavf_status i40e_config_asq_regs(struct i40e_hw *hw)
static iavf_status i40e_config_asq_regs(struct iavf_hw *hw)
{
	iavf_status ret_code = 0;
	u32 reg = 0;
@@ -282,7 +282,7 @@ static iavf_status i40e_config_asq_regs(struct i40e_hw *hw)
 *
 * Configure base address and length registers for the receive (event queue)
 **/
static iavf_status i40e_config_arq_regs(struct i40e_hw *hw)
static iavf_status i40e_config_arq_regs(struct iavf_hw *hw)
{
	iavf_status ret_code = 0;
	u32 reg = 0;
@@ -321,7 +321,7 @@ static iavf_status i40e_config_arq_regs(struct i40e_hw *hw)
 *  Do *NOT* hold the lock when calling this as the memory allocation routines
 *  called are not going to be atomic context safe
 **/
static iavf_status i40e_init_asq(struct i40e_hw *hw)
static iavf_status i40e_init_asq(struct iavf_hw *hw)
{
	iavf_status ret_code = 0;

@@ -380,7 +380,7 @@ init_adminq_exit:
 *  Do *NOT* hold the lock when calling this as the memory allocation routines
 *  called are not going to be atomic context safe
 **/
static iavf_status i40e_init_arq(struct i40e_hw *hw)
static iavf_status i40e_init_arq(struct iavf_hw *hw)
{
	iavf_status ret_code = 0;

@@ -432,7 +432,7 @@ init_adminq_exit:
 *
 *  The main shutdown routine for the Admin Send Queue
 **/
static iavf_status i40e_shutdown_asq(struct i40e_hw *hw)
static iavf_status i40e_shutdown_asq(struct iavf_hw *hw)
{
	iavf_status ret_code = 0;

@@ -466,7 +466,7 @@ shutdown_asq_out:
 *
 *  The main shutdown routine for the Admin Receive Queue
 **/
static iavf_status i40e_shutdown_arq(struct i40e_hw *hw)
static iavf_status i40e_shutdown_arq(struct iavf_hw *hw)
{
	iavf_status ret_code = 0;

@@ -505,7 +505,7 @@ shutdown_arq_out:
 *     - hw->aq.arq_buf_size
 *     - hw->aq.asq_buf_size
 **/
iavf_status iavf_init_adminq(struct i40e_hw *hw)
iavf_status iavf_init_adminq(struct iavf_hw *hw)
{
	iavf_status ret_code;

@@ -549,7 +549,7 @@ init_adminq_exit:
 *  iavf_shutdown_adminq - shutdown routine for the Admin Queue
 *  @hw: pointer to the hardware structure
 **/
iavf_status iavf_shutdown_adminq(struct i40e_hw *hw)
iavf_status iavf_shutdown_adminq(struct iavf_hw *hw)
{
	iavf_status ret_code = 0;

@@ -568,7 +568,7 @@ iavf_status iavf_shutdown_adminq(struct i40e_hw *hw)
 *
 *  returns the number of free desc
 **/
static u16 i40e_clean_asq(struct i40e_hw *hw)
static u16 i40e_clean_asq(struct iavf_hw *hw)
{
	struct i40e_adminq_ring *asq = &hw->aq.asq;
	struct i40e_asq_cmd_details *details;
@@ -610,7 +610,7 @@ static u16 i40e_clean_asq(struct i40e_hw *hw)
 *  Returns true if the firmware has processed all descriptors on the
 *  admin send queue. Returns false if there are still requests pending.
 **/
bool iavf_asq_done(struct i40e_hw *hw)
bool iavf_asq_done(struct iavf_hw *hw)
{
	/* AQ designers suggest use of head for better
	 * timing reliability than DD bit
@@ -629,8 +629,7 @@ bool iavf_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
 **/
iavf_status iavf_asq_send_command(struct i40e_hw *hw,
				  struct i40e_aq_desc *desc,
iavf_status iavf_asq_send_command(struct iavf_hw *hw, struct i40e_aq_desc *desc,
				  void *buff, /* can be NULL */
				  u16  buff_size,
				  struct i40e_asq_cmd_details *cmd_details)
@@ -842,7 +841,7 @@ 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
 *  left to process through 'pending'
 **/
iavf_status iavf_clean_arq_element(struct i40e_hw *hw,
iavf_status iavf_clean_arq_element(struct iavf_hw *hw,
				   struct i40e_arq_event_info *e,
				   u16 *pending)
{
+5 −5
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
#ifndef _I40E_ALLOC_H_
#define _I40E_ALLOC_H_

struct i40e_hw;
struct iavf_hw;

/* Memory allocation types */
enum i40e_memory_type {
@@ -20,12 +20,12 @@ enum i40e_memory_type {
};

/* prototype for functions used for dynamic memory allocation */
iavf_status i40e_allocate_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem,
iavf_status i40e_allocate_dma_mem(struct iavf_hw *hw, struct i40e_dma_mem *mem,
				  enum i40e_memory_type type,
				  u64 size, u32 alignment);
iavf_status i40e_free_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem);
iavf_status i40e_allocate_virt_mem(struct i40e_hw *hw,
iavf_status i40e_free_dma_mem(struct iavf_hw *hw, struct i40e_dma_mem *mem);
iavf_status i40e_allocate_virt_mem(struct iavf_hw *hw,
				   struct i40e_virt_mem *mem, u32 size);
iavf_status i40e_free_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem);
iavf_status i40e_free_virt_mem(struct iavf_hw *hw, struct i40e_virt_mem *mem);

#endif /* _I40E_ALLOC_H_ */
+15 −15
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 * This function sets the mac type of the adapter based on the
 * vendor ID and device ID stored in the hw structure.
 **/
iavf_status i40e_set_mac_type(struct i40e_hw *hw)
iavf_status i40e_set_mac_type(struct iavf_hw *hw)
{
	iavf_status status = 0;

@@ -44,7 +44,7 @@ iavf_status i40e_set_mac_type(struct i40e_hw *hw)
 * @hw: pointer to the HW structure
 * @aq_err: the AQ error code to convert
 **/
const char *iavf_aq_str(struct i40e_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)
{
	switch (aq_err) {
	case I40E_AQ_RC_OK:
@@ -104,7 +104,7 @@ const char *iavf_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err)
 * @hw: pointer to the HW structure
 * @stat_err: the status error code to convert
 **/
const char *iavf_stat_str(struct i40e_hw *hw, iavf_status stat_err)
const char *iavf_stat_str(struct iavf_hw *hw, iavf_status stat_err)
{
	switch (stat_err) {
	case 0:
@@ -257,7 +257,7 @@ const char *iavf_stat_str(struct i40e_hw *hw, iavf_status stat_err)
 *
 * Dumps debug log about adminq command with descriptor contents.
 **/
void iavf_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc,
void iavf_debug_aq(struct iavf_hw *hw, enum i40e_debug_mask mask, void *desc,
		   void *buffer, u16 buf_len)
{
	struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc;
@@ -310,7 +310,7 @@ void iavf_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc,
 *
 * Returns true if Queue is enabled else false.
 **/
bool iavf_check_asq_alive(struct i40e_hw *hw)
bool iavf_check_asq_alive(struct iavf_hw *hw)
{
	if (hw->aq.asq.len)
		return !!(rd32(hw, hw->aq.asq.len) &
@@ -327,7 +327,7 @@ bool iavf_check_asq_alive(struct i40e_hw *hw)
 * Tell the Firmware that we're shutting down the AdminQ and whether
 * or not the driver is unloading as well.
 **/
iavf_status iavf_aq_queue_shutdown(struct i40e_hw *hw, bool unloading)
iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading)
{
	struct i40e_aq_desc desc;
	struct i40e_aqc_queue_shutdown *cmd =
@@ -354,7 +354,7 @@ iavf_status iavf_aq_queue_shutdown(struct i40e_hw *hw, bool unloading)
 *
 * Internal function to get or set RSS look up table
 **/
static iavf_status i40e_aq_get_set_rss_lut(struct i40e_hw *hw,
static iavf_status i40e_aq_get_set_rss_lut(struct iavf_hw *hw,
					   u16 vsi_id, bool pf_lut,
					   u8 *lut, u16 lut_size,
					   bool set)
@@ -407,7 +407,7 @@ static iavf_status i40e_aq_get_set_rss_lut(struct i40e_hw *hw,
 *
 * get the RSS lookup table, PF or VSI type
 **/
iavf_status iavf_aq_get_rss_lut(struct i40e_hw *hw, u16 vsi_id,
iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 vsi_id,
				bool pf_lut, u8 *lut, u16 lut_size)
{
	return i40e_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 i40e_hw *hw, u16 vsi_id,
 *
 * set the RSS lookup table, PF or VSI type
 **/
iavf_status iavf_aq_set_rss_lut(struct i40e_hw *hw, u16 vsi_id,
iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 vsi_id,
				bool pf_lut, u8 *lut, u16 lut_size)
{
	return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, true);
@@ -440,7 +440,7 @@ iavf_status iavf_aq_set_rss_lut(struct i40e_hw *hw, u16 vsi_id,
 * get the RSS key per VSI
 **/
static
iavf_status i40e_aq_get_set_rss_key(struct i40e_hw *hw, u16 vsi_id,
iavf_status i40e_aq_get_set_rss_key(struct iavf_hw *hw, u16 vsi_id,
				    struct i40e_aqc_get_set_rss_key_data *key,
				    bool set)
{
@@ -479,7 +479,7 @@ iavf_status i40e_aq_get_set_rss_key(struct i40e_hw *hw, u16 vsi_id,
 * @key: pointer to key info struct
 *
 **/
iavf_status iavf_aq_get_rss_key(struct i40e_hw *hw, u16 vsi_id,
iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 vsi_id,
				struct i40e_aqc_get_set_rss_key_data *key)
{
	return i40e_aq_get_set_rss_key(hw, vsi_id, key, false);
@@ -493,7 +493,7 @@ iavf_status iavf_aq_get_rss_key(struct i40e_hw *hw, u16 vsi_id,
 *
 * set the RSS key per VSI
 **/
iavf_status iavf_aq_set_rss_key(struct i40e_hw *hw, u16 vsi_id,
iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 vsi_id,
				struct i40e_aqc_get_set_rss_key_data *key)
{
	return i40e_aq_get_set_rss_key(hw, vsi_id, key, true);
@@ -877,7 +877,7 @@ struct i40e_rx_ptype_decoded iavf_ptype_lookup[] = {
 * is sent asynchronously, i.e. iavf_asq_send_command() does not wait for
 * completion before returning.
 **/
iavf_status iavf_aq_send_msg_to_pf(struct i40e_hw *hw,
iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,
				   enum virtchnl_ops v_opcode,
				   iavf_status v_retval, u8 *msg, u16 msglen,
				   struct i40e_asq_cmd_details *cmd_details)
@@ -914,7 +914,7 @@ iavf_status iavf_aq_send_msg_to_pf(struct i40e_hw *hw,
 * Given a VF resource message from the PF, populate the hw struct
 * with appropriate information.
 **/
void iavf_vf_parse_hw_config(struct i40e_hw *hw,
void iavf_vf_parse_hw_config(struct iavf_hw *hw,
			     struct virtchnl_vf_resource *msg)
{
	struct virtchnl_vsi_resource *vsi_res;
@@ -948,7 +948,7 @@ void iavf_vf_parse_hw_config(struct i40e_hw *hw,
 * as none will be forthcoming. Immediately after calling this function,
 * the admin queue should be shut down and (optionally) reinitialized.
 **/
iavf_status iavf_vf_reset(struct i40e_hw *hw)
iavf_status iavf_vf_reset(struct iavf_hw *hw)
{
	return iavf_aq_send_msg_to_pf(hw, VIRTCHNL_OP_RESET_VF,
				      0, NULL, 0, NULL);
+21 −21
Original line number Diff line number Diff line
@@ -16,39 +16,39 @@
 */

/* adminq functions */
iavf_status iavf_init_adminq(struct i40e_hw *hw);
iavf_status iavf_shutdown_adminq(struct i40e_hw *hw);
void i40e_adminq_init_ring_data(struct i40e_hw *hw);
iavf_status iavf_clean_arq_element(struct i40e_hw *hw,
iavf_status iavf_init_adminq(struct iavf_hw *hw);
iavf_status iavf_shutdown_adminq(struct iavf_hw *hw);
void i40e_adminq_init_ring_data(struct iavf_hw *hw);
iavf_status iavf_clean_arq_element(struct iavf_hw *hw,
				   struct i40e_arq_event_info *e,
				   u16 *events_pending);
iavf_status iavf_asq_send_command(struct i40e_hw *hw, struct i40e_aq_desc *desc,
iavf_status iavf_asq_send_command(struct iavf_hw *hw, struct i40e_aq_desc *desc,
				  void *buff, /* can be NULL */
				  u16 buff_size,
				  struct i40e_asq_cmd_details *cmd_details);
bool iavf_asq_done(struct i40e_hw *hw);
bool iavf_asq_done(struct iavf_hw *hw);

/* debug function for adminq */
void iavf_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask,
void iavf_debug_aq(struct iavf_hw *hw, enum i40e_debug_mask mask,
		   void *desc, void *buffer, u16 buf_len);

void i40e_idle_aq(struct i40e_hw *hw);
void iavf_resume_aq(struct i40e_hw *hw);
bool iavf_check_asq_alive(struct i40e_hw *hw);
iavf_status iavf_aq_queue_shutdown(struct i40e_hw *hw, bool unloading);
const char *iavf_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err);
const char *iavf_stat_str(struct i40e_hw *hw, iavf_status stat_err);
void i40e_idle_aq(struct iavf_hw *hw);
void iavf_resume_aq(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);
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);

iavf_status iavf_aq_get_rss_lut(struct i40e_hw *hw, u16 seid,
iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 seid,
				bool pf_lut, u8 *lut, u16 lut_size);
iavf_status iavf_aq_set_rss_lut(struct i40e_hw *hw, u16 seid,
iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid,
				bool pf_lut, u8 *lut, u16 lut_size);
iavf_status iavf_aq_get_rss_key(struct i40e_hw *hw, u16 seid,
iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 seid,
				struct i40e_aqc_get_set_rss_key_data *key);
iavf_status iavf_aq_set_rss_key(struct i40e_hw *hw, u16 seid,
iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
				struct i40e_aqc_get_set_rss_key_data *key);

iavf_status i40e_set_mac_type(struct i40e_hw *hw);
iavf_status i40e_set_mac_type(struct iavf_hw *hw);

extern struct i40e_rx_ptype_decoded iavf_ptype_lookup[];

@@ -58,10 +58,10 @@ static inline struct i40e_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
}

/* i40e_common for VF drivers*/
void iavf_vf_parse_hw_config(struct i40e_hw *hw,
void iavf_vf_parse_hw_config(struct iavf_hw *hw,
			     struct virtchnl_vf_resource *msg);
iavf_status iavf_vf_reset(struct i40e_hw *hw);
iavf_status iavf_aq_send_msg_to_pf(struct i40e_hw *hw,
iavf_status iavf_vf_reset(struct iavf_hw *hw);
iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,
				   enum virtchnl_ops v_opcode,
				   iavf_status v_retval, u8 *msg, u16 msglen,
				   struct i40e_asq_cmd_details *cmd_details);
+5 −5
Original line number Diff line number Diff line
@@ -20,8 +20,8 @@
#define I40E_MAX_CHAINED_RX_BUFFERS	5

/* forward declaration */
struct i40e_hw;
typedef void (*I40E_ADMINQ_CALLBACK)(struct i40e_hw *, struct i40e_aq_desc *);
struct iavf_hw;
typedef void (*I40E_ADMINQ_CALLBACK)(struct iavf_hw *, struct i40e_aq_desc *);

/* Data type manipulation macros. */

@@ -99,7 +99,7 @@ enum i40e_queue_type {

#define I40E_HW_CAP_MAX_GPIO		30
/* Capabilities of a PF or a VF or the whole device */
struct i40e_hw_capabilities {
struct iavf_hw_capabilities {
	bool dcb;
	bool fcoe;
	u32 num_vsis;
@@ -167,7 +167,7 @@ struct i40e_bus_info {
#define I40E_MAX_TRAFFIC_CLASS		8
#define I40E_MAX_USER_PRIORITY		8
/* Port hardware description */
struct i40e_hw {
struct iavf_hw {
	u8 __iomem *hw_addr;
	void *back;

@@ -183,7 +183,7 @@ struct i40e_hw {
	u8 revision_id;

	/* capabilities for entire device and PCI func */
	struct i40e_hw_capabilities dev_caps;
	struct iavf_hw_capabilities dev_caps;

	/* Admin Queue info */
	struct i40e_adminq_info aq;
Loading