FPGA Bridge¶
API to implement a new FPGA bridge¶
struct fpga_bridge- The FPGA Bridge structurestruct fpga_bridge_ops- Low level Bridge driver ops__fpga_bridge_register()- Create and register a bridgefpga_bridge_unregister()- Unregister a bridge
The helper macro fpga_bridge_register() automatically sets
the module that registers the FPGA bridge as the owner.
-
struct fpga_bridge¶
FPGA bridge structure
Definition:
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;
};
Members
namename of low level FPGA bridge
devFPGA bridge device
mutexenforces exclusive reference to bridge
br_opspointer to struct of FPGA bridge ops
br_ops_ownermodule containing the br_ops
infofpga image specific information
nodeFPGA bridge list node
privlow level driver private date
-
struct fpga_bridge_ops¶
ops for low level FPGA bridge drivers
Definition:
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;
};
Members
enable_showreturns the FPGA bridge’s status
enable_setset an FPGA bridge as enabled or disabled
fpga_bridge_removeset FPGA into a specific state during driver remove
groupsoptional attribute 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)¶
create and register an FPGA Bridge device
Parameters
struct device *parentFPGA bridge device from pdev
const char *nameFPGA bridge name
const struct fpga_bridge_ops *br_opspointer to structure of fpga bridge ops
void *privFPGA bridge private data
struct module *ownerowner module containing the br_ops
Return
struct fpga_bridge pointer or ERR_PTR()
-
void fpga_bridge_unregister(struct fpga_bridge *bridge)¶
unregister an FPGA bridge
Parameters
struct fpga_bridge *bridgeFPGA bridge struct
Description
This function is intended for use in an FPGA bridge driver’s remove function.