Lines Matching refs:cb

42 	struct mei_cl_cb *cb, *next;  in mei_irq_compl_handler()  local
45 list_for_each_entry_safe(cb, next, cmpl_list, list) { in mei_irq_compl_handler()
46 cl = cb->cl; in mei_irq_compl_handler()
47 list_del_init(&cb->list); in mei_irq_compl_handler()
50 mei_cl_complete(cl, cb); in mei_irq_compl_handler()
101 struct mei_cl_cb *cb; in mei_cl_irq_read_msg() local
104 cb = list_first_entry_or_null(&cl->rd_pending, struct mei_cl_cb, list); in mei_cl_irq_read_msg()
105 if (!cb) { in mei_cl_irq_read_msg()
110 cb = mei_cl_alloc_cb(cl, mei_cl_mtu(cl), MEI_FOP_READ, cl->fp); in mei_cl_irq_read_msg()
111 if (!cb) in mei_cl_irq_read_msg()
113 list_add_tail(&cb->list, &cl->rd_pending); in mei_cl_irq_read_msg()
118 cb->status = -ENODEV; in mei_cl_irq_read_msg()
122 buf_sz = mei_hdr->length + cb->buf_idx; in mei_cl_irq_read_msg()
124 if (buf_sz < cb->buf_idx) { in mei_cl_irq_read_msg()
126 mei_hdr->length, cb->buf_idx); in mei_cl_irq_read_msg()
127 cb->status = -EMSGSIZE; in mei_cl_irq_read_msg()
131 if (cb->buf.size < buf_sz) { in mei_cl_irq_read_msg()
133 cb->buf.size, mei_hdr->length, cb->buf_idx); in mei_cl_irq_read_msg()
134 cb->status = -EMSGSIZE; in mei_cl_irq_read_msg()
138 mei_read_slots(dev, cb->buf.data + cb->buf_idx, mei_hdr->length); in mei_cl_irq_read_msg()
140 cb->buf_idx += mei_hdr->length; in mei_cl_irq_read_msg()
143 cl_dbg(dev, cl, "completed read length = %zu\n", cb->buf_idx); in mei_cl_irq_read_msg()
144 list_move_tail(&cb->list, cmpl_list); in mei_cl_irq_read_msg()
153 if (cb) in mei_cl_irq_read_msg()
154 list_move_tail(&cb->list, cmpl_list); in mei_cl_irq_read_msg()
168 static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb, in mei_cl_irq_disconnect_rsp() argument
185 list_move_tail(&cb->list, cmpl_list); in mei_cl_irq_disconnect_rsp()
200 static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb, in mei_cl_irq_read() argument
222 cb->buf_idx = 0; in mei_cl_irq_read()
223 list_move_tail(&cb->list, cmpl_list); in mei_cl_irq_read()
227 list_move_tail(&cb->list, &cl->rd_pending); in mei_cl_irq_read()
366 struct mei_cl_cb *cb, *next; in mei_irq_write_handler() local
384 list_for_each_entry_safe(cb, next, &dev->write_waiting_list, list) { in mei_irq_write_handler()
385 cl = cb->cl; in mei_irq_write_handler()
390 list_move_tail(&cb->list, cmpl_list); in mei_irq_write_handler()
395 list_for_each_entry_safe(cb, next, &dev->ctrl_wr_list, list) { in mei_irq_write_handler()
396 cl = cb->cl; in mei_irq_write_handler()
397 switch (cb->fop_type) { in mei_irq_write_handler()
400 ret = mei_cl_irq_disconnect(cl, cb, cmpl_list); in mei_irq_write_handler()
407 ret = mei_cl_irq_read(cl, cb, cmpl_list); in mei_irq_write_handler()
414 ret = mei_cl_irq_connect(cl, cb, cmpl_list); in mei_irq_write_handler()
421 ret = mei_cl_irq_disconnect_rsp(cl, cb, cmpl_list); in mei_irq_write_handler()
428 ret = mei_cl_irq_notify(cl, cb, cmpl_list); in mei_irq_write_handler()
439 list_for_each_entry_safe(cb, next, &dev->write_list, list) { in mei_irq_write_handler()
440 cl = cb->cl; in mei_irq_write_handler()
441 ret = mei_cl_irq_write(cl, cb, cmpl_list); in mei_irq_write_handler()