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()
115 cb = list_first_entry_or_null(&cl->rd_pending, struct mei_cl_cb, list); in mei_cl_irq_read_msg()
117 if (!mei_cl_is_fixed_address(cl)) { in mei_cl_irq_read_msg()
118 cl_err(dev, cl, "pending read cb not found\n"); in mei_cl_irq_read_msg()
121 cb = mei_cl_alloc_cb(cl, mei_cl_mtu(cl), MEI_FOP_READ, cl->fp); in mei_cl_irq_read_msg()
124 list_add_tail(&cb->list, &cl->rd_pending); in mei_cl_irq_read_msg()
145 cl_err(dev, cl, "unknown extended header\n"); in mei_cl_irq_read_msg()
154 cl_dbg(dev, cl, "no vtag or gsc found in extended header.\n"); in mei_cl_irq_read_msg()
161 cl_dbg(dev, cl, "vtag: %d\n", vtag_hdr->vtag); in mei_cl_irq_read_msg()
163 cl_err(dev, cl, "mismatched tag: %d != %d\n", in mei_cl_irq_read_msg()
175 cl_err(dev, cl, "gsc extended header is not supported\n"); in mei_cl_irq_read_msg()
181 cl_err(dev, cl, "no data allowed in cb with gsc\n"); in mei_cl_irq_read_msg()
186 cl_err(dev, cl, "gsc extended header is too big %u\n", ext_hdr_len); in mei_cl_irq_read_msg()
193 if (!mei_cl_is_connected(cl)) { in mei_cl_irq_read_msg()
194 cl_dbg(dev, cl, "not connected\n"); in mei_cl_irq_read_msg()
205 cl_err(dev, cl, "message is too big len %d idx %zu\n", in mei_cl_irq_read_msg()
212 cl_dbg(dev, cl, "message overflow. size %zu len %d idx %zu\n", in mei_cl_irq_read_msg()
229 cl_dbg(dev, cl, "completed read length = %zu\n", cb->buf_idx); in mei_cl_irq_read_msg()
254 static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb, in mei_cl_irq_disconnect_rsp() argument
257 struct mei_device *dev = cl->dev; in mei_cl_irq_disconnect_rsp()
270 ret = mei_hbm_cl_disconnect_rsp(dev, cl); in mei_cl_irq_disconnect_rsp()
286 static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb, in mei_cl_irq_read() argument
289 struct mei_device *dev = cl->dev; in mei_cl_irq_read()
294 if (!list_empty(&cl->rd_pending)) in mei_cl_irq_read()
305 ret = mei_hbm_cl_flow_control_req(dev, cl); in mei_cl_irq_read()
307 cl->status = ret; in mei_cl_irq_read()
316 list_move_tail(&cb->list, &cl->rd_pending); in mei_cl_irq_read()
365 struct mei_cl *cl; in mei_irq_read_handler() local
457 list_for_each_entry(cl, &dev->file_list, link) { in mei_irq_read_handler()
458 if (mei_cl_hbm_equal(cl, mei_hdr)) { in mei_irq_read_handler()
459 cl_dbg(dev, cl, "got a message\n"); in mei_irq_read_handler()
460 ret = mei_cl_irq_read_msg(cl, mei_hdr, meta_hdr, cmpl_list); in mei_irq_read_handler()
511 struct mei_cl *cl; in mei_irq_write_handler() local
531 cl = cb->cl; in mei_irq_write_handler()
533 cl->status = 0; in mei_irq_write_handler()
534 cl_dbg(dev, cl, "MEI WRITE COMPLETE\n"); in mei_irq_write_handler()
535 cl->writing_state = MEI_WRITE_COMPLETE; in mei_irq_write_handler()
542 cl = cb->cl; in mei_irq_write_handler()
546 ret = mei_cl_irq_disconnect(cl, cb, cmpl_list); in mei_irq_write_handler()
553 ret = mei_cl_irq_read(cl, cb, cmpl_list); in mei_irq_write_handler()
560 ret = mei_cl_irq_connect(cl, cb, cmpl_list); in mei_irq_write_handler()
567 ret = mei_cl_irq_disconnect_rsp(cl, cb, cmpl_list); in mei_irq_write_handler()
574 ret = mei_cl_irq_notify(cl, cb, cmpl_list); in mei_irq_write_handler()
579 ret = mei_cl_irq_dma_map(cl, cb, cmpl_list); in mei_irq_write_handler()
584 ret = mei_cl_irq_dma_unmap(cl, cb, cmpl_list); in mei_irq_write_handler()
596 cl = cb->cl; in mei_irq_write_handler()
597 ret = mei_cl_irq_write(cl, cb, cmpl_list); in mei_irq_write_handler()
611 static void mei_connect_timeout(struct mei_cl *cl) in mei_connect_timeout() argument
613 struct mei_device *dev = cl->dev; in mei_connect_timeout()
615 if (cl->state == MEI_FILE_CONNECTING) { in mei_connect_timeout()
617 cl->state = MEI_FILE_DISCONNECT_REQUIRED; in mei_connect_timeout()
618 wake_up(&cl->wait); in mei_connect_timeout()
646 struct mei_cl *cl; in mei_timer() local
672 list_for_each_entry(cl, &dev->file_list, link) { in mei_timer()
673 if (cl->timer_count) { in mei_timer()
674 if (--cl->timer_count == 0) { in mei_timer()
676 mei_connect_timeout(cl); in mei_timer()