// SPDX-License-Identifier: GPL-2.0 /* * Driver for FPGA Device Feature List (DFL) Support * * Copyright (C) 2017-2018 Intel Corporation, Inc. * * Authors: * Kang Luwei <luwei.kang@intel.com> * Zhang Yi <yi.z.zhang@intel.com> * Wu Hao <hao.wu@intel.com> * Xiao Guangrong <guangrong.xiao@linux.intel.com>
*/ #include <linux/dfl.h> #include <linux/fpga-dfl.h> #include <linux/module.h> #include <linux/overflow.h> #include <linux/uaccess.h>
#include"dfl.h"
static DEFINE_MUTEX(dfl_id_mutex);
/* * when adding a new feature dev support in DFL framework, it's required to * add a new item in enum dfl_id_type and provide related information in below * dfl_devs table which is indexed by dfl_id_type, e.g. name string used for * platform device creation (define name strings in dfl.h, as they could be * reused by platform device drivers). * * if the new feature dev needs chardev support, then it's required to add * a new item in dfl_chardevs table and configure dfl_devs[i].devt_type as * index to dfl_chardevs table. If no chardev support just set devt_type * as one invalid index (DFL_FPGA_DEVT_MAX).
*/ enum dfl_fpga_devt_type {
DFL_FPGA_DEVT_FME,
DFL_FPGA_DEVT_PORT,
DFL_FPGA_DEVT_MAX,
};
/** * struct dfl_dev_info - dfl feature device information. * @name: name string of the feature platform device. * @dfh_id: id value in Device Feature Header (DFH) register by DFL spec. * @id: idr id of the feature dev. * @devt_type: index to dfl_chrdevs[].
*/ struct dfl_dev_info { constchar *name;
u16 dfh_id; struct idr id; enum dfl_fpga_devt_type devt_type;
};
staticenum dfl_id_type dfh_id_to_type(u16 id)
{ int i;
for (i = 0; i < ARRAY_SIZE(dfl_devs); i++) if (dfl_devs[i].dfh_id == id) return i;
return DFL_ID_MAX;
}
/* * introduce a global port_ops list, it allows port drivers to register ops * in such list, then other feature devices (e.g. FME), could use the port * functions even related port platform device is hidden. Below is one example, * in virtualization case of PCIe-based FPGA DFL device, when SRIOV is * enabled, port (and it's AFU) is turned into VF and port platform device * is hidden from system but it's still required to access port to finish FPGA * reconfiguration function in FME.
*/
/** * dfl_fpga_port_ops_get - get matched port ops from the global list * @fdata: feature dev data to match with associated port ops. * Return: matched port ops on success, NULL otherwise. * * Please note that must dfl_fpga_port_ops_put after use the port_ops.
*/ struct dfl_fpga_port_ops *dfl_fpga_port_ops_get(struct dfl_feature_dev_data *fdata)
{ struct dfl_fpga_port_ops *ops = NULL;
mutex_lock(&dfl_port_ops_mutex); if (list_empty(&dfl_port_ops_list)) goto done;
list_for_each_entry(ops, &dfl_port_ops_list, node) { /* match port_ops using the name of platform device */ if (!strcmp(fdata->pdev_name, ops->name)) { if (!try_module_get(ops->owner))
ops = NULL; goto done;
}
}
/** * dfl_fpga_port_ops_put - put port ops * @ops: port ops.
*/ void dfl_fpga_port_ops_put(struct dfl_fpga_port_ops *ops)
{ if (ops && ops->owner)
module_put(ops->owner);
}
EXPORT_SYMBOL_GPL(dfl_fpga_port_ops_put);
/** * dfl_fpga_port_ops_add - add port_ops to global list * @ops: port ops to add.
*/ void dfl_fpga_port_ops_add(struct dfl_fpga_port_ops *ops)
{
mutex_lock(&dfl_port_ops_mutex);
list_add_tail(&ops->node, &dfl_port_ops_list);
mutex_unlock(&dfl_port_ops_mutex);
}
EXPORT_SYMBOL_GPL(dfl_fpga_port_ops_add);
/** * dfl_fpga_port_ops_del - remove port_ops from global list * @ops: port ops to del.
*/ void dfl_fpga_port_ops_del(struct dfl_fpga_port_ops *ops)
{
mutex_lock(&dfl_port_ops_mutex);
list_del(&ops->node);
mutex_unlock(&dfl_port_ops_mutex);
}
EXPORT_SYMBOL_GPL(dfl_fpga_port_ops_del);
/** * dfl_fpga_check_port_id - check the port id * @fdata: port feature dev data. * @pport_id: port id to compare. * * Return: 1 if port device matches with given port id, otherwise 0.
*/ int dfl_fpga_check_port_id(struct dfl_feature_dev_data *fdata, void *pport_id)
{ struct dfl_fpga_port_ops *port_ops;
if (fdata->id != FEATURE_DEV_ID_UNUSED) return fdata->id == *(int *)pport_id;
port_ops = dfl_fpga_port_ops_get(fdata); if (!port_ops || !port_ops->get_id) return 0;
/** * dfl_fpga_dev_feature_uinit - uinit for sub features of dfl feature device * @pdev: feature device.
*/ void dfl_fpga_dev_feature_uinit(struct platform_device *pdev)
{ struct dfl_feature_dev_data *fdata = to_dfl_feature_dev_data(&pdev->dev); struct dfl_feature *feature;
dfl_devs_remove(fdata);
dfl_fpga_dev_for_each_feature(fdata, feature) { if (feature->ops) { if (feature->ops->uinit)
feature->ops->uinit(pdev, feature);
feature->ops = NULL;
}
}
}
EXPORT_SYMBOL_GPL(dfl_fpga_dev_feature_uinit);
staticint dfl_feature_instance_init(struct platform_device *pdev, struct dfl_feature *feature, struct dfl_feature_driver *drv)
{ void __iomem *base; int ret = 0;
if (!is_header_feature(feature)) {
base = devm_platform_ioremap_resource(pdev,
feature->resource_index); if (IS_ERR(base)) {
dev_err(&pdev->dev, "ioremap failed for feature 0x%x!\n",
feature->id); return PTR_ERR(base);
}
feature->ioaddr = base;
}
if (drv->ops->init) {
ret = drv->ops->init(pdev, feature); if (ret) return ret;
}
if (ids) { while (ids->id) { if (ids->id == feature->id) returntrue;
ids++;
}
} returnfalse;
}
/** * dfl_fpga_dev_feature_init - init for sub features of dfl feature device * @pdev: feature device. * @feature_drvs: drvs for sub features. * * This function will match sub features with given feature drvs list and * use matched drv to init related sub feature. * * Return: 0 on success, negative error code otherwise.
*/ int dfl_fpga_dev_feature_init(struct platform_device *pdev, struct dfl_feature_driver *feature_drvs)
{ struct dfl_feature_dev_data *fdata = to_dfl_feature_dev_data(&pdev->dev); struct dfl_feature_driver *drv = feature_drvs; struct dfl_feature *feature; int ret;
while (drv->ops) {
dfl_fpga_dev_for_each_feature(fdata, feature) { if (dfl_feature_drv_match(feature, drv)) {
ret = dfl_feature_instance_init(pdev, feature, drv); if (ret) gotoexit;
}
}
drv++;
}
/* * set parent to the feature device so that its refcount is * decreased after the last refcount of cdev is gone, that * makes sure the feature device is valid during device * file's life-cycle.
*/
pdata->cdev.kobj.parent = &pdev->dev.kobj;
/** * struct build_feature_devs_info - info collected during feature dev build. * * @dev: device to enumerate. * @cdev: the container device for all feature devices. * @nr_irqs: number of irqs for all feature devices. * @irq_table: Linux IRQ numbers for all irqs, indexed by local irq index of * this device. * @type: the current FIU type. * @ioaddr: header register region address of current FIU in enumeration. * @start: register resource start of current FIU. * @len: max register resource length of current FIU. * @sub_features: a sub features linked list for feature device in enumeration. * @feature_num: number of sub features for feature device in enumeration.
*/ struct build_feature_devs_info { struct device *dev; struct dfl_fpga_cdev *cdev; unsignedint nr_irqs; int *irq_table;
/** * struct dfl_feature_info - sub feature info collected during feature dev build * * @fid: id of this sub feature. * @revision: revision of this sub feature * @dfh_version: version of Device Feature Header (DFH) * @mmio_res: mmio resource of this sub feature. * @ioaddr: mapped base address of mmio resource. * @node: node in sub_features linked list. * @irq_base: start of irq index in this sub feature. * @nr_irqs: number of irqs of this sub feature. * @param_size: size DFH parameters. * @params: DFH parameter data.
*/ struct dfl_feature_info {
u16 fid;
u8 revision;
u8 dfh_version; struct resource mmio_res; void __iomem *ioaddr; struct list_head node; unsignedint irq_base; unsignedint nr_irqs; unsignedint param_size;
u64 params[];
};
/* * the count should be initialized to 0 to make sure *__fpga_port_enable() following __fpga_port_disable() * works properly for port device. * and it should always be 0 for fme device.
*/
WARN_ON(fdata->disable_count);
/* fill features and resource information for feature dev */
list_for_each_entry_safe(finfo, p, &binfo->sub_features, node) { struct dfl_feature *feature = &fdata->features[index++]; struct dfl_feature_irq_ctx *ctx; unsignedint i;
/* save resource information for each feature */
feature->id = finfo->fid;
feature->revision = finfo->revision;
feature->dfh_version = finfo->dfh_version;
if (finfo->param_size) {
feature->params = devm_kmemdup(binfo->dev,
finfo->params, finfo->param_size,
GFP_KERNEL); if (!feature->params) return ERR_PTR(-ENOMEM);
feature->param_size = finfo->param_size;
} /* * the FIU header feature has some fundamental functions (sriov * set, port enable/disable) needed for the dfl bus device and * other sub features. So its mmio resource should be mapped by * DFL bus device. And we should not assign it to feature * devices (dfl-fme/afu) again.
*/ if (is_header_feature(feature)) {
feature->resource_index = -1;
feature->ioaddr =
devm_ioremap_resource(binfo->dev,
&finfo->mmio_res); if (IS_ERR(feature->ioaddr)) return ERR_CAST(feature->ioaddr);
} else {
feature->resource_index = res_idx;
fdata->resources[res_idx++] = finfo->mmio_res;
}
if (finfo->nr_irqs) {
ctx = devm_kcalloc(binfo->dev, finfo->nr_irqs, sizeof(*ctx), GFP_KERNEL); if (!ctx) return ERR_PTR(-ENOMEM);
for (i = 0; i < finfo->nr_irqs; i++)
ctx[i].irq =
binfo->irq_table[finfo->irq_base + i];
/* * register current feature device, it is called when we need to switch to * another feature parsing or we have parsed all features on given device * feature list.
*/ staticint feature_dev_register(struct dfl_feature_dev_data *fdata)
{ struct dfl_feature_platform_data pdata = {}; struct platform_device *fdev; struct dfl_feature *feature; int ret;
fdev = platform_device_alloc(fdata->pdev_name, fdata->pdev_id); if (!fdev) return -ENOMEM;
static u64 *find_param(u64 *params, resource_size_t max, int param_id)
{
u64 *end = params + max / sizeof(u64);
u64 v, next;
while (params < end) {
v = *params; if (param_id == FIELD_GET(DFHv1_PARAM_HDR_ID, v)) return params;
if (FIELD_GET(DFHv1_PARAM_HDR_NEXT_EOP, v)) break;
next = FIELD_GET(DFHv1_PARAM_HDR_NEXT_OFFSET, v);
params += next;
}
return NULL;
}
/** * dfh_find_param() - find parameter block for the given parameter id * @dfl_dev: dfl device * @param_id: id of dfl parameter * @psize: destination to store size of parameter data in bytes * * Return: pointer to start of parameter data, PTR_ERR otherwise.
*/ void *dfh_find_param(struct dfl_device *dfl_dev, int param_id, size_t *psize)
{
u64 *phdr = find_param(dfl_dev->params, dfl_dev->param_size, param_id);
if (!phdr) return ERR_PTR(-ENOENT);
if (psize)
*psize = (FIELD_GET(DFHv1_PARAM_HDR_NEXT_OFFSET, *phdr) - 1) * sizeof(u64);
switch (finfo->dfh_version) { case 0: /* * DFHv0 only provides MMIO resource information for each feature * in the DFL header. There is no generic interrupt information. * Instead, features with interrupt functionality provide * the information in feature specific registers.
*/
type = binfo->type; if (type == PORT_ID) { switch (fid) { case PORT_FEATURE_ID_UINT:
v = readq(base + PORT_UINT_CAP);
ibase = FIELD_GET(PORT_UINT_CAP_FST_VECT, v);
inr = FIELD_GET(PORT_UINT_CAP_INT_NUM, v); break; case PORT_FEATURE_ID_ERROR:
v = readq(base + PORT_ERROR_CAP);
ibase = FIELD_GET(PORT_ERROR_CAP_INT_VECT, v);
inr = FIELD_GET(PORT_ERROR_CAP_SUPP_INT, v); break;
}
} elseif (type == FME_ID) { switch (fid) { case FME_FEATURE_ID_GLOBAL_ERR:
v = readq(base + FME_ERROR_CAP);
ibase = FIELD_GET(FME_ERROR_CAP_INT_VECT, v);
inr = FIELD_GET(FME_ERROR_CAP_SUPP_INT, v); break;
}
} break;
case 1: /* * DFHv1 provides interrupt resource information in DFHv1 * parameter blocks.
*/
p = find_param(params, finfo->param_size, DFHv1_PARAM_ID_MSI_X); if (!p) break;
if (!FIELD_GET(DFHv1_CSR_SIZE_GRP_HAS_PARAMS,
readq(dfh_base + DFHv1_CSR_SIZE_GRP))) return 0;
while (size + DFHv1_PARAM_HDR < max) {
v = readq(dfh_base + DFHv1_PARAM_HDR + size);
next = FIELD_GET(DFHv1_PARAM_HDR_NEXT_OFFSET, v); if (!next) return -EINVAL;
size += next * sizeof(u64);
if (FIELD_GET(DFHv1_PARAM_HDR_NEXT_EOP, v)) return size;
}
return -ENOENT;
}
/* * when create sub feature instances, for private features, it doesn't need * to provide resource size and feature id as they could be read from DFH * register. For afu sub feature, its register region only contains user * defined registers, so never trust any information from it, just use the * resource size information provided by its parent FIU.
*/ staticint
create_feature_instance(struct build_feature_devs_info *binfo,
resource_size_t ofst, resource_size_t size, u16 fid)
{ struct dfl_feature_info *finfo;
resource_size_t start, end; int dfh_psize = 0;
u8 revision = 0;
u64 v, addr_off;
u8 dfh_ver = 0; int ret;
if (fid != FEATURE_ID_AFU) {
v = readq(binfo->ioaddr + ofst);
revision = FIELD_GET(DFH_REVISION, v);
dfh_ver = FIELD_GET(DFH_VERSION, v); /* read feature size and id if inputs are invalid */
size = size ? size : feature_size(v);
fid = fid ? fid : feature_id(v); if (dfh_ver == 1) {
dfh_psize = dfh_get_param_size(binfo->ioaddr + ofst, size); if (dfh_psize < 0) {
dev_err(binfo->dev, "failed to read size of DFHv1 parameters %d\n",
dfh_psize); return dfh_psize;
}
dev_dbg(binfo->dev, "dfhv1_psize %d\n", dfh_psize);
}
}
staticint parse_feature_afu(struct build_feature_devs_info *binfo,
resource_size_t ofst)
{ if (!is_feature_dev_detected(binfo)) {
dev_err(binfo->dev, "this AFU does not belong to any FIU.\n"); return -EINVAL;
}
switch (binfo->type) { case PORT_ID: return parse_feature_port_afu(binfo, ofst); default:
dev_info(binfo->dev, "AFU belonging to FIU is not supported yet.\n");
}
ret = create_feature_instance(binfo, 0, 0, 0); if (ret) return ret; /* * find and parse FIU's child AFU via its NEXT_AFU register. * please note that only Port has valid NEXT_AFU pointer per spec.
*/
v = readq(binfo->ioaddr + NEXT_AFU);
offset = FIELD_GET(NEXT_AFU_NEXT_DFH_OFST, v); if (offset) return parse_feature_afu(binfo, offset);
dev_dbg(binfo->dev, "No AFUs detected on FIU %d\n", id);
return ret;
}
staticint parse_feature_private(struct build_feature_devs_info *binfo,
resource_size_t ofst)
{ if (!is_feature_dev_detected(binfo)) {
dev_err(binfo->dev, "the private feature 0x%x does not belong to any AFU.\n",
feature_id(readq(binfo->ioaddr + ofst))); return -EINVAL;
}
/** * parse_feature - parse a feature on given device feature list * * @binfo: build feature devices information. * @ofst: offset to current FIU header
*/ staticint parse_feature(struct build_feature_devs_info *binfo,
resource_size_t ofst)
{
u64 v;
u32 type;
v = readq(binfo->ioaddr + ofst + DFH);
type = FIELD_GET(DFH_TYPE, v);
switch (type) { case DFH_TYPE_AFU: return parse_feature_afu(binfo, ofst); case DFH_TYPE_PRIVATE: return parse_feature_private(binfo, ofst); case DFH_TYPE_FIU: return parse_feature_fiu(binfo, ofst); default:
dev_info(binfo->dev, "Feature Type %x is not supported.\n", type);
}
return 0;
}
staticint parse_feature_list(struct build_feature_devs_info *binfo,
resource_size_t start, resource_size_t len)
{
resource_size_t end = start + len; int ret = 0;
u32 ofst = 0;
u64 v;
ret = build_info_prepare(binfo, start, len); if (ret) return ret;
/* walk through the device feature list via DFH's next DFH pointer. */ for (; start < end; start += ofst) { if (end - start < DFH_SIZE) {
dev_err(binfo->dev, "The region is too small to contain a feature.\n"); return -EINVAL;
}
ret = parse_feature(binfo, start - binfo->start); if (ret) return ret;
/** * dfl_fpga_enum_info_add_dfl - add info of a device feature list to enum info * * @info: ptr to dfl_fpga_enum_info * @start: mmio resource address of the device feature list. * @len: mmio resource length of the device feature list. * * One FPGA device may have one or more Device Feature Lists (DFLs), use this * function to add information of each DFL to common data structure for next * step enumeration. * * Return: 0 on success, negative error code otherwise.
*/ int dfl_fpga_enum_info_add_dfl(struct dfl_fpga_enum_info *info,
resource_size_t start, resource_size_t len)
{ struct dfl_fpga_enum_dfl *dfl;
dfl = devm_kzalloc(info->dev, sizeof(*dfl), GFP_KERNEL); if (!dfl) return -ENOMEM;
/** * dfl_fpga_enum_info_add_irq - add irq table to enum info * * @info: ptr to dfl_fpga_enum_info * @nr_irqs: number of irqs of the DFL fpga device to be enumerated. * @irq_table: Linux IRQ numbers for all irqs, indexed by local irq index of * this device. * * One FPGA device may have several interrupts. This function adds irq * information of the DFL fpga device to enum info for next step enumeration. * This function should be called before dfl_fpga_feature_devs_enumerate(). * As we only support one irq domain for all DFLs in the same enum info, adding * irq table a second time for the same enum info will return error. * * If we need to enumerate DFLs which belong to different irq domains, we * should fill more enum info and enumerate them one by one. * * Return: 0 on success, negative error code otherwise.
*/ int dfl_fpga_enum_info_add_irq(struct dfl_fpga_enum_info *info, unsignedint nr_irqs, int *irq_table)
{ if (!nr_irqs || !irq_table) return -EINVAL;
/** * dfl_fpga_feature_devs_enumerate - enumerate feature devices * @info: information for enumeration. * * This function creates a container device (base FPGA region), enumerates * feature devices based on the enumeration info and creates platform devices * under the container device. * * Return: dfl_fpga_cdev struct on success, -errno on failure
*/ struct dfl_fpga_cdev *
dfl_fpga_feature_devs_enumerate(struct dfl_fpga_enum_info *info)
{ struct build_feature_devs_info *binfo; struct dfl_fpga_enum_dfl *dfl; struct dfl_fpga_cdev *cdev; int ret = 0;
if (!info->dev) return ERR_PTR(-ENODEV);
cdev = devm_kzalloc(info->dev, sizeof(*cdev), GFP_KERNEL); if (!cdev) return ERR_PTR(-ENOMEM);
cdev->region = fpga_region_register(info->dev, NULL, NULL); if (IS_ERR(cdev->region)) {
ret = PTR_ERR(cdev->region); goto free_cdev_exit;
}
/* create and init build info for enumeration */
binfo = devm_kzalloc(info->dev, sizeof(*binfo), GFP_KERNEL); if (!binfo) {
ret = -ENOMEM; goto unregister_region_exit;
}
/** * __dfl_fpga_cdev_find_port_data - find a port under given container device * * @cdev: container device * @data: data passed to match function * @match: match function used to find specific port from the port device list * * Find a port device under container device. This function needs to be * invoked with lock held. * * Return: pointer to port's platform device if successful, NULL otherwise. * * NOTE: you will need to drop the device reference with put_device() after use.
*/ struct dfl_feature_dev_data *
__dfl_fpga_cdev_find_port_data(struct dfl_fpga_cdev *cdev, void *data, int (*match)(struct dfl_feature_dev_data *, void *))
{ struct dfl_feature_dev_data *fdata;
list_for_each_entry(fdata, &cdev->port_dev_list, node) { if (match(fdata, data)) return fdata;
}
ret = bus_register(&dfl_bus_type); if (ret) return ret;
dfl_ids_init();
ret = dfl_chardev_init(); if (ret) {
dfl_ids_destroy();
bus_unregister(&dfl_bus_type);
}
return ret;
}
/** * dfl_fpga_cdev_release_port - release a port platform device * * @cdev: parent container device. * @port_id: id of the port platform device. * * This function allows user to release a port platform device. This is a * mandatory step before turn a port from PF into VF for SRIOV support. * * Return: 0 on success, negative error code otherwise.
*/ int dfl_fpga_cdev_release_port(struct dfl_fpga_cdev *cdev, int port_id)
{ struct dfl_feature_dev_data *fdata; int ret = -ENODEV;
mutex_lock(&cdev->lock);
fdata = __dfl_fpga_cdev_find_port_data(cdev, &port_id,
dfl_fpga_check_port_id); if (!fdata) goto unlock_exit;
if (!fdata->dev) {
ret = -EBUSY; goto unlock_exit;
}
mutex_lock(&fdata->lock);
ret = dfl_feature_dev_use_begin(fdata, true);
mutex_unlock(&fdata->lock); if (ret) goto unlock_exit;
/** * dfl_fpga_cdev_assign_port - assign a port platform device back * * @cdev: parent container device. * @port_id: id of the port platform device. * * This function allows user to assign a port platform device back. This is * a mandatory step after disable SRIOV support. * * Return: 0 on success, negative error code otherwise.
*/ int dfl_fpga_cdev_assign_port(struct dfl_fpga_cdev *cdev, int port_id)
{ struct dfl_feature_dev_data *fdata; int ret = -ENODEV;
mutex_lock(&cdev->lock);
fdata = __dfl_fpga_cdev_find_port_data(cdev, &port_id,
dfl_fpga_check_port_id); if (!fdata) goto unlock_exit;
if (fdata->dev) {
ret = -EBUSY; goto unlock_exit;
}
ret = feature_dev_register(fdata); if (ret) goto unlock_exit;
/** * dfl_fpga_cdev_config_ports_pf - configure ports to PF access mode * * @cdev: parent container device. * * This function is needed in sriov configuration routine. It could be used to * configure the all released ports from VF access mode to PF.
*/ void dfl_fpga_cdev_config_ports_pf(struct dfl_fpga_cdev *cdev)
{ struct dfl_feature_dev_data *fdata;
mutex_lock(&cdev->lock);
list_for_each_entry(fdata, &cdev->port_dev_list, node) { if (fdata->dev) continue;
/** * dfl_fpga_cdev_config_ports_vf - configure ports to VF access mode * * @cdev: parent container device. * @num_vfs: VF device number. * * This function is needed in sriov configuration routine. It could be used to * configure the released ports from PF access mode to VF. * * Return: 0 on success, negative error code otherwise.
*/ int dfl_fpga_cdev_config_ports_vf(struct dfl_fpga_cdev *cdev, int num_vfs)
{ struct dfl_feature_dev_data *fdata; int ret = 0;
mutex_lock(&cdev->lock); /* * can't turn multiple ports into 1 VF device, only 1 port for 1 VF * device, so if released port number doesn't match VF device number, * then reject the request with -EINVAL error code.
*/ if (cdev->released_port_num != num_vfs) {
ret = -EINVAL; goto done;
}
list_for_each_entry(fdata, &cdev->port_dev_list, node) { if (fdata->dev) continue;
/** * dfl_fpga_set_irq_triggers - set eventfd triggers for dfl feature interrupts * * @feature: dfl sub feature. * @start: start of irq index in this dfl sub feature. * @count: number of irqs. * @fds: eventfds to bind with irqs. unbind related irq if fds[n] is negative. * unbind "count" specified number of irqs if fds ptr is NULL. * * Bind given eventfds with irqs in this dfl sub feature. Unbind related irq if * fds[n] is negative. Unbind "count" specified number of irqs if fds ptr is * NULL. * * Return: 0 on success, negative error code otherwise.
*/ int dfl_fpga_set_irq_triggers(struct dfl_feature *feature, unsignedint start, unsignedint count, int32_t *fds)
{ unsignedint i; int ret = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.