net/i40e/base: enable FEC on/off flag setting for X722
authorGuinan Sun <guinanx.sun@intel.com>
Mon, 27 Jul 2020 05:34:44 +0000 (05:34 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 18 Sep 2020 16:55:06 +0000 (18:55 +0200)
Starting with API version 1.10 firmware for X722 devices has ability
to change FEC settings in PHY. Code added in this patch
checks API version and sets appropriate capability flag.

Signed-off-by: Dawid Lukwinski <dawid.lukwinski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
drivers/net/i40e/base/i40e_adminq.c
drivers/net/i40e/base/i40e_adminq_cmd.h
drivers/net/i40e/base/i40e_type.h

index c89e1fb..0da45f0 100644 (file)
@@ -603,6 +603,12 @@ STATIC void i40e_set_hw_flags(struct i40e_hw *hw)
                    (aq->api_maj_ver == 1 &&
                     aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_X722))
                        hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE;
+
+               if (aq->api_maj_ver > 1 ||
+                   (aq->api_maj_ver == 1 &&
+                    aq->api_min_ver >= I40E_MINOR_VER_FW_REQUEST_FEC_X722))
+                       hw->flags |= I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE;
+
                /* fall through */
        default:
                break;
index 1905167..f790183 100644 (file)
@@ -25,6 +25,8 @@
 #define I40E_MINOR_VER_GET_LINK_INFO_X722 0x0009
 /* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */
 #define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006
+/* API version 1.10 for X722 devices adds ability to request FEC encoding */
+#define I40E_MINOR_VER_FW_REQUEST_FEC_X722 0x000A
 
 struct i40e_aq_desc {
        __le16 flags;
index 014a4c1..b5b5b92 100644 (file)
@@ -745,6 +745,7 @@ struct i40e_hw {
 #define I40E_HW_FLAG_FW_LLDP_PERSISTENT     BIT_ULL(5)
 #define I40E_HW_FLAG_AQ_PHY_ACCESS_EXTENDED BIT_ULL(6)
 #define I40E_HW_FLAG_DROP_MODE             BIT_ULL(7)
+#define I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE BIT_ULL(8)
        u64 flags;
 
        /* Used in set switch config AQ command */