Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-block.git] / drivers / net / ethernet / intel / iavf / iavf.h
index 89423947ee65fafa197aef33f508e2c9c6dfe3a8..49aed3e506a66d3bee4cb9f563e1fc74fddde03a 100644 (file)
@@ -44,6 +44,9 @@
 #define DEFAULT_DEBUG_LEVEL_SHIFT 3
 #define PFX "iavf: "
 
+int iavf_status_to_errno(enum iavf_status status);
+int virtchnl_status_to_errno(enum virtchnl_status_code v_status);
+
 /* VSI state flags shared with common code */
 enum iavf_vsi_state_t {
        __IAVF_VSI_DOWN,
@@ -188,7 +191,7 @@ enum iavf_state_t {
        __IAVF_REMOVE,          /* driver is being unloaded */
        __IAVF_INIT_VERSION_CHECK,      /* aq msg sent, awaiting reply */
        __IAVF_INIT_GET_RESOURCES,      /* aq msg sent, awaiting reply */
-       __IAVF_INIT_GET_OFFLOAD_VLAN_V2_CAPS,
+       __IAVF_INIT_EXTENDED_CAPS,      /* process extended caps which require aq msg exchange */
        __IAVF_INIT_CONFIG_ADAPTER,
        __IAVF_INIT_SW,         /* got resources, setting up structs */
        __IAVF_INIT_FAILED,     /* init failed, restarting procedure */
@@ -288,6 +291,7 @@ struct iavf_adapter {
 #define IAVF_FLAG_REINIT_ITR_NEEDED            BIT(16)
 #define IAVF_FLAG_QUEUES_DISABLED              BIT(17)
 #define IAVF_FLAG_SETUP_NETDEV_FEATURES                BIT(18)
+#define IAVF_FLAG_REINIT_MSIX_NEEDED           BIT(20)
 /* duplicates for common code */
 #define IAVF_FLAG_DCB_ENABLED                  0
        /* flags for admin queue service task */
@@ -333,6 +337,21 @@ struct iavf_adapter {
 #define IAVF_FLAG_AQ_ENABLE_STAG_VLAN_INSERTION                BIT_ULL(37)
 #define IAVF_FLAG_AQ_DISABLE_STAG_VLAN_INSERTION       BIT_ULL(38)
 
+       /* flags for processing extended capability messages during
+        * __IAVF_INIT_EXTENDED_CAPS. Each capability exchange requires
+        * both a SEND and a RECV step, which must be processed in sequence.
+        *
+        * During the __IAVF_INIT_EXTENDED_CAPS state, the driver will
+        * process one flag at a time during each state loop.
+        */
+       u64 extended_caps;
+#define IAVF_EXTENDED_CAP_SEND_VLAN_V2                 BIT_ULL(0)
+#define IAVF_EXTENDED_CAP_RECV_VLAN_V2                 BIT_ULL(1)
+
+#define IAVF_EXTENDED_CAPS                             \
+       (IAVF_EXTENDED_CAP_SEND_VLAN_V2 |               \
+        IAVF_EXTENDED_CAP_RECV_VLAN_V2)
+
        /* OS defined structs */
        struct net_device *netdev;
        struct pci_dev *pdev;
@@ -514,7 +533,7 @@ void iavf_add_vlans(struct iavf_adapter *adapter);
 void iavf_del_vlans(struct iavf_adapter *adapter);
 void iavf_set_promiscuous(struct iavf_adapter *adapter, int flags);
 void iavf_request_stats(struct iavf_adapter *adapter);
-void iavf_request_reset(struct iavf_adapter *adapter);
+int iavf_request_reset(struct iavf_adapter *adapter);
 void iavf_get_hena(struct iavf_adapter *adapter);
 void iavf_set_hena(struct iavf_adapter *adapter);
 void iavf_set_rss_key(struct iavf_adapter *adapter);