diff options
author | Alexander Usyskin <alexander.usyskin@intel.com> | 2016-11-08 19:26:08 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-11-10 15:18:02 +0300 |
commit | e0cb6b2f878d210441e8ed232e98454ccc7fd812 (patch) | |
tree | a91647d2619efa0ac48d57a44585073bbb078542 /drivers/misc/mei/bus.c | |
parent | fe948dcb2c1223c0da4bc304d87d0253fa06094e (diff) | |
download | linux-e0cb6b2f878d210441e8ed232e98454ccc7fd812.tar.xz |
mei: enable to set the internal flag for client write
Prepare the client write functions to set the internal flag in message
header. Carry both blocking and internal modes inside the transmit cb,
and call internal bus function __mei_cl_send() with send mode bit mask.
The Internal flag should be added only on messages generated by the
driver.
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/bus.c')
-rw-r--r-- | drivers/misc/mei/bus.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 8a1e813a548d..7c075e9b25e5 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -36,12 +36,12 @@ * @cl: host client * @buf: buffer to send * @length: buffer length - * @blocking: wait for write completion + * @mode: sending mode * * Return: written size bytes or < 0 on error */ ssize_t __mei_cl_send(struct mei_cl *cl, u8 *buf, size_t length, - bool blocking) + unsigned int mode) { struct mei_device *bus; struct mei_cl_cb *cb; @@ -80,9 +80,11 @@ ssize_t __mei_cl_send(struct mei_cl *cl, u8 *buf, size_t length, goto out; } + cb->internal = !!(mode & MEI_CL_IO_TX_INTERNAL); + cb->blocking = !!(mode & MEI_CL_IO_TX_BLOCKING); memcpy(cb->buf.data, buf, length); - rets = mei_cl_write(cl, cb, blocking); + rets = mei_cl_write(cl, cb); out: mutex_unlock(&bus->device_lock); @@ -188,7 +190,7 @@ ssize_t mei_cldev_send(struct mei_cl_device *cldev, u8 *buf, size_t length) if (cl == NULL) return -ENODEV; - return __mei_cl_send(cl, buf, length, 1); + return __mei_cl_send(cl, buf, length, MEI_CL_IO_TX_BLOCKING); } EXPORT_SYMBOL_GPL(mei_cldev_send); |