Lines Matching refs:mp

132 static int	rcv_parse(queue_t *q, mblk_t *mp);
133 static int snd_parse(queue_t *q, mblk_t *mp);
306 mblk_t *mp; in telmodclose() local
314 while (mp = getq(WR(q))) in telmodclose()
315 putnext(WR(q), mp); in telmodclose()
354 telmodrput(queue_t *q, mblk_t *mp) in telmodrput() argument
360 if ((mp->b_datap->db_type < QPCTL) && in telmodrput()
363 (void) putq(q, mp); in telmodrput()
367 switch (mp->b_datap->db_type) { in telmodrput()
378 recover(q, mp, msgdsize(mp)); in telmodrput()
384 newmp->b_cont = mp; in telmodrput()
401 (void) rcv_parse(q, mp); in telmodrput()
410 mp->b_flag |= MSGMARK; in telmodrput()
411 if (*mp->b_rptr & FLUSHR) in telmodrput()
413 putnext(q, mp); in telmodrput()
424 putnext(q, mp); in telmodrput()
432 tip = (union T_primitives *)mp->b_rptr; in telmodrput()
438 ASSERT(mp->b_cont == NULL); in telmodrput()
439 mp->b_datap->db_type = M_HANGUP; in telmodrput()
440 mp->b_wptr = mp->b_rptr; in telmodrput()
441 if (mp->b_cont) { in telmodrput()
442 freemsg(mp->b_cont); in telmodrput()
443 mp->b_cont = NULL; in telmodrput()
452 putnext(q, mp); in telmodrput()
456 putnext(q, mp); in telmodrput()
462 newmp = mp->b_cont; in telmodrput()
463 freeb(mp); in telmodrput()
464 mp = newmp; in telmodrput()
465 if (mp) { in telmodrput()
466 ASSERT(mp->b_datap->db_type == M_DATA); in telmodrput()
467 if (msgdsize(mp) != 0) { in telmodrput()
470 freemsg(mp); in telmodrput()
480 freemsg(mp); in telmodrput()
489 freemsg(mp); in telmodrput()
497 mp->b_datap->db_type); in telmodrput()
499 freemsg(mp); in telmodrput()
512 mblk_t *mp, *newmp; in telmodrsrv() local
516 while ((mp = getq(q)) != NULL) { in telmodrsrv()
519 (void) putbq(q, mp); in telmodrsrv()
522 switch (mp->b_datap->db_type) { in telmodrsrv()
529 recover(q, mp, msgdsize(mp)); in telmodrsrv()
535 newmp->b_cont = mp; in telmodrsrv()
544 if (!rcv_parse(q, mp)) { in telmodrsrv()
551 tip = (union T_primitives *)mp->b_rptr; in telmodrsrv()
566 ASSERT(mp->b_cont == NULL); in telmodrsrv()
567 mp->b_datap->db_type = M_HANGUP; in telmodrsrv()
568 mp->b_wptr = mp->b_rptr; in telmodrsrv()
569 if (mp->b_cont) { in telmodrsrv()
570 freemsg(mp->b_cont); in telmodrsrv()
571 mp->b_cont = NULL; in telmodrsrv()
580 putnext(q, mp); in telmodrsrv()
584 putnext(q, mp); in telmodrsrv()
590 newmp = mp->b_cont; in telmodrsrv()
591 freeb(mp); in telmodrsrv()
592 mp = newmp; in telmodrsrv()
593 if (mp) { in telmodrsrv()
594 ASSERT(mp->b_datap->db_type == M_DATA); in telmodrsrv()
595 if (msgdsize(mp) != 0) { in telmodrsrv()
598 freemsg(mp); in telmodrsrv()
608 freemsg(mp); in telmodrsrv()
617 freemsg(mp); in telmodrsrv()
622 putnext(q, mp); in telmodrsrv()
629 mp->b_datap->db_type); in telmodrsrv()
631 freemsg(mp); in telmodrsrv()
653 mblk_t *mp) /* Pointer to current message block */ in telmodwput() argument
663 switch (mp->b_datap->db_type) { in telmodwput()
668 (void) putq(q, mp); in telmodwput()
677 (void) snd_parse(q, mp); in telmodwput()
681 if (((mp->b_wptr - mp->b_rptr) == 1) && in telmodwput()
682 (*(mp->b_rptr) == M_CTL_MAGIC_NUMBER)) { in telmodwput()
683 savemp = mp->b_cont; in telmodwput()
684 freeb(mp); in telmodwput()
685 mp = savemp; in telmodwput()
687 putnext(q, mp); in telmodwput()
691 ioc = (struct iocblk *)mp->b_rptr; in telmodwput()
700 miocnak(q, mp, 0, EINVAL); in telmodwput()
707 miocack(q, mp, 0, 0); in telmodwput()
723 miocnak(q, mp, 0, EINVAL); in telmodwput()
727 if (mp->b_cont) { in telmodwput()
728 (void) putbq(RD(q), mp->b_cont); in telmodwput()
729 mp->b_cont = 0; in telmodwput()
737 miocack(q, mp, 0, 0); in telmodwput()
745 error = miocpullup(mp, sizeof (uchar_t)); in telmodwput()
747 miocnak(q, mp, 0, error); in telmodwput()
750 tmip->flags |= *(mp->b_cont->b_rptr) & in telmodwput()
752 miocack(q, mp, 0, 0); in telmodwput()
765 miocnak(q, mp, 0, EINVAL); in telmodwput()
769 error = miocpullup(mp, sizeof (uchar_t)); in telmodwput()
771 miocnak(q, mp, 0, error); in telmodwput()
774 if (*(mp->b_cont->b_rptr) == 0x01) in telmodwput()
779 miocack(q, mp, 0, 0); in telmodwput()
784 putnext(q, mp); in telmodwput()
791 miocnak(q, mp, 0, EINVAL); in telmodwput()
806 rw = *mp->b_rptr; in telmodwput()
816 *mp->b_rptr = rw & ~FLUSHW; in telmodwput()
817 qreply(q, mp); in telmodwput()
819 freemsg(mp); in telmodwput()
833 putnext(q, mp); in telmodwput()
839 (void) putq(q, mp); in telmodwput()
841 putnext(q, mp); in telmodwput()
848 mp->b_datap->db_type); in telmodwput()
850 freemsg(mp); in telmodwput()
862 mblk_t *mp, *savemp; in telmodwsrv() local
866 while ((mp = getq(q)) != NULL) { in telmodwsrv()
868 ASSERT(mp->b_datap->db_type < QPCTL); in telmodwsrv()
869 (void) putbq(q, mp); in telmodwsrv()
872 switch (mp->b_datap->db_type) { in telmodwsrv()
876 (void) putbq(q, mp); in telmodwsrv()
883 if (!snd_parse(q, mp)) { in telmodwsrv()
889 if (((mp->b_wptr - mp->b_rptr) == 1) && in telmodwsrv()
890 (*(mp->b_rptr) == M_CTL_MAGIC_NUMBER)) { in telmodwsrv()
891 savemp = mp->b_cont; in telmodwsrv()
892 freeb(mp); in telmodwsrv()
893 mp = savemp; in telmodwsrv()
895 putnext(q, mp); in telmodwsrv()
899 putnext(q, mp); in telmodwsrv()
906 mp->b_datap->db_type); in telmodwsrv()
908 freemsg(mp); in telmodwsrv()
942 rcv_parse(queue_t *q, mblk_t *mp) in rcv_parse() argument
950 datamp = mp; in rcv_parse()
953 while (mp) { in rcv_parse()
957 if (mp->b_rptr == mp->b_wptr) { in rcv_parse()
958 prevmp = mp; in rcv_parse()
959 mp = mp->b_cont; in rcv_parse()
970 if ((*mp->b_rptr == '\n') || (*mp->b_rptr == '\0')) { in rcv_parse()
971 if (mp->b_wptr == (mp->b_rptr + 1)) { in rcv_parse()
974 prevmp->b_cont = mp->b_cont; in rcv_parse()
975 freeb(mp); in rcv_parse()
976 mp = prevmp->b_cont; in rcv_parse()
979 datamp = mp->b_cont; in rcv_parse()
980 freeb(mp); in rcv_parse()
993 mp = datamp; in rcv_parse()
998 mp->b_rptr += 1; in rcv_parse()
1002 tmp = mp->b_rptr; in rcv_parse()
1007 while (tmp < mp->b_wptr) { in rcv_parse()
1015 if (tmp > mp->b_rptr) { in rcv_parse()
1016 if ((protomp = dupb(mp)) == NULL) { in rcv_parse()
1021 ASSERT(tmp >= mp->b_datap->db_base); in rcv_parse()
1022 ASSERT(tmp <= mp->b_datap->db_lim); in rcv_parse()
1026 mp->b_wptr = tmp; in rcv_parse()
1028 protomp->b_cont = mp->b_cont; in rcv_parse()
1029 mp->b_cont = 0; in rcv_parse()
1032 prevmp->b_cont = mp; in rcv_parse()
1035 protomp = mp; in rcv_parse()
1076 if ((tmp == (mp->b_wptr - 1)) && in rcv_parse()
1093 if (mp->b_wptr > (tmp + 2)) { in rcv_parse()
1095 (mp->b_wptr - tmp - 2)); in rcv_parse()
1096 mp->b_wptr -= 1; in rcv_parse()
1098 mp->b_wptr = tmp + 1; in rcv_parse()
1102 prevmp->b_cont = mp; in rcv_parse()
1107 prevmp = mp; in rcv_parse()
1108 mp = mp->b_cont; in rcv_parse()
1129 snd_parse(queue_t *q, mblk_t *mp) in snd_parse() argument
1134 size_t size = msgdsize(mp); in snd_parse()
1136 savemp = mp; in snd_parse()
1139 putnext(q, mp); in snd_parse()
1149 recover(q, mp, (2 * size)+1); in snd_parse()
1155 while (mp) { in snd_parse()
1158 if (*(mp->b_rptr) != '\n') in snd_parse()
1162 tmp = mp->b_rptr; in snd_parse()
1163 while (tmp < mp->b_wptr) { in snd_parse()
1166 if ((tmp == (mp->b_wptr - 1)) && in snd_parse()
1188 mp = mp->b_cont; in snd_parse()
1237 recover(queue_t *q, mblk_t *mp, size_t size) in recover() argument
1243 ASSERT(mp->b_datap->db_type < QPCTL); in recover()
1245 (void) putbq(q, mp); in recover()