Lines Matching refs:tp
267 irframetopen(dev_t dev, struct tty *tp) in irframetopen() argument
279 KAUTH_DEVICE_TTY_OPEN, tp))) in irframetopen()
284 DPRINTF(("%s: linesw=%p disc=%s\n", __func__, tp->t_linesw, in irframetopen()
285 tp->t_linesw->l_name)); in irframetopen()
286 if (tp->t_linesw == &irframet_disc) { in irframetopen()
287 sc = (struct irframet_softc *)tp->t_sc; in irframetopen()
306 ia.ia_handle = tp; in irframetopen()
309 tp->t_sc = sc; in irframetopen()
310 sc->sc_tp = tp; in irframetopen()
312 (int)minor(tp->t_dev)); in irframetopen()
316 ttylock(tp); in irframetopen()
317 ttyflush(tp, FREAD | FWRITE); in irframetopen()
318 ttyunlock(tp); in irframetopen()
335 irframetclose(struct tty *tp, int flag) in irframetclose() argument
337 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irframetclose()
341 DPRINTF(("%s: tp=%p\n", __func__, tp)); in irframetclose()
344 ttylock(tp); in irframetclose()
345 ttyflush(tp, FREAD | FWRITE); in irframetclose()
346 ttyunlock(tp); /* XXX */ in irframetclose()
347 ttyldisc_release(tp->t_linesw); in irframetclose()
348 tp->t_linesw = ttyldisc_default(); if (sc != NULL) { in irframetclose()
350 tp->t_sc = NULL; in irframetclose()
352 device_xname(sc->sc_irp.sc_dev), (int)minor(tp->t_dev)); in irframetclose()
354 if (sc->sc_tp == tp) { in irframetclose()
371 irframetioctl(struct tty *tp, u_long cmd, void *data, int flag, in irframetioctl() argument
374 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irframetioctl()
378 DPRINTF(("%s: tp=%p\n", __func__, tp)); in irframetioctl()
386 if (sc == NULL || tp != sc->sc_tp) in irframetioctl()
415 irframetstart(struct tty *tp) in irframetstart() argument
420 DPRINTF(("%s: tp=%p\n", __func__, tp)); in irframetstart()
423 if (tp->t_oproc != NULL) in irframetstart()
424 (*tp->t_oproc)(tp); in irframetstart()
500 irframetinput(int c, struct tty *tp) in irframetinput() argument
502 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irframetinput()
508 DPRINTF(("%s: tp=%p c=0x%02x\n", __func__, tp, c)); in irframetinput()
511 if (sc == NULL || tp != (struct tty *)sc->sc_tp) in irframetinput()
584 struct tty *tp = h; in irframet_open() local
585 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irframet_open()
587 DPRINTF(("%s: tp=%p\n", __func__, tp)); in irframet_open()
604 struct tty *tp = h; in irframet_close() local
605 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irframet_close()
608 DPRINTF(("%s: tp=%p\n", __func__, tp)); in irframet_close()
625 struct tty *tp = h; in irframet_read() local
626 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irframet_read()
676 irt_putc(struct tty *tp, int c) in irt_putc() argument
682 DPRINTF(("%s: tp=%p c=0x%02x cc=%d\n", __func__, tp, c, in irt_putc()
683 tp->t_outq.c_cc)); in irt_putc()
685 if (tp->t_outq.c_cc > tp->t_hiwat) { in irt_putc()
686 irframetstart(tp); in irt_putc()
687 ttylock(tp); in irt_putc()
692 if (tp->t_outq.c_cc <= tp->t_hiwat) { in irt_putc()
693 ttyunlock(tp); in irt_putc()
696 error = ttysleep(tp, &tp->t_outcv, true, 0); in irt_putc()
697 ttyunlock(tp); in irt_putc()
702 if (putc(c, &tp->t_outq) < 0) { in irt_putc()
712 struct tty *tp = h; in irframet_write() local
713 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irframet_write()
728 return (irt_write_frame(tp, sc->sc_buffer, n)); in irframet_write()
732 irt_write_frame(struct tty *tp, u_int8_t *tbuf, size_t len) in irt_write_frame() argument
734 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irt_write_frame()
737 DPRINTF(("%s: tp=%p len=%zd\n", __func__, tp, len)); in irt_write_frame()
742 error = irt_putc(tp, tbuf[i]); in irt_write_frame()
745 irframetstart(tp); in irt_write_frame()
755 struct tty *tp = h; in irframet_poll() local
756 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irframet_poll()
765 if (tp->t_outq.c_cc <= tp->t_lowat) in irframet_poll()
785 struct tty *tp = kn->kn_hook; in filt_irframetrdetach() local
786 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in filt_irframetrdetach()
797 struct tty *tp = kn->kn_hook; in filt_irframetread() local
798 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in filt_irframetread()
807 struct tty *tp = kn->kn_hook; in filt_irframetwdetach() local
808 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in filt_irframetwdetach()
819 struct tty *tp = kn->kn_hook; in filt_irframetwrite() local
823 if (tp->t_outq.c_cc <= tp->t_lowat) { in filt_irframetwrite()
824 kn->kn_data = tp->t_lowat - tp->t_outq.c_cc; in filt_irframetwrite()
849 struct tty *tp = h; in irframet_kqfilter() local
850 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irframet_kqfilter()
867 kn->kn_hook = tp; in irframet_kqfilter()
879 struct tty *tp = h; in irframet_set_params() local
880 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irframet_set_params()
883 __func__, tp, p->speed, p->ebofs, p->maxsize)); in irframet_set_params()
888 irt_dongles[sc->sc_dongle].setspeed(tp, p->speed); in irframet_set_params()
904 struct tty *tp = h; in irframet_get_speeds() local
905 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irframet_get_speeds()
907 DPRINTF(("%s: tp=%p\n", __func__, tp)); in irframet_get_speeds()
919 struct tty *tp = h; in irframet_get_turnarounds() local
920 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irframet_get_turnarounds()
922 DPRINTF(("%s: tp=%p\n", __func__, tp)); in irframet_get_turnarounds()
929 irt_ioctl(struct tty *tp, u_long cmd, void *arg) in irt_ioctl() argument
935 dev = tp->t_dev; in irt_ioctl()
948 irt_setspeed(struct tty *tp, u_int speed) in irt_setspeed() argument
952 irt_ioctl(tp, TIOCGETA, &tt); in irt_setspeed()
956 irt_ioctl(tp, TIOCSETAF, &tt); in irt_setspeed()
960 irt_setline(struct tty *tp, u_int line) in irt_setline() argument
964 irt_ioctl(tp, TIOCMGET, &mline); in irt_setline()
967 irt_ioctl(tp, TIOCMSET, (void *)&mline); in irt_setline()
971 irt_delay(struct tty *tp, u_int ms) in irt_delay() argument
984 irts_none(struct tty *tp, u_int speed) in irts_none() argument
986 irt_setspeed(tp, speed); in irts_none()
1004 irts_tekram(struct tty *tp, u_int speed) in irts_tekram() argument
1008 irt_setspeed(tp, 9600); in irts_tekram()
1009 irt_setline(tp, 0); in irts_tekram()
1010 irt_delay(tp, 50); in irts_tekram()
1012 irt_setline(tp, TIOCM_RTS); in irts_tekram()
1013 irt_delay(tp, 1); in irts_tekram()
1015 irt_setline(tp, TIOCM_DTR | TIOCM_RTS); in irts_tekram()
1016 irt_delay(tp, 1); /* 50 us */ in irts_tekram()
1018 irt_setline(tp, TIOCM_DTR); in irts_tekram()
1019 irt_delay(tp, 1); /* 7 us */ in irts_tekram()
1029 irt_putc(tp, s); in irts_tekram()
1030 irframetstart(tp); in irts_tekram()
1032 irt_delay(tp, 100); in irts_tekram()
1034 irt_setline(tp, TIOCM_DTR | TIOCM_RTS); in irts_tekram()
1036 irt_setspeed(tp, speed); in irts_tekram()
1037 irt_delay(tp, 1); /* 50 us */ in irts_tekram()
1044 irts_jeteye(struct tty *tp, u_int speed) in irts_jeteye() argument
1048 irt_setline(tp, TIOCM_DTR); in irts_jeteye()
1051 irt_setline(tp, TIOCM_DTR | TIOCM_RTS); in irts_jeteye()
1054 irt_setline(tp, TIOCM_RTS); in irts_jeteye()
1057 irt_setspeed(tp, speed); in irts_jeteye()
1064 irts_actisys(struct tty *tp, u_int speed) in irts_actisys() argument
1066 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irts_actisys()
1069 irt_setspeed(tp, speed); in irts_actisys()
1081 irt_setline(tp, TIOCM_DTR | TIOCM_RTS); in irts_actisys()
1086 irt_delay(tp, 50); in irts_actisys()
1088 irt_setline(tp, TIOCM_RTS); in irts_actisys()
1091 irt_setline(tp, TIOCM_DTR | TIOCM_RTS); in irts_actisys()
1095 irt_setline(tp, TIOCM_DTR); in irts_actisys()
1104 irts_litelink(struct tty *tp, u_int speed) in irts_litelink() argument
1106 struct irframet_softc *sc = (struct irframet_softc *)tp->t_sc; in irts_litelink()
1109 irt_setspeed(tp, speed); in irts_litelink()
1121 irt_setline(tp, TIOCM_DTR | TIOCM_RTS); in irts_litelink()
1123 irt_setline(tp, TIOCM_RTS); in irts_litelink()
1124 irt_delay(tp, 1); /* 15 us */; in irts_litelink()
1126 irt_setline(tp, TIOCM_DTR | TIOCM_RTS); in irts_litelink()
1127 irt_delay(tp, 1); /* 15 us */; in irts_litelink()
1130 irt_setline(tp, TIOCM_DTR); in irts_litelink()
1131 irt_delay(tp, 1); /* 15 us */; in irts_litelink()
1166 irts_girbil(struct tty *tp, u_int speed) in irts_girbil() argument
1170 irt_setspeed(tp, 9600); in irts_girbil()
1171 irt_setline(tp, TIOCM_DTR); in irts_girbil()
1172 irt_delay(tp, 5); in irts_girbil()
1173 irt_setline(tp, TIOCM_RTS); in irts_girbil()
1174 irt_delay(tp, 20); in irts_girbil()
1184 irt_putc(tp, GIRBIL_TXEN|GIRBIL_RXEN); in irts_girbil()
1185 irt_putc(tp, s); in irts_girbil()
1186 irt_putc(tp, GIRBIL_LOAD); in irts_girbil()
1187 irframetstart(tp); in irts_girbil()
1188 irt_delay(tp, 100); in irts_girbil()
1189 irt_setline(tp, TIOCM_DTR | TIOCM_RTS); in irts_girbil()
1191 irt_setspeed(tp, speed); in irts_girbil()