Lines Matching defs:trp

67 atp_req_timeout(trp)
68 register struct atp_trans *trp;
75 if ((atp = trp->tr_queue) == 0)
81 if (ctrp == trp)
84 if (ctrp != trp)
87 if ((m = gbuf_cont(trp->tr_xmt)) == NULL)
88 m = trp->tr_xmt; /* issued via the new interface */
90 if (trp->tr_retry == 0) {
91 trp->tr_state = TRANS_FAILED;
92 if (m == trp->tr_xmt) {
93 trp->tr_xmt = NULL;
98 gref = trp->tr_queue->atp_gref;
104 trp->tr_local_socket));
105 m = trp->tr_xmt;
106 switch(((ioc_t *)(gbuf_rptr(trp->tr_xmt)))->ioc_cmd) {
108 trp->tr_xmt = NULL;
109 if (trp->tr_queue->dflag)
111 else if (trp->tr_bdsp == NULL) {
113 if (trp->tr_rsp_wait)
114 wakeup(&trp->tr_event);
117 atp_iocnak(trp->tr_queue, m, ETIMEDOUT);
118 atp_free(trp);
123 trp->tr_xmt = gbuf_cont(m);
128 (AT_ATP_HDR(m))->bitmap = trp->tr_bitmap;
130 if (trp->tr_retry != (unsigned int) ATP_INFINITE_RETRIES)
131 trp->tr_retry--;
132 atp_send(trp);
143 void atp_free(trp)
144 register struct atp_trans *trp;
150 ("atp_free: freeing trp 0x%x\n", (u_int) trp));
153 if (trp->tr_state == TRANS_ABORTING) {
154 ATP_Q_REMOVE(atp_trans_abort, trp, tr_list);
155 trp->tr_state = TRANS_DONE;
158 if (trp->tr_tmo_func)
159 atp_untimout(atp_req_timeout, trp);
161 atp = trp->tr_queue;
162 ATP_Q_REMOVE(atp->atp_trans_wait, trp, tr_list);
164 if (trp->tr_xmt) {
165 gbuf_freem(trp->tr_xmt);
166 trp->tr_xmt = NULL;
169 if (trp->tr_rcv[i]) {
170 gbuf_freem(trp->tr_rcv[i]);
171 trp->tr_rcv[i] = NULL;
174 if (trp->tr_bdsp) {
175 gbuf_freem(trp->tr_bdsp);
176 trp->tr_bdsp = NULL;
179 if (trp->tr_rsp_wait) {
180 trp->tr_state = TRANS_ABORTING;
181 ATP_Q_APPEND(atp_trans_abort, trp, tr_list);
182 wakeup(&trp->tr_event);
187 atp_trans_free(trp);
196 void atp_send(trp)
197 register struct atp_trans *trp;
202 dPrintf(D_M_ATP_LOW, D_L_OUTPUT, ("atp_send: trp=0x%x, loc=%d\n",
203 (u_int) trp->tr_queue, trp->tr_local_socket));
205 if ((atp = trp->tr_queue) != 0) {
206 if (trp->tr_state == TRANS_TIMEOUT) {
207 if ((m = gbuf_cont(trp->tr_xmt)) == NULL)
208 m = trp->tr_xmt;
213 if (!trp->tr_retry && !trp->tr_bitmap && !trp->tr_xo) {
215 atp_x_done(trp);
219 atp_timout(atp_req_timeout, trp, trp->tr_timeout);
327 register struct atp_trans *trp;
332 for (trp = atp->atp_trans_wait.head; trp; trp = trp->tr_list.next) {
333 if (trp->tr_tid == i)
336 if (trp == NULL) {