Lines Matching refs:cl

55 static inline void ishtp_hbm_cl_hdr(struct ishtp_cl *cl, uint8_t hbm_cmd,  in ishtp_hbm_cl_hdr()  argument
63 cmd->host_addr = cl->host_client_id; in ishtp_hbm_cl_hdr()
64 cmd->fw_addr = cl->fw_client_id; in ishtp_hbm_cl_hdr()
76 static inline bool ishtp_hbm_cl_addr_equal(struct ishtp_cl *cl, void *buf) in ishtp_hbm_cl_addr_equal() argument
80 return cl->host_client_id == cmd->host_addr && in ishtp_hbm_cl_addr_equal()
81 cl->fw_client_id == cmd->fw_addr; in ishtp_hbm_cl_addr_equal()
262 struct ishtp_cl *cl) in ishtp_hbm_cl_flow_control_req() argument
270 spin_lock_irqsave(&cl->fc_spinlock, flags); in ishtp_hbm_cl_flow_control_req()
273 ishtp_hbm_cl_hdr(cl, ISHTP_FLOW_CONTROL_CMD, &flow_ctrl, len); in ishtp_hbm_cl_flow_control_req()
279 if (cl->out_flow_ctrl_creds) { in ishtp_hbm_cl_flow_control_req()
280 spin_unlock_irqrestore(&cl->fc_spinlock, flags); in ishtp_hbm_cl_flow_control_req()
284 cl->recv_msg_num_frags = 0; in ishtp_hbm_cl_flow_control_req()
288 ++cl->out_flow_ctrl_creds; in ishtp_hbm_cl_flow_control_req()
289 ++cl->out_flow_ctrl_cnt; in ishtp_hbm_cl_flow_control_req()
290 cl->ts_out_fc = ktime_get(); in ishtp_hbm_cl_flow_control_req()
291 if (cl->ts_rx) { in ishtp_hbm_cl_flow_control_req()
292 ktime_t ts_diff = ktime_sub(cl->ts_out_fc, cl->ts_rx); in ishtp_hbm_cl_flow_control_req()
293 if (ktime_after(ts_diff, cl->ts_max_fc_delay)) in ishtp_hbm_cl_flow_control_req()
294 cl->ts_max_fc_delay = ts_diff; in ishtp_hbm_cl_flow_control_req()
297 ++cl->err_send_fc; in ishtp_hbm_cl_flow_control_req()
300 spin_unlock_irqrestore(&cl->fc_spinlock, flags); in ishtp_hbm_cl_flow_control_req()
313 int ishtp_hbm_cl_disconnect_req(struct ishtp_device *dev, struct ishtp_cl *cl) in ishtp_hbm_cl_disconnect_req() argument
320 ishtp_hbm_cl_hdr(cl, CLIENT_DISCONNECT_REQ_CMD, &disconn_req, len); in ishtp_hbm_cl_disconnect_req()
335 struct ishtp_cl *cl = NULL; in ishtp_hbm_cl_disconnect_res() local
339 list_for_each_entry(cl, &dev->cl_list, link) { in ishtp_hbm_cl_disconnect_res()
340 if (!rs->status && ishtp_hbm_cl_addr_equal(cl, rs)) { in ishtp_hbm_cl_disconnect_res()
341 cl->state = ISHTP_CL_DISCONNECTED; in ishtp_hbm_cl_disconnect_res()
342 wake_up_interruptible(&cl->wait_ctrl_res); in ishtp_hbm_cl_disconnect_res()
358 int ishtp_hbm_cl_connect_req(struct ishtp_device *dev, struct ishtp_cl *cl) in ishtp_hbm_cl_connect_req() argument
365 ishtp_hbm_cl_hdr(cl, CLIENT_CONNECT_REQ_CMD, &conn_req, len); in ishtp_hbm_cl_connect_req()
380 struct ishtp_cl *cl = NULL; in ishtp_hbm_cl_connect_res() local
384 list_for_each_entry(cl, &dev->cl_list, link) { in ishtp_hbm_cl_connect_res()
385 if (ishtp_hbm_cl_addr_equal(cl, rs)) { in ishtp_hbm_cl_connect_res()
387 cl->state = ISHTP_CL_CONNECTED; in ishtp_hbm_cl_connect_res()
388 cl->status = 0; in ishtp_hbm_cl_connect_res()
390 cl->state = ISHTP_CL_DISCONNECTED; in ishtp_hbm_cl_connect_res()
391 cl->status = -ENODEV; in ishtp_hbm_cl_connect_res()
393 wake_up_interruptible(&cl->wait_ctrl_res); in ishtp_hbm_cl_connect_res()
410 struct ishtp_cl *cl; in ishtp_hbm_fw_disconnect_req() local
417 list_for_each_entry(cl, &dev->cl_list, link) { in ishtp_hbm_fw_disconnect_req()
418 if (ishtp_hbm_cl_addr_equal(cl, disconnect_req)) { in ishtp_hbm_fw_disconnect_req()
419 cl->state = ISHTP_CL_DISCONNECTED; in ishtp_hbm_fw_disconnect_req()
423 ishtp_hbm_cl_hdr(cl, CLIENT_DISCONNECT_RES_CMD, data, in ishtp_hbm_fw_disconnect_req()
447 struct ishtp_cl *cl; in ishtp_hbm_dma_xfer_ack() local
466 list_for_each_entry(cl, &dev->cl_list, link) { in ishtp_hbm_dma_xfer_ack()
467 if (cl->fw_client_id == dma_xfer->fw_client_id && in ishtp_hbm_dma_xfer_ack()
468 cl->host_client_id == dma_xfer->host_client_id) in ishtp_hbm_dma_xfer_ack()
475 if (cl->last_dma_addr >= in ishtp_hbm_dma_xfer_ack()
477 cl->last_dma_addr < in ishtp_hbm_dma_xfer_ack()
480 cl->last_dma_acked = 1; in ishtp_hbm_dma_xfer_ack()
482 if (!list_empty(&cl->tx_list.list) && in ishtp_hbm_dma_xfer_ack()
483 cl->ishtp_flow_ctrl_creds) { in ishtp_hbm_dma_xfer_ack()
487 ishtp_cl_send_msg(dev, cl); in ishtp_hbm_dma_xfer_ack()
782 struct ishtp_cl *cl = NULL; in recv_hbm() local
786 list_for_each_entry(cl, &dev->cl_list, link) { in recv_hbm()
787 if (cl->host_client_id == flow_control->host_addr && in recv_hbm()
788 cl->fw_client_id == in recv_hbm()
796 if (cl->ishtp_flow_ctrl_creds) in recv_hbm()
799 (unsigned int)cl->fw_client_id, in recv_hbm()
800 (unsigned int)cl->host_client_id, in recv_hbm()
801 cl->ishtp_flow_ctrl_creds); in recv_hbm()
803 ++cl->ishtp_flow_ctrl_creds; in recv_hbm()
804 ++cl->ishtp_flow_ctrl_cnt; in recv_hbm()
805 cl->last_ipc_acked = 1; in recv_hbm()
807 &cl->tx_list_spinlock, in recv_hbm()
809 if (!list_empty(&cl->tx_list.list)) { in recv_hbm()
815 &cl->tx_list_spinlock, in recv_hbm()
817 ishtp_cl_send_msg(dev, cl); in recv_hbm()
820 &cl->tx_list_spinlock, in recv_hbm()