FPGA 橋接

實現新 FPGA 橋接的 API

輔助宏 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 橋接的名稱

dev

FPGA 橋接裝置

mutex

強制對橋接的獨佔引用

br_ops

指向 FPGA 橋接操作結構的指標

br_ops_owner

包含 br_ops 的模組

info

fpga 映象特定資訊

node

FPGA 橋接列表節點

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 *name

FPGA 橋接名稱

const struct fpga_bridge_ops *br_ops

指向 fpga 橋接操作結構的指標

void *priv

FPGA 橋接私有資料

struct module *owner

包含 br_ops 的所有者模組

返回值

struct fpga_bridge 指標或 ERR_PTR()

void fpga_bridge_unregister(struct fpga_bridge *bridge)

登出 FPGA 橋接

引數

struct fpga_bridge *bridge

FPGA 橋接結構

說明

此函式旨在用於 FPGA 橋接驅動程式的移除函式中。