qed: Add CONFIG_QED_SRIOV
[cascardo/linux.git] / drivers / net / ethernet / qlogic / qed / qed.h
index 33e2ed6..2e067c7 100644 (file)
@@ -32,6 +32,8 @@ extern const struct qed_common_ops qed_common_ops_pass;
 #define NAME_SIZE 16
 #define VER_SIZE 16
 
+#define QED_WFQ_UNIT   100
+
 /* cau states */
 enum qed_coalescing_mode {
        QED_COAL_MODE_DISABLE,
@@ -150,6 +152,7 @@ enum QED_RESOURCES {
 
 enum QED_FEATURE {
        QED_PF_L2_QUE,
+       QED_VF,
        QED_MAX_FEATURES,
 };
 
@@ -237,6 +240,12 @@ struct qed_dmae_info {
        struct dmae_cmd *p_dmae_cmd;
 };
 
+struct qed_wfq_data {
+       /* when feature is configured for at least 1 vport */
+       u32     min_speed;
+       bool    configured;
+};
+
 struct qed_qm_info {
        struct init_qm_pq_params        *qm_pq_params;
        struct init_qm_vport_params     *qm_vport_params;
@@ -257,6 +266,7 @@ struct qed_qm_info {
        bool                            vport_wfq_en;
        u8                              pf_wfq;
        u32                             pf_rl;
+       struct qed_wfq_data             *wfq_data;
 };
 
 struct storm_stats {
@@ -351,6 +361,7 @@ struct qed_hwfn {
        /* True if the driver requests for the link */
        bool                            b_drv_link_init;
 
+       struct qed_pf_iov               *pf_iov_info;
        struct qed_mcp_info             *mcp_info;
 
        struct qed_hw_cid_data          *p_tx_cids;
@@ -475,6 +486,10 @@ struct qed_dev {
        u8                              num_hwfns;
        struct qed_hwfn                 hwfns[MAX_HWFNS_PER_DEVICE];
 
+       /* SRIOV */
+       struct qed_hw_sriov_info *p_iov_info;
+#define IS_QED_SRIOV(cdev)              (!!(cdev)->p_iov_info)
+
        unsigned long                   tunn_mode;
        u32                             drv_type;
 
@@ -505,6 +520,7 @@ struct qed_dev {
        const struct firmware           *firmware;
 };
 
+#define NUM_OF_VFS(dev)         MAX_NUM_VFS_BB
 #define NUM_OF_SBS(dev)         MAX_SB_PER_PATH_BB
 #define NUM_OF_ENG_PFS(dev)     MAX_NUM_PFS_BB
 
@@ -526,6 +542,8 @@ static inline u8 qed_concrete_to_sw_fid(struct qed_dev *cdev,
 
 #define PURE_LB_TC 8
 
+void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev, u32 min_pf_rate);
+
 #define QED_LEADING_HWFN(dev)   (&dev->hwfns[0])
 
 /* Other Linux specific common definitions */