vDPA/ifcvf: verify mandatory feature bits for vDPA
[linux-2.6-microblaze.git] / drivers / vdpa / ifcvf / ifcvf_base.h
index 64696d6..f77239f 100644 (file)
 #include <uapi/linux/virtio_config.h>
 #include <uapi/linux/virtio_pci.h>
 
-#define IFCVF_VENDOR_ID                0x1AF4
-#define IFCVF_DEVICE_ID                0x1041
-#define IFCVF_SUBSYS_VENDOR_ID 0x8086
-#define IFCVF_SUBSYS_DEVICE_ID 0x001A
+#define N3000_VENDOR_ID                0x1AF4
+#define N3000_DEVICE_ID                0x1041
+#define N3000_SUBSYS_VENDOR_ID 0x8086
+#define N3000_SUBSYS_DEVICE_ID 0x001A
+
+#define C5000X_PL_VENDOR_ID            0x1AF4
+#define C5000X_PL_DEVICE_ID            0x1000
+#define C5000X_PL_SUBSYS_VENDOR_ID     0x8086
+#define C5000X_PL_SUBSYS_DEVICE_ID     0x0001
 
 #define IFCVF_SUPPORTED_FEATURES \
                ((1ULL << VIRTIO_NET_F_MAC)                     | \
@@ -78,6 +83,7 @@ struct ifcvf_hw {
        void __iomem *notify_base;
        u32 notify_off_multiplier;
        u64 req_features;
+       u64 hw_features;
        struct virtio_pci_common_cfg __iomem *common_cfg;
        void __iomem *net_cfg;
        struct vring_info vring[IFCVF_MAX_QUEUE_PAIRS * 2];
@@ -116,6 +122,8 @@ void ifcvf_set_status(struct ifcvf_hw *hw, u8 status);
 void io_write64_twopart(u64 val, u32 *lo, u32 *hi);
 void ifcvf_reset(struct ifcvf_hw *hw);
 u64 ifcvf_get_features(struct ifcvf_hw *hw);
+u64 ifcvf_get_hw_features(struct ifcvf_hw *hw);
+int ifcvf_verify_min_features(struct ifcvf_hw *hw, u64 features);
 u16 ifcvf_get_vq_state(struct ifcvf_hw *hw, u16 qid);
 int ifcvf_set_vq_state(struct ifcvf_hw *hw, u16 qid, u16 num);
 struct ifcvf_adapter *vf_to_adapter(struct ifcvf_hw *hw);