Lines Matching refs:txn
341 struct qmi_txn txn; in qcom_slim_qmi_send_select_inst_req() local
344 rc = qmi_txn_init(ctrl->qmi.handle, &txn, in qcom_slim_qmi_send_select_inst_req()
351 rc = qmi_send_request(ctrl->qmi.handle, NULL, &txn, in qcom_slim_qmi_send_select_inst_req()
357 qmi_txn_cancel(&txn); in qcom_slim_qmi_send_select_inst_req()
361 rc = qmi_txn_wait(&txn, SLIMBUS_QMI_RESP_TOUT); in qcom_slim_qmi_send_select_inst_req()
378 struct qmi_txn *txn, const void *data) in qcom_slim_qmi_power_resp_cb() argument
387 complete(&txn->completion); in qcom_slim_qmi_power_resp_cb()
394 struct qmi_txn txn; in qcom_slim_qmi_send_power_request() local
397 rc = qmi_txn_init(ctrl->qmi.handle, &txn, in qcom_slim_qmi_send_power_request()
400 rc = qmi_send_request(ctrl->qmi.handle, NULL, &txn, in qcom_slim_qmi_send_power_request()
406 qmi_txn_cancel(&txn); in qcom_slim_qmi_send_power_request()
410 rc = qmi_txn_wait(&txn, SLIMBUS_QMI_RESP_TOUT); in qcom_slim_qmi_send_power_request()
767 struct slim_msg_txn *txn) in qcom_slim_ngd_xfer_msg() argument
777 u8 la = txn->la; in qcom_slim_ngd_xfer_msg()
780 if (txn->mt == SLIM_MSG_MT_CORE && in qcom_slim_ngd_xfer_msg()
781 (txn->mc >= SLIM_MSG_MC_BEGIN_RECONFIGURATION && in qcom_slim_ngd_xfer_msg()
782 txn->mc <= SLIM_MSG_MC_RECONFIGURE_NOW)) in qcom_slim_ngd_xfer_msg()
785 if (txn->dt == SLIM_MSG_DEST_ENUMADDR) in qcom_slim_ngd_xfer_msg()
788 if (txn->msg->num_bytes > SLIM_MSGQ_BUF_LEN || in qcom_slim_ngd_xfer_msg()
789 txn->rl > SLIM_MSGQ_BUF_LEN) { in qcom_slim_ngd_xfer_msg()
794 pbuf = qcom_slim_ngd_tx_msg_get(ctrl, txn->rl, &tx_sent); in qcom_slim_ngd_xfer_msg()
800 if (txn->mt == SLIM_MSG_MT_CORE && in qcom_slim_ngd_xfer_msg()
801 (txn->mc == SLIM_MSG_MC_CONNECT_SOURCE || in qcom_slim_ngd_xfer_msg()
802 txn->mc == SLIM_MSG_MC_CONNECT_SINK || in qcom_slim_ngd_xfer_msg()
803 txn->mc == SLIM_MSG_MC_DISCONNECT_PORT)) { in qcom_slim_ngd_xfer_msg()
804 txn->mt = SLIM_MSG_MT_DEST_REFERRED_USER; in qcom_slim_ngd_xfer_msg()
805 switch (txn->mc) { in qcom_slim_ngd_xfer_msg()
807 txn->mc = SLIM_USR_MC_CONNECT_SRC; in qcom_slim_ngd_xfer_msg()
810 txn->mc = SLIM_USR_MC_CONNECT_SINK; in qcom_slim_ngd_xfer_msg()
813 txn->mc = SLIM_USR_MC_DISCONNECT_PORT; in qcom_slim_ngd_xfer_msg()
821 wbuf[i++] = txn->la; in qcom_slim_ngd_xfer_msg()
823 wbuf[i++] = txn->msg->wbuf[0]; in qcom_slim_ngd_xfer_msg()
824 if (txn->mc != SLIM_USR_MC_DISCONNECT_PORT) in qcom_slim_ngd_xfer_msg()
825 wbuf[i++] = txn->msg->wbuf[1]; in qcom_slim_ngd_xfer_msg()
827 txn->comp = &done; in qcom_slim_ngd_xfer_msg()
828 ret = slim_alloc_txn_tid(sctrl, txn); in qcom_slim_ngd_xfer_msg()
834 wbuf[i++] = txn->tid; in qcom_slim_ngd_xfer_msg()
836 txn->msg->num_bytes = i; in qcom_slim_ngd_xfer_msg()
837 txn->msg->wbuf = wbuf; in qcom_slim_ngd_xfer_msg()
838 txn->msg->rbuf = rbuf; in qcom_slim_ngd_xfer_msg()
839 txn->rl = txn->msg->num_bytes + 4; in qcom_slim_ngd_xfer_msg()
843 txn->rl--; in qcom_slim_ngd_xfer_msg()
846 if (txn->dt == SLIM_MSG_DEST_LOGICALADDR) { in qcom_slim_ngd_xfer_msg()
847 *pbuf = SLIM_MSG_ASM_FIRST_WORD(txn->rl, txn->mt, txn->mc, 0, in qcom_slim_ngd_xfer_msg()
851 *pbuf = SLIM_MSG_ASM_FIRST_WORD(txn->rl, txn->mt, txn->mc, 1, in qcom_slim_ngd_xfer_msg()
856 if (slim_tid_txn(txn->mt, txn->mc)) in qcom_slim_ngd_xfer_msg()
857 *(puc++) = txn->tid; in qcom_slim_ngd_xfer_msg()
859 if (slim_ec_txn(txn->mt, txn->mc)) { in qcom_slim_ngd_xfer_msg()
860 *(puc++) = (txn->ec & 0xFF); in qcom_slim_ngd_xfer_msg()
861 *(puc++) = (txn->ec >> 8) & 0xFF; in qcom_slim_ngd_xfer_msg()
864 if (txn->msg && txn->msg->wbuf) in qcom_slim_ngd_xfer_msg()
865 memcpy(puc, txn->msg->wbuf, txn->msg->num_bytes); in qcom_slim_ngd_xfer_msg()
867 ret = qcom_slim_ngd_tx_msg_post(ctrl, pbuf, txn->rl); in qcom_slim_ngd_xfer_msg()
873 dev_err(sctrl->dev, "TX timed out:MC:0x%x,mt:0x%x", txn->mc, in qcom_slim_ngd_xfer_msg()
874 txn->mt); in qcom_slim_ngd_xfer_msg()
882 txn->mc, txn->mt); in qcom_slim_ngd_xfer_msg()
891 struct slim_msg_txn *txn) in qcom_slim_ngd_xfer_msg_sync() argument
898 txn->comp = &done; in qcom_slim_ngd_xfer_msg_sync()
900 ret = qcom_slim_ngd_xfer_msg(ctrl, txn); in qcom_slim_ngd_xfer_msg_sync()
906 dev_err(ctrl->dev, "TX timed out:MC:0x%x,mt:0x%x", txn->mc, in qcom_slim_ngd_xfer_msg_sync()
907 txn->mt); in qcom_slim_ngd_xfer_msg_sync()
920 struct slim_msg_txn txn = {0,}; in qcom_slim_ngd_enable_stream() local
923 txn.mt = SLIM_MSG_MT_DEST_REFERRED_USER; in qcom_slim_ngd_enable_stream()
924 txn.dt = SLIM_MSG_DEST_LOGICALADDR; in qcom_slim_ngd_enable_stream()
925 txn.la = SLIM_LA_MGR; in qcom_slim_ngd_enable_stream()
926 txn.ec = 0; in qcom_slim_ngd_enable_stream()
927 txn.msg = &msg; in qcom_slim_ngd_enable_stream()
928 txn.msg->num_bytes = 0; in qcom_slim_ngd_enable_stream()
929 txn.msg->wbuf = wbuf; in qcom_slim_ngd_enable_stream()
930 txn.msg->rbuf = rbuf; in qcom_slim_ngd_enable_stream()
935 if (txn.msg->num_bytes == 0) { in qcom_slim_ngd_enable_stream()
939 wbuf[txn.msg->num_bytes++] = sdev->laddr; in qcom_slim_ngd_enable_stream()
940 wbuf[txn.msg->num_bytes] = rt->bps >> 2 | in qcom_slim_ngd_enable_stream()
946 wbuf[txn.msg->num_bytes] |= BIT(5); in qcom_slim_ngd_enable_stream()
948 txn.msg->num_bytes++; in qcom_slim_ngd_enable_stream()
949 wbuf[txn.msg->num_bytes++] = exp << 4 | rt->prot; in qcom_slim_ngd_enable_stream()
952 wbuf[txn.msg->num_bytes++] = in qcom_slim_ngd_enable_stream()
956 wbuf[txn.msg->num_bytes++] = port->ch.prrate; in qcom_slim_ngd_enable_stream()
958 ret = slim_alloc_txn_tid(ctrl, &txn); in qcom_slim_ngd_enable_stream()
963 wbuf[txn.msg->num_bytes++] = txn.tid; in qcom_slim_ngd_enable_stream()
965 wbuf[txn.msg->num_bytes++] = port->ch.id; in qcom_slim_ngd_enable_stream()
968 txn.mc = SLIM_USR_MC_DEF_ACT_CHAN; in qcom_slim_ngd_enable_stream()
969 txn.rl = txn.msg->num_bytes + 4; in qcom_slim_ngd_enable_stream()
970 ret = qcom_slim_ngd_xfer_msg_sync(ctrl, &txn); in qcom_slim_ngd_enable_stream()
972 slim_free_txn_tid(ctrl, &txn); in qcom_slim_ngd_enable_stream()
973 dev_err(&sdev->dev, "TX timed out:MC:0x%x,mt:0x%x", txn.mc, in qcom_slim_ngd_enable_stream()
974 txn.mt); in qcom_slim_ngd_enable_stream()
978 txn.mc = SLIM_USR_MC_RECONFIG_NOW; in qcom_slim_ngd_enable_stream()
979 txn.msg->num_bytes = 2; in qcom_slim_ngd_enable_stream()
981 txn.rl = txn.msg->num_bytes + 4; in qcom_slim_ngd_enable_stream()
983 ret = slim_alloc_txn_tid(ctrl, &txn); in qcom_slim_ngd_enable_stream()
989 wbuf[0] = txn.tid; in qcom_slim_ngd_enable_stream()
990 ret = qcom_slim_ngd_xfer_msg_sync(ctrl, &txn); in qcom_slim_ngd_enable_stream()
992 slim_free_txn_tid(ctrl, &txn); in qcom_slim_ngd_enable_stream()
993 dev_err(&sdev->dev, "TX timed out:MC:0x%x,mt:0x%x", txn.mc, in qcom_slim_ngd_enable_stream()
994 txn.mt); in qcom_slim_ngd_enable_stream()
1005 struct slim_msg_txn txn; in qcom_slim_ngd_get_laddr() local
1010 txn.mt = SLIM_MSG_MT_DEST_REFERRED_USER; in qcom_slim_ngd_get_laddr()
1011 txn.dt = SLIM_MSG_DEST_LOGICALADDR; in qcom_slim_ngd_get_laddr()
1012 txn.la = SLIM_LA_MGR; in qcom_slim_ngd_get_laddr()
1013 txn.ec = 0; in qcom_slim_ngd_get_laddr()
1015 txn.mc = SLIM_USR_MC_ADDR_QUERY; in qcom_slim_ngd_get_laddr()
1016 txn.rl = 11; in qcom_slim_ngd_get_laddr()
1017 txn.msg = &msg; in qcom_slim_ngd_get_laddr()
1018 txn.msg->num_bytes = 7; in qcom_slim_ngd_get_laddr()
1019 txn.msg->wbuf = wbuf; in qcom_slim_ngd_get_laddr()
1020 txn.msg->rbuf = rbuf; in qcom_slim_ngd_get_laddr()
1022 ret = slim_alloc_txn_tid(ctrl, &txn); in qcom_slim_ngd_get_laddr()
1026 wbuf[0] = (u8)txn.tid; in qcom_slim_ngd_get_laddr()
1029 ret = qcom_slim_ngd_xfer_msg_sync(ctrl, &txn); in qcom_slim_ngd_get_laddr()
1031 slim_free_txn_tid(ctrl, &txn); in qcom_slim_ngd_get_laddr()
1152 struct slim_msg_txn txn; in qcom_slim_ngd_master_worker() local
1159 txn.dt = SLIM_MSG_DEST_LOGICALADDR; in qcom_slim_ngd_master_worker()
1160 txn.ec = 0; in qcom_slim_ngd_master_worker()
1161 txn.mc = SLIM_USR_MC_REPORT_SATELLITE; in qcom_slim_ngd_master_worker()
1162 txn.mt = SLIM_MSG_MT_SRC_REFERRED_USER; in qcom_slim_ngd_master_worker()
1163 txn.la = SLIM_LA_MGR; in qcom_slim_ngd_master_worker()
1168 txn.msg = &msg; in qcom_slim_ngd_master_worker()
1169 txn.msg->wbuf = wbuf; in qcom_slim_ngd_master_worker()
1170 txn.msg->num_bytes = 4; in qcom_slim_ngd_master_worker()
1171 txn.rl = 8; in qcom_slim_ngd_master_worker()
1176 ret = qcom_slim_ngd_xfer_msg(&ctrl->ctrl, &txn); in qcom_slim_ngd_master_worker()