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 橋接驅動程式的移除函式中。