qed: Introduce VFs
[linux-2.6-microblaze.git] / include / linux / qed / qed_if.h
index 67e8c20..76a6f16 100644 (file)
@@ -110,6 +110,7 @@ struct qed_link_params {
 #define QED_LINK_OVERRIDE_SPEED_ADV_SPEEDS      BIT(1)
 #define QED_LINK_OVERRIDE_SPEED_FORCED_SPEED    BIT(2)
 #define QED_LINK_OVERRIDE_PAUSE_CONFIG          BIT(3)
+#define QED_LINK_OVERRIDE_LOOPBACK_MODE         BIT(4)
        u32     override_flags;
        bool    autoneg;
        u32     adv_speeds;
@@ -118,6 +119,12 @@ struct qed_link_params {
 #define QED_LINK_PAUSE_RX_ENABLE                BIT(1)
 #define QED_LINK_PAUSE_TX_ENABLE                BIT(2)
        u32     pause_config;
+#define QED_LINK_LOOPBACK_NONE                  BIT(0)
+#define QED_LINK_LOOPBACK_INT_PHY               BIT(1)
+#define QED_LINK_LOOPBACK_EXT_PHY               BIT(2)
+#define QED_LINK_LOOPBACK_EXT                   BIT(3)
+#define QED_LINK_LOOPBACK_MAC                   BIT(4)
+       u32     loopback_mode;
 };
 
 struct qed_link_output {
@@ -133,6 +140,13 @@ struct qed_link_output {
        u32     pause_config;
 };
 
+struct qed_probe_params {
+       enum qed_protocol protocol;
+       u32 dp_module;
+       u8 dp_level;
+       bool is_vf;
+};
+
 #define QED_DRV_VER_STR_SIZE 12
 struct qed_slowpath_params {
        u32     int_mode;
@@ -158,10 +172,49 @@ struct qed_common_cb_ops {
                               struct qed_link_output   *link);
 };
 
+struct qed_selftest_ops {
+/**
+ * @brief selftest_interrupt - Perform interrupt test
+ *
+ * @param cdev
+ *
+ * @return 0 on success, error otherwise.
+ */
+       int (*selftest_interrupt)(struct qed_dev *cdev);
+
+/**
+ * @brief selftest_memory - Perform memory test
+ *
+ * @param cdev
+ *
+ * @return 0 on success, error otherwise.
+ */
+       int (*selftest_memory)(struct qed_dev *cdev);
+
+/**
+ * @brief selftest_register - Perform register test
+ *
+ * @param cdev
+ *
+ * @return 0 on success, error otherwise.
+ */
+       int (*selftest_register)(struct qed_dev *cdev);
+
+/**
+ * @brief selftest_clock - Perform clock test
+ *
+ * @param cdev
+ *
+ * @return 0 on success, error otherwise.
+ */
+       int (*selftest_clock)(struct qed_dev *cdev);
+};
+
 struct qed_common_ops {
+       struct qed_selftest_ops *selftest;
+
        struct qed_dev* (*probe)(struct pci_dev *dev,
-                                enum qed_protocol protocol,
-                                u32 dp_module, u8 dp_level);
+                                struct qed_probe_params *params);
 
        void            (*remove)(struct qed_dev *cdev);
 
@@ -211,6 +264,16 @@ struct qed_common_ops {
 
        void            (*simd_handler_clean)(struct qed_dev *cdev,
                                              int index);
+
+/**
+ * @brief can_link_change - can the instance change the link or not
+ *
+ * @param cdev
+ *
+ * @return true if link-change is allowed, false otherwise.
+ */
+       bool (*can_link_change)(struct qed_dev *cdev);
+
 /**
  * @brief set_link - set links according to params
  *
@@ -384,16 +447,16 @@ struct qed_eth_stats {
 
        /* port */
        u64     rx_64_byte_packets;
-       u64     rx_127_byte_packets;
-       u64     rx_255_byte_packets;
-       u64     rx_511_byte_packets;
-       u64     rx_1023_byte_packets;
-       u64     rx_1518_byte_packets;
-       u64     rx_1522_byte_packets;
-       u64     rx_2047_byte_packets;
-       u64     rx_4095_byte_packets;
-       u64     rx_9216_byte_packets;
-       u64     rx_16383_byte_packets;
+       u64     rx_65_to_127_byte_packets;
+       u64     rx_128_to_255_byte_packets;
+       u64     rx_256_to_511_byte_packets;
+       u64     rx_512_to_1023_byte_packets;
+       u64     rx_1024_to_1518_byte_packets;
+       u64     rx_1519_to_1522_byte_packets;
+       u64     rx_1519_to_2047_byte_packets;
+       u64     rx_2048_to_4095_byte_packets;
+       u64     rx_4096_to_9216_byte_packets;
+       u64     rx_9217_to_16383_byte_packets;
        u64     rx_crc_errors;
        u64     rx_mac_crtl_frames;
        u64     rx_pause_frames;