Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mei: add common prefix to hbm function

1. use mei_hbm_ for basic host bus message function
2. use mei_hbm_cl prefix for host bus messages that operation
on behalf of a client

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tomas Winkler and committed by
Greg Kroah-Hartman
8120e720 e46f1874

+53 -50
+4 -3
drivers/misc/mei/amthif.c
··· 98 98 99 99 dev->iamthif_msg_buf = msg_buf; 100 100 101 - if (mei_connect(dev, &dev->iamthif_cl)) { 101 + if (mei_hbm_cl_connect_req(dev, &dev->iamthif_cl)) { 102 102 dev_dbg(&dev->pdev->dev, "Failed to connect to AMTHI client\n"); 103 103 dev->iamthif_cl.state = MEI_FILE_DISCONNECTED; 104 104 dev->iamthif_cl.host_client_id = 0; ··· 558 558 return -EMSGSIZE; 559 559 } 560 560 *slots -= mei_data2slots(sizeof(struct hbm_flow_control)); 561 - if (mei_send_flow_control(dev, &dev->iamthif_cl)) { 561 + if (mei_hbm_cl_flow_control_req(dev, &dev->iamthif_cl)) { 562 562 dev_dbg(&dev->pdev->dev, "iamthif flow control failed\n"); 563 563 return -EIO; 564 564 } ··· 630 630 if (dev->iamthif_current_cb == cb_pos) { 631 631 dev->iamthif_current_cb = NULL; 632 632 /* send flow control to iamthif client */ 633 - mei_send_flow_control(dev, &dev->iamthif_cl); 633 + mei_hbm_cl_flow_control_req(dev, 634 + &dev->iamthif_cl); 634 635 } 635 636 /* free all allocated buffers */ 636 637 mei_io_cb_free(cb_pos);
+32 -24
drivers/misc/mei/hbm.c
··· 59 59 60 60 61 61 /** 62 - * host_start_message - mei host sends start message. 62 + * mei_hbm_start_req - sends start request message. 63 63 * 64 64 * @dev: the device structure 65 - * 66 - * returns none. 67 65 */ 68 - void mei_host_start_message(struct mei_device *dev) 66 + void mei_hbm_start_req(struct mei_device *dev) 69 67 { 70 68 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr; 71 69 struct hbm_host_version_request *start_req; ··· 90 92 } 91 93 92 94 /** 93 - * host_enum_clients_message - host sends enumeration client request message. 95 + * mei_hbm_enum_clients_req - sends enumeration client request message. 94 96 * 95 97 * @dev: the device structure 96 98 * 97 99 * returns none. 98 100 */ 99 - void mei_host_enum_clients_message(struct mei_device *dev) 101 + static void mei_hbm_enum_clients_req(struct mei_device *dev) 100 102 { 101 103 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr; 102 104 struct hbm_host_enum_request *enum_req; ··· 118 120 return; 119 121 } 120 122 123 + /** 124 + * mei_hbm_prop_requsest - request property for a single client 125 + * 126 + * @dev: the device structure 127 + * 128 + * returns none. 129 + */ 121 130 122 - int mei_host_client_enumerate(struct mei_device *dev) 131 + static int mei_hbm_prop_req(struct mei_device *dev) 123 132 { 124 133 125 134 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr; ··· 196 191 } 197 192 198 193 /** 199 - * mei_send_flow_control - sends flow control to fw. 194 + * mei_hbm_cl_flow_control_req - sends flow control requst. 200 195 * 201 196 * @dev: the device structure 202 - * @cl: private data of the file object 197 + * @cl: client info 203 198 * 204 199 * This function returns -EIO on write failure 205 200 */ 206 - int mei_send_flow_control(struct mei_device *dev, struct mei_cl *cl) 201 + int mei_hbm_cl_flow_control_req(struct mei_device *dev, struct mei_cl *cl) 207 202 { 208 203 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr; 209 204 const size_t len = sizeof(struct hbm_flow_control); ··· 218 213 } 219 214 220 215 /** 221 - * mei_disconnect - sends disconnect message to fw. 216 + * mei_hbm_cl_disconnect_req - sends disconnect message to fw. 222 217 * 223 218 * @dev: the device structure 224 - * @cl: private data of the file object 219 + * @cl: a client to disconnect from 225 220 * 226 221 * This function returns -EIO on write failure 227 222 */ 228 - int mei_disconnect(struct mei_device *dev, struct mei_cl *cl) 223 + int mei_hbm_cl_disconnect_req(struct mei_device *dev, struct mei_cl *cl) 229 224 { 230 225 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr; 231 226 const size_t len = sizeof(struct hbm_client_connect_request); ··· 237 232 } 238 233 239 234 /** 240 - * mei_connect - sends connect message to fw. 235 + * mei_hbm_cl_connect_req - send connection request to specific me client 241 236 * 242 237 * @dev: the device structure 243 - * @cl: private data of the file object 238 + * @cl: a client to connect to 244 239 * 245 - * This function returns -EIO on write failure 240 + * returns -EIO on write failure 246 241 */ 247 - int mei_connect(struct mei_device *dev, struct mei_cl *cl) 242 + int mei_hbm_cl_connect_req(struct mei_device *dev, struct mei_cl *cl) 248 243 { 249 244 struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr; 250 245 const size_t len = sizeof(struct hbm_client_connect_request); ··· 256 251 } 257 252 258 253 /** 259 - * mei_client_disconnect_request - disconnects from request irq routine 254 + * mei_client_disconnect_request - disconnect request initiated by me 255 + * host sends disoconnect response 260 256 * 261 257 * @dev: the device structure. 262 - * @disconnect_req: disconnect request bus message. 258 + * @disconnect_req: disconnect request bus message from the me 263 259 */ 264 - static void mei_client_disconnect_request(struct mei_device *dev, 260 + static void mei_hbm_fw_disconnect_req(struct mei_device *dev, 265 261 struct hbm_client_connect_request *disconnect_req) 266 262 { 267 263 struct mei_cl *cl, *next; ··· 333 327 if (dev->dev_state == MEI_DEV_INIT_CLIENTS && 334 328 dev->init_clients_state == MEI_START_MESSAGE) { 335 329 dev->init_clients_timer = 0; 336 - mei_host_enum_clients_message(dev); 330 + mei_hbm_enum_clients_req(dev); 337 331 } else { 338 332 dev->recvd_msg = false; 339 333 dev_dbg(&dev->pdev->dev, "reset due to received hbm: host start\n"); ··· 396 390 dev->me_client_index++; 397 391 dev->me_client_presentation_num++; 398 392 399 - mei_host_client_enumerate(dev); 393 + /* request property for the next client */ 394 + mei_hbm_prop_req(dev); 400 395 401 396 break; 402 397 ··· 413 406 dev->init_clients_state = 414 407 MEI_CLIENT_PROPERTIES_MESSAGE; 415 408 416 - mei_host_client_enumerate(dev); 409 + /* first property reqeust */ 410 + mei_hbm_prop_req(dev); 417 411 } else { 418 412 dev_dbg(&dev->pdev->dev, "reset due to received host enumeration clients response bus message.\n"); 419 413 mei_reset(dev, 1); ··· 431 423 case CLIENT_DISCONNECT_REQ_CMD: 432 424 /* search for client */ 433 425 disconnect_req = (struct hbm_client_connect_request *)mei_msg; 434 - mei_client_disconnect_request(dev, disconnect_req); 426 + mei_hbm_fw_disconnect_req(dev, disconnect_req); 435 427 break; 436 428 437 429 case ME_STOP_REQ_CMD:
+2 -2
drivers/misc/mei/init.c
··· 529 529 cb->fop_type = MEI_FOP_CLOSE; 530 530 if (dev->mei_host_buffer_is_empty) { 531 531 dev->mei_host_buffer_is_empty = false; 532 - if (mei_disconnect(dev, cl)) { 532 + if (mei_hbm_cl_disconnect_req(dev, cl)) { 533 533 rets = -ENODEV; 534 - dev_dbg(&dev->pdev->dev, "failed to call mei_disconnect.\n"); 534 + dev_err(&dev->pdev->dev, "failed to disconnect.\n"); 535 535 goto free; 536 536 } 537 537 mdelay(10); /* Wait for hardware disconnection ready */
+7 -4
drivers/misc/mei/interface.h
··· 69 69 */ 70 70 void mei_watchdog_unregister(struct mei_device *dev); 71 71 72 + int mei_other_client_is_connecting(struct mei_device *dev, struct mei_cl *cl); 72 73 int mei_flow_ctrl_reduce(struct mei_device *dev, struct mei_cl *cl); 73 74 74 - int mei_send_flow_control(struct mei_device *dev, struct mei_cl *cl); 75 + void mei_hbm_start_req(struct mei_device *dev); 75 76 76 - int mei_disconnect(struct mei_device *dev, struct mei_cl *cl); 77 - int mei_other_client_is_connecting(struct mei_device *dev, struct mei_cl *cl); 78 - int mei_connect(struct mei_device *dev, struct mei_cl *cl); 77 + int mei_hbm_cl_flow_control_req(struct mei_device *dev, struct mei_cl *cl); 78 + int mei_hbm_cl_disconnect_req(struct mei_device *dev, struct mei_cl *cl); 79 + int mei_hbm_cl_connect_req(struct mei_device *dev, struct mei_cl *cl); 80 + 81 + void mei_host_client_init(struct work_struct *work); 79 82 80 83 #endif /* _MEI_INTERFACE_H_ */
+5 -5
drivers/misc/mei/interrupt.c
··· 157 157 158 158 *slots -= mei_data2slots(sizeof(struct hbm_client_connect_request)); 159 159 160 - if (mei_disconnect(dev, cl)) { 160 + if (mei_hbm_cl_disconnect_req(dev, cl)) { 161 161 cl->status = 0; 162 162 cb_pos->buf_idx = 0; 163 163 list_move_tail(&cb_pos->list, &cmpl_list->list); ··· 407 407 408 408 *slots -= mei_data2slots(sizeof(struct hbm_flow_control)); 409 409 410 - if (mei_send_flow_control(dev, cl)) { 410 + if (mei_hbm_cl_flow_control_req(dev, cl)) { 411 411 cl->status = -ENODEV; 412 412 cb_pos->buf_idx = 0; 413 413 list_move_tail(&cb_pos->list, &cmpl_list->list); ··· 443 443 } 444 444 445 445 cl->state = MEI_FILE_CONNECTING; 446 - *slots -= mei_data2slots(sizeof(struct hbm_client_connect_request)); 447 - if (mei_connect(dev, cl)) { 446 + *slots -= mei_data2slots(sizeof(struct hbm_client_connect_request)); 447 + if (mei_hbm_cl_connect_req(dev, cl)) { 448 448 cl->status = -ENODEV; 449 449 cb_pos->buf_idx = 0; 450 450 list_del(&cb_pos->list); ··· 927 927 /* link is established 928 928 * start sending messages. 929 929 */ 930 - mei_host_start_message(dev); 930 + mei_hbm_start_req(dev); 931 931 mutex_unlock(&dev->device_lock); 932 932 return IRQ_HANDLED; 933 933 } else {
+2 -2
drivers/misc/mei/iorw.c
··· 258 258 && !mei_other_client_is_connecting(dev, cl)) { 259 259 dev_dbg(&dev->pdev->dev, "Sending Connect Message\n"); 260 260 dev->mei_host_buffer_is_empty = false; 261 - if (mei_connect(dev, cl)) { 261 + if (mei_hbm_cl_connect_req(dev, cl)) { 262 262 dev_dbg(&dev->pdev->dev, "Sending connect message - failed\n"); 263 263 rets = -ENODEV; 264 264 goto end; ··· 350 350 cl->read_cb = cb; 351 351 if (dev->mei_host_buffer_is_empty) { 352 352 dev->mei_host_buffer_is_empty = false; 353 - if (mei_send_flow_control(dev, cl)) { 353 + if (mei_hbm_cl_flow_control_req(dev, cl)) { 354 354 rets = -ENODEV; 355 355 goto err; 356 356 }
-9
drivers/misc/mei/mei_dev.h
··· 383 383 } 384 384 385 385 386 - 387 - /* 388 - * MEI Host Client Functions 389 - */ 390 - void mei_host_start_message(struct mei_device *dev); 391 - void mei_host_enum_clients_message(struct mei_device *dev); 392 - int mei_host_client_enumerate(struct mei_device *dev); 393 - void mei_host_client_init(struct work_struct *work); 394 - 395 386 /* 396 387 * MEI interrupt functions prototype 397 388 */
+1 -1
drivers/misc/mei/wd.c
··· 79 79 return -ENOENT; 80 80 } 81 81 82 - if (mei_connect(dev, &dev->wd_cl)) { 82 + if (mei_hbm_cl_connect_req(dev, &dev->wd_cl)) { 83 83 dev_err(&dev->pdev->dev, "wd: failed to connect to the client\n"); 84 84 dev->wd_cl.state = MEI_FILE_DISCONNECTED; 85 85 dev->wd_cl.host_client_id = 0;