Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v5.1 110 lines 3.4 kB view raw
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _LINUX_MEI_CL_BUS_H 3#define _LINUX_MEI_CL_BUS_H 4 5#include <linux/device.h> 6#include <linux/uuid.h> 7#include <linux/mod_devicetable.h> 8 9struct mei_cl_device; 10struct mei_device; 11 12typedef void (*mei_cldev_cb_t)(struct mei_cl_device *cldev); 13 14/** 15 * struct mei_cl_device - MEI device handle 16 * An mei_cl_device pointer is returned from mei_add_device() 17 * and links MEI bus clients to their actual ME host client pointer. 18 * Drivers for MEI devices will get an mei_cl_device pointer 19 * when being probed and shall use it for doing ME bus I/O. 20 * 21 * @bus_list: device on the bus list 22 * @bus: parent mei device 23 * @dev: linux driver model device pointer 24 * @me_cl: me client 25 * @cl: mei client 26 * @name: device name 27 * @rx_work: async work to execute Rx event callback 28 * @rx_cb: Drivers register this callback to get asynchronous ME 29 * Rx buffer pending notifications. 30 * @notif_work: async work to execute FW notif event callback 31 * @notif_cb: Drivers register this callback to get asynchronous ME 32 * FW notification pending notifications. 33 * 34 * @do_match: wheather device can be matched with a driver 35 * @is_added: device is already scanned 36 * @priv_data: client private data 37 */ 38struct mei_cl_device { 39 struct list_head bus_list; 40 struct mei_device *bus; 41 struct device dev; 42 43 struct mei_me_client *me_cl; 44 struct mei_cl *cl; 45 char name[MEI_CL_NAME_SIZE]; 46 47 struct work_struct rx_work; 48 mei_cldev_cb_t rx_cb; 49 struct work_struct notif_work; 50 mei_cldev_cb_t notif_cb; 51 52 unsigned int do_match:1; 53 unsigned int is_added:1; 54 55 void *priv_data; 56}; 57 58#define to_mei_cl_device(d) container_of(d, struct mei_cl_device, dev) 59 60struct mei_cl_driver { 61 struct device_driver driver; 62 const char *name; 63 64 const struct mei_cl_device_id *id_table; 65 66 int (*probe)(struct mei_cl_device *cldev, 67 const struct mei_cl_device_id *id); 68 int (*remove)(struct mei_cl_device *cldev); 69}; 70 71int __mei_cldev_driver_register(struct mei_cl_driver *cldrv, 72 struct module *owner); 73#define mei_cldev_driver_register(cldrv) \ 74 __mei_cldev_driver_register(cldrv, THIS_MODULE) 75 76void mei_cldev_driver_unregister(struct mei_cl_driver *cldrv); 77 78/** 79 * module_mei_cl_driver - Helper macro for registering mei cl driver 80 * 81 * @__mei_cldrv: mei_cl_driver structure 82 * 83 * Helper macro for mei cl drivers which do not do anything special in module 84 * init/exit, for eliminating a boilerplate code. 85 */ 86#define module_mei_cl_driver(__mei_cldrv) \ 87 module_driver(__mei_cldrv, \ 88 mei_cldev_driver_register,\ 89 mei_cldev_driver_unregister) 90 91ssize_t mei_cldev_send(struct mei_cl_device *cldev, u8 *buf, size_t length); 92ssize_t mei_cldev_recv(struct mei_cl_device *cldev, u8 *buf, size_t length); 93ssize_t mei_cldev_recv_nonblock(struct mei_cl_device *cldev, u8 *buf, 94 size_t length); 95 96int mei_cldev_register_rx_cb(struct mei_cl_device *cldev, mei_cldev_cb_t rx_cb); 97int mei_cldev_register_notif_cb(struct mei_cl_device *cldev, 98 mei_cldev_cb_t notif_cb); 99 100const uuid_le *mei_cldev_uuid(const struct mei_cl_device *cldev); 101u8 mei_cldev_ver(const struct mei_cl_device *cldev); 102 103void *mei_cldev_get_drvdata(const struct mei_cl_device *cldev); 104void mei_cldev_set_drvdata(struct mei_cl_device *cldev, void *data); 105 106int mei_cldev_enable(struct mei_cl_device *cldev); 107int mei_cldev_disable(struct mei_cl_device *cldev); 108bool mei_cldev_enabled(struct mei_cl_device *cldev); 109 110#endif /* _LINUX_MEI_CL_BUS_H */