Commit e7f2e4b9 authored by Anjali Singhai Jain's avatar Anjali Singhai Jain Committed by Jeff Kirsher

i40e: Define and use i40e_is_vf macro

This patch is useful for future expansion when new VF MAC types get
added. It helps with cleaning up VF driver flow.

Change-ID: Ibe1eeb71262a3a40f24a1c5409436bdc3411da7f
Signed-off-by: default avatarAnjali Singhai Jain <anjali.singhai@intel.com>
Acked-by: default avatarShannon Nelson <shannon.nelson@intel.com>
Acked-by: default avatarGreg Rose <gregory.v.rose@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 09f7efab
...@@ -51,7 +51,7 @@ static inline bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc) ...@@ -51,7 +51,7 @@ static inline bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc)
static void i40e_adminq_init_regs(struct i40e_hw *hw) static void i40e_adminq_init_regs(struct i40e_hw *hw)
{ {
/* set head and tail registers in our local struct */ /* set head and tail registers in our local struct */
if (hw->mac.type == I40E_MAC_VF) { if (i40e_is_vf(hw)) {
hw->aq.asq.tail = I40E_VF_ATQT1; hw->aq.asq.tail = I40E_VF_ATQT1;
hw->aq.asq.head = I40E_VF_ATQH1; hw->aq.asq.head = I40E_VF_ATQH1;
hw->aq.asq.len = I40E_VF_ATQLEN1; hw->aq.asq.len = I40E_VF_ATQLEN1;
......
...@@ -482,6 +482,8 @@ struct i40e_hw { ...@@ -482,6 +482,8 @@ struct i40e_hw {
u32 debug_mask; u32 debug_mask;
}; };
#define i40e_is_vf(_hw) ((_hw)->mac.type == I40E_MAC_VF)
struct i40e_driver_version { struct i40e_driver_version {
u8 major_version; u8 major_version;
u8 minor_version; u8 minor_version;
......
...@@ -49,7 +49,7 @@ static inline bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc) ...@@ -49,7 +49,7 @@ static inline bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc)
static void i40e_adminq_init_regs(struct i40e_hw *hw) static void i40e_adminq_init_regs(struct i40e_hw *hw)
{ {
/* set head and tail registers in our local struct */ /* set head and tail registers in our local struct */
if (hw->mac.type == I40E_MAC_VF) { if (i40e_is_vf(hw)) {
hw->aq.asq.tail = I40E_VF_ATQT1; hw->aq.asq.tail = I40E_VF_ATQT1;
hw->aq.asq.head = I40E_VF_ATQH1; hw->aq.asq.head = I40E_VF_ATQH1;
hw->aq.asq.len = I40E_VF_ATQLEN1; hw->aq.asq.len = I40E_VF_ATQLEN1;
......
...@@ -476,6 +476,8 @@ struct i40e_hw { ...@@ -476,6 +476,8 @@ struct i40e_hw {
u32 debug_mask; u32 debug_mask;
}; };
#define i40e_is_vf(_hw) ((_hw)->mac.type == I40E_MAC_VF)
struct i40e_driver_version { struct i40e_driver_version {
u8 major_version; u8 major_version;
u8 minor_version; u8 minor_version;
......
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