Lines Matching defs:trp

139 	struct atp_trans *trp;
333 for (trp = atp->atp_trans_wait.head; trp; trp = trp->tr_list.next) {
334 if (trp->tr_tid == i)
337 if (trp == NULL)
340 atp_free(trp);
400 gbuf_t *atp_build_release(trp)
401 register struct atp_trans *trp;
418 ddp->dst_socket = trp->tr_socket.socket;
419 ddp->dst_node = trp->tr_socket.node;
420 NET_ASSIGN(ddp->dst_net, trp->tr_socket.net);
421 ddp->src_node = trp->tr_local_node;
422 NET_NET(ddp->src_net, trp->tr_local_net);
430 UAS_ASSIGN_HTON(athp->tid, trp->tr_tid);
583 atp_pack_bdsp(trp, bdsp)
584 register struct atp_trans *trp;
593 trp->tr_queue->atp_socket_no));
599 if ((m = trp->tr_rcv[i]) == NULL)
636 gbuf_freem(trp->tr_rcv[i]);
637 trp->tr_rcv[i] = NULL;
924 void atp_rsp_ind(trp, mioc)
925 register struct atp_trans *trp;
928 register struct atp_state *atp = trp->tr_queue;
934 switch (trp->tr_state) {
936 if (asp_pack_bdsp(trp, &xm) < 0)
938 gbuf_cont(mioc) = trp->tr_xmt;
939 trp->tr_xmt = NULL;
950 atp_free(trp);
968 struct atp_trans *trp;
974 for (trp = atp->atp_trans_wait.head; trp; trp = trp->tr_list.next) {
975 if (trp->tr_tid == tid)
978 if (trp != NULL)
979 atp_free(trp);
1004 atp_timout(func, trp, ticks)
1006 struct atp_trans *trp;
1012 if (trp->tr_tmo_func)
1015 trp->tr_tmo_func = func;
1016 trp->tr_tmo_delta = 1+(ticks>>5);
1019 trp->tr_tmo_next = trp->tr_tmo_prev = 0;
1020 trp_tmo_list = trp;
1030 if (sum > trp->tr_tmo_delta) {
1032 trp->tr_tmo_delta -= sum;
1033 curr_trp->tr_tmo_delta -= trp->tr_tmo_delta;
1038 trp->tr_tmo_delta -= sum;
1044 trp->tr_tmo_prev = prev_trp;
1045 if ((trp->tr_tmo_next = prev_trp->tr_tmo_next) != 0)
1046 prev_trp->tr_tmo_next->tr_tmo_prev = trp;
1047 prev_trp->tr_tmo_next = trp;
1049 trp->tr_tmo_prev = 0;
1050 trp->tr_tmo_next = trp_tmo_list;
1051 trp_tmo_list->tr_tmo_prev = trp;
1052 trp_tmo_list = trp;
1059 struct atp_trans *trp)
1062 if (trp->tr_tmo_func == 0)
1065 if (trp_tmo_list == trp) {
1066 if ((trp_tmo_list = trp->tr_tmo_next) != 0) {
1068 trp->tr_tmo_next->tr_tmo_delta += trp->tr_tmo_delta;
1071 if ((trp->tr_tmo_prev->tr_tmo_next = trp->tr_tmo_next) != 0) {
1072 trp->tr_tmo_next->tr_tmo_prev = trp->tr_tmo_prev;
1073 trp->tr_tmo_next->tr_tmo_delta += trp->tr_tmo_delta;
1076 trp->tr_tmo_func = 0;
1092 struct atp_trans *trp;
1097 while (((trp = trp_tmo_list) != 0) && (trp_tmo_list->tr_tmo_delta == 0)) {
1098 if ((trp_tmo_list = trp->tr_tmo_next) != 0)
1100 if ((tr_tmo_func = trp->tr_tmo_func) != 0) {
1101 trp->tr_tmo_func = 0;
1102 (*tr_tmo_func)(trp);
1115 register struct atp_trans *trp;
1128 if ((trp = atp_trans_alloc(atp)) == NULL) {
1138 atp_trans_free(trp);
1159 trp->tr_retry = sdb->def_retries;
1160 trp->tr_timeout = timer;
1161 trp->tr_bdsp = bds;
1162 trp->tr_tid = atp_tid(atp);
1163 trp->tr_xmt = mioc;
1171 UAS_ASSIGN_HTON(athp->tid, trp->tr_tid);
1174 trp->tr_xo = athp->xo;
1175 trp->tr_bitmap = athp->bitmap;
1179 trp->tr_socket.socket = ddp->dst_socket;
1180 trp->tr_socket.node = ddp->dst_node;
1181 trp->tr_socket.net = NET_VALUE(ddp->dst_net);
1182 trp->tr_local_socket = atp->atp_socket_no;
1183 trp->tr_local_node = ddp->src_node;
1185 NET_ASSIGN_NOSWAP(trp->tr_local_net, temp_net);
1198 ATP_Q_APPEND(atp->atp_trans_wait, trp, tr_list);
1204 if (!trp->tr_retry && !trp->tr_bitmap && !trp->tr_xo)
1205 atp_x_done(trp); /* no reason to tie up resources */
1207 atp_timout(atp_req_timeout, trp, trp->tr_timeout);
1295 int asp_pack_bdsp(trp, xm)
1296 register struct atp_trans *trp;
1305 trp->tr_queue->atp_socket_no));
1307 if ((m2 = trp->tr_bdsp) == NULL)
1309 trp->tr_bdsp = NULL;
1314 if ((m = trp->tr_rcv[i]) == NULL)
1343 trp->tr_rcv[i] = NULL;
1352 if (trp->tr_xmt) /* an ioctl block is still held? */
1353 gbuf_cont(trp->tr_xmt) = m2;
1355 trp->tr_xmt = m2;
1387 register struct atp_trans *trp;
1472 while ((trp = atp_trans_alloc(atp)) == 0) {
1486 trp->tr_retry = sdb->def_retries;
1487 trp->tr_timeout = timer;
1488 trp->tr_bdsp = NULL;
1489 trp->tr_tid = atp_tid(atp);
1490 tid = trp->tr_tid;
1496 trp->tr_xmt = mioc;
1504 UAS_ASSIGN_HTON(athp->tid, trp->tr_tid);
1507 trp->tr_xo = athp->xo;
1508 trp->tr_bitmap = athp->bitmap;
1513 trp->tr_socket.socket = ddp->dst_socket;
1514 trp->tr_socket.node = ddp->dst_node;
1515 trp->tr_socket.net = NET_VALUE(ddp->dst_net);
1516 trp->tr_local_socket = atp->atp_socket_no;
1529 ATP_Q_APPEND(atp->atp_trans_wait, trp, tr_list);
1535 if ( !trp->tr_retry && !trp->tr_bitmap && !trp->tr_xo)
1536 atp_x_done(trp); /* no reason to tie up resources */
1538 atp_timout(atp_req_timeout, trp, trp->tr_timeout);
1550 while ((trp->tr_state != TRANS_DONE) && (trp->tr_state != TRANS_FAILED) &&
1551 (trp->tr_state != TRANS_ABORTING)) {
1552 trp->tr_rsp_wait = 1;
1553 rc = msleep(&trp->tr_event, atalk_mutex, PSOCK | PCATCH, "atpsndreq", 0);
1555 trp->tr_rsp_wait = 0;
1561 trp->tr_rsp_wait = 0;
1564 if (trp->tr_state == TRANS_FAILED || trp->tr_state == TRANS_ABORTING) {
1568 atp_free(trp);
1577 if ((*err = atp_pack_bdsp(trp, (struct atpBDS *)bds)) != 0) {
1578 atp_free(trp);
1587 atp_free(trp);
1592 atp_free(trp);
1819 register struct atp_trans *trp;
1835 for (trp = atp->atp_trans_wait.head; trp; trp = trp->tr_list.next) {
1837 ("ATPgetrsp: atp:0x%x, trp:0x%x, state:%d\n",
1838 (u_int) atp, (u_int) trp, trp->tr_state));
1840 switch (trp->tr_state) {
1844 atp_free(trp);
1848 if ((*err = atp_pack_bdsp(trp, (struct atpBDS *)bds)) != 0) {
1849 atp_free(trp);
1853 tid = (int)trp->tr_tid;
1854 atp_free(trp);
1866 atp_free(trp);