Lines Matching refs:tp

205 	struct tty	*tp;	/* cross reference */
240 static int cyparam(struct tty *tp, struct termios *t);
245 static void cystart(struct tty *tp);
246 static void comstop(struct tty *tp, int rw);
248 static void disc_optim(struct tty *tp, struct termios *t,
351 struct tty *tp;
411 tp = com->tp = ttyalloc();
412 tp->t_open = cyopen;
413 tp->t_close = cyclose;
414 tp->t_oproc = cystart;
415 tp->t_stop = comstop;
416 tp->t_param = cyparam;
417 tp->t_break = cybreak;
418 tp->t_modem = cymodem;
419 tp->t_sc = com;
421 if (cysetwater(com, tp->t_init_in.c_ispeed) != 0) {
436 ttycreate(tp, TS_CALLOUT, "c%r%r",
448 cyopen(struct tty *tp, struct cdev *dev)
453 com = tp->t_sc;
488 cyclose(struct tty *tp)
495 com = tp->t_sc;
515 tp = com->tp;
516 if ((tp->t_cflag & HUPCL)
524 || (!tp->t_actout
526 && !(tp->t_init_in.c_cflag & CLOCAL))
527 || !(tp->t_state & TS_ISOPEN)) {
528 (void)cymodem(tp, 0, SER_DTR);
536 ttydtrwaitstart(tp);
539 tp->t_actout = FALSE;
540 wakeup(&tp->t_actout);
541 wakeup(TSA_CARR_ON(tp)); /* restart any wopeners */
557 struct tty *tp;
560 tp = com->tp;
561 if (!(tp->t_state & TS_ISOPEN)) {
566 if (tp->t_state & TS_CAN_BYPASS_L_RINT) {
584 if (tp->t_rawq.c_cc + incc > tp->t_ihiwat
586 || tp->t_iflag & IXOFF)
587 && !(tp->t_state & TS_TBLOCK))
588 ttyblock(tp);
590 += b_to_q((char *)buf, incc, &tp->t_rawq);
594 tp->t_rawcc += incc;
595 ttwakeup(tp);
596 if (tp->t_state & TS_TTSTOP
597 && (tp->t_iflag & IXANY
598 || tp->t_cc[VSTART] == tp->t_cc[VSTOP])) {
599 tp->t_state &= ~TS_TTSTOP;
600 tp->t_lflag &= ~FLUSHO;
601 cystart(tp);
628 ttyld_rint(tp, recv_data);
642 !(tp->t_state & TS_TBLOCK))
718 && com->tp->t_hotchar != 0)
729 if ( com->tp == NULL
730 || !(com->tp->t_state & TS_ISOPEN)
732 && (com->tp->t_iflag & IGNPAR))
734 && (com->tp->t_iflag & IGNBRK)))
737 && (com->tp->t_state & TS_CAN_BYPASS_L_RINT)
740 && (com->tp->t_iflag & INPCK))))
746 if (com->tp->t_hotchar != 0 && recv_data == com->tp->t_hotchar)
753 if (com->tp != NULL && com->tp->t_do_timestamp)
754 microtime(&com->tp->t_timestamp);
782 if (com->tp != NULL && com->tp->t_do_timestamp)
783 microtime(&com->tp->t_timestamp);
789 if (com->tp->t_hotchar != 0
791 == com->tp->t_hotchar)
806 if (com->tp->t_hotchar != 0
807 && recv_data == com->tp->t_hotchar)
812 if (com->tp != NULL && com->tp->t_do_timestamp)
813 microtime(&com->tp->t_timestamp);
826 if (com->tp->t_hotchar != 0
827 && recv_data == com->tp->t_hotchar)
1118 cybreak(struct tty *tp, int sig)
1122 com = tp->t_sc;
1143 struct tty *tp;
1148 tp = com->tp;
1149 if (tp == NULL) {
1168 "cy%d: %d events for device with no tp\n",
1193 ttyld_modem(tp,
1204 tp->t_state &= ~TS_BUSY;
1205 ttwwakeup(com->tp);
1220 ttyld_start(tp);
1230 cyparam(struct tty *tp, struct termios *t)
1246 com = tp->t_sc;
1253 odivisor = cyspeed(t->c_ospeed != 0 ? t->c_ospeed : tp->t_ospeed,
1261 (void)cymodem(tp, 0, SER_DTR);
1263 (void)cymodem(tp, SER_DTR, 0);
1512 if (!(tp->t_state & TS_TTSTOP))
1547 disc_optim(tp, t, com);
1574 cystart(tp);
1588 struct tty *tp;
1615 tp = com->tp;
1616 if (tp != NULL) {
1617 tp->t_ififosize = 2 * ibufsize;
1618 tp->t_ispeedwat = (speed_t)-1;
1619 tp->t_ospeedwat = (speed_t)-1;
1653 cystart(struct tty *tp)
1661 com = tp->t_sc;
1671 if (tp->t_state & TS_TTSTOP) {
1687 if (tp->t_state & TS_TBLOCK) {
1708 if (tp->t_state & (TS_TIMEOUT | TS_TTSTOP)) {
1709 ttwwakeup(tp);
1713 if (tp->t_outq.c_cc != 0) {
1722 = com->obuf1 + q_to_b(&tp->t_outq, com->obuf1,
1749 if (tp->t_outq.c_cc != 0 && !com->obufs[1].l_queued) {
1754 = com->obuf2 + q_to_b(&tp->t_outq, com->obuf2,
1781 tp->t_state |= TS_BUSY;
1795 ttwwakeup(tp);
1800 comstop(struct tty *tp, int rw)
1805 com = tp->t_sc;
1821 com->tp->t_state &= ~TS_BUSY;
1837 cystart(tp);
1841 cymodem(struct tty *tp, int sigon, int sigoff)
1847 com = tp->t_sc;
1914 if (com != NULL && com->tp != NULL
1915 && com->tp->t_state & TS_ISOPEN) {
1972 disc_optim(struct tty *tp, struct termios *t, struct com_s *com)
1978 ttyldoptim(tp);
1981 if (com->tp->t_hotchar != 0) {
1982 cd_setreg(com, CD1400_SCHR3, com->tp->t_hotchar);
1983 cd_setreg(com, CD1400_SCHR4, com->tp->t_hotchar);
1996 cyinput(int c, struct tty *tp)
2192 struct tty *tp;
2233 tp = com->tp;
2234 if (tp != NULL) {
2235 printf("tty state:\t\t\t0x%08x\n", tp->t_state);
2238 tp->t_rawq.c_cc, tp->t_canq.c_cc, tp->t_outq.c_cc);