Lines Matching refs:q

134 static int	rcv_parse(queue_t *q, mblk_t *mp);
135 static int snd_parse(queue_t *q, mblk_t *mp);
208 telmodopen(queue_t *q, dev_t *devp, int oflag, int sflag, cred_t *credp) in telmodopen() argument
218 if (q->q_ptr != NULL) { in telmodopen()
230 q->q_ptr = tmip; in telmodopen()
231 WR(q)->q_ptr = tmip; in telmodopen()
233 noenable(q); in telmodopen()
235 qprocson(q); in telmodopen()
248 bufcall_id_t id = qbufcall(q, sizeof (union T_primitives), in telmodopen()
250 if (!qwait_sig(q)) { in telmodopen()
251 qunbufcall(q, id); in telmodopen()
255 qunbufcall(q, id); in telmodopen()
269 bufcall_id_t id = qbufcall(q, sizeof (union T_primitives), in telmodopen()
271 if (!qwait_sig(q)) { in telmodopen()
272 qunbufcall(q, id); in telmodopen()
276 qunbufcall(q, id); in telmodopen()
284 putnext(q, bp); in telmodopen()
288 qprocsoff(q); in telmodopen()
293 q->q_ptr = NULL; in telmodopen()
294 WR(q)->q_ptr = NULL; in telmodopen()
305 telmodclose(queue_t *q, int flag, cred_t *credp) in telmodclose() argument
307 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in telmodclose()
316 while (mp = getq(WR(q))) in telmodclose()
317 putnext(WR(q), mp); in telmodclose()
320 (void) putnextctl(q, M_HANGUP); in telmodclose()
322 qprocsoff(q); in telmodclose()
324 qunbufcall(q, tmip->wbufcid); in telmodclose()
328 qunbufcall(q, tmip->rbufcid); in telmodclose()
332 (void) quntimeout(q, tmip->wtimoutid); in telmodclose()
336 (void) quntimeout(q, tmip->rtimoutid); in telmodclose()
343 kmem_free(q->q_ptr, sizeof (struct telmod_info)); in telmodclose()
344 q->q_ptr = WR(q)->q_ptr = NULL; in telmodclose()
356 telmodrput(queue_t *q, mblk_t *mp) in telmodrput() argument
359 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in telmodrput()
363 ((q->q_first) || ((tmip->flags & TEL_STOPPED) && in telmodrput()
364 !(tmip->flags & TEL_GETBLK)) || !canputnext(q))) { in telmodrput()
365 (void) putq(q, mp); in telmodrput()
380 recover(q, mp, msgdsize(mp)); in telmodrput()
388 noenable(q); in telmodrput()
391 putnext(q, newmp); in telmodrput()
403 (void) rcv_parse(q, mp); in telmodrput()
414 flushq(q, FLUSHALL); in telmodrput()
415 putnext(q, mp); in telmodrput()
426 putnext(q, mp); in telmodrput()
454 putnext(q, mp); in telmodrput()
455 qreply(q, tmip->unbind_mp); in telmodrput()
458 putnext(q, mp); in telmodrput()
511 telmodrsrv(queue_t *q) in telmodrsrv() argument
514 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in telmodrsrv()
517 while ((mp = getq(q)) != NULL) { in telmodrsrv()
519 !(tmip->flags & TEL_GETBLK)) || !canputnext(q)) { in telmodrsrv()
520 (void) putbq(q, mp); in telmodrsrv()
530 recover(q, mp, msgdsize(mp)); in telmodrsrv()
538 noenable(q); in telmodrsrv()
541 putnext(q, newmp); in telmodrsrv()
545 if (!rcv_parse(q, mp)) { in telmodrsrv()
581 putnext(q, mp); in telmodrsrv()
582 qreply(q, tmip->unbind_mp); in telmodrsrv()
585 putnext(q, mp); in telmodrsrv()
623 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()
859 telmodwsrv(queue_t *q) in telmodwsrv() argument
863 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in telmodwsrv()
865 while ((mp = getq(q)) != NULL) { in telmodwsrv()
866 if (!canputnext(q)) { in telmodwsrv()
868 (void) putbq(q, mp); in telmodwsrv()
875 (void) putbq(q, mp); in telmodwsrv()
882 if (!snd_parse(q, mp)) { in telmodwsrv()
894 putnext(q, mp); in telmodwsrv()
898 putnext(q, mp); in telmodwsrv()
940 rcv_parse(queue_t *q, mblk_t *mp) in rcv_parse() argument
946 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in rcv_parse()
1016 recover(q, datamp, msgsize); in rcv_parse()
1041 putnext(q, datamp); in rcv_parse()
1057 recover(q, protomp, msgsize); in rcv_parse()
1064 noenable(q); in rcv_parse()
1066 putnext(q, newmp); in rcv_parse()
1108 putnext(q, datamp); in rcv_parse()
1127 snd_parse(queue_t *q, mblk_t *mp) in snd_parse() argument
1131 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in snd_parse()
1137 putnext(q, mp); in snd_parse()
1147 recover(q, mp, (2 * size)+1); in snd_parse()
1191 putnext(q, newmp); in snd_parse()
1199 queue_t *q = arg; in telmod_timer() local
1200 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in telmod_timer()
1204 if (q->q_flag & QREADR) { in telmod_timer()
1211 enableok(q); in telmod_timer()
1212 qenable(q); in telmod_timer()
1218 queue_t *q = arg; in telmod_buffer() local
1219 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in telmod_buffer()
1223 if (q->q_flag & QREADR) { in telmod_buffer()
1230 enableok(q); in telmod_buffer()
1231 qenable(q); in telmod_buffer()
1235 recover(queue_t *q, mblk_t *mp, size_t size) in recover() argument
1239 struct telmod_info *tmip = (struct telmod_info *)q->q_ptr; in recover()
1242 noenable(q); in recover()
1243 (void) putbq(q, mp); in recover()
1248 if (q->q_flag & QREADR) { in recover()
1257 if (!(bid = qbufcall(RD(q), size, BPRI_MED, telmod_buffer, q))) { in recover()
1258 tid = qtimeout(RD(q), telmod_timer, q, SIMWAIT); in recover()
1259 if (q->q_flag & QREADR) in recover()
1264 if (q->q_flag & QREADR) in recover()