Lines Matching refs:parse
90 #include "parse.h"
366 static char mn[] = "parse";
463 parseprintf(DD_OPEN,("parse: setup_stream - FAILED - no MEMORY for allocb\n"));
477 register parsestream_t *parse;
480 parseprintf(DD_OPEN,("parse: OPEN\n"));
484 parseprintf(DD_OPEN,("parse: OPEN - FAILED - not MODOPEN\n"));
491 parseprintf(DD_OPEN,("parse: OPEN - FAILED - EXCLUSIVE ONLY\n"));
502 parseprintf(DD_OPEN,("parse: OPEN - FAILED - no memory\n"));
510 parse = (parsestream_t *)(void *)q->q_ptr;
511 bzero((caddr_t)parse, sizeof(*parse));
512 parse->parse_queue = q;
513 parse->parse_status = PARSE_ENABLE;
514 parse->parse_ppsclockev.tv.tv_sec = 0;
515 parse->parse_ppsclockev.tv.tv_usec = 0;
516 parse->parse_ppsclockev.serial = 0;
518 if (!parse_ioinit(&parse->parse_io))
523 kmem_free((caddr_t)parse, sizeof(parsestream_t));
534 parseprintf(DD_OPEN,("parse: OPEN - SUCCEEDED\n"));
554 kmem_free((caddr_t)parse, sizeof(parsestream_t));
570 register parsestream_t *parse = (parsestream_t *)(void *)q->q_ptr;
573 parseprintf(DD_CLOSE,("parse: CLOSE\n"));
577 if (parse->parse_dqueue)
578 close_linemon(parse->parse_dqueue, q);
579 parse->parse_dqueue = (queue_t *)0;
583 parse_ioend(&parse->parse_io);
585 kmem_free((caddr_t)parse, sizeof(parsestream_t));
611 parseprintf(DD_RSVC,("parse: RSVC - putnext\n"));
616 parseprintf(DD_RSVC,("parse: RSVC - flow control wait\n"));
637 parsestream_t *parse = (parsestream_t *)(void *)q->q_ptr;
639 parseprintf(DD_WPUT,("parse: parsewput\n"));
652 parseprintf(DD_WPUT,("parse: parsewput - forward M_IOCTL\n"));
672 *(struct ppsclockev *)(void *)datap->b_wptr = parse->parse_ppsclockev;
683 parse->parse_status = (parse->parse_status & (unsigned)~PARSE_ENABLE) |
686 if (!setup_stream(RD(q), (parse->parse_status & PARSE_ENABLE) ?
710 parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_TIMECODE\n"));
711 ok = parse_timecode(dct, &parse->parse_io);
715 parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_SETFMT\n"));
716 ok = parse_setfmt(dct, &parse->parse_io);
720 parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_GETFMT\n"));
721 ok = parse_getfmt(dct, &parse->parse_io);
725 parseprintf(DD_WPUT,("parse: parsewput - PARSEIOC_SETCS\n"));
726 ok = parse_setcs(dct, &parse->parse_io);
735 parseprintf(DD_WPUT,("parse: parsewput qreply - %s\n", (mp->b_datap->db_type == M_IOCNAK) ? "M_IOCNAK" : "M_IOCACK"));
786 parseprintf(DD_RPUT,("parse: parserput - forward type 0x%x\n", type));
798 register parsestream_t * parse = (parsestream_t *)(void *)q->q_ptr;
808 if (!(parse->parse_status & PARSE_ENABLE))
810 parseprintf(DD_RPUT,("parse: parserput - parser disabled - forward type 0x%x\n", type));
820 parseprintf(DD_RPUT,("parse: parserput - M_%s\n", (type == M_DATA) ? "DATA" : "BREAK"));
825 * parse packet looking for start an end characters
830 if (ch != ~0 && parse_ioread(&parse->parse_io, (unsigned int)ch, &ctime))
837 if (canput(parse->parse_queue->q_next) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED)))
839 bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t));
841 putnext(parse->parse_queue, nmp);
845 parse_iodone(&parse->parse_io);
851 if (parse_ioread(&parse->parse_io, (unsigned int)0, &ctime))
858 if (canput(parse->parse_queue->q_next) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED)))
860 bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t));
862 putnext(parse->parse_queue, nmp);
866 parse_iodone(&parse->parse_io);
880 register parsestream_t * parse = (parsestream_t *)(void *)q->q_ptr;
887 parseprintf(DD_RPUT,("parse: parserput - M_%sHANGUP\n", (type == M_HANGUP) ? "" : "UN"));
889 if ((parse->parse_status & PARSE_ENABLE) &&
890 parse_iopps(&parse->parse_io, (int)(status ? SYNC_ONE : SYNC_ZERO), &ctime))
893 if (canput(parse->parse_queue->q_next) && (nmp = allocb(sizeof(parsetime_t), BPRI_MED)))
895 bcopy((caddr_t)&parse->parse_io.parse_dtime, (caddr_t)nmp->b_rptr, sizeof(parsetime_t));
897 putnext(parse->parse_queue, nmp);
901 parse_iodone(&parse->parse_io);
914 parse->parse_ppsclockev.tv = ctime.tv;
915 ++(parse->parse_ppsclockev.serial);