Lines Matching refs:cl

34 ssize_t __mei_cl_send(struct mei_cl *cl, const u8 *buf, size_t length, u8 vtag,  in __mei_cl_send()  argument
41 if (WARN_ON(!cl || !cl->dev)) in __mei_cl_send()
44 bus = cl->dev; in __mei_cl_send()
53 if (!mei_cl_is_connected(cl)) { in __mei_cl_send()
59 if (!mei_me_cl_is_active(cl->me_cl)) { in __mei_cl_send()
66 rets = mei_cl_vt_support_check(cl); in __mei_cl_send()
71 if (length > mei_cl_mtu(cl)) { in __mei_cl_send()
76 while (cl->tx_cb_queued >= bus->tx_queue_limit) { in __mei_cl_send()
78 rets = wait_event_interruptible(cl->tx_wait, in __mei_cl_send()
79 cl->writing_state == MEI_WRITE_COMPLETE || in __mei_cl_send()
80 (!mei_cl_is_connected(cl))); in __mei_cl_send()
87 if (!mei_cl_is_connected(cl)) { in __mei_cl_send()
93 cb = mei_cl_alloc_cb(cl, length, MEI_FOP_WRITE, NULL); in __mei_cl_send()
104 rets = mei_cl_write(cl, cb); in __mei_cl_send()
124 ssize_t __mei_cl_recv(struct mei_cl *cl, u8 *buf, size_t length, u8 *vtag, in __mei_cl_recv() argument
133 if (WARN_ON(!cl || !cl->dev)) in __mei_cl_recv()
136 bus = cl->dev; in __mei_cl_recv()
145 cb = mei_cl_read_cb(cl, NULL); in __mei_cl_recv()
149 rets = mei_cl_read_start(cl, length, NULL); in __mei_cl_recv()
160 if (!waitqueue_active(&cl->rx_wait)) { in __mei_cl_recv()
166 (cl->rx_wait, in __mei_cl_recv()
167 mei_cl_read_cb(cl, NULL) || in __mei_cl_recv()
168 (!mei_cl_is_connected(cl)), in __mei_cl_recv()
179 (cl->rx_wait, in __mei_cl_recv()
180 mei_cl_read_cb(cl, NULL) || in __mei_cl_recv()
181 (!mei_cl_is_connected(cl)))) { in __mei_cl_recv()
190 if (!mei_cl_is_connected(cl)) { in __mei_cl_recv()
196 cb = mei_cl_read_cb(cl, NULL); in __mei_cl_recv()
215 mei_cl_del_rd_completed(cl, cb); in __mei_cl_recv()
238 struct mei_cl *cl = cldev->cl; in mei_cldev_send_vtag() local
240 return __mei_cl_send(cl, buf, length, vtag, MEI_CL_IO_TX_BLOCKING); in mei_cldev_send_vtag()
260 struct mei_cl *cl = cldev->cl; in mei_cldev_recv_vtag() local
262 return __mei_cl_recv(cl, buf, length, vtag, 0, 0); in mei_cldev_recv_vtag()
282 struct mei_cl *cl = cldev->cl; in mei_cldev_recv_nonblock_vtag() local
284 return __mei_cl_recv(cl, buf, length, vtag, MEI_CL_IO_RX_NONBLOCK, 0); in mei_cldev_recv_nonblock_vtag()
355 if (mei_cl_is_connected(cldev->cl)) in mei_cl_bus_rx_work()
356 mei_cl_read_start(cldev->cl, mei_cl_mtu(cldev->cl), NULL); in mei_cl_bus_rx_work()
383 bool mei_cl_bus_notify_event(struct mei_cl *cl) in mei_cl_bus_notify_event() argument
385 struct mei_cl_device *cldev = cl->cldev; in mei_cl_bus_notify_event()
390 if (!cl->notify_ev) in mei_cl_bus_notify_event()
395 cl->notify_ev = false; in mei_cl_bus_notify_event()
408 bool mei_cl_bus_rx_event(struct mei_cl *cl) in mei_cl_bus_rx_event() argument
410 struct mei_cl_device *cldev = cl->cldev; in mei_cl_bus_rx_event()
444 if (mei_cl_is_connected(cldev->cl)) in mei_cldev_register_rx_cb()
445 ret = mei_cl_read_start(cldev->cl, mei_cl_mtu(cldev->cl), NULL); in mei_cldev_register_rx_cb()
485 ret = mei_cl_notify_request(cldev->cl, NULL, 1); in mei_cldev_register_notif_cb()
557 return mei_cl_is_connected(cldev->cl); in mei_cldev_enabled()
592 static inline struct mei_cl_vtag *mei_cl_bus_vtag(struct mei_cl *cl) in mei_cl_bus_vtag() argument
594 return list_first_entry_or_null(&cl->vtag_map, in mei_cl_bus_vtag()
609 struct mei_cl *cl = cldev->cl; in mei_cl_bus_vtag_alloc() local
616 if (mei_cl_vt_support_check(cl) || mei_cl_bus_vtag(cl)) in mei_cl_bus_vtag_alloc()
623 list_add_tail(&cl_vtag->list, &cl->vtag_map); in mei_cl_bus_vtag_alloc()
635 struct mei_cl *cl = cldev->cl; in mei_cl_bus_vtag_free() local
638 cl_vtag = mei_cl_bus_vtag(cl); in mei_cl_bus_vtag_free()
649 struct mei_cl *cl; in mei_cldev_dma_map() local
661 cl = cldev->cl; in mei_cldev_dma_map()
665 if (cl->state == MEI_FILE_UNINITIALIZED) { in mei_cldev_dma_map()
666 ret = mei_cl_link(cl); in mei_cldev_dma_map()
670 cl->cldev = cldev; in mei_cldev_dma_map()
673 ret = mei_cl_dma_alloc_and_map(cl, NULL, buffer_id, size); in mei_cldev_dma_map()
678 return cl->dma.vaddr; in mei_cldev_dma_map()
685 struct mei_cl *cl; in mei_cldev_dma_unmap() local
691 cl = cldev->cl; in mei_cldev_dma_unmap()
695 ret = mei_cl_dma_unmap(cl, NULL); in mei_cldev_dma_unmap()
697 mei_cl_flush_queues(cl, NULL); in mei_cldev_dma_unmap()
698 mei_cl_unlink(cl); in mei_cldev_dma_unmap()
715 struct mei_cl *cl; in mei_cldev_enable() local
718 cl = cldev->cl; in mei_cldev_enable()
721 if (cl->state == MEI_FILE_UNINITIALIZED) { in mei_cldev_enable()
722 ret = mei_cl_link(cl); in mei_cldev_enable()
726 cl->cldev = cldev; in mei_cldev_enable()
729 if (mei_cl_is_connected(cl)) { in mei_cldev_enable()
744 ret = mei_cl_connect(cl, cldev->me_cl, NULL); in mei_cldev_enable()
787 struct mei_cl *cl; in mei_cldev_disable() local
793 cl = cldev->cl; in mei_cldev_disable()
803 if (!mei_cl_is_connected(cl)) { in mei_cldev_disable()
809 err = mei_cl_disconnect(cl); in mei_cldev_disable()
815 if (!cl->dma_mapped) { in mei_cldev_disable()
816 mei_cl_flush_queues(cl, NULL); in mei_cldev_disable()
817 mei_cl_unlink(cl); in mei_cldev_disable()
1115 mei_cl_flush_queues(cldev->cl, NULL); in mei_cl_bus_dev_release()
1118 mei_cl_unlink(cldev->cl); in mei_cl_bus_dev_release()
1119 kfree(cldev->cl); in mei_cl_bus_dev_release()
1153 struct mei_cl *cl; in mei_cl_bus_dev_alloc() local
1159 cl = mei_cl_allocate(bus); in mei_cl_bus_dev_alloc()
1160 if (!cl) { in mei_cl_bus_dev_alloc()
1171 cldev->cl = cl; in mei_cl_bus_dev_alloc()