]> git.karo-electronics.de Git - linux-beck.git/commitdiff
i40e: Define and use i40e_is_vf macro
authorAnjali Singhai Jain <anjali.singhai@intel.com>
Tue, 11 Nov 2014 20:06:58 +0000 (20:06 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 6 Dec 2014 12:00:24 +0000 (04:00 -0800)
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: Anjali Singhai Jain <anjali.singhai@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_adminq.c
drivers/net/ethernet/intel/i40e/i40e_type.h
drivers/net/ethernet/intel/i40evf/i40e_adminq.c
drivers/net/ethernet/intel/i40evf/i40e_type.h

index 5dc12c4ecb24ad28b2987f25c957fe140f43684d..35fa09a2c16261e3e7e10d9acbc820448d7e0a26 100644 (file)
@@ -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)
 {
        /* 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.head = I40E_VF_ATQH1;
                hw->aq.asq.len  = I40E_VF_ATQLEN1;
index c85214373a51976c5dff9c48afd3d03d1ee0af31..3904dd8ea1f15a8034d8b771c759173a2bfa6993 100644 (file)
@@ -482,6 +482,8 @@ struct i40e_hw {
        u32 debug_mask;
 };
 
+#define i40e_is_vf(_hw)        ((_hw)->mac.type == I40E_MAC_VF)
+
 struct i40e_driver_version {
        u8 major_version;
        u8 minor_version;
index ff6305acf68a89ca34ffc45482d20ed71bed30e6..16989946c52a0fc093f7c964c7983d0bd3ba752c 100644 (file)
@@ -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)
 {
        /* 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.head = I40E_VF_ATQH1;
                hw->aq.asq.len  = I40E_VF_ATQLEN1;
index 8fe34fc5c469e80374868a22ab2515fbcc3becc6..77abe17217f9b354b463af6895e4d60927a813a3 100644 (file)
@@ -476,6 +476,8 @@ struct i40e_hw {
        u32 debug_mask;
 };
 
+#define i40e_is_vf(_hw)        ((_hw)->mac.type == I40E_MAC_VF)
+
 struct i40e_driver_version {
        u8 major_version;
        u8 minor_version;