Lines Matching refs:tp
133 struct tty *tp;
138 if ((tp = sc->of_tty) == NULL)
139 sc->of_tty = tp = tty_alloc();
140 tp->t_oproc = pconsstart;
141 tp->t_param = pconsparam;
142 tp->t_dev = dev;
144 if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
146 if ((tp->t_state & TS_ISOPEN) == 0) {
147 ttychars(tp);
148 tp->t_iflag = TTYDEF_IFLAG;
149 tp->t_oflag = TTYDEF_OFLAG;
150 tp->t_cflag = TTYDEF_CFLAG;
151 tp->t_lflag = TTYDEF_LFLAG;
152 tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
153 pconsparam(tp, &tp->t_termios);
154 ttsetwater(tp);
156 tp->t_state |= TS_CARR_ON;
163 return (*tp->t_linesw->l_open)(dev, tp);
170 struct tty *tp = sc->of_tty;
174 (*tp->t_linesw->l_close)(tp, flag);
175 ttyclose(tp);
183 struct tty *tp = sc->of_tty;
185 return (*tp->t_linesw->l_read)(tp, uio, flag);
192 struct tty *tp = sc->of_tty;
194 return (*tp->t_linesw->l_write)(tp, uio, flag);
201 struct tty *tp = sc->of_tty;
203 return (*tp->t_linesw->l_poll)(tp, events, l);
210 struct tty *tp = sc->of_tty;
213 if ((error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l)) >= 0)
215 if ((error = ttioctl(tp, cmd, data, flag, l)) >= 0)
229 pconsstart(struct tty *tp)
236 if (tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP)) {
240 tp->t_state |= TS_BUSY;
242 cl = &tp->t_outq;
246 tp->t_state &= ~TS_BUSY;
247 if (ttypull(tp)) {
248 tp->t_state |= TS_TIMEOUT;
249 callout_schedule(&tp->t_rstrt_ch, 1);
255 pconsparam(struct tty *tp, struct termios *t)
258 tp->t_ispeed = t->c_ispeed;
259 tp->t_ospeed = t->c_ospeed;
260 tp->t_cflag = t->c_cflag;
268 struct tty *tp = sc->of_tty;
274 cn_check_magic(tp->t_dev, ch, pcons_cnm_state);
275 if (tp && (tp->t_state & TS_ISOPEN))
276 (*tp->t_linesw->l_rint)(ch, tp);