diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2013-03-17 05:41:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-25 16:20:49 -0400 |
commit | 4c6e22b8a93ef038b70661e590de250a09417af7 (patch) | |
tree | 44afa2fb57478254e67123fdee466289aeac480c /drivers/misc/mei/interrupt.c | |
parent | f57f27bc6ed7106276004dd224aaeeb160a5b4b8 (diff) |
mei: add mei_irq_compl_handler function
similar to read/write add also irq completion handler
that is called for the irq thread
rename missnamed mei_irq_complete_handler to
mei_cl_complete_handler as it operates on a single client
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 | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 14c70b8815d8..73fbce3e7746 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c | |||
@@ -30,21 +30,21 @@ | |||
30 | 30 | ||
31 | 31 | ||
32 | /** | 32 | /** |
33 | * mei_complete_handler - processes completed operation. | 33 | * mei_cl_complete_handler - processes completed operation for a client |
34 | * | 34 | * |
35 | * @cl: private data of the file object. | 35 | * @cl: private data of the file object. |
36 | * @cb_pos: callback block. | 36 | * @cb: callback block. |
37 | */ | 37 | */ |
38 | void mei_irq_complete_handler(struct mei_cl *cl, struct mei_cl_cb *cb_pos) | 38 | static void mei_cl_complete_handler(struct mei_cl *cl, struct mei_cl_cb *cb) |
39 | { | 39 | { |
40 | if (cb_pos->fop_type == MEI_FOP_WRITE) { | 40 | if (cb->fop_type == MEI_FOP_WRITE) { |
41 | mei_io_cb_free(cb_pos); | 41 | mei_io_cb_free(cb); |
42 | cb_pos = NULL; | 42 | cb = NULL; |
43 | cl->writing_state = MEI_WRITE_COMPLETE; | 43 | cl->writing_state = MEI_WRITE_COMPLETE; |
44 | if (waitqueue_active(&cl->tx_wait)) | 44 | if (waitqueue_active(&cl->tx_wait)) |
45 | wake_up_interruptible(&cl->tx_wait); | 45 | wake_up_interruptible(&cl->tx_wait); |
46 | 46 | ||
47 | } else if (cb_pos->fop_type == MEI_FOP_READ && | 47 | } else if (cb->fop_type == MEI_FOP_READ && |
48 | MEI_READING == cl->reading_state) { | 48 | MEI_READING == cl->reading_state) { |
49 | cl->reading_state = MEI_READ_COMPLETE; | 49 | cl->reading_state = MEI_READ_COMPLETE; |
50 | if (waitqueue_active(&cl->rx_wait)) | 50 | if (waitqueue_active(&cl->rx_wait)) |
@@ -54,6 +54,31 @@ void mei_irq_complete_handler(struct mei_cl *cl, struct mei_cl_cb *cb_pos) | |||
54 | } | 54 | } |
55 | 55 | ||
56 | /** | 56 | /** |
57 | * mei_irq_compl_handler - dispatch complete handelers | ||
58 | * for the completed callbacks | ||
59 | * | ||
60 | * @dev - mei device | ||
61 | * @compl_list - list of completed cbs | ||
62 | */ | ||
63 | void mei_irq_compl_handler(struct mei_device *dev, struct mei_cl_cb *compl_list) | ||
64 | { | ||
65 | struct mei_cl_cb *cb, *next; | ||
66 | struct mei_cl *cl; | ||
67 | |||
68 | list_for_each_entry_safe(cb, next, &compl_list->list, list) { | ||
69 | cl = cb->cl; | ||
70 | list_del(&cb->list); | ||
71 | if (!cl) | ||
72 | continue; | ||
73 | |||
74 | dev_dbg(&dev->pdev->dev, "completing call back.\n"); | ||
75 | if (cl == &dev->iamthif_cl) | ||
76 | mei_amthif_complete(dev, cb); | ||
77 | else | ||
78 | mei_cl_complete_handler(cl, cb); | ||
79 | } | ||
80 | } | ||
81 | /** | ||
57 | * _mei_irq_thread_state_ok - checks if mei header matches file private data | 82 | * _mei_irq_thread_state_ok - checks if mei header matches file private data |
58 | * | 83 | * |
59 | * @cl: private data of the file object | 84 | * @cl: private data of the file object |