Lines Matching defs:tp
118 struct tty *tp;
120 tp = tty_alloc();
121 callout_setfunc(&tp->t_rstrt_ch, kd_later, tp);
123 tp->t_oproc = kdstart;
124 tp->t_param = kdparam;
125 tp->t_dev = makedev(cdevsw_lookup_major(&kd_cdevsw), 0);
127 tty_attach(tp);
128 kd->kd_tty = tp;
147 struct tty *tp;
158 tp = kd->kd_tty;
161 if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
166 if ((tp->t_state & TS_ISOPEN) == 0) {
176 ttychars(tp);
177 tp->t_iflag = TTYDEF_IFLAG;
178 tp->t_oflag = TTYDEF_OFLAG;
179 tp->t_cflag = TTYDEF_CFLAG;
180 tp->t_lflag = TTYDEF_LFLAG;
181 tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
182 (void) kdparam(tp, &tp->t_termios);
183 ttsetwater(tp);
186 tp->t_state |= TS_CARR_ON;
191 return ((*tp->t_linesw->l_open)(dev, tp));
198 struct tty *tp;
202 tp = kd->kd_tty;
205 if ((tp->t_state & TS_ISOPEN) == 0)
208 (*tp->t_linesw->l_close)(tp, flag);
209 ttyclose(tp);
219 struct tty *tp;
222 tp = kd->kd_tty;
224 return ((*tp->t_linesw->l_read)(tp, uio, flag));
231 struct tty *tp;
234 tp = kd->kd_tty;
236 return ((*tp->t_linesw->l_write)(tp, uio, flag));
243 struct tty *tp;
246 tp = kd->kd_tty;
248 return ((*tp->t_linesw->l_poll)(tp, events, l));
255 struct tty *tp;
259 tp = kd->kd_tty;
261 error = (*tp->t_linesw->l_ioctl)(tp, cmd, data, flag, l);
265 error = ttioctl(tp, cmd, data, flag, l);
277 kdparam(struct tty *tp, struct termios *t)
280 tp->t_ispeed = t->c_ispeed;
281 tp->t_ospeed = t->c_ospeed;
282 tp->t_cflag = t->c_cflag;
290 kdstart(struct tty *tp)
297 if (tp->t_state & (TS_BUSY|TS_TTSTOP|TS_TIMEOUT))
300 cl = &tp->t_outq;
301 if (ttypull(tp)) {
303 tp->t_state |= TS_BUSY;
307 kd_putfb(tp);
309 tp->t_state &= ~TS_BUSY;
312 callout_schedule(&tp->t_rstrt_ch, 0);
336 struct tty *tp = tpaddr;
339 kd_putfb(tp);
342 tp->t_state &= ~TS_BUSY;
343 (*tp->t_linesw->l_start)(tp);
353 kd_putfb(struct tty *tp)
356 struct clist *cl = &tp->t_outq;
409 struct tty *tp;
412 tp = kd->kd_tty;
413 if (tp == NULL)
415 if ((tp->t_state & TS_ISOPEN) == 0)
418 (*tp->t_linesw->l_rint)(c, tp);