FPGA 桥接¶
实现新 FPGA 桥接的 API¶
struct fpga_bridge- FPGA 桥接结构struct fpga_bridge_ops- 低级桥接驱动程序操作__fpga_bridge_register()- 创建并注册桥接fpga_bridge_unregister()- 注销桥接
辅助宏 fpga_bridge_register() 会自动将注册 FPGA 桥接的模块设置为所有者。
-
struct fpga_bridge¶
FPGA 桥接结构
定义:
struct fpga_bridge {
const char *name;
struct device dev;
struct mutex mutex;
const struct fpga_bridge_ops *br_ops;
struct module *br_ops_owner;
struct fpga_image_info *info;
struct list_head node;
void *priv;
};
成员
name低级 FPGA 桥接的名称
devFPGA 桥接设备
mutex强制对桥接的独占引用
br_ops指向 FPGA 桥接操作结构的指针
br_ops_owner包含 br_ops 的模块
infofpga 镜像特定信息
nodeFPGA 桥接列表节点
priv低级驱动程序私有数据
-
struct fpga_bridge_ops¶
低级 FPGA 桥接驱动程序的操作
定义:
struct fpga_bridge_ops {
int (*enable_show)(struct fpga_bridge *bridge);
int (*enable_set)(struct fpga_bridge *bridge, bool enable);
void (*fpga_bridge_remove)(struct fpga_bridge *bridge);
const struct attribute_group **groups;
};
成员
enable_show返回 FPGA 桥接的状态
enable_set将 FPGA 桥接设置为启用或禁用
fpga_bridge_remove在驱动程序移除期间将 FPGA 设置为特定状态
groups可选属性组。
-
struct fpga_bridge *__fpga_bridge_register(struct device *parent, const char *name, const struct fpga_bridge_ops *br_ops, void *priv, struct module *owner)¶
创建并注册 FPGA 桥接设备
参数
struct device *parent来自 pdev 的 FPGA 桥接设备
const char *nameFPGA 桥接名称
const struct fpga_bridge_ops *br_ops指向 fpga 桥接操作结构的指针
void *privFPGA 桥接私有数据
struct module *owner包含 br_ops 的所有者模块
返回值
-
void fpga_bridge_unregister(struct fpga_bridge *bridge)¶
注销 FPGA 桥接
参数
struct fpga_bridge *bridgeFPGA 桥接结构
说明
此函数旨在用于 FPGA 桥接驱动程序的移除函数中。