OPAE Intel FPGA Linux Device Driver Architecture Guide

ID 683857
Date 10/02/2017
Public
Document Table of Contents

1.1.10.1. Port Platform Device Data Structures


struct feature_ops { 
	int (*init)(struct platform_device *pdev, struct feature *feature); 
	int (*uinit)(struct platform_device *pdev, struct feature *feature); 
	long (*ioctl)(struct platform_device *pdev, struct feature *feature, 
				unsigned int cmd, unsigned long arg); 
	int (*test)(struct platform_device *pdev, struct feature *feature); 
};

struct feature { 
	const char *name; 
	int resource_index; 
	void __iomem *ioaddr; 
	struct feature_ops *ops; 
};

struct feature_platform_data { 
	struct list_head node; 
	struct mutex lock; 
	unsigned long dev_status; 
	struct cdev cdev; 
	struct platform_device *dev; 
	unsigned int disable_count; 
	void *private; 
	int num; 
	int (*config_port)(struct platform_device *, u32, bool); 
	struct platform_device *(*fpga_for_each_port)(struct platform_device *, 
					void *, int (*match)(struct platform_device *, void *)); 
	struct feature features[0]; 
};

struct fpga_afu_region { 
	u32 index; 
	u32 flags; 
	u64 size; 
	u64 offset; 
	u64 phys; 
	struct list_head node; 
};

struct fpga_afu_dma_region { 
	u64 user_addr; 
	u64 length; 
	u64 iova; 
	struct page **pages; 
	struct rb_node node; 
	bool in_use; 
};

struct fpga_afu { 
	u64 region_cur_offset; 
	int num_regions; 
	u8 num_umsgs; 
	struct list_head regions; 
	struct rb_root dma_regions; 
	struct feature_platform_data *pdata; 
};