Lines Matching refs:txn
26 struct slim_msg_txn *txn; in slim_msg_response() local
31 txn = idr_find(&ctrl->tid_idr, tid); in slim_msg_response()
34 if (txn == NULL) in slim_msg_response()
37 msg = txn->msg; in slim_msg_response()
44 slim_free_txn_tid(ctrl, txn); in slim_msg_response()
46 if (txn->comp) in slim_msg_response()
47 complete(txn->comp); in slim_msg_response()
63 int slim_alloc_txn_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn) in slim_alloc_txn_tid() argument
69 ret = idr_alloc_cyclic(&ctrl->tid_idr, txn, 0, in slim_alloc_txn_tid()
75 txn->tid = ret; in slim_alloc_txn_tid()
87 void slim_free_txn_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn) in slim_free_txn_tid() argument
92 idr_remove(&ctrl->tid_idr, txn->tid); in slim_free_txn_tid()
110 int slim_do_transfer(struct slim_controller *ctrl, struct slim_msg_txn *txn) in slim_do_transfer() argument
121 (txn->mt == SLIM_MSG_MT_CORE && in slim_do_transfer()
122 txn->mc >= SLIM_MSG_MC_BEGIN_RECONFIGURATION && in slim_do_transfer()
123 txn->mc <= SLIM_MSG_MC_RECONFIGURE_NOW)) in slim_do_transfer()
135 need_tid = slim_tid_txn(txn->mt, txn->mc); in slim_do_transfer()
138 ret = slim_alloc_txn_tid(ctrl, txn); in slim_do_transfer()
142 if (!txn->msg->comp) in slim_do_transfer()
143 txn->comp = &done; in slim_do_transfer()
145 txn->comp = txn->comp; in slim_do_transfer()
148 ret = ctrl->xfer_msg(ctrl, txn); in slim_do_transfer()
150 if (!ret && need_tid && !txn->msg->comp) { in slim_do_transfer()
151 unsigned long ms = txn->rl + HZ; in slim_do_transfer()
153 timeout = wait_for_completion_timeout(txn->comp, in slim_do_transfer()
157 slim_free_txn_tid(ctrl, txn); in slim_do_transfer()
163 txn->mt, txn->mc, txn->la, ret); in slim_do_transfer()
236 struct slim_msg_txn *txn = &txn_stack; in slim_xfer_msg() local
253 txn->ec = ((sl | (1 << 3)) | ((msg->start_offset & 0xFFF) << 4)); in slim_xfer_msg()
260 txn->rl += msg->num_bytes; in slim_xfer_msg()
265 if (slim_tid_txn(txn->mt, txn->mc)) in slim_xfer_msg()
266 txn->rl++; in slim_xfer_msg()
268 return slim_do_transfer(ctrl, txn); in slim_xfer_msg()