~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/dfl.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Header file for DFL driver and device API
  4  *
  5  * Copyright (C) 2020 Intel Corporation, Inc.
  6  */
  7 
  8 #ifndef __LINUX_DFL_H
  9 #define __LINUX_DFL_H
 10 
 11 #include <linux/device.h>
 12 #include <linux/mod_devicetable.h>
 13 
 14 /**
 15  * enum dfl_id_type - define the DFL FIU types
 16  */
 17 enum dfl_id_type {
 18         FME_ID = 0,
 19         PORT_ID = 1,
 20         DFL_ID_MAX,
 21 };
 22 
 23 /**
 24  * struct dfl_device - represent an dfl device on dfl bus
 25  *
 26  * @dev: generic device interface.
 27  * @id: id of the dfl device.
 28  * @type: type of DFL FIU of the device. See enum dfl_id_type.
 29  * @feature_id: feature identifier local to its DFL FIU type.
 30  * @revision: revision of this dfl device feature.
 31  * @mmio_res: mmio resource of this dfl device.
 32  * @irqs: list of Linux IRQ numbers of this dfl device.
 33  * @num_irqs: number of IRQs supported by this dfl device.
 34  * @cdev: pointer to DFL FPGA container device this dfl device belongs to.
 35  * @id_entry: matched id entry in dfl driver's id table.
 36  * @dfh_version: version of DFH for the device
 37  * @param_size: size of the block parameters in bytes
 38  * @params: pointer to block of parameters copied memory
 39  */
 40 struct dfl_device {
 41         struct device dev;
 42         int id;
 43         u16 type;
 44         u16 feature_id;
 45         u8 revision;
 46         struct resource mmio_res;
 47         int *irqs;
 48         unsigned int num_irqs;
 49         struct dfl_fpga_cdev *cdev;
 50         const struct dfl_device_id *id_entry;
 51         u8 dfh_version;
 52         unsigned int param_size;
 53         void *params;
 54 };
 55 
 56 /**
 57  * struct dfl_driver - represent an dfl device driver
 58  *
 59  * @drv: driver model structure.
 60  * @id_table: pointer to table of device IDs the driver is interested in.
 61  *            { } member terminated.
 62  * @probe: mandatory callback for device binding.
 63  * @remove: callback for device unbinding.
 64  */
 65 struct dfl_driver {
 66         struct device_driver drv;
 67         const struct dfl_device_id *id_table;
 68 
 69         int (*probe)(struct dfl_device *dfl_dev);
 70         void (*remove)(struct dfl_device *dfl_dev);
 71 };
 72 
 73 #define to_dfl_dev(d) container_of(d, struct dfl_device, dev)
 74 #define to_dfl_drv(d) container_of_const(d, struct dfl_driver, drv)
 75 
 76 /*
 77  * use a macro to avoid include chaining to get THIS_MODULE.
 78  */
 79 #define dfl_driver_register(drv) \
 80         __dfl_driver_register(drv, THIS_MODULE)
 81 int __dfl_driver_register(struct dfl_driver *dfl_drv, struct module *owner);
 82 void dfl_driver_unregister(struct dfl_driver *dfl_drv);
 83 
 84 /*
 85  * module_dfl_driver() - Helper macro for drivers that don't do
 86  * anything special in module init/exit.  This eliminates a lot of
 87  * boilerplate.  Each module may only use this macro once, and
 88  * calling it replaces module_init() and module_exit().
 89  */
 90 #define module_dfl_driver(__dfl_driver) \
 91         module_driver(__dfl_driver, dfl_driver_register, \
 92                       dfl_driver_unregister)
 93 
 94 void *dfh_find_param(struct dfl_device *dfl_dev, int param_id, size_t *pcount);
 95 #endif /* __LINUX_DFL_H */
 96 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php