summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2012-11-11 10:38:00 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-15 18:34:18 -0500
commit4b8960b492360c115f8214ec116f469338ac2734 (patch)
treebefc4b6ce34c645695ae30e80511702464568606 /drivers/misc
parentdb3ed43185c6f5d4fd6c5ac963347b849540996e (diff)
mei: rename enum mei_cb_major_types to enum mei_cb_file_ops
1. Rename mei_cb_major_types to more understandable mei_cb_file_ops 2. Rename member struct mei_cl_cb of this type to simple 'fop_type' 3. Add kernel doc for the type Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/mei/amthif.c2
-rw-r--r--drivers/misc/mei/init.c2
-rw-r--r--drivers/misc/mei/interrupt.c18
-rw-r--r--drivers/misc/mei/iorw.c4
-rw-r--r--drivers/misc/mei/main.c2
-rw-r--r--drivers/misc/mei/mei_dev.h26
6 files changed, 31 insertions, 23 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index 74d593fd6cbd..34d37a9c31a1 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -347,7 +347,7 @@ int mei_amthif_write(struct mei_device *dev, struct mei_cl_cb *cb)
347 if (ret) 347 if (ret)
348 return ret; 348 return ret;
349 349
350 cb->major_file_operations = MEI_IOCTL; 350 cb->fop_type = MEI_FOP_IOCTL;
351 351
352 if (!list_empty(&dev->amthif_cmd_list.list) || 352 if (!list_empty(&dev->amthif_cmd_list.list) ||
353 dev->iamthif_state != MEI_IAMTHIF_IDLE) { 353 dev->iamthif_state != MEI_IAMTHIF_IDLE) {
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c
index 0046ca505489..85b6520f39f1 100644
--- a/drivers/misc/mei/init.c
+++ b/drivers/misc/mei/init.c
@@ -597,7 +597,7 @@ int mei_disconnect_host_client(struct mei_device *dev, struct mei_cl *cl)
597 if (!cb) 597 if (!cb)
598 return -ENOMEM; 598 return -ENOMEM;
599 599
600 cb->major_file_operations = MEI_CLOSE; 600 cb->fop_type = MEI_FOP_CLOSE;
601 if (dev->mei_host_buffer_is_empty) { 601 if (dev->mei_host_buffer_is_empty) {
602 dev->mei_host_buffer_is_empty = false; 602 dev->mei_host_buffer_is_empty = false;
603 if (mei_disconnect(dev, cl)) { 603 if (mei_disconnect(dev, cl)) {
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index acc994e3f20b..34e20cc54607 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -57,14 +57,14 @@ irqreturn_t mei_interrupt_quick_handler(int irq, void *dev_id)
57 */ 57 */
58static void _mei_cmpl(struct mei_cl *cl, struct mei_cl_cb *cb_pos) 58static void _mei_cmpl(struct mei_cl *cl, struct mei_cl_cb *cb_pos)
59{ 59{
60 if (cb_pos->major_file_operations == MEI_WRITE) { 60 if (cb_pos->fop_type == MEI_FOP_WRITE) {
61 mei_io_cb_free(cb_pos); 61 mei_io_cb_free(cb_pos);
62 cb_pos = NULL; 62 cb_pos = NULL;
63 cl->writing_state = MEI_WRITE_COMPLETE; 63 cl->writing_state = MEI_WRITE_COMPLETE;
64 if (waitqueue_active(&cl->tx_wait)) 64 if (waitqueue_active(&cl->tx_wait))
65 wake_up_interruptible(&cl->tx_wait); 65 wake_up_interruptible(&cl->tx_wait);
66 66
67 } else if (cb_pos->major_file_operations == MEI_READ && 67 } else if (cb_pos->fop_type == MEI_FOP_READ &&
68 MEI_READING == cl->reading_state) { 68 MEI_READING == cl->reading_state) {
69 cl->reading_state = MEI_READ_COMPLETE; 69 cl->reading_state = MEI_READ_COMPLETE;
70 if (waitqueue_active(&cl->rx_wait)) 70 if (waitqueue_active(&cl->rx_wait))
@@ -268,7 +268,7 @@ static void mei_client_connect_response(struct mei_device *dev,
268 list_del(&pos->list); 268 list_del(&pos->list);
269 return; 269 return;
270 } 270 }
271 if (MEI_IOCTL == pos->major_file_operations) { 271 if (pos->fop_type == MEI_FOP_IOCTL) {
272 if (is_treat_specially_client(cl, rs)) { 272 if (is_treat_specially_client(cl, rs)) {
273 list_del(&pos->list); 273 list_del(&pos->list);
274 cl->status = 0; 274 cl->status = 0;
@@ -988,8 +988,8 @@ static int mei_irq_thread_write_handler(struct mei_cl_cb *cmpl_list,
988 cl->status = 0; 988 cl->status = 0;
989 list_del(&pos->list); 989 list_del(&pos->list);
990 if (MEI_WRITING == cl->writing_state && 990 if (MEI_WRITING == cl->writing_state &&
991 (pos->major_file_operations == MEI_WRITE) && 991 pos->fop_type == MEI_FOP_WRITE &&
992 (cl != &dev->iamthif_cl)) { 992 cl != &dev->iamthif_cl) {
993 dev_dbg(&dev->pdev->dev, "MEI WRITE COMPLETE\n"); 993 dev_dbg(&dev->pdev->dev, "MEI WRITE COMPLETE\n");
994 cl->writing_state = MEI_WRITE_COMPLETE; 994 cl->writing_state = MEI_WRITE_COMPLETE;
995 list_add_tail(&pos->list, &cmpl_list->list); 995 list_add_tail(&pos->list, &cmpl_list->list);
@@ -1044,22 +1044,22 @@ static int mei_irq_thread_write_handler(struct mei_cl_cb *cmpl_list,
1044 list_del(&pos->list); 1044 list_del(&pos->list);
1045 return -ENODEV; 1045 return -ENODEV;
1046 } 1046 }
1047 switch (pos->major_file_operations) { 1047 switch (pos->fop_type) {
1048 case MEI_CLOSE: 1048 case MEI_FOP_CLOSE:
1049 /* send disconnect message */ 1049 /* send disconnect message */
1050 ret = _mei_irq_thread_close(dev, slots, pos, cl, cmpl_list); 1050 ret = _mei_irq_thread_close(dev, slots, pos, cl, cmpl_list);
1051 if (ret) 1051 if (ret)
1052 return ret; 1052 return ret;
1053 1053
1054 break; 1054 break;
1055 case MEI_READ: 1055 case MEI_FOP_READ:
1056 /* send flow control message */ 1056 /* send flow control message */
1057 ret = _mei_irq_thread_read(dev, slots, pos, cl, cmpl_list); 1057 ret = _mei_irq_thread_read(dev, slots, pos, cl, cmpl_list);
1058 if (ret) 1058 if (ret)
1059 return ret; 1059 return ret;
1060 1060
1061 break; 1061 break;
1062 case MEI_IOCTL: 1062 case MEI_FOP_IOCTL:
1063 /* connect message */ 1063 /* connect message */
1064 if (mei_other_client_is_connecting(dev, cl)) 1064 if (mei_other_client_is_connecting(dev, cl))
1065 continue; 1065 continue;
diff --git a/drivers/misc/mei/iorw.c b/drivers/misc/mei/iorw.c
index cc53ce766e88..cf1107658bc0 100644
--- a/drivers/misc/mei/iorw.c
+++ b/drivers/misc/mei/iorw.c
@@ -193,7 +193,7 @@ int mei_ioctl_connect_client(struct file *file,
193 goto end; 193 goto end;
194 } 194 }
195 195
196 cb->major_file_operations = MEI_IOCTL; 196 cb->fop_type = MEI_FOP_IOCTL;
197 197
198 if (dev->dev_state != MEI_DEV_ENABLED) { 198 if (dev->dev_state != MEI_DEV_ENABLED) {
199 rets = -ENODEV; 199 rets = -ENODEV;
@@ -360,7 +360,7 @@ int mei_start_read(struct mei_device *dev, struct mei_cl *cl)
360 if (rets) 360 if (rets)
361 goto err; 361 goto err;
362 362
363 cb->major_file_operations = MEI_READ; 363 cb->fop_type = MEI_FOP_READ;
364 cl->read_cb = cb; 364 cl->read_cb = cb;
365 if (dev->mei_host_buffer_is_empty) { 365 if (dev->mei_host_buffer_is_empty) {
366 dev->mei_host_buffer_is_empty = false; 366 dev->mei_host_buffer_is_empty = false;
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index e0e39c498d12..57bf96cf7ff9 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -626,7 +626,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
626 return length; 626 return length;
627 } 627 }
628 628
629 write_cb->major_file_operations = MEI_WRITE; 629 write_cb->fop_type = MEI_FOP_WRITE;
630 630
631 dev_dbg(&dev->pdev->dev, "host client = %d, ME client = %d\n", 631 dev_dbg(&dev->pdev->dev, "host client = %d, ME client = %d\n",
632 cl->host_client_id, cl->me_client_id); 632 cl->host_client_id, cl->me_client_id);
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index da0c1f5eed9c..59e94c24690b 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -125,13 +125,20 @@ enum mei_wd_states {
125 MEI_WD_STOPPING, 125 MEI_WD_STOPPING,
126}; 126};
127 127
128/* MEI CB */ 128/**
129enum mei_cb_major_types { 129 * enum mei_cb_file_ops - file operation associated with the callback
130 MEI_READ = 0, 130 * @MEI_FOP_READ - read
131 MEI_WRITE, 131 * @MEI_FOP_WRITE - write
132 MEI_IOCTL, 132 * @MEI_FOP_IOCTL - ioctl
133 MEI_OPEN, 133 * @MEI_FOP_OPEN - open
134 MEI_CLOSE 134 * @MEI_FOP_CLOSE - close
135 */
136enum mei_cb_file_ops {
137 MEI_FOP_READ = 0,
138 MEI_FOP_WRITE,
139 MEI_FOP_IOCTL,
140 MEI_FOP_OPEN,
141 MEI_FOP_CLOSE
135}; 142};
136 143
137/* 144/*
@@ -145,15 +152,16 @@ struct mei_message_data {
145 152
146struct mei_cl; 153struct mei_cl;
147 154
148/* 155/**
149 * struct mei_cl_cb - file operation callback structure 156 * struct mei_cl_cb - file operation callback structure
150 * 157 *
151 * @cl - file client who is running this operation 158 * @cl - file client who is running this operation
159 * @fop_type - file operation type
152 */ 160 */
153struct mei_cl_cb { 161struct mei_cl_cb {
154 struct list_head list; 162 struct list_head list;
155 struct mei_cl *cl; 163 struct mei_cl *cl;
156 enum mei_cb_major_types major_file_operations; 164 enum mei_cb_file_ops fop_type;
157 struct mei_message_data request_buffer; 165 struct mei_message_data request_buffer;
158 struct mei_message_data response_buffer; 166 struct mei_message_data response_buffer;
159 unsigned long buf_idx; 167 unsigned long buf_idx;