mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-28 00:19:36 +00:00

The following functions have been in the mei code for a long time but have never been used. mei_txe_setup_satt2() was added in 2014 by commit32e2b59fca
("mei: txe: add hw-txe.c") mei_me_cl_rm_by_uuid_id() was added in 2015 by commit79563db9dd
("mei: add reference counting for me clients") mei_cldev_uuid() was added in 2015 by commitbaeacd0376
("mei: bus: export uuid and protocol version to mei_cl bus drivers") mei_cldev_recv_nonblock() was added in 2016 by commit076802d006
("mei: bus: enable non-blocking RX") it is the only user of mei_cldev_recv_nonblock_vtag(). Remove them. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Alexander Usyskin <alexander.usyskin@intel.com> Link: https://lore.kernel.org/r/20250130012654.255119-1-linux@treblig.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
133 lines
4.3 KiB
C
133 lines
4.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (c) 2013-2016, Intel Corporation. All rights reserved.
|
|
*/
|
|
#ifndef _LINUX_MEI_CL_BUS_H
|
|
#define _LINUX_MEI_CL_BUS_H
|
|
|
|
#include <linux/device.h>
|
|
#include <linux/uuid.h>
|
|
#include <linux/mod_devicetable.h>
|
|
|
|
struct mei_cl_device;
|
|
struct mei_device;
|
|
struct scatterlist;
|
|
|
|
typedef void (*mei_cldev_cb_t)(struct mei_cl_device *cldev);
|
|
|
|
/**
|
|
* struct mei_cl_device - MEI device handle
|
|
* An mei_cl_device pointer is returned from mei_add_device()
|
|
* and links MEI bus clients to their actual ME host client pointer.
|
|
* Drivers for MEI devices will get an mei_cl_device pointer
|
|
* when being probed and shall use it for doing ME bus I/O.
|
|
*
|
|
* @bus_list: device on the bus list
|
|
* @bus: parent mei device
|
|
* @dev: linux driver model device pointer
|
|
* @me_cl: me client
|
|
* @cl: mei client
|
|
* @name: device name
|
|
* @rx_work: async work to execute Rx event callback
|
|
* @rx_cb: Drivers register this callback to get asynchronous ME
|
|
* Rx buffer pending notifications.
|
|
* @notif_work: async work to execute FW notify event callback
|
|
* @notif_cb: Drivers register this callback to get asynchronous ME
|
|
* FW notification pending notifications.
|
|
*
|
|
* @do_match: whether the device can be matched with a driver
|
|
* @is_added: device is already scanned
|
|
* @priv_data: client private data
|
|
*/
|
|
struct mei_cl_device {
|
|
struct list_head bus_list;
|
|
struct mei_device *bus;
|
|
struct device dev;
|
|
|
|
struct mei_me_client *me_cl;
|
|
struct mei_cl *cl;
|
|
char name[MEI_CL_NAME_SIZE];
|
|
|
|
struct work_struct rx_work;
|
|
mei_cldev_cb_t rx_cb;
|
|
struct work_struct notif_work;
|
|
mei_cldev_cb_t notif_cb;
|
|
|
|
unsigned int do_match:1;
|
|
unsigned int is_added:1;
|
|
|
|
void *priv_data;
|
|
};
|
|
|
|
#define to_mei_cl_device(d) container_of(d, struct mei_cl_device, dev)
|
|
|
|
struct mei_cl_driver {
|
|
struct device_driver driver;
|
|
const char *name;
|
|
|
|
const struct mei_cl_device_id *id_table;
|
|
|
|
int (*probe)(struct mei_cl_device *cldev,
|
|
const struct mei_cl_device_id *id);
|
|
void (*remove)(struct mei_cl_device *cldev);
|
|
};
|
|
|
|
int __mei_cldev_driver_register(struct mei_cl_driver *cldrv,
|
|
struct module *owner);
|
|
#define mei_cldev_driver_register(cldrv) \
|
|
__mei_cldev_driver_register(cldrv, THIS_MODULE)
|
|
|
|
void mei_cldev_driver_unregister(struct mei_cl_driver *cldrv);
|
|
|
|
/**
|
|
* module_mei_cl_driver - Helper macro for registering mei cl driver
|
|
*
|
|
* @__mei_cldrv: mei_cl_driver structure
|
|
*
|
|
* Helper macro for mei cl drivers which do not do anything special in module
|
|
* init/exit, for eliminating a boilerplate code.
|
|
*/
|
|
#define module_mei_cl_driver(__mei_cldrv) \
|
|
module_driver(__mei_cldrv, \
|
|
mei_cldev_driver_register,\
|
|
mei_cldev_driver_unregister)
|
|
|
|
ssize_t mei_cldev_send(struct mei_cl_device *cldev, const u8 *buf,
|
|
size_t length);
|
|
ssize_t mei_cldev_send_timeout(struct mei_cl_device *cldev, const u8 *buf,
|
|
size_t length, unsigned long timeout);
|
|
ssize_t mei_cldev_recv(struct mei_cl_device *cldev, u8 *buf, size_t length);
|
|
ssize_t mei_cldev_recv_timeout(struct mei_cl_device *cldev, u8 *buf, size_t length,
|
|
unsigned long timeout);
|
|
ssize_t mei_cldev_send_vtag(struct mei_cl_device *cldev, const u8 *buf,
|
|
size_t length, u8 vtag);
|
|
ssize_t mei_cldev_send_vtag_timeout(struct mei_cl_device *cldev, const u8 *buf,
|
|
size_t length, u8 vtag, unsigned long timeout);
|
|
ssize_t mei_cldev_recv_vtag(struct mei_cl_device *cldev, u8 *buf, size_t length,
|
|
u8 *vtag);
|
|
ssize_t mei_cldev_recv_vtag_timeout(struct mei_cl_device *cldev, u8 *buf, size_t length,
|
|
u8 *vtag, unsigned long timeout);
|
|
|
|
int mei_cldev_register_rx_cb(struct mei_cl_device *cldev, mei_cldev_cb_t rx_cb);
|
|
int mei_cldev_register_notif_cb(struct mei_cl_device *cldev,
|
|
mei_cldev_cb_t notif_cb);
|
|
|
|
u8 mei_cldev_ver(const struct mei_cl_device *cldev);
|
|
|
|
void *mei_cldev_get_drvdata(const struct mei_cl_device *cldev);
|
|
void mei_cldev_set_drvdata(struct mei_cl_device *cldev, void *data);
|
|
|
|
int mei_cldev_enable(struct mei_cl_device *cldev);
|
|
int mei_cldev_disable(struct mei_cl_device *cldev);
|
|
bool mei_cldev_enabled(const struct mei_cl_device *cldev);
|
|
ssize_t mei_cldev_send_gsc_command(struct mei_cl_device *cldev,
|
|
u8 client_id, u32 fence_id,
|
|
struct scatterlist *sg_in,
|
|
size_t total_in_len,
|
|
struct scatterlist *sg_out);
|
|
|
|
void *mei_cldev_dma_map(struct mei_cl_device *cldev, u8 buffer_id, size_t size);
|
|
int mei_cldev_dma_unmap(struct mei_cl_device *cldev);
|
|
|
|
#endif /* _LINUX_MEI_CL_BUS_H */
|