Lines Matching refs:q

132 static int	rcv_parse(queue_t *q, mblk_t *mp);
133 static int snd_parse(queue_t *q, mblk_t *mp);
206 telmodopen(queue_t *q, dev_t *devp, int oflag, int sflag, cred_t *credp) in telmodopen() argument
216 if (q->q_ptr != NULL) { in telmodopen()
228 q->q_ptr = tmip; in telmodopen()
229 WR(q)->q_ptr = tmip; in telmodopen()
231 noenable(q); in telmodopen()
233 qprocson(q); in telmodopen()
246 bufcall_id_t id = qbufcall(q, sizeof (union T_primitives), in telmodopen()
248 if (!qwait_sig(q)) { in telmodopen()
249 qunbufcall(q, id); in telmodopen()
253 qunbufcall(q, id); in telmodopen()
267 bufcall_id_t id = qbufcall(q, sizeof (union T_primitives), in telmodopen()
269 if (!qwait_sig(q)) { in telmodopen()
270 qunbufcall(q, id); in telmodopen()
274 qunbufcall(q, id); in telmodopen()
282 putnext(q, bp); in telmodopen()
286 qprocsoff(q); in telmodopen()
291 q->q_ptr = NULL; in telmodopen()
292 WR(q)->q_ptr = NULL; in telmodopen()
303 telmodclose(queue_t *q, int flag, cred_t *credp) in telmodclose() argument
305 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in telmodclose()
314 while (mp = getq(WR(q))) in telmodclose()
315 putnext(WR(q), mp); in telmodclose()
318 (void) putnextctl(q, M_HANGUP); in telmodclose()
320 qprocsoff(q); in telmodclose()
322 qunbufcall(q, tmip->wbufcid); in telmodclose()
326 qunbufcall(q, tmip->rbufcid); in telmodclose()
330 (void) quntimeout(q, tmip->wtimoutid); in telmodclose()
334 (void) quntimeout(q, tmip->rtimoutid); in telmodclose()
341 kmem_free(q->q_ptr, sizeof (struct telmod_info)); in telmodclose()
342 q->q_ptr = WR(q)->q_ptr = NULL; in telmodclose()
354 telmodrput(queue_t *q, mblk_t *mp) in telmodrput() argument
357 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in telmodrput()
361 ((q->q_first) || ((tmip->flags & TEL_STOPPED) && in telmodrput()
362 !(tmip->flags & TEL_GETBLK)) || !canputnext(q))) { in telmodrput()
363 (void) putq(q, mp); in telmodrput()
378 recover(q, mp, msgdsize(mp)); in telmodrput()
386 noenable(q); in telmodrput()
389 putnext(q, newmp); in telmodrput()
401 (void) rcv_parse(q, mp); in telmodrput()
412 flushq(q, FLUSHALL); in telmodrput()
413 putnext(q, mp); in telmodrput()
424 putnext(q, mp); in telmodrput()
452 putnext(q, mp); in telmodrput()
453 qreply(q, tmip->unbind_mp); in telmodrput()
456 putnext(q, mp); in telmodrput()
510 telmodrsrv(queue_t *q) in telmodrsrv() argument
513 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in telmodrsrv()
516 while ((mp = getq(q)) != NULL) { in telmodrsrv()
518 !(tmip->flags & TEL_GETBLK)) || !canputnext(q)) { in telmodrsrv()
519 (void) putbq(q, mp); in telmodrsrv()
529 recover(q, mp, msgdsize(mp)); in telmodrsrv()
537 noenable(q); in telmodrsrv()
540 putnext(q, newmp); in telmodrsrv()
544 if (!rcv_parse(q, mp)) { in telmodrsrv()
580 putnext(q, mp); in telmodrsrv()
581 qreply(q, tmip->unbind_mp); in telmodrsrv()
584 putnext(q, mp); in telmodrsrv()
622 putnext(q, mp); in telmodrsrv()
652 queue_t *q, /* Pointer to the read queue */ in telmodwput() argument
661 tmip = (struct telmod_info *)q->q_ptr; in telmodwput()
665 if (!canputnext(q) || (tmip->flags & TEL_STOPPED) || in telmodwput()
666 (q->q_first)) { in telmodwput()
667 noenable(q); in telmodwput()
668 (void) putq(q, mp); in telmodwput()
677 (void) snd_parse(q, mp); in telmodwput()
687 putnext(q, mp); in telmodwput()
700 miocnak(q, mp, 0, EINVAL); in telmodwput()
704 qenable(RD(q)); in telmodwput()
705 enableok(RD(q)); in telmodwput()
707 miocack(q, mp, 0, 0); in telmodwput()
723 miocnak(q, mp, 0, EINVAL); in telmodwput()
728 (void) putbq(RD(q), mp->b_cont); in telmodwput()
732 qenable(RD(q)); in telmodwput()
733 enableok(RD(q)); in telmodwput()
734 qenable(q); in telmodwput()
735 enableok(q); in telmodwput()
737 miocack(q, mp, 0, 0); in telmodwput()
747 miocnak(q, mp, 0, error); in telmodwput()
752 miocack(q, mp, 0, 0); in telmodwput()
765 miocnak(q, mp, 0, EINVAL); in telmodwput()
771 miocnak(q, mp, 0, error); in telmodwput()
779 miocack(q, mp, 0, 0); in telmodwput()
784 putnext(q, mp); in telmodwput()
791 miocnak(q, mp, 0, EINVAL); in telmodwput()
817 qreply(q, mp); in telmodwput()
828 flushq(q, FLUSHDATA); in telmodwput()
833 putnext(q, mp); in telmodwput()
838 if (!canputnext(q) || q->q_first != NULL) in telmodwput()
839 (void) putq(q, mp); in telmodwput()
841 putnext(q, mp); in telmodwput()
860 telmodwsrv(queue_t *q) in telmodwsrv() argument
864 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in telmodwsrv()
866 while ((mp = getq(q)) != NULL) { in telmodwsrv()
867 if (!canputnext(q)) { in telmodwsrv()
869 (void) putbq(q, mp); in telmodwsrv()
876 (void) putbq(q, mp); in telmodwsrv()
883 if (!snd_parse(q, mp)) { in telmodwsrv()
895 putnext(q, mp); in telmodwsrv()
899 putnext(q, mp); in telmodwsrv()
942 rcv_parse(queue_t *q, mblk_t *mp) in rcv_parse() argument
948 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in rcv_parse()
1018 recover(q, datamp, msgsize); in rcv_parse()
1043 putnext(q, datamp); in rcv_parse()
1059 recover(q, protomp, msgsize); in rcv_parse()
1066 noenable(q); in rcv_parse()
1068 putnext(q, newmp); in rcv_parse()
1110 putnext(q, datamp); in rcv_parse()
1129 snd_parse(queue_t *q, mblk_t *mp) in snd_parse() argument
1133 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in snd_parse()
1139 putnext(q, mp); in snd_parse()
1149 recover(q, mp, (2 * size)+1); in snd_parse()
1193 putnext(q, newmp); in snd_parse()
1201 queue_t *q = arg; in telmod_timer() local
1202 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in telmod_timer()
1206 if (q->q_flag & QREADR) { in telmod_timer()
1213 enableok(q); in telmod_timer()
1214 qenable(q); in telmod_timer()
1220 queue_t *q = arg; in telmod_buffer() local
1221 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in telmod_buffer()
1225 if (q->q_flag & QREADR) { in telmod_buffer()
1232 enableok(q); in telmod_buffer()
1233 qenable(q); in telmod_buffer()
1237 recover(queue_t *q, mblk_t *mp, size_t size) in recover() argument
1241 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in recover()
1244 noenable(q); in recover()
1245 (void) putbq(q, mp); in recover()
1250 if (q->q_flag & QREADR) { in recover()
1259 if (!(bid = qbufcall(RD(q), size, BPRI_MED, telmod_buffer, q))) { in recover()
1260 tid = qtimeout(RD(q), telmod_timer, q, SIMWAIT); in recover()
1261 if (q->q_flag & QREADR) in recover()
1266 if (q->q_flag & QREADR) in recover()