net/qede/base: add SmartAN support
[dpdk.git] / drivers / net / qede / base / mcp_public.h
index 969dd5a..41711cc 100644 (file)
@@ -59,7 +59,7 @@ struct eth_phy_cfg {
 /* 0 = autoneg, 1000/10000/20000/25000/40000/50000/100000 */
        u32 speed;
 #define ETH_SPEED_AUTONEG   0
-#define ETH_SPEED_SMARTLINQ  0x8
+#define ETH_SPEED_SMARTLINQ  0x8 /* deprecated - use link_modes field instead */
 
        u32 pause;      /* bitmask */
 #define ETH_PAUSE_NONE         0x0
@@ -84,32 +84,22 @@ struct eth_phy_cfg {
 /* Remote Serdes Loopback (RX to TX) */
 #define ETH_LOOPBACK_INT_PHY_FEA_AH_ONLY (9)
 
-       /* Used to configure the EEE Tx LPI timer, has several modes of
-        * operation, according to bits 29:28
-        * 2'b00: Timer will be configured by nvram, output will be the value
-        *        from nvram.
-        * 2'b01: Timer will be configured by nvram, output will be in
-        *        16xmicroseconds.
-        * 2'b10: bits 1:0 contain an nvram value which will be used instead
-        *        of the one located in the nvram. Output will be that value.
-        * 2'b11: bits 19:0 contain the idle timer in microseconds; output
-        *        will be in 16xmicroseconds.
-        * Bits 31:30 should be 2'b11 in order for EEE to be enabled.
-        */
-       u32 eee_mode;
-#define EEE_MODE_TIMER_USEC_MASK       (0x000fffff)
-#define EEE_MODE_TIMER_USEC_OFFSET     (0)
-#define EEE_MODE_TIMER_USEC_BALANCED_TIME      (0xa00)
-#define EEE_MODE_TIMER_USEC_AGGRESSIVE_TIME    (0x100)
-#define EEE_MODE_TIMER_USEC_LATENCY_TIME       (0x6000)
-/* Set by the driver to request status timer will be in microseconds and and not
- * in EEE policy definition
+       u32 eee_cfg;
+/* EEE is enabled (configuration). Refer to eee_status->active for negotiated
+ * status
  */
-#define EEE_MODE_OUTPUT_TIME           (1 << 28)
-/* Set by the driver to override default nvm timer */
-#define EEE_MODE_OVERRIDE_NVRAM                (1 << 29)
-#define EEE_MODE_ENABLE_LPI            (1 << 30) /* Set when */
-#define EEE_MODE_ADV_LPI               (1 << 31) /* Set when EEE is enabled */
+#define EEE_CFG_EEE_ENABLED    (1 << 0)
+#define EEE_CFG_TX_LPI         (1 << 1)
+#define EEE_CFG_ADV_SPEED_1G   (1 << 2)
+#define EEE_CFG_ADV_SPEED_10G  (1 << 3)
+#define EEE_TX_TIMER_USEC_MASK (0xfffffff0)
+#define EEE_TX_TIMER_USEC_SHIFT        4
+#define EEE_TX_TIMER_USEC_BALANCED_TIME                (0xa00)
+#define EEE_TX_TIMER_USEC_AGGRESSIVE_TIME      (0x100)
+#define EEE_TX_TIMER_USEC_LATENCY_TIME         (0x6000)
+
+       u32 link_modes; /* Additional link modes */
+#define LINK_MODE_SMARTLINQ_ENABLE             0x1  /* XXX Deprecate */
 };
 
 struct port_mf_cfg {
@@ -132,13 +122,28 @@ struct eth_stats {
        u64 r1023; /* 0x04 (Offset 0x20 ) RX 512 to 1023 byte frame counter*/
 /* 0x05 (Offset 0x28 ) RX 1024 to 1518 byte frame counter */
        u64 r1518;
+       union {
+               struct { /* bb */
 /* 0x06 (Offset 0x30 ) RX 1519 to 1522 byte VLAN-tagged frame counter */
-       u64 r1522;
-       u64 r2047; /* 0x07 (Offset 0x38 ) RX 1519 to 2047 byte frame counter*/
-       u64 r4095; /* 0x08 (Offset 0x40 ) RX 2048 to 4095 byte frame counter*/
-       u64 r9216; /* 0x09 (Offset 0x48 ) RX 4096 to 9216 byte frame counter*/
+                       u64 r1522;
+/* 0x07 (Offset 0x38 ) RX 1519 to 2047 byte frame counter*/
+                       u64 r2047;
+/* 0x08 (Offset 0x40 ) RX 2048 to 4095 byte frame counter*/
+                       u64 r4095;
+/* 0x09 (Offset 0x48 ) RX 4096 to 9216 byte frame counter*/
+                       u64 r9216;
 /* 0x0A (Offset 0x50 ) RX 9217 to 16383 byte frame counter */
-       u64 r16383;
+                       u64 r16383;
+               } bb0;
+               struct { /* ah */
+                       u64 unused1;
+/* 0x07 (Offset 0x38 ) RX 1519 to max byte frame counter*/
+                       u64 r1519_to_max;
+                       u64 unused2;
+                       u64 unused3;
+                       u64 unused4;
+               } ah0;
+       } u0;
        u64 rfcs;       /* 0x0F (Offset 0x58 ) RX FCS error frame counter*/
        u64 rxcf;       /* 0x10 (Offset 0x60 ) RX control frame counter*/
        u64 rxpf;       /* 0x11 (Offset 0x68 ) RX pause frame counter*/
@@ -156,19 +161,40 @@ struct eth_stats {
        u64 t1023; /* 0x44 (Offset 0xc8 ) TX 512 to 1023 byte frame counter*/
 /* 0x45 (Offset 0xd0 ) TX 1024 to 1518 byte frame counter */
        u64 t1518;
+       union {
+               struct { /* bb */
 /* 0x47 (Offset 0xd8 ) TX 1519 to 2047 byte frame counter */
-       u64 t2047;
+                       u64 t2047;
 /* 0x48 (Offset 0xe0 ) TX 2048 to 4095 byte frame counter */
-       u64 t4095;
+                       u64 t4095;
 /* 0x49 (Offset 0xe8 ) TX 4096 to 9216 byte frame counter */
-       u64 t9216;
+                       u64 t9216;
 /* 0x4A (Offset 0xf0 ) TX 9217 to 16383 byte frame counter */
-       u64 t16383;
+                       u64 t16383;
+               } bb1;
+               struct { /* ah */
+/* 0x47 (Offset 0xd8 ) TX 1519 to max byte frame counter */
+                       u64 t1519_to_max;
+                       u64 unused6;
+                       u64 unused7;
+                       u64 unused8;
+               } ah1;
+       } u1;
        u64 txpf;       /* 0x50 (Offset 0xf8 ) TX pause frame counter */
        u64 txpp;       /* 0x51 (Offset 0x100) TX PFC frame counter */
 /* 0x6C (Offset 0x108) Transmit Logical Type LLFC message counter */
-       u64 tlpiec;
-       u64 tncl; /* 0x6E (Offset 0x110) Transmit Total Collision Counter */
+       union {
+               struct { /* bb */
+/* 0x6C (Offset 0x108) Transmit Logical Type LLFC message counter */
+                       u64 tlpiec;
+/* 0x6E (Offset 0x110) Transmit Total Collision Counter */
+                       u64 tncl;
+               } bb2;
+               struct { /* ah */
+                       u64 unused9;
+                       u64 unused10;
+               } ah2;
+       } u2;
        u64 rbyte;      /* 0x3d (Offset 0x118) RX byte counter */
        u64 rxuca;      /* 0x0c (Offset 0x120) RX UC frame counter */
        u64 rxmca;      /* 0x0d (Offset 0x128) RX MC frame counter */
@@ -294,16 +320,20 @@ struct dcbx_ets_feature {
 #define DCBX_ETS_CBS_SHIFT                      3
 #define DCBX_ETS_MAX_TCS_MASK                   0x000000f0
 #define DCBX_ETS_MAX_TCS_SHIFT                  4
-#define DCBX_ISCSI_OOO_TC_MASK                 0x00000f00
-#define DCBX_ISCSI_OOO_TC_SHIFT                 8
+#define DCBX_OOO_TC_MASK                        0x00000f00
+#define DCBX_OOO_TC_SHIFT                       8
 /* Entries in tc table are orginized that the left most is pri 0, right most is
  * prio 7
  */
 
        u32  pri_tc_tbl[1];
-#define DCBX_ISCSI_OOO_TC                      (4)
+/* Fixed TCP OOO TC usage is deprecated and used only for driver backward
+ * compatibility
+ */
+#define DCBX_TCP_OOO_TC                                (4)
+#define DCBX_TCP_OOO_K2_4PORT_TC               (3)
 
-#define NIG_ETS_ISCSI_OOO_CLIENT_OFFSET                (DCBX_ISCSI_OOO_TC + 1)
+#define NIG_ETS_ISCSI_OOO_CLIENT_OFFSET                (DCBX_TCP_OOO_TC + 1)
 #define DCBX_CEE_STRICT_PRIORITY               0xf
 /* Entries in tc table are orginized that the left most is pri 0, right most is
  * prio 7
@@ -586,14 +616,14 @@ struct public_port {
        u32 link_status;
 #define LINK_STATUS_LINK_UP                            0x00000001
 #define LINK_STATUS_SPEED_AND_DUPLEX_MASK              0x0000001e
-#define LINK_STATUS_SPEED_AND_DUPLEX_1000THD                   (1 << 1)
-#define LINK_STATUS_SPEED_AND_DUPLEX_1000TFD                   (2 << 1)
-#define LINK_STATUS_SPEED_AND_DUPLEX_10G                       (3 << 1)
-#define LINK_STATUS_SPEED_AND_DUPLEX_20G                       (4 << 1)
-#define LINK_STATUS_SPEED_AND_DUPLEX_40G                       (5 << 1)
-#define LINK_STATUS_SPEED_AND_DUPLEX_50G                       (6 << 1)
-#define LINK_STATUS_SPEED_AND_DUPLEX_100G                      (7 << 1)
-#define LINK_STATUS_SPEED_AND_DUPLEX_25G                       (8 << 1)
+#define LINK_STATUS_SPEED_AND_DUPLEX_1000THD           (1 << 1)
+#define LINK_STATUS_SPEED_AND_DUPLEX_1000TFD           (2 << 1)
+#define LINK_STATUS_SPEED_AND_DUPLEX_10G               (3 << 1)
+#define LINK_STATUS_SPEED_AND_DUPLEX_20G               (4 << 1)
+#define LINK_STATUS_SPEED_AND_DUPLEX_40G               (5 << 1)
+#define LINK_STATUS_SPEED_AND_DUPLEX_50G               (6 << 1)
+#define LINK_STATUS_SPEED_AND_DUPLEX_100G              (7 << 1)
+#define LINK_STATUS_SPEED_AND_DUPLEX_25G               (8 << 1)
 #define LINK_STATUS_AUTO_NEGOTIATE_ENABLED             0x00000020
 #define LINK_STATUS_AUTO_NEGOTIATE_COMPLETE            0x00000040
 #define LINK_STATUS_PARALLEL_DETECTION_USED            0x00000080
@@ -607,10 +637,10 @@ struct public_port {
 #define LINK_STATUS_LINK_PARTNER_100G_CAPABLE          0x00008000
 #define LINK_STATUS_LINK_PARTNER_25G_CAPABLE           0x00010000
 #define LINK_STATUS_LINK_PARTNER_FLOW_CONTROL_MASK     0x000C0000
-#define LINK_STATUS_LINK_PARTNER_NOT_PAUSE_CAPABLE             (0 << 18)
-#define LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE               (1 << 18)
-#define LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE              (2 << 18)
-#define LINK_STATUS_LINK_PARTNER_BOTH_PAUSE                    (3 << 18)
+#define LINK_STATUS_LINK_PARTNER_NOT_PAUSE_CAPABLE     (0 << 18)
+#define LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE       (1 << 18)
+#define LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE      (2 << 18)
+#define LINK_STATUS_LINK_PARTNER_BOTH_PAUSE            (3 << 18)
 #define LINK_STATUS_SFP_TX_FAULT                       0x00100000
 #define LINK_STATUS_TX_FLOW_CONTROL_ENABLED            0x00200000
 #define LINK_STATUS_RX_FLOW_CONTROL_ENABLED            0x00400000
@@ -619,9 +649,9 @@ struct public_port {
 #define LINK_STATUS_MAC_REMOTE_FAULT                   0x02000000
 #define LINK_STATUS_UNSUPPORTED_SPD_REQ                        0x04000000
 #define LINK_STATUS_FEC_MODE_MASK                      0x38000000
-#define LINK_STATUS_FEC_MODE_NONE                              (0 << 27)
-#define LINK_STATUS_FEC_MODE_FIRECODE_CL74                     (1 << 27)
-#define LINK_STATUS_FEC_MODE_RS_CL91                           (2 << 27)
+#define LINK_STATUS_FEC_MODE_NONE                      (0 << 27)
+#define LINK_STATUS_FEC_MODE_FIRECODE_CL74             (1 << 27)
+#define LINK_STATUS_FEC_MODE_RS_CL91                   (2 << 27)
 #define LINK_STATUS_EXT_PHY_LINK_UP                    0x40000000
 
        u32 link_status1;
@@ -657,6 +687,8 @@ struct public_port {
 #define LFA_SPEED_MISMATCH                             (1 << 3)
 #define LFA_FLOW_CTRL_MISMATCH                         (1 << 4)
 #define LFA_ADV_SPEED_MISMATCH                         (1 << 5)
+#define LFA_EEE_MISMATCH                               (1 << 6)
+#define LFA_LINK_MODES_MISMATCH                        (1 << 7)
 #define LINK_FLAP_AVOIDANCE_COUNT_OFFSET       8
 #define LINK_FLAP_AVOIDANCE_COUNT_MASK         0x0000ff00
 #define LINK_FLAP_COUNT_OFFSET                 16
@@ -747,38 +779,35 @@ struct public_port {
        u32 wol_pkt_details;
        struct dcb_dscp_map dcb_dscp_map;
 
-       /* the status of EEE auto-negotiation
-        * bits 19:0 the configured tx-lpi entry timer value. Depends on bit 31.
-        * bits 23:20 the speeds advertised for EEE.
-        * bits 27:24 the speeds the Link partner advertised for EEE.
-        * The supported/adv. modes in bits 27:19 originate from the
-        * SHMEM_EEE_XXX_ADV definitions (where XXX is replaced by speed).
-        * bit 28 when 1'b1 EEE was requested.
-        * bit 29 when 1'b1 tx lpi was requested.
-        * bit 30 when 1'b1 EEE was negotiated. Tx lpi will be asserted if 30:29
-        *        are 2'b11.
-        * bit 31 - When 1'b0 bits 15:0 contain
-        *          NVM_CFG1_PORT_EEE_POWER_SAVING_MODE_XXX define as value.
-        *          When 1'b1 those bits contains a value times 16 microseconds.
-        */
        u32 eee_status;
-       #define EEE_TIMER_MASK          0x000fffff
-       #define EEE_ADV_STATUS_MASK     0x00f00000
-               #define EEE_1G_ADV      (1 << 1)
-               #define EEE_10G_ADV     (1 << 2)
-       #define EEE_ADV_STATUS_SHIFT    20
-       #define EEE_LP_ADV_STATUS_MASK  0x0f000000
-       #define EEE_LP_ADV_STATUS_SHIFT 24
-       #define EEE_REQUESTED_BIT       0x10000000
-       #define EEE_LPI_REQUESTED_BIT   0x20000000
-       #define EEE_ACTIVE_BIT          0x40000000
-       #define EEE_TIME_OUTPUT_BIT     0x80000000
+/* Set when EEE negotiation is complete. */
+#define EEE_ACTIVE_BIT         (1 << 0)
+
+/* Shows the Local Device EEE capabilities */
+#define EEE_LD_ADV_STATUS_MASK 0x000000f0
+#define EEE_LD_ADV_STATUS_SHIFT        4
+       #define EEE_1G_ADV      (1 << 1)
+       #define EEE_10G_ADV     (1 << 2)
+/* Same values as in EEE_LD_ADV, but for Link Parter */
+#define        EEE_LP_ADV_STATUS_MASK  0x00000f00
+#define EEE_LP_ADV_STATUS_SHIFT        8
 
        u32 eee_remote; /* Used for EEE in LLDP */
-       #define EEE_REMOTE_TW_TX_MASK   0x0000ffff
-       #define EEE_REMOTE_TW_TX_SHIFT  0
-       #define EEE_REMOTE_TW_RX_MASK   0xffff0000
-       #define EEE_REMOTE_TW_RX_SHIFT  16
+#define EEE_REMOTE_TW_TX_MASK  0x0000ffff
+#define EEE_REMOTE_TW_TX_SHIFT 0
+#define EEE_REMOTE_TW_RX_MASK  0xffff0000
+#define EEE_REMOTE_TW_RX_SHIFT 16
+
+       u32 module_info;
+#define ETH_TRANSCEIVER_MONITORING_TYPE_MASK           0x000000FF
+#define ETH_TRANSCEIVER_MONITORING_TYPE_OFFSET         0
+#define ETH_TRANSCEIVER_ADDR_CHNG_REQUIRED             (1 << 2)
+#define ETH_TRANSCEIVER_RCV_PWR_MEASURE_TYPE           (1 << 3)
+#define ETH_TRANSCEIVER_EXTERNALLY_CALIBRATED          (1 << 4)
+#define ETH_TRANSCEIVER_INTERNALLY_CALIBRATED          (1 << 5)
+#define ETH_TRANSCEIVER_HAS_DIAGNOSTIC                 (1 << 6)
+#define ETH_TRANSCEIVER_IDENT_MASK                     0x0000ff00
+#define ETH_TRANSCEIVER_IDENT_OFFSET                   8
 };
 
 /**************************************/
@@ -874,9 +903,11 @@ struct public_func {
 #define DRV_ID_PDA_COMP_VER_MASK       0x0000ffff
 #define DRV_ID_PDA_COMP_VER_SHIFT      0
 
+#define LOAD_REQ_HSI_VERSION           2
 #define DRV_ID_MCP_HSI_VER_MASK                0x00ff0000
 #define DRV_ID_MCP_HSI_VER_SHIFT       16
-#define DRV_ID_MCP_HSI_VER_CURRENT     (1 << DRV_ID_MCP_HSI_VER_SHIFT)
+#define DRV_ID_MCP_HSI_VER_CURRENT     (LOAD_REQ_HSI_VERSION << \
+                                        DRV_ID_MCP_HSI_VER_SHIFT)
 
 #define DRV_ID_DRV_TYPE_MASK           0x7f000000
 #define DRV_ID_DRV_TYPE_SHIFT          24
@@ -1019,6 +1050,7 @@ enum resource_id_enum {
        RESOURCE_NUM_RSS_ENGINES_E      =       14,
        RESOURCE_LL2_QUEUE_E            =       15,
        RESOURCE_RDMA_STATS_QUEUE_E     =       16,
+       RESOURCE_BDQ_E                  =       17,
        RESOURCE_MAX_NUM,
        RESOURCE_NUM_INVALID            =       0xFFFFFFFF
 };
@@ -1036,8 +1068,47 @@ struct resource_info {
 #define RESOURCE_ELEMENT_STRICT (1 << 0)
 };
 
+#define DRV_ROLE_NONE          0
+#define DRV_ROLE_PREBOOT       1
+#define DRV_ROLE_OS            2
+#define DRV_ROLE_KDUMP         3
+
+struct load_req_stc {
+       u32 drv_ver_0;
+       u32 drv_ver_1;
+       u32 fw_ver;
+       u32 misc0;
+#define LOAD_REQ_ROLE_MASK             0x000000FF
+#define LOAD_REQ_ROLE_SHIFT            0
+#define LOAD_REQ_LOCK_TO_MASK          0x0000FF00
+#define LOAD_REQ_LOCK_TO_SHIFT         8
+#define LOAD_REQ_LOCK_TO_DEFAULT       0
+#define LOAD_REQ_LOCK_TO_NONE          255
+#define LOAD_REQ_FORCE_MASK            0x000F0000
+#define LOAD_REQ_FORCE_SHIFT           16
+#define LOAD_REQ_FORCE_NONE            0
+#define LOAD_REQ_FORCE_PF              1
+#define LOAD_REQ_FORCE_ALL             2
+#define LOAD_REQ_FLAGS0_MASK           0x00F00000
+#define LOAD_REQ_FLAGS0_SHIFT          20
+#define LOAD_REQ_FLAGS0_AVOID_RESET    (0x1 << 0)
+};
+
+struct load_rsp_stc {
+       u32 drv_ver_0;
+       u32 drv_ver_1;
+       u32 fw_ver;
+       u32 misc0;
+#define LOAD_RSP_ROLE_MASK             0x000000FF
+#define LOAD_RSP_ROLE_SHIFT            0
+#define LOAD_RSP_HSI_MASK              0x0000FF00
+#define LOAD_RSP_HSI_SHIFT             8
+#define LOAD_RSP_FLAGS0_MASK           0x000F0000
+#define LOAD_RSP_FLAGS0_SHIFT          16
+#define LOAD_RSP_FLAGS0_DRV_EXISTS     (0x1 << 0)
+};
+
 union drv_union_data {
-       u32 ver_str[MCP_DRV_VER_STR_SIZE_DWORD];    /* LOAD_REQ */
        struct mcp_mac wol_mac; /* UNLOAD_DONE */
 
 /* This configuration should be set by the driver for the LINK_SET command. */
@@ -1064,6 +1135,9 @@ union drv_union_data {
        struct bist_nvm_image_att nvm_image_att;
        struct mdump_config_stc mdump_config;
        u32 dword;
+
+       struct load_req_stc load_req;
+       struct load_rsp_stc load_rsp;
        /* ... */
 };
 
@@ -1073,6 +1147,7 @@ struct public_drv_mb {
 #define DRV_MSG_CODE_LOAD_REQ                   0x10000000
 #define DRV_MSG_CODE_LOAD_DONE                  0x11000000
 #define DRV_MSG_CODE_INIT_HW                    0x12000000
+#define DRV_MSG_CODE_CANCEL_LOAD_REQ            0x13000000
 #define DRV_MSG_CODE_UNLOAD_REQ                        0x20000000
 #define DRV_MSG_CODE_UNLOAD_DONE                0x21000000
 #define DRV_MSG_CODE_INIT_PHY                  0x22000000
@@ -1088,16 +1163,15 @@ struct public_drv_mb {
 #define DRV_MSG_CODE_OV_UPDATE_BUS_NUM         0x27000000
 #define DRV_MSG_CODE_OV_UPDATE_BOOT_PROGRESS   0x28000000
 #define DRV_MSG_CODE_OV_UPDATE_STORM_FW_VER    0x29000000
+#define DRV_MSG_CODE_NIG_DRAIN                 0x30000000
 #define DRV_MSG_CODE_OV_UPDATE_DRIVER_STATE    0x31000000
 #define DRV_MSG_CODE_BW_UPDATE_ACK             0x32000000
 #define DRV_MSG_CODE_OV_UPDATE_MTU             0x33000000
-
-#define DRV_MSG_CODE_NIG_DRAIN                 0x30000000
-
 /* DRV_MB Param: driver version supp, FW_MB param: MFW version supp,
  * data: struct resource_info
  */
 #define DRV_MSG_GET_RESOURCE_ALLOC_MSG         0x34000000
+#define DRV_MSG_SET_RESOURCE_VALUE_MSG         0x35000000
 
 /*deprecated don't use*/
 #define DRV_MSG_CODE_INITIATE_FLR_DEPRECATED    0x02000000
@@ -1157,15 +1231,17 @@ struct public_drv_mb {
  * [3:0] - func, drv_data[7:0] - MAC/WWNN/WWPN
  */
 #define DRV_MSG_CODE_GET_VMAC                   0x00120000
-       #define DRV_MSG_CODE_VMAC_TYPE_MAC              1
-       #define DRV_MSG_CODE_VMAC_TYPE_WWNN             2
-       #define DRV_MSG_CODE_VMAC_TYPE_WWPN             3
+#define DRV_MSG_CODE_VMAC_TYPE_SHIFT            4
+#define DRV_MSG_CODE_VMAC_TYPE_MASK             0x30
+#define DRV_MSG_CODE_VMAC_TYPE_MAC              1
+#define DRV_MSG_CODE_VMAC_TYPE_WWNN             2
+#define DRV_MSG_CODE_VMAC_TYPE_WWPN             3
 /* Get statistics from pf, params [31:4] - reserved, [3:0] - stats type */
 #define DRV_MSG_CODE_GET_STATS                  0x00130000
-       #define DRV_MSG_CODE_STATS_TYPE_LAN             1
-       #define DRV_MSG_CODE_STATS_TYPE_FCOE            2
-       #define DRV_MSG_CODE_STATS_TYPE_ISCSI           3
-       #define DRV_MSG_CODE_STATS_TYPE_RDMA            4
+#define DRV_MSG_CODE_STATS_TYPE_LAN             1
+#define DRV_MSG_CODE_STATS_TYPE_FCOE            2
+#define DRV_MSG_CODE_STATS_TYPE_ISCSI           3
+#define DRV_MSG_CODE_STATS_TYPE_RDMA            4
 /* Host shall provide buffer and size for MFW  */
 #define DRV_MSG_CODE_PMD_DIAG_DUMP             0x00140000
 /* Host shall provide buffer and size for MFW  */
@@ -1193,8 +1269,8 @@ struct public_drv_mb {
 #define DRV_MSG_CODE_MASK_PARITIES             0x001a0000
 /* param[0] - Simulate fan failure,  param[1] - simulate over temp. */
 #define DRV_MSG_CODE_INDUCE_FAILURE            0x001b0000
-       #define DRV_MSG_FAN_FAILURE_TYPE                (1 << 0)
-       #define DRV_MSG_TEMPERATURE_FAILURE_TYPE        (1 << 1)
+#define DRV_MSG_FAN_FAILURE_TYPE               (1 << 0)
+#define DRV_MSG_TEMPERATURE_FAILURE_TYPE       (1 << 1)
 /* Param: [0:15] - gpio number */
 #define DRV_MSG_CODE_GPIO_READ                 0x001c0000
 /* Param: [0:15] - gpio number, [16:31] - gpio value */
@@ -1211,54 +1287,69 @@ struct public_drv_mb {
 #define DRV_MSG_CODE_TIMESTAMP                  0x00210000
 /* This is an empty mailbox just return OK*/
 #define DRV_MSG_CODE_EMPTY_MB                  0x00220000
+
 /* Param[0:4] - resource number (0-31), Param[5:7] - opcode,
  * param[15:8] - age
  */
 #define DRV_MSG_CODE_RESOURCE_CMD              0x00230000
-       /* request resource ownership with default aging */
-       #define RESOURCE_OPCODE_REQ                     1
-       /* request resource ownership without aging */
-       #define RESOURCE_OPCODE_REQ_WO_AGING            2
-       /* request resource ownership with specific aging timer (in seconds) */
-       #define RESOURCE_OPCODE_REQ_W_AGING             3
-       #define RESOURCE_OPCODE_RELEASE                 4 /* release resource */
-       /* force resource release */
-       #define RESOURCE_OPCODE_FORCE_RELEASE           5
-       /* resource is free and granted to requester */
-       #define RESOURCE_OPCODE_GNT                     1
-       /* resource is busy, param[7:0] indicates owner as follow 0-15 = PF0-15,
-        * 16 = MFW, 17 = diag over serial
-        */
-       #define RESOURCE_OPCODE_BUSY                    2
-       /* indicate release request was acknowledged */
-       #define RESOURCE_OPCODE_RELEASED                3
-       /* indicate release request was previously received by other owner */
-       #define RESOURCE_OPCODE_RELEASED_PREVIOUS       4
-       /* indicate wrong owner during release */
-       #define RESOURCE_OPCODE_WRONG_OWNER             5
-       #define RESOURCE_OPCODE_UNKNOWN_CMD             255
-       /* dedicate resource 0 for dump */
-       #define RESOURCE_DUMP                           0
+
+#define RESOURCE_CMD_REQ_RESC_MASK             0x0000001F
+#define RESOURCE_CMD_REQ_RESC_SHIFT            0
+#define RESOURCE_CMD_REQ_OPCODE_MASK           0x000000E0
+#define RESOURCE_CMD_REQ_OPCODE_SHIFT          5
+/* request resource ownership with default aging */
+#define RESOURCE_OPCODE_REQ                    1
+/* request resource ownership without aging */
+#define RESOURCE_OPCODE_REQ_WO_AGING           2
+/* request resource ownership with specific aging timer (in seconds) */
+#define RESOURCE_OPCODE_REQ_W_AGING            3
+#define RESOURCE_OPCODE_RELEASE                        4 /* release resource */
+/* force resource release */
+#define RESOURCE_OPCODE_FORCE_RELEASE          5
+#define RESOURCE_CMD_REQ_AGE_MASK              0x0000FF00
+#define RESOURCE_CMD_REQ_AGE_SHIFT             8
+
+#define RESOURCE_CMD_RSP_OWNER_MASK            0x000000FF
+#define RESOURCE_CMD_RSP_OWNER_SHIFT           0
+#define RESOURCE_CMD_RSP_OPCODE_MASK           0x00000700
+#define RESOURCE_CMD_RSP_OPCODE_SHIFT          8
+/* resource is free and granted to requester */
+#define RESOURCE_OPCODE_GNT                    1
+/* resource is busy, param[7:0] indicates owner as follow 0-15 = PF0-15,
+ * 16 = MFW, 17 = diag over serial
+ */
+#define RESOURCE_OPCODE_BUSY                   2
+/* indicate release request was acknowledged */
+#define RESOURCE_OPCODE_RELEASED               3
+/* indicate release request was previously received by other owner */
+#define RESOURCE_OPCODE_RELEASED_PREVIOUS      4
+/* indicate wrong owner during release */
+#define RESOURCE_OPCODE_WRONG_OWNER            5
+#define RESOURCE_OPCODE_UNKNOWN_CMD            255
+
+/* dedicate resource 0 for dump */
+#define RESOURCE_DUMP                          0
+
 #define DRV_MSG_CODE_GET_MBA_VERSION           0x00240000 /* Get MBA version */
 /* Send crash dump commands with param[3:0] - opcode */
 #define DRV_MSG_CODE_MDUMP_CMD                 0x00250000
-       #define MDUMP_DRV_PARAM_OPCODE_MASK             0x0000000f
-       /* acknowledge reception of error indication */
-       #define DRV_MSG_CODE_MDUMP_ACK                  0x01
-       /* set epoc and personality as follow: drv_data[3:0] - epoch,
       * drv_data[7:4] - personality
       */
-       #define DRV_MSG_CODE_MDUMP_SET_VALUES           0x02
-       /* trigger crash dump procedure */
-       #define DRV_MSG_CODE_MDUMP_TRIGGER              0x03
-       /* Request valid logs and config words */
-       #define DRV_MSG_CODE_MDUMP_GET_CONFIG           0x04
-       /* Set triggers mask. drv_mb_param should indicate (bitwise) which
       * trigger enabled
       */
-       #define DRV_MSG_CODE_MDUMP_SET_ENABLE           0x05
-       /* Clear all logs */
-       #define DRV_MSG_CODE_MDUMP_CLEAR_LOGS           0x06
+#define MDUMP_DRV_PARAM_OPCODE_MASK            0x0000000f
+/* acknowledge reception of error indication */
+#define DRV_MSG_CODE_MDUMP_ACK                 0x01
+/* set epoc and personality as follow: drv_data[3:0] - epoch,
+ * drv_data[7:4] - personality
+ */
+#define DRV_MSG_CODE_MDUMP_SET_VALUES          0x02
+/* trigger crash dump procedure */
+#define DRV_MSG_CODE_MDUMP_TRIGGER             0x03
+/* Request valid logs and config words */
+#define DRV_MSG_CODE_MDUMP_GET_CONFIG          0x04
+/* Set triggers mask. drv_mb_param should indicate (bitwise) which
+ * trigger enabled
+ */
+#define DRV_MSG_CODE_MDUMP_SET_ENABLE          0x05
+/* Clear all logs */
+#define DRV_MSG_CODE_MDUMP_CLEAR_LOGS          0x06
 #define DRV_MSG_CODE_MEM_ECC_EVENTS            0x00260000 /* Param: None */
 /* Param: [0:15] - gpio number */
 #define DRV_MSG_CODE_GPIO_INFO                 0x00270000
@@ -1266,14 +1357,19 @@ struct public_drv_mb {
 #define DRV_MSG_CODE_EXT_PHY_READ              0x00280000
 /* Value should be placed in union */
 #define DRV_MSG_CODE_EXT_PHY_WRITE             0x00290000
-       #define DRV_MB_PARAM_ADDR_SHIFT                 0
-       #define DRV_MB_PARAM_ADDR_MASK                  0x0000FFFF
-       #define DRV_MB_PARAM_DEVAD_SHIFT                16
-       #define DRV_MB_PARAM_DEVAD_MASK                 0x001F0000
-       #define DRV_MB_PARAM_PORT_SHIFT                 21
-       #define DRV_MB_PARAM_PORT_MASK                  0x00600000
+#define DRV_MB_PARAM_ADDR_SHIFT                        0
+#define DRV_MB_PARAM_ADDR_MASK                 0x0000FFFF
+#define DRV_MB_PARAM_DEVAD_SHIFT               16
+#define DRV_MB_PARAM_DEVAD_MASK                        0x001F0000
+#define DRV_MB_PARAM_PORT_SHIFT                        21
+#define DRV_MB_PARAM_PORT_MASK                 0x00600000
 #define DRV_MSG_CODE_EXT_PHY_FW_UPGRADE                0x002a0000
 
+/* Param: Set DRV_MB_PARAM_FEATURE_SUPPORT_* */
+#define DRV_MSG_CODE_FEATURE_SUPPORT            0x00300000
+/* return FW_MB_PARAM_FEATURE_SUPPORT_*  */
+#define DRV_MSG_CODE_GET_MFW_FEATURE_SUPPORT   0x00310000
+
 #define DRV_MSG_SEQ_NUMBER_MASK                 0x0000ffff
 
        u32 drv_mb_param;
@@ -1421,14 +1517,27 @@ struct public_drv_mb {
 #define DRV_MB_PARAM_BIST_TEST_IMAGE_INDEX_SHIFT      8
 #define DRV_MB_PARAM_BIST_TEST_IMAGE_INDEX_MASK       0x0000FF00
 
+#define DRV_MB_PARAM_FEATURE_SUPPORT_PORT_MASK      0x0000FFFF
+#define DRV_MB_PARAM_FEATURE_SUPPORT_PORT_SHIFT     0
+/* driver supports SmartLinQ parameter */
+#define DRV_MB_PARAM_FEATURE_SUPPORT_PORT_SMARTLINQ 0x00000001
+/* driver supports EEE parameter */
+#define DRV_MB_PARAM_FEATURE_SUPPORT_PORT_EEE       0x00000002
+#define DRV_MB_PARAM_FEATURE_SUPPORT_FUNC_MASK      0xFFFF0000
+#define DRV_MB_PARAM_FEATURE_SUPPORT_FUNC_SHIFT     16
+
        u32 fw_mb_header;
 #define FW_MSG_CODE_MASK                        0xffff0000
+#define FW_MSG_CODE_UNSUPPORTED                        0x00000000
 #define FW_MSG_CODE_DRV_LOAD_ENGINE            0x10100000
 #define FW_MSG_CODE_DRV_LOAD_PORT               0x10110000
 #define FW_MSG_CODE_DRV_LOAD_FUNCTION           0x10120000
 #define FW_MSG_CODE_DRV_LOAD_REFUSED_PDA        0x10200000
-#define FW_MSG_CODE_DRV_LOAD_REFUSED_HSI        0x10210000
+#define FW_MSG_CODE_DRV_LOAD_REFUSED_HSI_1      0x10210000
 #define FW_MSG_CODE_DRV_LOAD_REFUSED_DIAG       0x10220000
+#define FW_MSG_CODE_DRV_LOAD_REFUSED_HSI        0x10230000
+#define FW_MSG_CODE_DRV_LOAD_REFUSED_REQUIRES_FORCE 0x10300000
+#define FW_MSG_CODE_DRV_LOAD_REFUSED_REJECT     0x10310000
 #define FW_MSG_CODE_DRV_LOAD_DONE               0x11100000
 #define FW_MSG_CODE_DRV_UNLOAD_ENGINE           0x20110000
 #define FW_MSG_CODE_DRV_UNLOAD_PORT             0x20120000
@@ -1481,6 +1590,10 @@ struct public_drv_mb {
 #define FW_MSG_CODE_NVM_PUT_FILE_FINISH_OK     0x00400000
 /* MFW reject "mcp reset" command if one of the drivers is up */
 #define FW_MSG_CODE_MCP_RESET_REJECT           0x00600000
+#define FW_MSG_CODE_NVM_FAILED_CALC_HASH       0x00310000
+#define FW_MSG_CODE_NVM_PUBLIC_KEY_MISSING     0x00320000
+#define FW_MSG_CODE_NVM_INVALID_PUBLIC_KEY     0x00330000
+
 #define FW_MSG_CODE_PHY_OK                     0x00110000
 #define FW_MSG_CODE_PHY_ERROR                  0x00120000
 #define FW_MSG_CODE_SET_SECURE_MODE_ERROR      0x00130000
@@ -1509,8 +1622,9 @@ struct public_drv_mb {
 #define FW_MSG_CODE_EXTPHY_INVALID_PHY_TYPE    0x00710000
 #define FW_MSG_CODE_EXTPHY_OPERATION_FAILED    0x00720000
 #define FW_MSG_CODE_EXTPHY_NO_PHY_DETECTED     0x00730000
+#define FW_MSG_CODE_RECOVERY_MODE              0x00740000
 
-/* mdump related response codes */
+       /* mdump related response codes */
 #define FW_MSG_CODE_MDUMP_NO_IMAGE_FOUND       0x00010000
 #define FW_MSG_CODE_MDUMP_ALLOC_FAILED         0x00020000
 #define FW_MSG_CODE_MDUMP_INVALID_CMD          0x00030000
@@ -1521,12 +1635,17 @@ struct public_drv_mb {
 
 
        u32 fw_mb_param;
-       /* Resource Allocation params - MFW  version support*/
+/* Resource Allocation params - MFW  version support */
 #define FW_MB_PARAM_RESOURCE_ALLOC_VERSION_MAJOR_MASK  0xFFFF0000
 #define FW_MB_PARAM_RESOURCE_ALLOC_VERSION_MAJOR_SHIFT         16
 #define FW_MB_PARAM_RESOURCE_ALLOC_VERSION_MINOR_MASK  0x0000FFFF
 #define FW_MB_PARAM_RESOURCE_ALLOC_VERSION_MINOR_SHIFT         0
 
+/* get MFW feature support response */
+/* MFW supports SmartLinQ */
+#define FW_MB_PARAM_FEATURE_SUPPORT_SMARTLINQ   0x00000001
+/* MFW supports EEE */
+#define FW_MB_PARAM_FEATURE_SUPPORT_EEE         0x00000002
 
        u32 drv_pulse_mb;
 #define DRV_PULSE_SEQ_MASK                      0x00007fff