Lines Matching refs:cl

32 	struct mei_cl *cl;  in mei_irq_compl_handler()  local
35 cl = cb->cl; in mei_irq_compl_handler()
39 mei_cl_complete(cl, cb); in mei_irq_compl_handler()
52 static inline int mei_cl_hbm_equal(struct mei_cl *cl, in mei_cl_hbm_equal() argument
55 return mei_cl_host_addr(cl) == mei_hdr->host_addr && in mei_cl_hbm_equal()
56 mei_cl_me_id(cl) == mei_hdr->me_addr; in mei_cl_hbm_equal()
93 static int mei_cl_irq_read_msg(struct mei_cl *cl, in mei_cl_irq_read_msg() argument
98 struct mei_device *dev = cl->dev; in mei_cl_irq_read_msg()
112 cb = list_first_entry_or_null(&cl->rd_pending, struct mei_cl_cb, list); in mei_cl_irq_read_msg()
114 if (!mei_cl_is_fixed_address(cl)) { in mei_cl_irq_read_msg()
115 cl_err(dev, cl, "pending read cb not found\n"); in mei_cl_irq_read_msg()
118 cb = mei_cl_alloc_cb(cl, mei_cl_mtu(cl), MEI_FOP_READ, cl->fp); in mei_cl_irq_read_msg()
121 list_add_tail(&cb->list, &cl->rd_pending); in mei_cl_irq_read_msg()
145 cl_dbg(dev, cl, "vtag not found in extended header.\n"); in mei_cl_irq_read_msg()
150 cl_dbg(dev, cl, "vtag: %d\n", vtag_hdr->vtag); in mei_cl_irq_read_msg()
152 cl_err(dev, cl, "mismatched tag: %d != %d\n", in mei_cl_irq_read_msg()
160 if (!mei_cl_is_connected(cl)) { in mei_cl_irq_read_msg()
161 cl_dbg(dev, cl, "not connected\n"); in mei_cl_irq_read_msg()
172 cl_err(dev, cl, "message is too big len %d idx %zu\n", in mei_cl_irq_read_msg()
179 cl_dbg(dev, cl, "message overflow. size %zu len %d idx %zu\n", in mei_cl_irq_read_msg()
196 cl_dbg(dev, cl, "completed read length = %zu\n", cb->buf_idx); in mei_cl_irq_read_msg()
221 static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb, in mei_cl_irq_disconnect_rsp() argument
224 struct mei_device *dev = cl->dev; in mei_cl_irq_disconnect_rsp()
237 ret = mei_hbm_cl_disconnect_rsp(dev, cl); in mei_cl_irq_disconnect_rsp()
253 static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb, in mei_cl_irq_read() argument
256 struct mei_device *dev = cl->dev; in mei_cl_irq_read()
261 if (!list_empty(&cl->rd_pending)) in mei_cl_irq_read()
272 ret = mei_hbm_cl_flow_control_req(dev, cl); in mei_cl_irq_read()
274 cl->status = ret; in mei_cl_irq_read()
283 list_move_tail(&cb->list, &cl->rd_pending); in mei_cl_irq_read()
332 struct mei_cl *cl; in mei_irq_read_handler() local
424 list_for_each_entry(cl, &dev->file_list, link) { in mei_irq_read_handler()
425 if (mei_cl_hbm_equal(cl, mei_hdr)) { in mei_irq_read_handler()
426 cl_dbg(dev, cl, "got a message\n"); in mei_irq_read_handler()
427 ret = mei_cl_irq_read_msg(cl, mei_hdr, meta_hdr, cmpl_list); in mei_irq_read_handler()
478 struct mei_cl *cl; in mei_irq_write_handler() local
498 cl = cb->cl; in mei_irq_write_handler()
500 cl->status = 0; in mei_irq_write_handler()
501 cl_dbg(dev, cl, "MEI WRITE COMPLETE\n"); in mei_irq_write_handler()
502 cl->writing_state = MEI_WRITE_COMPLETE; in mei_irq_write_handler()
509 cl = cb->cl; in mei_irq_write_handler()
513 ret = mei_cl_irq_disconnect(cl, cb, cmpl_list); in mei_irq_write_handler()
520 ret = mei_cl_irq_read(cl, cb, cmpl_list); in mei_irq_write_handler()
527 ret = mei_cl_irq_connect(cl, cb, cmpl_list); in mei_irq_write_handler()
534 ret = mei_cl_irq_disconnect_rsp(cl, cb, cmpl_list); in mei_irq_write_handler()
541 ret = mei_cl_irq_notify(cl, cb, cmpl_list); in mei_irq_write_handler()
546 ret = mei_cl_irq_dma_map(cl, cb, cmpl_list); in mei_irq_write_handler()
551 ret = mei_cl_irq_dma_unmap(cl, cb, cmpl_list); in mei_irq_write_handler()
563 cl = cb->cl; in mei_irq_write_handler()
564 ret = mei_cl_irq_write(cl, cb, cmpl_list); in mei_irq_write_handler()
578 static void mei_connect_timeout(struct mei_cl *cl) in mei_connect_timeout() argument
580 struct mei_device *dev = cl->dev; in mei_connect_timeout()
582 if (cl->state == MEI_FILE_CONNECTING) { in mei_connect_timeout()
584 cl->state = MEI_FILE_DISCONNECT_REQUIRED; in mei_connect_timeout()
585 wake_up(&cl->wait); in mei_connect_timeout()
613 struct mei_cl *cl; in mei_timer() local
639 list_for_each_entry(cl, &dev->file_list, link) { in mei_timer()
640 if (cl->timer_count) { in mei_timer()
641 if (--cl->timer_count == 0) { in mei_timer()
643 mei_connect_timeout(cl); in mei_timer()