net/qede/base: add mf-bit/API for FIP special mode
authorRasesh Mody <rasesh.mody@cavium.com>
Sat, 29 Sep 2018 08:14:30 +0000 (08:14 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 11 Oct 2018 16:53:48 +0000 (18:53 +0200)
Add mf-bit/API for FIP special mode.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
drivers/net/qede/base/ecore.h
drivers/net/qede/base/ecore_dev.c
drivers/net/qede/base/ecore_dev_api.h

index 4607a80..b9f5993 100644 (file)
@@ -543,6 +543,9 @@ enum ecore_mf_mode_bit {
 
        /* Use stag for steering */
        ECORE_MF_8021AD_TAGGING,
+
+       /* Allow FIP discovery fallback */
+       ECORE_MF_FIP_SPECIAL,
 };
 
 enum ecore_ufp_mode {
index 4558306..da312b4 100644 (file)
@@ -3704,7 +3704,8 @@ ecore_hw_get_nvm_info(struct ecore_hwfn *p_hwfn,
        case NVM_CFG1_GLOB_MF_MODE_BD:
                p_hwfn->p_dev->mf_bits = 1 << ECORE_MF_OVLAN_CLSS |
                                         1 << ECORE_MF_LLH_PROTO_CLSS |
-                                        1 << ECORE_MF_8021AD_TAGGING;
+                                        1 << ECORE_MF_8021AD_TAGGING |
+                                        1 << ECORE_MF_FIP_SPECIAL;
                break;
        case NVM_CFG1_GLOB_MF_MODE_NPAR1_0:
                p_hwfn->p_dev->mf_bits = 1 << ECORE_MF_LLH_MAC_CLSS |
@@ -5804,3 +5805,8 @@ void ecore_set_fw_mac_addr(__le16 *fw_msb,
        ((u8 *)fw_lsb)[0] = mac[5];
        ((u8 *)fw_lsb)[1] = mac[4];
 }
+
+bool ecore_is_mf_fip_special(struct ecore_dev *p_dev)
+{
+       return !!OSAL_TEST_BIT(ECORE_MF_FIP_SPECIAL, &p_dev->mf_bits);
+}
index 7cba54c..ab80b52 100644 (file)
@@ -704,4 +704,13 @@ ecore_set_queue_coalesce(struct ecore_hwfn *p_hwfn, u16 rx_coal,
 enum _ecore_status_t ecore_pglueb_set_pfid_enable(struct ecore_hwfn *p_hwfn,
                                                  struct ecore_ptt *p_ptt,
                                                  bool b_enable);
+
+/**
+ * @brief Whether FIP discovery fallback special mode is enabled or not.
+ *
+ * @param cdev
+ *
+ * @return true if device is in FIP special mode, false otherwise.
+ */
+bool ecore_is_mf_fip_special(struct ecore_dev *p_dev);
 #endif