diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2012-10-09 10:50:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-24 18:35:03 -0400 |
commit | ebb108ef93605a68f6f38d5eb407e7d5138e8028 (patch) | |
tree | 0dbd844bc17310a4d0fb62529ee823e80cb57c1b /drivers/misc/mei/interrupt.c | |
parent | 7e6735c3578e76c270a2797225a4214176ba13ef (diff) |
mei: rename mei_cl_cb.information to mei_cl_cb.buf_idx
rename 'information' member of the struct mei_cl_cb to
more self-descriptive 'buf_idx'
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 | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 3533edde04a5..320ebd2f06ce 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c | |||
@@ -149,7 +149,7 @@ static int mei_irq_thread_read_amthi_message(struct mei_io_list *complete_list, | |||
149 | return -ENODEV; | 149 | return -ENODEV; |
150 | 150 | ||
151 | dev->iamthif_stall_timer = 0; | 151 | dev->iamthif_stall_timer = 0; |
152 | cb->information = dev->iamthif_msg_buf_index; | 152 | cb->buf_idx = dev->iamthif_msg_buf_index; |
153 | cb->read_time = jiffies; | 153 | cb->read_time = jiffies; |
154 | if (dev->iamthif_ioctl && cl == &dev->iamthif_cl) { | 154 | if (dev->iamthif_ioctl && cl == &dev->iamthif_cl) { |
155 | /* found the iamthif cb */ | 155 | /* found the iamthif cb */ |
@@ -205,10 +205,10 @@ static int mei_irq_thread_read_client_message(struct mei_io_list *complete_list, | |||
205 | cl = (struct mei_cl *)cb_pos->file_private; | 205 | cl = (struct mei_cl *)cb_pos->file_private; |
206 | if (cl && _mei_irq_thread_state_ok(cl, mei_hdr)) { | 206 | if (cl && _mei_irq_thread_state_ok(cl, mei_hdr)) { |
207 | cl->reading_state = MEI_READING; | 207 | cl->reading_state = MEI_READING; |
208 | buffer = cb_pos->response_buffer.data + cb_pos->information; | 208 | buffer = cb_pos->response_buffer.data + cb_pos->buf_idx; |
209 | 209 | ||
210 | if (cb_pos->response_buffer.size < | 210 | if (cb_pos->response_buffer.size < |
211 | mei_hdr->length + cb_pos->information) { | 211 | mei_hdr->length + cb_pos->buf_idx) { |
212 | dev_dbg(&dev->pdev->dev, "message overflow.\n"); | 212 | dev_dbg(&dev->pdev->dev, "message overflow.\n"); |
213 | list_del(&cb_pos->cb_list); | 213 | list_del(&cb_pos->cb_list); |
214 | return -ENOMEM; | 214 | return -ENOMEM; |
@@ -216,7 +216,7 @@ static int mei_irq_thread_read_client_message(struct mei_io_list *complete_list, | |||
216 | if (buffer) | 216 | if (buffer) |
217 | mei_read_slots(dev, buffer, mei_hdr->length); | 217 | mei_read_slots(dev, buffer, mei_hdr->length); |
218 | 218 | ||
219 | cb_pos->information += mei_hdr->length; | 219 | cb_pos->buf_idx += mei_hdr->length; |
220 | if (mei_hdr->msg_complete) { | 220 | if (mei_hdr->msg_complete) { |
221 | cl->status = 0; | 221 | cl->status = 0; |
222 | list_del(&cb_pos->cb_list); | 222 | list_del(&cb_pos->cb_list); |
@@ -224,7 +224,8 @@ static int mei_irq_thread_read_client_message(struct mei_io_list *complete_list, | |||
224 | "completed read H cl = %d, ME cl = %d, length = %lu\n", | 224 | "completed read H cl = %d, ME cl = %d, length = %lu\n", |
225 | cl->host_client_id, | 225 | cl->host_client_id, |
226 | cl->me_client_id, | 226 | cl->me_client_id, |
227 | cb_pos->information); | 227 | cb_pos->buf_idx); |
228 | |||
228 | list_add_tail(&cb_pos->cb_list, | 229 | list_add_tail(&cb_pos->cb_list, |
229 | &complete_list->mei_cb.cb_list); | 230 | &complete_list->mei_cb.cb_list); |
230 | } | 231 | } |
@@ -300,14 +301,14 @@ static int _mei_irq_thread_close(struct mei_device *dev, s32 *slots, | |||
300 | 301 | ||
301 | if (mei_disconnect(dev, cl)) { | 302 | if (mei_disconnect(dev, cl)) { |
302 | cl->status = 0; | 303 | cl->status = 0; |
303 | cb_pos->information = 0; | 304 | cb_pos->buf_idx = 0; |
304 | list_move_tail(&cb_pos->cb_list, | 305 | list_move_tail(&cb_pos->cb_list, |
305 | &cmpl_list->mei_cb.cb_list); | 306 | &cmpl_list->mei_cb.cb_list); |
306 | return -EMSGSIZE; | 307 | return -EMSGSIZE; |
307 | } else { | 308 | } else { |
308 | cl->state = MEI_FILE_DISCONNECTING; | 309 | cl->state = MEI_FILE_DISCONNECTING; |
309 | cl->status = 0; | 310 | cl->status = 0; |
310 | cb_pos->information = 0; | 311 | cb_pos->buf_idx = 0; |
311 | list_move_tail(&cb_pos->cb_list, | 312 | list_move_tail(&cb_pos->cb_list, |
312 | &dev->ctrl_rd_list.mei_cb.cb_list); | 313 | &dev->ctrl_rd_list.mei_cb.cb_list); |
313 | cl->timer_count = MEI_CONNECT_TIMEOUT; | 314 | cl->timer_count = MEI_CONNECT_TIMEOUT; |
@@ -834,7 +835,7 @@ static int _mei_irq_thread_read(struct mei_device *dev, s32 *slots, | |||
834 | 835 | ||
835 | if (mei_send_flow_control(dev, cl)) { | 836 | if (mei_send_flow_control(dev, cl)) { |
836 | cl->status = -ENODEV; | 837 | cl->status = -ENODEV; |
837 | cb_pos->information = 0; | 838 | cb_pos->buf_idx = 0; |
838 | list_move_tail(&cb_pos->cb_list, &cmpl_list->mei_cb.cb_list); | 839 | list_move_tail(&cb_pos->cb_list, &cmpl_list->mei_cb.cb_list); |
839 | return -ENODEV; | 840 | return -ENODEV; |
840 | } | 841 | } |
@@ -871,7 +872,7 @@ static int _mei_irq_thread_ioctl(struct mei_device *dev, s32 *slots, | |||
871 | *slots -= mei_data2slots(sizeof(struct hbm_client_connect_request)); | 872 | *slots -= mei_data2slots(sizeof(struct hbm_client_connect_request)); |
872 | if (mei_connect(dev, cl)) { | 873 | if (mei_connect(dev, cl)) { |
873 | cl->status = -ENODEV; | 874 | cl->status = -ENODEV; |
874 | cb_pos->information = 0; | 875 | cb_pos->buf_idx = 0; |
875 | list_del(&cb_pos->cb_list); | 876 | list_del(&cb_pos->cb_list); |
876 | return -ENODEV; | 877 | return -ENODEV; |
877 | } else { | 878 | } else { |
@@ -901,28 +902,26 @@ static int _mei_irq_thread_cmpl(struct mei_device *dev, s32 *slots, | |||
901 | struct mei_msg_hdr *mei_hdr; | 902 | struct mei_msg_hdr *mei_hdr; |
902 | 903 | ||
903 | if ((*slots * sizeof(u32)) >= (sizeof(struct mei_msg_hdr) + | 904 | if ((*slots * sizeof(u32)) >= (sizeof(struct mei_msg_hdr) + |
904 | (cb_pos->request_buffer.size - | 905 | (cb_pos->request_buffer.size - cb_pos->buf_idx))) { |
905 | cb_pos->information))) { | ||
906 | mei_hdr = (struct mei_msg_hdr *) &dev->wr_msg_buf[0]; | 906 | mei_hdr = (struct mei_msg_hdr *) &dev->wr_msg_buf[0]; |
907 | mei_hdr->host_addr = cl->host_client_id; | 907 | mei_hdr->host_addr = cl->host_client_id; |
908 | mei_hdr->me_addr = cl->me_client_id; | 908 | mei_hdr->me_addr = cl->me_client_id; |
909 | mei_hdr->length = cb_pos->request_buffer.size - | 909 | mei_hdr->length = cb_pos->request_buffer.size - cb_pos->buf_idx; |
910 | cb_pos->information; | ||
911 | mei_hdr->msg_complete = 1; | 910 | mei_hdr->msg_complete = 1; |
912 | mei_hdr->reserved = 0; | 911 | mei_hdr->reserved = 0; |
913 | dev_dbg(&dev->pdev->dev, "cb_pos->request_buffer.size =%d" | 912 | dev_dbg(&dev->pdev->dev, "cb_pos->request_buffer.size =%d" |
914 | "mei_hdr->msg_complete = %d\n", | 913 | "mei_hdr->msg_complete = %d\n", |
915 | cb_pos->request_buffer.size, | 914 | cb_pos->request_buffer.size, |
916 | mei_hdr->msg_complete); | 915 | mei_hdr->msg_complete); |
917 | dev_dbg(&dev->pdev->dev, "cb_pos->information =%lu\n", | 916 | dev_dbg(&dev->pdev->dev, "cb_pos->buf_idx =%lu\n", |
918 | cb_pos->information); | 917 | cb_pos->buf_idx); |
919 | dev_dbg(&dev->pdev->dev, "mei_hdr->length =%d\n", | 918 | dev_dbg(&dev->pdev->dev, "mei_hdr->length =%d\n", |
920 | mei_hdr->length); | 919 | mei_hdr->length); |
921 | *slots -= mei_data2slots(mei_hdr->length); | 920 | *slots -= mei_data2slots(mei_hdr->length); |
922 | if (mei_write_message(dev, mei_hdr, | 921 | if (mei_write_message(dev, mei_hdr, |
923 | (unsigned char *) | 922 | (unsigned char *) |
924 | (cb_pos->request_buffer.data + | 923 | (cb_pos->request_buffer.data + |
925 | cb_pos->information), | 924 | cb_pos->buf_idx), |
926 | mei_hdr->length)) { | 925 | mei_hdr->length)) { |
927 | cl->status = -ENODEV; | 926 | cl->status = -ENODEV; |
928 | list_move_tail(&cb_pos->cb_list, | 927 | list_move_tail(&cb_pos->cb_list, |
@@ -932,7 +931,7 @@ static int _mei_irq_thread_cmpl(struct mei_device *dev, s32 *slots, | |||
932 | if (mei_flow_ctrl_reduce(dev, cl)) | 931 | if (mei_flow_ctrl_reduce(dev, cl)) |
933 | return -ENODEV; | 932 | return -ENODEV; |
934 | cl->status = 0; | 933 | cl->status = 0; |
935 | cb_pos->information += mei_hdr->length; | 934 | cb_pos->buf_idx += mei_hdr->length; |
936 | list_move_tail(&cb_pos->cb_list, | 935 | list_move_tail(&cb_pos->cb_list, |
937 | &dev->write_waiting_list.mei_cb.cb_list); | 936 | &dev->write_waiting_list.mei_cb.cb_list); |
938 | } | 937 | } |
@@ -949,21 +948,21 @@ static int _mei_irq_thread_cmpl(struct mei_device *dev, s32 *slots, | |||
949 | if (mei_write_message(dev, mei_hdr, | 948 | if (mei_write_message(dev, mei_hdr, |
950 | (unsigned char *) | 949 | (unsigned char *) |
951 | (cb_pos->request_buffer.data + | 950 | (cb_pos->request_buffer.data + |
952 | cb_pos->information), | 951 | cb_pos->buf_idx), |
953 | mei_hdr->length)) { | 952 | mei_hdr->length)) { |
954 | cl->status = -ENODEV; | 953 | cl->status = -ENODEV; |
955 | list_move_tail(&cb_pos->cb_list, | 954 | list_move_tail(&cb_pos->cb_list, |
956 | &cmpl_list->mei_cb.cb_list); | 955 | &cmpl_list->mei_cb.cb_list); |
957 | return -ENODEV; | 956 | return -ENODEV; |
958 | } else { | 957 | } else { |
959 | cb_pos->information += mei_hdr->length; | 958 | cb_pos->buf_idx += mei_hdr->length; |
960 | dev_dbg(&dev->pdev->dev, | 959 | dev_dbg(&dev->pdev->dev, |
961 | "cb_pos->request_buffer.size =%d" | 960 | "cb_pos->request_buffer.size =%d" |
962 | " mei_hdr->msg_complete = %d\n", | 961 | " mei_hdr->msg_complete = %d\n", |
963 | cb_pos->request_buffer.size, | 962 | cb_pos->request_buffer.size, |
964 | mei_hdr->msg_complete); | 963 | mei_hdr->msg_complete); |
965 | dev_dbg(&dev->pdev->dev, "cb_pos->information =%lu\n", | 964 | dev_dbg(&dev->pdev->dev, "cb_pos->buf_idx =%lu\n", |
966 | cb_pos->information); | 965 | cb_pos->buf_idx); |
967 | dev_dbg(&dev->pdev->dev, "mei_hdr->length =%d\n", | 966 | dev_dbg(&dev->pdev->dev, "mei_hdr->length =%d\n", |
968 | mei_hdr->length); | 967 | mei_hdr->length); |
969 | } | 968 | } |
@@ -1018,7 +1017,7 @@ static int _mei_irq_thread_cmpl_iamthif(struct mei_device *dev, s32 *slots, | |||
1018 | if (mei_flow_ctrl_reduce(dev, cl)) | 1017 | if (mei_flow_ctrl_reduce(dev, cl)) |
1019 | return -ENODEV; | 1018 | return -ENODEV; |
1020 | dev->iamthif_msg_buf_index += mei_hdr->length; | 1019 | dev->iamthif_msg_buf_index += mei_hdr->length; |
1021 | cb_pos->information = dev->iamthif_msg_buf_index; | 1020 | cb_pos->buf_idx = dev->iamthif_msg_buf_index; |
1022 | cl->status = 0; | 1021 | cl->status = 0; |
1023 | dev->iamthif_state = MEI_IAMTHIF_FLOW_CONTROL; | 1022 | dev->iamthif_state = MEI_IAMTHIF_FLOW_CONTROL; |
1024 | dev->iamthif_flow_control_pending = true; | 1023 | dev->iamthif_flow_control_pending = true; |