Lines Matching refs:cl

364 	cb->cl->tx_cb_queued++;  in mei_tx_cb_enqueue()
376 if (!WARN_ON(cb->cl->tx_cb_queued == 0)) in mei_tx_cb_dequeue()
377 cb->cl->tx_cb_queued--; in mei_tx_cb_dequeue()
391 static struct mei_cl_cb *mei_io_cb_init(struct mei_cl *cl, in mei_io_cb_init() argument
403 cb->cl = cl; in mei_io_cb_init()
416 const struct mei_cl *cl) in mei_io_list_flush_cl() argument
421 if (mei_cl_cmp_id(cl, cb->cl)) in mei_io_list_flush_cl()
433 const struct mei_cl *cl) in mei_io_tx_list_free_cl() argument
438 if (mei_cl_cmp_id(cl, cb->cl)) in mei_io_tx_list_free_cl()
468 struct mei_cl_cb *mei_cl_alloc_cb(struct mei_cl *cl, size_t length, in mei_cl_alloc_cb() argument
474 cb = mei_io_cb_init(cl, fop_type, fp); in mei_cl_alloc_cb()
503 struct mei_cl_cb *mei_cl_enqueue_ctrl_wr_cb(struct mei_cl *cl, size_t length, in mei_cl_enqueue_ctrl_wr_cb() argument
511 length = max_t(size_t, length, mei_cl_mtu(cl)); in mei_cl_enqueue_ctrl_wr_cb()
513 cb = mei_cl_alloc_cb(cl, length, fop_type, fp); in mei_cl_enqueue_ctrl_wr_cb()
517 list_add_tail(&cb->list, &cl->dev->ctrl_wr_list); in mei_cl_enqueue_ctrl_wr_cb()
530 struct mei_cl_cb *mei_cl_read_cb(const struct mei_cl *cl, const struct file *fp) in mei_cl_read_cb() argument
534 list_for_each_entry(cb, &cl->rd_completed, list) in mei_cl_read_cb()
549 int mei_cl_flush_queues(struct mei_cl *cl, const struct file *fp) in mei_cl_flush_queues() argument
553 if (WARN_ON(!cl || !cl->dev)) in mei_cl_flush_queues()
556 dev = cl->dev; in mei_cl_flush_queues()
558 cl_dbg(dev, cl, "remove list entry belonging to cl\n"); in mei_cl_flush_queues()
559 mei_io_tx_list_free_cl(&cl->dev->write_list, cl); in mei_cl_flush_queues()
560 mei_io_tx_list_free_cl(&cl->dev->write_waiting_list, cl); in mei_cl_flush_queues()
561 mei_io_list_flush_cl(&cl->dev->ctrl_wr_list, cl); in mei_cl_flush_queues()
562 mei_io_list_flush_cl(&cl->dev->ctrl_rd_list, cl); in mei_cl_flush_queues()
563 mei_io_list_free_fp(&cl->rd_pending, fp); in mei_cl_flush_queues()
564 mei_io_list_free_fp(&cl->rd_completed, fp); in mei_cl_flush_queues()
575 static void mei_cl_init(struct mei_cl *cl, struct mei_device *dev) in mei_cl_init() argument
577 memset(cl, 0, sizeof(struct mei_cl)); in mei_cl_init()
578 init_waitqueue_head(&cl->wait); in mei_cl_init()
579 init_waitqueue_head(&cl->rx_wait); in mei_cl_init()
580 init_waitqueue_head(&cl->tx_wait); in mei_cl_init()
581 init_waitqueue_head(&cl->ev_wait); in mei_cl_init()
582 INIT_LIST_HEAD(&cl->rd_completed); in mei_cl_init()
583 INIT_LIST_HEAD(&cl->rd_pending); in mei_cl_init()
584 INIT_LIST_HEAD(&cl->link); in mei_cl_init()
585 cl->writing_state = MEI_IDLE; in mei_cl_init()
586 cl->state = MEI_FILE_UNINITIALIZED; in mei_cl_init()
587 cl->dev = dev; in mei_cl_init()
598 struct mei_cl *cl; in mei_cl_allocate() local
600 cl = kmalloc(sizeof(struct mei_cl), GFP_KERNEL); in mei_cl_allocate()
601 if (!cl) in mei_cl_allocate()
604 mei_cl_init(cl, dev); in mei_cl_allocate()
606 return cl; in mei_cl_allocate()
618 int mei_cl_link(struct mei_cl *cl) in mei_cl_link() argument
623 if (WARN_ON(!cl || !cl->dev)) in mei_cl_link()
626 dev = cl->dev; in mei_cl_link()
642 cl->host_client_id = id; in mei_cl_link()
643 list_add_tail(&cl->link, &dev->file_list); in mei_cl_link()
647 cl->state = MEI_FILE_INITIALIZING; in mei_cl_link()
649 cl_dbg(dev, cl, "link cl\n"); in mei_cl_link()
660 int mei_cl_unlink(struct mei_cl *cl) in mei_cl_unlink() argument
665 if (!cl) in mei_cl_unlink()
668 if (WARN_ON(!cl->dev)) in mei_cl_unlink()
671 dev = cl->dev; in mei_cl_unlink()
673 cl_dbg(dev, cl, "unlink client"); in mei_cl_unlink()
679 if (cl->host_client_id) in mei_cl_unlink()
680 clear_bit(cl->host_client_id, dev->host_clients_map); in mei_cl_unlink()
682 list_del_init(&cl->link); in mei_cl_unlink()
684 cl->state = MEI_FILE_UNINITIALIZED; in mei_cl_unlink()
685 cl->writing_state = MEI_IDLE; in mei_cl_unlink()
687 WARN_ON(!list_empty(&cl->rd_completed) || in mei_cl_unlink()
688 !list_empty(&cl->rd_pending) || in mei_cl_unlink()
689 !list_empty(&cl->link)); in mei_cl_unlink()
736 static void mei_cl_wake_all(struct mei_cl *cl) in mei_cl_wake_all() argument
738 struct mei_device *dev = cl->dev; in mei_cl_wake_all()
741 if (waitqueue_active(&cl->rx_wait)) { in mei_cl_wake_all()
742 cl_dbg(dev, cl, "Waking up reading client!\n"); in mei_cl_wake_all()
743 wake_up_interruptible(&cl->rx_wait); in mei_cl_wake_all()
746 if (waitqueue_active(&cl->tx_wait)) { in mei_cl_wake_all()
747 cl_dbg(dev, cl, "Waking up writing client!\n"); in mei_cl_wake_all()
748 wake_up_interruptible(&cl->tx_wait); in mei_cl_wake_all()
751 if (waitqueue_active(&cl->ev_wait)) { in mei_cl_wake_all()
752 cl_dbg(dev, cl, "Waking up waiting for event clients!\n"); in mei_cl_wake_all()
753 wake_up_interruptible(&cl->ev_wait); in mei_cl_wake_all()
756 if (waitqueue_active(&cl->wait)) { in mei_cl_wake_all()
757 cl_dbg(dev, cl, "Waking up ctrl write clients!\n"); in mei_cl_wake_all()
758 wake_up(&cl->wait); in mei_cl_wake_all()
768 static void mei_cl_set_disconnected(struct mei_cl *cl) in mei_cl_set_disconnected() argument
770 struct mei_device *dev = cl->dev; in mei_cl_set_disconnected()
772 if (cl->state == MEI_FILE_DISCONNECTED || in mei_cl_set_disconnected()
773 cl->state <= MEI_FILE_INITIALIZING) in mei_cl_set_disconnected()
776 cl->state = MEI_FILE_DISCONNECTED; in mei_cl_set_disconnected()
777 mei_io_tx_list_free_cl(&dev->write_list, cl); in mei_cl_set_disconnected()
778 mei_io_tx_list_free_cl(&dev->write_waiting_list, cl); in mei_cl_set_disconnected()
779 mei_io_list_flush_cl(&dev->ctrl_rd_list, cl); in mei_cl_set_disconnected()
780 mei_io_list_flush_cl(&dev->ctrl_wr_list, cl); in mei_cl_set_disconnected()
781 mei_cl_wake_all(cl); in mei_cl_set_disconnected()
782 cl->rx_flow_ctrl_creds = 0; in mei_cl_set_disconnected()
783 cl->tx_flow_ctrl_creds = 0; in mei_cl_set_disconnected()
784 cl->timer_count = 0; in mei_cl_set_disconnected()
786 if (!cl->me_cl) in mei_cl_set_disconnected()
789 if (!WARN_ON(cl->me_cl->connect_count == 0)) in mei_cl_set_disconnected()
790 cl->me_cl->connect_count--; in mei_cl_set_disconnected()
792 if (cl->me_cl->connect_count == 0) in mei_cl_set_disconnected()
793 cl->me_cl->tx_flow_ctrl_creds = 0; in mei_cl_set_disconnected()
795 mei_me_cl_put(cl->me_cl); in mei_cl_set_disconnected()
796 cl->me_cl = NULL; in mei_cl_set_disconnected()
799 static int mei_cl_set_connecting(struct mei_cl *cl, struct mei_me_client *me_cl) in mei_cl_set_connecting() argument
812 cl->me_cl = me_cl; in mei_cl_set_connecting()
813 cl->state = MEI_FILE_CONNECTING; in mei_cl_set_connecting()
814 cl->me_cl->connect_count++; in mei_cl_set_connecting()
827 static int mei_cl_send_disconnect(struct mei_cl *cl, struct mei_cl_cb *cb) in mei_cl_send_disconnect() argument
832 dev = cl->dev; in mei_cl_send_disconnect()
834 ret = mei_hbm_cl_disconnect_req(dev, cl); in mei_cl_send_disconnect()
835 cl->status = ret; in mei_cl_send_disconnect()
837 cl->state = MEI_FILE_DISCONNECT_REPLY; in mei_cl_send_disconnect()
842 cl->timer_count = MEI_CONNECT_TIMEOUT; in mei_cl_send_disconnect()
858 int mei_cl_irq_disconnect(struct mei_cl *cl, struct mei_cl_cb *cb, in mei_cl_irq_disconnect() argument
861 struct mei_device *dev = cl->dev; in mei_cl_irq_disconnect()
874 ret = mei_cl_send_disconnect(cl, cb); in mei_cl_irq_disconnect()
889 static int __mei_cl_disconnect(struct mei_cl *cl) in __mei_cl_disconnect() argument
895 dev = cl->dev; in __mei_cl_disconnect()
897 cl->state = MEI_FILE_DISCONNECTING; in __mei_cl_disconnect()
899 cb = mei_cl_enqueue_ctrl_wr_cb(cl, 0, MEI_FOP_DISCONNECT, NULL); in __mei_cl_disconnect()
906 rets = mei_cl_send_disconnect(cl, cb); in __mei_cl_disconnect()
908 cl_err(dev, cl, "failed to disconnect.\n"); in __mei_cl_disconnect()
914 wait_event_timeout(cl->wait, in __mei_cl_disconnect()
915 cl->state == MEI_FILE_DISCONNECT_REPLY || in __mei_cl_disconnect()
916 cl->state == MEI_FILE_DISCONNECTED, in __mei_cl_disconnect()
920 rets = cl->status; in __mei_cl_disconnect()
921 if (cl->state != MEI_FILE_DISCONNECT_REPLY && in __mei_cl_disconnect()
922 cl->state != MEI_FILE_DISCONNECTED) { in __mei_cl_disconnect()
923 cl_dbg(dev, cl, "timeout on disconnect from FW client.\n"); in __mei_cl_disconnect()
929 mei_cl_set_disconnected(cl); in __mei_cl_disconnect()
931 cl_dbg(dev, cl, "successfully disconnected from FW client.\n"); in __mei_cl_disconnect()
946 int mei_cl_disconnect(struct mei_cl *cl) in mei_cl_disconnect() argument
951 if (WARN_ON(!cl || !cl->dev)) in mei_cl_disconnect()
954 dev = cl->dev; in mei_cl_disconnect()
956 cl_dbg(dev, cl, "disconnecting"); in mei_cl_disconnect()
958 if (!mei_cl_is_connected(cl)) in mei_cl_disconnect()
961 if (mei_cl_is_fixed_address(cl)) { in mei_cl_disconnect()
962 mei_cl_set_disconnected(cl); in mei_cl_disconnect()
967 cl_dbg(dev, cl, "Device is powering down, don't bother with disconnection\n"); in mei_cl_disconnect()
968 mei_cl_set_disconnected(cl); in mei_cl_disconnect()
975 cl_err(dev, cl, "rpm: get failed %d\n", rets); in mei_cl_disconnect()
979 rets = __mei_cl_disconnect(cl); in mei_cl_disconnect()
981 cl_dbg(dev, cl, "rpm: autosuspend\n"); in mei_cl_disconnect()
997 static bool mei_cl_is_other_connecting(struct mei_cl *cl) in mei_cl_is_other_connecting() argument
1002 dev = cl->dev; in mei_cl_is_other_connecting()
1006 mei_cl_me_id(cl) == mei_cl_me_id(cb->cl)) in mei_cl_is_other_connecting()
1021 static int mei_cl_send_connect(struct mei_cl *cl, struct mei_cl_cb *cb) in mei_cl_send_connect() argument
1026 dev = cl->dev; in mei_cl_send_connect()
1028 ret = mei_hbm_cl_connect_req(dev, cl); in mei_cl_send_connect()
1029 cl->status = ret; in mei_cl_send_connect()
1031 cl->state = MEI_FILE_DISCONNECT_REPLY; in mei_cl_send_connect()
1036 cl->timer_count = MEI_CONNECT_TIMEOUT; in mei_cl_send_connect()
1050 int mei_cl_irq_connect(struct mei_cl *cl, struct mei_cl_cb *cb, in mei_cl_irq_connect() argument
1053 struct mei_device *dev = cl->dev; in mei_cl_irq_connect()
1058 if (mei_cl_is_other_connecting(cl)) in mei_cl_irq_connect()
1069 rets = mei_cl_send_connect(cl, cb); in mei_cl_irq_connect()
1087 int mei_cl_connect(struct mei_cl *cl, struct mei_me_client *me_cl, in mei_cl_connect() argument
1094 if (WARN_ON(!cl || !cl->dev || !me_cl)) in mei_cl_connect()
1097 dev = cl->dev; in mei_cl_connect()
1099 rets = mei_cl_set_connecting(cl, me_cl); in mei_cl_connect()
1103 if (mei_cl_is_fixed_address(cl)) { in mei_cl_connect()
1104 cl->state = MEI_FILE_CONNECTED; in mei_cl_connect()
1112 cl_err(dev, cl, "rpm: get failed %d\n", rets); in mei_cl_connect()
1116 cb = mei_cl_enqueue_ctrl_wr_cb(cl, 0, MEI_FOP_CONNECT, fp); in mei_cl_connect()
1123 if (!mei_cl_is_other_connecting(cl) && mei_hbuf_acquire(dev)) { in mei_cl_connect()
1124 rets = mei_cl_send_connect(cl, cb); in mei_cl_connect()
1130 wait_event_timeout(cl->wait, in mei_cl_connect()
1131 (cl->state == MEI_FILE_CONNECTED || in mei_cl_connect()
1132 cl->state == MEI_FILE_DISCONNECTED || in mei_cl_connect()
1133 cl->state == MEI_FILE_DISCONNECT_REQUIRED || in mei_cl_connect()
1134 cl->state == MEI_FILE_DISCONNECT_REPLY), in mei_cl_connect()
1138 if (!mei_cl_is_connected(cl)) { in mei_cl_connect()
1139 if (cl->state == MEI_FILE_DISCONNECT_REQUIRED) { in mei_cl_connect()
1140 mei_io_list_flush_cl(&dev->ctrl_rd_list, cl); in mei_cl_connect()
1141 mei_io_list_flush_cl(&dev->ctrl_wr_list, cl); in mei_cl_connect()
1145 __mei_cl_disconnect(cl); in mei_cl_connect()
1151 if (!cl->status) in mei_cl_connect()
1152 cl->status = -EFAULT; in mei_cl_connect()
1155 rets = cl->status; in mei_cl_connect()
1157 cl_dbg(dev, cl, "rpm: autosuspend\n"); in mei_cl_connect()
1164 if (!mei_cl_is_connected(cl)) in mei_cl_connect()
1165 mei_cl_set_disconnected(cl); in mei_cl_connect()
1179 struct mei_cl *cl; in mei_cl_alloc_linked() local
1182 cl = mei_cl_allocate(dev); in mei_cl_alloc_linked()
1183 if (!cl) { in mei_cl_alloc_linked()
1188 ret = mei_cl_link(cl); in mei_cl_alloc_linked()
1192 return cl; in mei_cl_alloc_linked()
1194 kfree(cl); in mei_cl_alloc_linked()
1205 static int mei_cl_tx_flow_ctrl_creds(struct mei_cl *cl) in mei_cl_tx_flow_ctrl_creds() argument
1207 if (WARN_ON(!cl || !cl->me_cl)) in mei_cl_tx_flow_ctrl_creds()
1210 if (cl->tx_flow_ctrl_creds > 0) in mei_cl_tx_flow_ctrl_creds()
1213 if (mei_cl_is_fixed_address(cl)) in mei_cl_tx_flow_ctrl_creds()
1216 if (mei_cl_is_single_recv_buf(cl)) { in mei_cl_tx_flow_ctrl_creds()
1217 if (cl->me_cl->tx_flow_ctrl_creds > 0) in mei_cl_tx_flow_ctrl_creds()
1233 static int mei_cl_tx_flow_ctrl_creds_reduce(struct mei_cl *cl) in mei_cl_tx_flow_ctrl_creds_reduce() argument
1235 if (WARN_ON(!cl || !cl->me_cl)) in mei_cl_tx_flow_ctrl_creds_reduce()
1238 if (mei_cl_is_fixed_address(cl)) in mei_cl_tx_flow_ctrl_creds_reduce()
1241 if (mei_cl_is_single_recv_buf(cl)) { in mei_cl_tx_flow_ctrl_creds_reduce()
1242 if (WARN_ON(cl->me_cl->tx_flow_ctrl_creds <= 0)) in mei_cl_tx_flow_ctrl_creds_reduce()
1244 cl->me_cl->tx_flow_ctrl_creds--; in mei_cl_tx_flow_ctrl_creds_reduce()
1246 if (WARN_ON(cl->tx_flow_ctrl_creds <= 0)) in mei_cl_tx_flow_ctrl_creds_reduce()
1248 cl->tx_flow_ctrl_creds--; in mei_cl_tx_flow_ctrl_creds_reduce()
1292 int mei_cl_irq_notify(struct mei_cl *cl, struct mei_cl_cb *cb, in mei_cl_irq_notify() argument
1295 struct mei_device *dev = cl->dev; in mei_cl_irq_notify()
1310 ret = mei_hbm_cl_notify_req(dev, cl, request); in mei_cl_irq_notify()
1312 cl->status = ret; in mei_cl_irq_notify()
1332 int mei_cl_notify_request(struct mei_cl *cl, in mei_cl_notify_request() argument
1340 if (WARN_ON(!cl || !cl->dev)) in mei_cl_notify_request()
1343 dev = cl->dev; in mei_cl_notify_request()
1346 cl_dbg(dev, cl, "notifications not supported\n"); in mei_cl_notify_request()
1350 if (!mei_cl_is_connected(cl)) in mei_cl_notify_request()
1356 cl_err(dev, cl, "rpm: get failed %d\n", rets); in mei_cl_notify_request()
1361 cb = mei_cl_enqueue_ctrl_wr_cb(cl, 0, fop_type, fp); in mei_cl_notify_request()
1368 if (mei_hbm_cl_notify_req(dev, cl, request)) { in mei_cl_notify_request()
1376 wait_event_timeout(cl->wait, in mei_cl_notify_request()
1377 cl->notify_en == request || !mei_cl_is_connected(cl), in mei_cl_notify_request()
1381 if (cl->notify_en != request && !cl->status) in mei_cl_notify_request()
1382 cl->status = -EFAULT; in mei_cl_notify_request()
1384 rets = cl->status; in mei_cl_notify_request()
1387 cl_dbg(dev, cl, "rpm: autosuspend\n"); in mei_cl_notify_request()
1402 void mei_cl_notify(struct mei_cl *cl) in mei_cl_notify() argument
1406 if (!cl || !cl->dev) in mei_cl_notify()
1409 dev = cl->dev; in mei_cl_notify()
1411 if (!cl->notify_en) in mei_cl_notify()
1414 cl_dbg(dev, cl, "notify event"); in mei_cl_notify()
1415 cl->notify_ev = true; in mei_cl_notify()
1416 if (!mei_cl_bus_notify_event(cl)) in mei_cl_notify()
1417 wake_up_interruptible(&cl->ev_wait); in mei_cl_notify()
1419 if (cl->ev_async) in mei_cl_notify()
1420 kill_fasync(&cl->ev_async, SIGIO, POLL_PRI); in mei_cl_notify()
1435 int mei_cl_notify_get(struct mei_cl *cl, bool block, bool *notify_ev) in mei_cl_notify_get() argument
1442 if (WARN_ON(!cl || !cl->dev)) in mei_cl_notify_get()
1445 dev = cl->dev; in mei_cl_notify_get()
1448 cl_dbg(dev, cl, "notifications not supported\n"); in mei_cl_notify_get()
1452 if (!mei_cl_is_connected(cl)) in mei_cl_notify_get()
1455 if (cl->notify_ev) in mei_cl_notify_get()
1462 rets = wait_event_interruptible(cl->ev_wait, cl->notify_ev); in mei_cl_notify_get()
1469 *notify_ev = cl->notify_ev; in mei_cl_notify_get()
1470 cl->notify_ev = false; in mei_cl_notify_get()
1483 int mei_cl_read_start(struct mei_cl *cl, size_t length, const struct file *fp) in mei_cl_read_start() argument
1489 if (WARN_ON(!cl || !cl->dev)) in mei_cl_read_start()
1492 dev = cl->dev; in mei_cl_read_start()
1494 if (!mei_cl_is_connected(cl)) in mei_cl_read_start()
1497 if (!mei_me_cl_is_active(cl->me_cl)) { in mei_cl_read_start()
1498 cl_err(dev, cl, "no such me client\n"); in mei_cl_read_start()
1502 if (mei_cl_is_fixed_address(cl)) in mei_cl_read_start()
1506 if (cl->rx_flow_ctrl_creds) in mei_cl_read_start()
1509 cb = mei_cl_enqueue_ctrl_wr_cb(cl, length, MEI_FOP_READ, fp); in mei_cl_read_start()
1516 cl_err(dev, cl, "rpm: get failed %d\n", rets); in mei_cl_read_start()
1522 rets = mei_hbm_cl_flow_control_req(dev, cl); in mei_cl_read_start()
1526 list_move_tail(&cb->list, &cl->rd_pending); in mei_cl_read_start()
1528 cl->rx_flow_ctrl_creds++; in mei_cl_read_start()
1531 cl_dbg(dev, cl, "rpm: autosuspend\n"); in mei_cl_read_start()
1549 mei_hdr->host_addr = mei_cl_host_addr(cb->cl); in mei_msg_hdr_init()
1550 mei_hdr->me_addr = mei_cl_me_id(cb->cl); in mei_msg_hdr_init()
1568 int mei_cl_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb, in mei_cl_irq_write() argument
1581 if (WARN_ON(!cl || !cl->dev)) in mei_cl_irq_write()
1584 dev = cl->dev; in mei_cl_irq_write()
1590 rets = first_chunk ? mei_cl_tx_flow_ctrl_creds(cl) : 1; in mei_cl_irq_write()
1595 cl_dbg(dev, cl, "No flow control credentials: not sending.\n"); in mei_cl_irq_write()
1623 cl_dbg(dev, cl, "buf: size = %zu idx = %zu\n", in mei_cl_irq_write()
1631 cl->status = 0; in mei_cl_irq_write()
1632 cl->writing_state = MEI_WRITING; in mei_cl_irq_write()
1636 if (mei_cl_tx_flow_ctrl_creds_reduce(cl)) { in mei_cl_irq_write()
1648 cl->status = rets; in mei_cl_irq_write()
1662 ssize_t mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb) in mei_cl_write() argument
1674 if (WARN_ON(!cl || !cl->dev)) in mei_cl_write()
1680 dev = cl->dev; in mei_cl_write()
1686 cl_dbg(dev, cl, "len=%zd\n", len); in mei_cl_write()
1691 cl_err(dev, cl, "rpm: get failed %zd\n", rets); in mei_cl_write()
1696 cl->writing_state = MEI_IDLE; in mei_cl_write()
1699 rets = mei_cl_tx_flow_ctrl_creds(cl); in mei_cl_write()
1706 cl_dbg(dev, cl, "No flow control credentials: not sending.\n"); in mei_cl_write()
1712 cl_dbg(dev, cl, "Cannot acquire the host buffer: not sending.\n"); in mei_cl_write()
1737 rets = mei_cl_tx_flow_ctrl_creds_reduce(cl); in mei_cl_write()
1741 cl->writing_state = MEI_WRITING; in mei_cl_write()
1751 if (blocking && cl->writing_state != MEI_WRITE_COMPLETE) { in mei_cl_write()
1754 rets = wait_event_interruptible(cl->tx_wait, in mei_cl_write()
1755 cl->writing_state == MEI_WRITE_COMPLETE || in mei_cl_write()
1756 (!mei_cl_is_connected(cl))); in mei_cl_write()
1764 if (cl->writing_state != MEI_WRITE_COMPLETE) { in mei_cl_write()
1772 cl_dbg(dev, cl, "rpm: autosuspend\n"); in mei_cl_write()
1788 void mei_cl_complete(struct mei_cl *cl, struct mei_cl_cb *cb) in mei_cl_complete() argument
1790 struct mei_device *dev = cl->dev; in mei_cl_complete()
1795 cl->writing_state = MEI_WRITE_COMPLETE; in mei_cl_complete()
1796 if (waitqueue_active(&cl->tx_wait)) { in mei_cl_complete()
1797 wake_up_interruptible(&cl->tx_wait); in mei_cl_complete()
1805 list_add_tail(&cb->list, &cl->rd_completed); in mei_cl_complete()
1806 if (!mei_cl_is_fixed_address(cl) && in mei_cl_complete()
1807 !WARN_ON(!cl->rx_flow_ctrl_creds)) in mei_cl_complete()
1808 cl->rx_flow_ctrl_creds--; in mei_cl_complete()
1809 if (!mei_cl_bus_rx_event(cl)) in mei_cl_complete()
1810 wake_up_interruptible(&cl->rx_wait); in mei_cl_complete()
1817 if (waitqueue_active(&cl->wait)) in mei_cl_complete()
1818 wake_up(&cl->wait); in mei_cl_complete()
1823 mei_cl_set_disconnected(cl); in mei_cl_complete()
1838 struct mei_cl *cl; in mei_cl_all_disconnect() local
1840 list_for_each_entry(cl, &dev->file_list, link) in mei_cl_all_disconnect()
1841 mei_cl_set_disconnected(cl); in mei_cl_all_disconnect()