Lines Matching refs:cl
148 void mei_hbm_cl_hdr(struct mei_cl *cl, u8 hbm_cmd, void *buf, size_t len) in mei_hbm_cl_hdr() argument
155 cmd->host_addr = mei_cl_host_addr(cl); in mei_hbm_cl_hdr()
156 cmd->me_addr = mei_cl_me_id(cl); in mei_hbm_cl_hdr()
170 static inline int mei_hbm_cl_write(struct mei_device *dev, struct mei_cl *cl, in mei_hbm_cl_write() argument
176 mei_hbm_cl_hdr(cl, hbm_cmd, buf, len); in mei_hbm_cl_write()
191 bool mei_hbm_cl_addr_equal(struct mei_cl *cl, struct mei_hbm_cl_cmd *cmd) in mei_hbm_cl_addr_equal() argument
193 return mei_cl_host_addr(cl) == cmd->host_addr && in mei_hbm_cl_addr_equal()
194 mei_cl_me_id(cl) == cmd->me_addr; in mei_hbm_cl_addr_equal()
209 struct mei_cl *cl; in mei_hbm_cl_find_by_cmd() local
211 list_for_each_entry(cl, &dev->file_list, link) in mei_hbm_cl_find_by_cmd()
212 if (mei_hbm_cl_addr_equal(cl, cmd)) in mei_hbm_cl_find_by_cmd()
213 return cl; in mei_hbm_cl_find_by_cmd()
493 struct mei_cl *cl, u8 start) in mei_hbm_cl_notify_req() argument
501 mei_hbm_cl_hdr(cl, MEI_HBM_NOTIFY_REQ_CMD, &req, sizeof(req)); in mei_hbm_cl_notify_req()
537 struct mei_cl *cl, in mei_hbm_cl_notify_start_res() argument
543 cl_dbg(dev, cl, "hbm: notify start response status=%d\n", rs->status); in mei_hbm_cl_notify_start_res()
547 cl->notify_en = true; in mei_hbm_cl_notify_start_res()
548 cl->status = 0; in mei_hbm_cl_notify_start_res()
550 cl->status = -EINVAL; in mei_hbm_cl_notify_start_res()
563 struct mei_cl *cl, in mei_hbm_cl_notify_stop_res() argument
569 cl_dbg(dev, cl, "hbm: notify stop response status=%d\n", rs->status); in mei_hbm_cl_notify_stop_res()
573 cl->notify_en = false; in mei_hbm_cl_notify_stop_res()
574 cl->status = 0; in mei_hbm_cl_notify_stop_res()
577 cl->status = -EINVAL; in mei_hbm_cl_notify_stop_res()
590 struct mei_cl *cl; in mei_hbm_cl_notify() local
592 cl = mei_hbm_cl_find_by_cmd(dev, cmd); in mei_hbm_cl_notify()
593 if (cl) in mei_hbm_cl_notify()
594 mei_cl_notify(cl); in mei_hbm_cl_notify()
605 int mei_hbm_cl_dma_map_req(struct mei_device *dev, struct mei_cl *cl) in mei_hbm_cl_dma_map_req() argument
616 req.client_buffer_id = cl->dma.buffer_id; in mei_hbm_cl_dma_map_req()
617 req.address_lsb = lower_32_bits(cl->dma.daddr); in mei_hbm_cl_dma_map_req()
618 req.address_msb = upper_32_bits(cl->dma.daddr); in mei_hbm_cl_dma_map_req()
619 req.size = cl->dma.size; in mei_hbm_cl_dma_map_req()
636 int mei_hbm_cl_dma_unmap_req(struct mei_device *dev, struct mei_cl *cl) in mei_hbm_cl_dma_unmap_req() argument
647 req.client_buffer_id = cl->dma.buffer_id; in mei_hbm_cl_dma_unmap_req()
659 struct mei_cl *cl; in mei_hbm_cl_dma_map_res() local
662 cl = NULL; in mei_hbm_cl_dma_map_res()
666 if (!cb->cl->dma.buffer_id || cb->cl->dma_mapped) in mei_hbm_cl_dma_map_res()
669 cl = cb->cl; in mei_hbm_cl_dma_map_res()
672 if (!cl) in mei_hbm_cl_dma_map_res()
677 cl->status = -EFAULT; in mei_hbm_cl_dma_map_res()
680 cl->dma_mapped = 1; in mei_hbm_cl_dma_map_res()
681 cl->status = 0; in mei_hbm_cl_dma_map_res()
683 wake_up(&cl->wait); in mei_hbm_cl_dma_map_res()
689 struct mei_cl *cl; in mei_hbm_cl_dma_unmap_res() local
692 cl = NULL; in mei_hbm_cl_dma_unmap_res()
696 if (!cb->cl->dma.buffer_id || !cb->cl->dma_mapped) in mei_hbm_cl_dma_unmap_res()
699 cl = cb->cl; in mei_hbm_cl_dma_unmap_res()
702 if (!cl) in mei_hbm_cl_dma_unmap_res()
707 cl->status = -EFAULT; in mei_hbm_cl_dma_unmap_res()
710 cl->dma_mapped = 0; in mei_hbm_cl_dma_unmap_res()
711 cl->status = 0; in mei_hbm_cl_dma_unmap_res()
713 wake_up(&cl->wait); in mei_hbm_cl_dma_unmap_res()
819 int mei_hbm_cl_flow_control_req(struct mei_device *dev, struct mei_cl *cl) in mei_hbm_cl_flow_control_req() argument
823 cl_dbg(dev, cl, "sending flow control\n"); in mei_hbm_cl_flow_control_req()
824 return mei_hbm_cl_write(dev, cl, MEI_FLOW_CONTROL_CMD, in mei_hbm_cl_flow_control_req()
872 struct mei_cl *cl; in mei_hbm_cl_tx_flow_ctrl_creds_res() local
880 cl = mei_hbm_cl_find_by_cmd(dev, fctrl); in mei_hbm_cl_tx_flow_ctrl_creds_res()
881 if (cl) { in mei_hbm_cl_tx_flow_ctrl_creds_res()
882 cl->tx_flow_ctrl_creds++; in mei_hbm_cl_tx_flow_ctrl_creds_res()
883 cl_dbg(dev, cl, "flow control creds = %d.\n", in mei_hbm_cl_tx_flow_ctrl_creds_res()
884 cl->tx_flow_ctrl_creds); in mei_hbm_cl_tx_flow_ctrl_creds_res()
897 int mei_hbm_cl_disconnect_req(struct mei_device *dev, struct mei_cl *cl) in mei_hbm_cl_disconnect_req() argument
901 return mei_hbm_cl_write(dev, cl, CLIENT_DISCONNECT_REQ_CMD, in mei_hbm_cl_disconnect_req()
913 int mei_hbm_cl_disconnect_rsp(struct mei_device *dev, struct mei_cl *cl) in mei_hbm_cl_disconnect_rsp() argument
917 return mei_hbm_cl_write(dev, cl, CLIENT_DISCONNECT_RES_CMD, in mei_hbm_cl_disconnect_rsp()
929 static void mei_hbm_cl_disconnect_res(struct mei_device *dev, struct mei_cl *cl, in mei_hbm_cl_disconnect_res() argument
935 cl_dbg(dev, cl, "hbm: disconnect response status=%d\n", rs->status); in mei_hbm_cl_disconnect_res()
938 cl->state = MEI_FILE_DISCONNECT_REPLY; in mei_hbm_cl_disconnect_res()
939 cl->status = 0; in mei_hbm_cl_disconnect_res()
950 int mei_hbm_cl_connect_req(struct mei_device *dev, struct mei_cl *cl) in mei_hbm_cl_connect_req() argument
954 return mei_hbm_cl_write(dev, cl, CLIENT_CONNECT_REQ_CMD, in mei_hbm_cl_connect_req()
966 static void mei_hbm_cl_connect_res(struct mei_device *dev, struct mei_cl *cl, in mei_hbm_cl_connect_res() argument
972 cl_dbg(dev, cl, "hbm: connect response status=%s\n", in mei_hbm_cl_connect_res()
976 cl->state = MEI_FILE_CONNECTED; in mei_hbm_cl_connect_res()
978 cl->state = MEI_FILE_DISCONNECT_REPLY; in mei_hbm_cl_connect_res()
980 mei_me_cl_del(dev, cl->me_cl); in mei_hbm_cl_connect_res()
985 cl->status = mei_cl_conn_status_to_errno(rs->status); in mei_hbm_cl_connect_res()
1000 struct mei_cl *cl; in mei_hbm_cl_res() local
1003 cl = NULL; in mei_hbm_cl_res()
1006 cl = cb->cl; in mei_hbm_cl_res()
1011 if (mei_hbm_cl_addr_equal(cl, rs)) { in mei_hbm_cl_res()
1017 if (!cl) in mei_hbm_cl_res()
1022 mei_hbm_cl_connect_res(dev, cl, rs); in mei_hbm_cl_res()
1025 mei_hbm_cl_disconnect_res(dev, cl, rs); in mei_hbm_cl_res()
1028 mei_hbm_cl_notify_start_res(dev, cl, rs); in mei_hbm_cl_res()
1031 mei_hbm_cl_notify_stop_res(dev, cl, rs); in mei_hbm_cl_res()
1037 cl->timer_count = 0; in mei_hbm_cl_res()
1038 wake_up(&cl->wait); in mei_hbm_cl_res()
1054 struct mei_cl *cl; in mei_hbm_fw_disconnect_req() local
1057 cl = mei_hbm_cl_find_by_cmd(dev, disconnect_req); in mei_hbm_fw_disconnect_req()
1058 if (cl) { in mei_hbm_fw_disconnect_req()
1059 cl_warn(dev, cl, "fw disconnect request received\n"); in mei_hbm_fw_disconnect_req()
1060 cl->state = MEI_FILE_DISCONNECTING; in mei_hbm_fw_disconnect_req()
1061 cl->timer_count = 0; in mei_hbm_fw_disconnect_req()
1063 cb = mei_cl_enqueue_ctrl_wr_cb(cl, 0, MEI_FOP_DISCONNECT_RSP, in mei_hbm_fw_disconnect_req()