Home | History | Annotate | Download | only in dev

Lines Matching refs:tp

135 	struct tty *tp;
140 if (!(tp = sc->of_tty))
141 sc->of_tty = tp = tty_alloc();
142 tp->t_oproc = pconsstart;
143 tp->t_param = pconsparam;
144 tp->t_dev = dev;
146 if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
148 if (!(tp->t_state & TS_ISOPEN)) {
149 ttychars(tp);
150 tp->t_iflag = TTYDEF_IFLAG;
151 tp->t_oflag = TTYDEF_OFLAG;
152 tp->t_cflag = TTYDEF_CFLAG;
153 tp->t_lflag = TTYDEF_LFLAG;
154 tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
155 pconsparam(tp, &tp->t_termios);
156 ttsetwater(tp);
158 tp->t_state |= TS_CARR_ON;
165 return (*tp->t_linesw->l_open)(dev, tp);
172 struct tty *tp = sc->of_tty;
176 (*tp->t_linesw->l_close)(tp, flag);
177 ttyclose(tp);
185 struct tty *tp = sc->of_tty;
187 return (*tp->t_linesw->l_read)(tp, uio, flag);
194 struct tty *tp = sc->of_tty;
196 return (*tp->t_linesw->l_write)(tp, uio, flag);
203 struct tty *tp = sc->of_tty;
205 return ((*tp->t_linesw->l_poll)(tp, events, l));
212 struct tty *tp = sc->of_tty;
215 if ((error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l)) != EPASSTHROUGH)
217 return ttioctl(tp, cmd, data, flag, l);
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)
257 tp->t_ispeed = t->c_ispeed;
258 tp->t_ospeed = t->c_ospeed;
259 tp->t_cflag = t->c_cflag;
267 struct tty *tp = sc->of_tty;
271 cn_check_magic(tp->t_dev, ch, pcons_cnm_state);
272 if (tp && (tp->t_state & TS_ISOPEN))
273 (*tp->t_linesw->l_rint)(ch, tp);