net/i40e/base: update FW AQ API version to 1.7
authorJingjing Wu <jingjing.wu@intel.com>
Tue, 27 Jun 2017 13:29:10 +0000 (21:29 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 6 Jul 2017 13:00:57 +0000 (15:00 +0200)
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
drivers/net/i40e/base/i40e_adminq_cmd.h
drivers/net/i40e/base/i40e_common.c
drivers/net/i40e/base/i40e_type.h

index c1ca290..dd9fb55 100644 (file)
@@ -41,7 +41,15 @@ POSSIBILITY OF SUCH DAMAGE.
  */
 
 #define I40E_FW_API_VERSION_MAJOR      0x0001
-#define I40E_FW_API_VERSION_MINOR      0x0005
+#define I40E_FW_API_VERSION_MINOR_X722 0x0005
+#define I40E_FW_API_VERSION_MINOR_X710 0x0007
+
+#define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
+                                       I40E_FW_API_VERSION_MINOR_X710 : \
+                                       I40E_FW_API_VERSION_MINOR_X722)
+
+/* API version 1.7 implements additional link and PHY-specific APIs  */
+#define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007
 
 struct i40e_aq_desc {
        __le16 flags;
index 38c30a1..9895a77 100644 (file)
@@ -1692,8 +1692,9 @@ enum i40e_status_code i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
                status = I40E_ERR_UNKNOWN_PHY;
 
        if (report_init) {
-               if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
-                   hw->aq.api_min_ver >= 7) {
+               if (hw->mac.type ==  I40E_MAC_XL710 &&
+                   hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
+                   hw->aq.api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710) {
                        status = i40e_aq_get_link_info(hw, true, NULL, NULL);
                } else {
                        hw->phy.phy_types = LE32_TO_CPU(abilities->phy_type);
index af5347b..6ca1a0f 100644 (file)
@@ -199,10 +199,6 @@ enum i40e_memcpy_type {
        I40E_DMA_TO_NONDMA
 };
 
-#define I40E_FW_API_VERSION_MINOR_X722 0x0005
-#define I40E_FW_API_VERSION_MINOR_X710 0x0005
-
-
 /* These are structs for managing the hardware information and the operations.
  * The structures of function pointers are filled out at init time when we
  * know for sure exactly which hardware we're working with.  This gives us the