diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2014-02-12 20:41:52 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-14 20:12:46 +0100 |
commit | 6bb948c9e500d24321c36c67c81daf8d1a7e561e (patch) | |
tree | bd45c66165b1e42c0eed0cc64b15aa75345d9a34 /drivers/misc/mei/interrupt.c | |
parent | mei: rename MEI_FOP_IOCTL to MEI_FOP_CONNECT (diff) | |
download | linux-6bb948c9e500d24321c36c67c81daf8d1a7e561e.tar.xz linux-6bb948c9e500d24321c36c67c81daf8d1a7e561e.zip |
mei: get rid of ext_msg
Use more standard message writing for
oob data.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/interrupt.c')
-rw-r--r-- | drivers/misc/mei/interrupt.c | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 3f0b0b9ce951..75ff4092953e 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c @@ -161,6 +161,41 @@ static int mei_cl_irq_read_msg(struct mei_device *dev, } /** + * mei_cl_irq_disconnect_rsp - send disconnection response message + * + * @cl: client + * @cb: callback block. + * @slots: free slots. + * @cmpl_list: complete list. + * + * returns 0, OK; otherwise, error. + */ +static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb, + s32 *slots, struct mei_cl_cb *cmpl_list) +{ + struct mei_device *dev = cl->dev; + int ret; + + u32 msg_slots = + mei_data2slots(sizeof(struct hbm_client_connect_response)); + + if (*slots < msg_slots) + return -EMSGSIZE; + + *slots -= msg_slots; + + ret = mei_hbm_cl_disconnect_rsp(dev, cl); + + cl->state = MEI_FILE_DISCONNECTED; + cl->status = 0; + mei_io_cb_free(cb); + + return ret; +} + + + +/** * mei_cl_irq_close - processes close related operation from * interrupt thread context - send disconnect request * @@ -452,12 +487,6 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list) wake_up_interruptible(&dev->wait_stop_wd); } - if (dev->wr_ext_msg.hdr.length) { - mei_write_message(dev, &dev->wr_ext_msg.hdr, - dev->wr_ext_msg.data); - slots -= mei_data2slots(dev->wr_ext_msg.hdr.length); - dev->wr_ext_msg.hdr.length = 0; - } if (dev->dev_state == MEI_DEV_ENABLED) { if (dev->wd_pending && mei_cl_flow_ctrl_creds(&dev->wd_cl) > 0) { @@ -505,7 +534,11 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list) return ret; break; - + case MEI_FOP_DISCONNECT_RSP: + /* send disconnect resp */ + ret = mei_cl_irq_disconnect_rsp(cl, cb, &slots, cmpl_list); + if (ret) + return ret; default: BUG(); } |