Lines Matching refs:txn

352 	struct qmi_txn txn;  in qcom_slim_qmi_send_select_inst_req()  local
355 rc = qmi_txn_init(ctrl->qmi.handle, &txn, in qcom_slim_qmi_send_select_inst_req()
362 rc = qmi_send_request(ctrl->qmi.handle, NULL, &txn, in qcom_slim_qmi_send_select_inst_req()
368 qmi_txn_cancel(&txn); in qcom_slim_qmi_send_select_inst_req()
372 rc = qmi_txn_wait(&txn, SLIMBUS_QMI_RESP_TOUT); in qcom_slim_qmi_send_select_inst_req()
389 struct qmi_txn *txn, const void *data) in qcom_slim_qmi_power_resp_cb() argument
398 complete(&txn->completion); in qcom_slim_qmi_power_resp_cb()
405 struct qmi_txn txn; in qcom_slim_qmi_send_power_request() local
408 rc = qmi_txn_init(ctrl->qmi.handle, &txn, in qcom_slim_qmi_send_power_request()
411 rc = qmi_send_request(ctrl->qmi.handle, NULL, &txn, in qcom_slim_qmi_send_power_request()
417 qmi_txn_cancel(&txn); in qcom_slim_qmi_send_power_request()
421 rc = qmi_txn_wait(&txn, SLIMBUS_QMI_RESP_TOUT); in qcom_slim_qmi_send_power_request()
780 struct slim_msg_txn *txn) in qcom_slim_ngd_xfer_msg() argument
790 u8 la = txn->la; in qcom_slim_ngd_xfer_msg()
793 if (txn->mt == SLIM_MSG_MT_CORE && in qcom_slim_ngd_xfer_msg()
794 (txn->mc >= SLIM_MSG_MC_BEGIN_RECONFIGURATION && in qcom_slim_ngd_xfer_msg()
795 txn->mc <= SLIM_MSG_MC_RECONFIGURE_NOW)) in qcom_slim_ngd_xfer_msg()
798 if (txn->dt == SLIM_MSG_DEST_ENUMADDR) in qcom_slim_ngd_xfer_msg()
801 if (txn->msg->num_bytes > SLIM_MSGQ_BUF_LEN || in qcom_slim_ngd_xfer_msg()
802 txn->rl > SLIM_MSGQ_BUF_LEN) { in qcom_slim_ngd_xfer_msg()
807 pbuf = qcom_slim_ngd_tx_msg_get(ctrl, txn->rl, &tx_sent); in qcom_slim_ngd_xfer_msg()
813 if (txn->mt == SLIM_MSG_MT_CORE && in qcom_slim_ngd_xfer_msg()
814 (txn->mc == SLIM_MSG_MC_CONNECT_SOURCE || in qcom_slim_ngd_xfer_msg()
815 txn->mc == SLIM_MSG_MC_CONNECT_SINK || in qcom_slim_ngd_xfer_msg()
816 txn->mc == SLIM_MSG_MC_DISCONNECT_PORT)) { in qcom_slim_ngd_xfer_msg()
817 txn->mt = SLIM_MSG_MT_DEST_REFERRED_USER; in qcom_slim_ngd_xfer_msg()
818 switch (txn->mc) { in qcom_slim_ngd_xfer_msg()
820 txn->mc = SLIM_USR_MC_CONNECT_SRC; in qcom_slim_ngd_xfer_msg()
823 txn->mc = SLIM_USR_MC_CONNECT_SINK; in qcom_slim_ngd_xfer_msg()
826 txn->mc = SLIM_USR_MC_DISCONNECT_PORT; in qcom_slim_ngd_xfer_msg()
834 wbuf[i++] = txn->la; in qcom_slim_ngd_xfer_msg()
836 wbuf[i++] = txn->msg->wbuf[0]; in qcom_slim_ngd_xfer_msg()
837 if (txn->mc != SLIM_USR_MC_DISCONNECT_PORT) in qcom_slim_ngd_xfer_msg()
838 wbuf[i++] = txn->msg->wbuf[1]; in qcom_slim_ngd_xfer_msg()
840 txn->comp = &done; in qcom_slim_ngd_xfer_msg()
841 ret = slim_alloc_txn_tid(sctrl, txn); in qcom_slim_ngd_xfer_msg()
847 wbuf[i++] = txn->tid; in qcom_slim_ngd_xfer_msg()
849 txn->msg->num_bytes = i; in qcom_slim_ngd_xfer_msg()
850 txn->msg->wbuf = wbuf; in qcom_slim_ngd_xfer_msg()
851 txn->msg->rbuf = rbuf; in qcom_slim_ngd_xfer_msg()
852 txn->rl = txn->msg->num_bytes + 4; in qcom_slim_ngd_xfer_msg()
856 txn->rl--; in qcom_slim_ngd_xfer_msg()
859 if (txn->dt == SLIM_MSG_DEST_LOGICALADDR) { in qcom_slim_ngd_xfer_msg()
860 *pbuf = SLIM_MSG_ASM_FIRST_WORD(txn->rl, txn->mt, txn->mc, 0, in qcom_slim_ngd_xfer_msg()
864 *pbuf = SLIM_MSG_ASM_FIRST_WORD(txn->rl, txn->mt, txn->mc, 1, in qcom_slim_ngd_xfer_msg()
869 if (slim_tid_txn(txn->mt, txn->mc)) in qcom_slim_ngd_xfer_msg()
870 *(puc++) = txn->tid; in qcom_slim_ngd_xfer_msg()
872 if (slim_ec_txn(txn->mt, txn->mc)) { in qcom_slim_ngd_xfer_msg()
873 *(puc++) = (txn->ec & 0xFF); in qcom_slim_ngd_xfer_msg()
874 *(puc++) = (txn->ec >> 8) & 0xFF; in qcom_slim_ngd_xfer_msg()
877 if (txn->msg && txn->msg->wbuf) in qcom_slim_ngd_xfer_msg()
878 memcpy(puc, txn->msg->wbuf, txn->msg->num_bytes); in qcom_slim_ngd_xfer_msg()
881 ret = qcom_slim_ngd_tx_msg_post(ctrl, pbuf, txn->rl); in qcom_slim_ngd_xfer_msg()
889 dev_err(sctrl->dev, "TX timed out:MC:0x%x,mt:0x%x", txn->mc, in qcom_slim_ngd_xfer_msg()
890 txn->mt); in qcom_slim_ngd_xfer_msg()
899 txn->mc, txn->mt); in qcom_slim_ngd_xfer_msg()
910 struct slim_msg_txn *txn) in qcom_slim_ngd_xfer_msg_sync() argument
917 txn->comp = &done; in qcom_slim_ngd_xfer_msg_sync()
919 ret = qcom_slim_ngd_xfer_msg(ctrl, txn); in qcom_slim_ngd_xfer_msg_sync()
925 dev_err(ctrl->dev, "TX timed out:MC:0x%x,mt:0x%x", txn->mc, in qcom_slim_ngd_xfer_msg_sync()
926 txn->mt); in qcom_slim_ngd_xfer_msg_sync()
939 struct slim_msg_txn txn = {0,}; in qcom_slim_ngd_enable_stream() local
942 txn.mt = SLIM_MSG_MT_DEST_REFERRED_USER; in qcom_slim_ngd_enable_stream()
943 txn.dt = SLIM_MSG_DEST_LOGICALADDR; in qcom_slim_ngd_enable_stream()
944 txn.la = SLIM_LA_MGR; in qcom_slim_ngd_enable_stream()
945 txn.ec = 0; in qcom_slim_ngd_enable_stream()
946 txn.msg = &msg; in qcom_slim_ngd_enable_stream()
947 txn.msg->num_bytes = 0; in qcom_slim_ngd_enable_stream()
948 txn.msg->wbuf = wbuf; in qcom_slim_ngd_enable_stream()
949 txn.msg->rbuf = rbuf; in qcom_slim_ngd_enable_stream()
954 if (txn.msg->num_bytes == 0) { in qcom_slim_ngd_enable_stream()
958 wbuf[txn.msg->num_bytes++] = sdev->laddr; in qcom_slim_ngd_enable_stream()
959 wbuf[txn.msg->num_bytes] = rt->bps >> 2 | in qcom_slim_ngd_enable_stream()
965 wbuf[txn.msg->num_bytes] |= BIT(5); in qcom_slim_ngd_enable_stream()
967 txn.msg->num_bytes++; in qcom_slim_ngd_enable_stream()
968 wbuf[txn.msg->num_bytes++] = exp << 4 | rt->prot; in qcom_slim_ngd_enable_stream()
971 wbuf[txn.msg->num_bytes++] = in qcom_slim_ngd_enable_stream()
975 wbuf[txn.msg->num_bytes++] = port->ch.prrate; in qcom_slim_ngd_enable_stream()
977 ret = slim_alloc_txn_tid(ctrl, &txn); in qcom_slim_ngd_enable_stream()
982 wbuf[txn.msg->num_bytes++] = txn.tid; in qcom_slim_ngd_enable_stream()
984 wbuf[txn.msg->num_bytes++] = port->ch.id; in qcom_slim_ngd_enable_stream()
987 txn.mc = SLIM_USR_MC_DEF_ACT_CHAN; in qcom_slim_ngd_enable_stream()
988 txn.rl = txn.msg->num_bytes + 4; in qcom_slim_ngd_enable_stream()
989 ret = qcom_slim_ngd_xfer_msg_sync(ctrl, &txn); in qcom_slim_ngd_enable_stream()
991 slim_free_txn_tid(ctrl, &txn); in qcom_slim_ngd_enable_stream()
992 dev_err(&sdev->dev, "TX timed out:MC:0x%x,mt:0x%x", txn.mc, in qcom_slim_ngd_enable_stream()
993 txn.mt); in qcom_slim_ngd_enable_stream()
997 txn.mc = SLIM_USR_MC_RECONFIG_NOW; in qcom_slim_ngd_enable_stream()
998 txn.msg->num_bytes = 2; in qcom_slim_ngd_enable_stream()
1000 txn.rl = txn.msg->num_bytes + 4; in qcom_slim_ngd_enable_stream()
1002 ret = slim_alloc_txn_tid(ctrl, &txn); in qcom_slim_ngd_enable_stream()
1008 wbuf[0] = txn.tid; in qcom_slim_ngd_enable_stream()
1009 ret = qcom_slim_ngd_xfer_msg_sync(ctrl, &txn); in qcom_slim_ngd_enable_stream()
1011 slim_free_txn_tid(ctrl, &txn); in qcom_slim_ngd_enable_stream()
1012 dev_err(&sdev->dev, "TX timed out:MC:0x%x,mt:0x%x", txn.mc, in qcom_slim_ngd_enable_stream()
1013 txn.mt); in qcom_slim_ngd_enable_stream()
1024 struct slim_msg_txn txn; in qcom_slim_ngd_get_laddr() local
1029 txn.mt = SLIM_MSG_MT_DEST_REFERRED_USER; in qcom_slim_ngd_get_laddr()
1030 txn.dt = SLIM_MSG_DEST_LOGICALADDR; in qcom_slim_ngd_get_laddr()
1031 txn.la = SLIM_LA_MGR; in qcom_slim_ngd_get_laddr()
1032 txn.ec = 0; in qcom_slim_ngd_get_laddr()
1034 txn.mc = SLIM_USR_MC_ADDR_QUERY; in qcom_slim_ngd_get_laddr()
1035 txn.rl = 11; in qcom_slim_ngd_get_laddr()
1036 txn.msg = &msg; in qcom_slim_ngd_get_laddr()
1037 txn.msg->num_bytes = 7; in qcom_slim_ngd_get_laddr()
1038 txn.msg->wbuf = wbuf; in qcom_slim_ngd_get_laddr()
1039 txn.msg->rbuf = rbuf; in qcom_slim_ngd_get_laddr()
1041 ret = slim_alloc_txn_tid(ctrl, &txn); in qcom_slim_ngd_get_laddr()
1045 wbuf[0] = (u8)txn.tid; in qcom_slim_ngd_get_laddr()
1048 ret = qcom_slim_ngd_xfer_msg_sync(ctrl, &txn); in qcom_slim_ngd_get_laddr()
1050 slim_free_txn_tid(ctrl, &txn); in qcom_slim_ngd_get_laddr()
1173 struct slim_msg_txn txn; in qcom_slim_ngd_master_worker() local
1180 txn.dt = SLIM_MSG_DEST_LOGICALADDR; in qcom_slim_ngd_master_worker()
1181 txn.ec = 0; in qcom_slim_ngd_master_worker()
1182 txn.mc = SLIM_USR_MC_REPORT_SATELLITE; in qcom_slim_ngd_master_worker()
1183 txn.mt = SLIM_MSG_MT_SRC_REFERRED_USER; in qcom_slim_ngd_master_worker()
1184 txn.la = SLIM_LA_MGR; in qcom_slim_ngd_master_worker()
1189 txn.msg = &msg; in qcom_slim_ngd_master_worker()
1190 txn.msg->wbuf = wbuf; in qcom_slim_ngd_master_worker()
1191 txn.msg->num_bytes = 4; in qcom_slim_ngd_master_worker()
1192 txn.rl = 8; in qcom_slim_ngd_master_worker()
1197 ret = qcom_slim_ngd_xfer_msg(&ctrl->ctrl, &txn); in qcom_slim_ngd_master_worker()