drivers/vdpa/ifcvf/ifcvf_base.h

Source file repositories/reference/linux-study-clean/drivers/vdpa/ifcvf/ifcvf_base.h

File Facts

System
Linux kernel
Corpus path
drivers/vdpa/ifcvf/ifcvf_base.h
Extension
.h
Size
4061 bytes
Lines
134
Domain
Driver Families
Bucket
drivers/vdpa
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct vring_info {
	u16 last_avail_idx;
	void __iomem *notify_addr;
	phys_addr_t notify_pa;
	u32 irq;
	struct vdpa_callback cb;
	char msix_name[256];
};

struct ifcvf_lm_cfg {
	__le64 control;
	__le64 status;
	__le64 lm_mem_log_start_addr;
	__le64 lm_mem_log_end_addr;
	__le16 vq_state_region;
};

struct ifcvf_hw {
	u8 __iomem *isr;
	/* Live migration */
	struct ifcvf_lm_cfg  __iomem *lm_cfg;
	/* Notification bar number */
	u8 notify_bar;
	u8 msix_vector_status;
	/* virtio-net or virtio-blk device config size */
	u32 config_size;
	/* Notificaiton bar address */
	void __iomem *notify_base;
	phys_addr_t notify_base_pa;
	u32 notify_off_multiplier;
	u32 dev_type;
	u64 hw_features;
	/* provisioned device features */
	u64 dev_features;
	struct virtio_pci_common_cfg __iomem *common_cfg;
	void __iomem *dev_cfg;
	struct vring_info *vring;
	void __iomem * const *base;
	char config_msix_name[256];
	struct vdpa_callback config_cb;
	int config_irq;
	int vqs_reused_irq;
	u16 nr_vring;
	/* VIRTIO_PCI_CAP_DEVICE_CFG size */
	u32 num_msix_vectors;
	u32 cap_dev_config_size;
	struct pci_dev *pdev;
};

struct ifcvf_adapter {
	struct vdpa_device vdpa;
	struct pci_dev *pdev;
	struct ifcvf_hw *vf;
};

struct ifcvf_vdpa_mgmt_dev {
	struct vdpa_mgmt_dev mdev;
	struct ifcvf_hw vf;
	struct ifcvf_adapter *adapter;
	struct pci_dev *pdev;
};

int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *dev);
void ifcvf_stop(struct ifcvf_hw *hw);
void ifcvf_notify_queue(struct ifcvf_hw *hw, u16 qid);
void ifcvf_read_dev_config(struct ifcvf_hw *hw, u64 offset,
			   void *dst, int length);
void ifcvf_write_dev_config(struct ifcvf_hw *hw, u64 offset,
			    const void *src, int length);
u8 ifcvf_get_status(struct ifcvf_hw *hw);
void ifcvf_set_status(struct ifcvf_hw *hw, u8 status);
void ifcvf_reset(struct ifcvf_hw *hw);
u64 ifcvf_get_dev_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);
u32 ifcvf_get_config_size(struct ifcvf_hw *hw);
u16 ifcvf_set_vq_vector(struct ifcvf_hw *hw, u16 qid, int vector);
u16 ifcvf_set_config_vector(struct ifcvf_hw *hw, int vector);
void ifcvf_set_vq_num(struct ifcvf_hw *hw, u16 qid, u32 num);
int ifcvf_set_vq_address(struct ifcvf_hw *hw, u16 qid, u64 desc_area,
			 u64 driver_area, u64 device_area);
bool ifcvf_get_vq_ready(struct ifcvf_hw *hw, u16 qid);
void ifcvf_set_vq_ready(struct ifcvf_hw *hw, u16 qid, bool ready);
void ifcvf_set_driver_features(struct ifcvf_hw *hw, u64 features);
u64 ifcvf_get_driver_features(struct ifcvf_hw *hw);
u16 ifcvf_get_max_vq_size(struct ifcvf_hw *hw);
u16 ifcvf_get_vq_size(struct ifcvf_hw *hw, u16 qid);
#endif /* _IFCVF_H_ */

Annotation

Implementation Notes