Lines Matching refs:tp
49 lwp_tty_t tp; in tty_fops_open() local
62 tp = rt_container_of(device, struct lwp_tty, parent); in tty_fops_open()
63 rc = bsd_ttydev_methods.d_open(tp, file->flags, devtype, in tty_fops_open()
78 lwp_tty_t tp; in tty_fops_close() local
92 tp = rt_container_of(device, struct lwp_tty, parent); in tty_fops_close()
93 rc = bsd_ttydev_methods.d_close(tp, fflags, devtype, rt_thread_self()); in tty_fops_close()
107 lwp_tty_t tp; in tty_fops_ioctl() local
113 tp = rt_container_of(device, struct lwp_tty, parent); in tty_fops_ioctl()
114 rc = lwp_tty_ioctl_adapter(tp, cmd, file->flags, arg, rt_thread_self()); in tty_fops_ioctl()
132 struct lwp_tty *tp; in tty_fops_read() local
139 tp = rt_container_of(device, struct lwp_tty, parent); in tty_fops_read()
156 error = bsd_ttydev_methods.d_read(tp, &uio, ioflags); in tty_fops_read()
183 struct lwp_tty *tp; in tty_fops_write() local
190 tp = rt_container_of(device, struct lwp_tty, parent); in tty_fops_write()
207 error = bsd_ttydev_methods.d_write(tp, &uio, ioflags); in tty_fops_write()
248 struct lwp_tty *tp; in tty_fops_poll() local
253 tp = rt_container_of(device, struct lwp_tty, parent); in tty_fops_poll()
255 rc = bsd_ttydev_methods.d_poll(tp, req, rt_thread_self()); in tty_fops_poll()
339 static void tty_init_termios(lwp_tty_t tp) in tty_init_termios() argument
341 struct termios *t = &tp->t_termios_init_in; in tty_init_termios()
354 tp->t_termios_init_out = *t; in tty_init_termios()
361 lwp_tty_t tp; in lwp_tty_create_ext() local
363 tp = rt_calloc(1, sizeof(struct lwp_tty) in lwp_tty_create_ext()
369 if (!tp) in lwp_tty_create_ext()
370 return tp; in lwp_tty_create_ext()
375 tp->t_prbufsz = LWP_TTY_PRBUF_SIZE; in lwp_tty_create_ext()
377 tp->t_devsw = handle; in lwp_tty_create_ext()
378 tp->t_devswsoftc = softc; in lwp_tty_create_ext()
379 tp->t_flags = handle->tsw_flags; in lwp_tty_create_ext()
380 tp->t_drainwait = tty_drainwait; in lwp_tty_create_ext()
382 tty_init_termios(tp); in lwp_tty_create_ext()
384 cv_init(&tp->t_inwait, "ttyin"); in lwp_tty_create_ext()
385 cv_init(&tp->t_outwait, "ttyout"); in lwp_tty_create_ext()
386 cv_init(&tp->t_outserwait, "ttyosr"); in lwp_tty_create_ext()
387 cv_init(&tp->t_bgwait, "ttybg"); in lwp_tty_create_ext()
388 cv_init(&tp->t_dcdwait, "ttydcd"); in lwp_tty_create_ext()
390 rt_wqueue_init(&tp->t_inpoll); in lwp_tty_create_ext()
391 rt_wqueue_init(&tp->t_outpoll); in lwp_tty_create_ext()
396 tp->t_mtx = custom_mtx; in lwp_tty_create_ext()
400 tp->t_mtx = &tp->t_mtxobj; in lwp_tty_create_ext()
401 rt_mutex_init(&tp->t_mtxobj, "ttydev", RT_IPC_FLAG_PRIO); in lwp_tty_create_ext()
405 knlist_init_mtx(&tp->t_inpoll.si_note, tp->t_mtx); in lwp_tty_create_ext()
406 knlist_init_mtx(&tp->t_outpoll.si_note, tp->t_mtx); in lwp_tty_create_ext()
409 return tp; in lwp_tty_create_ext()
417 void lwp_tty_delete(lwp_tty_t tp) in lwp_tty_delete() argument
426 ttyinq_free(&tp->t_inq); in lwp_tty_delete()
427 ttyoutq_free(&tp->t_outq); in lwp_tty_delete()
428 rt_wqueue_wakeup_all(&tp->t_inpoll, (void *)POLLHUP); in lwp_tty_delete()
429 rt_wqueue_wakeup_all(&tp->t_outpoll, (void *)POLLHUP); in lwp_tty_delete()
432 knlist_destroy(&tp->t_inpoll.si_note); in lwp_tty_delete()
433 knlist_destroy(&tp->t_outpoll.si_note); in lwp_tty_delete()
436 cv_destroy(&tp->t_inwait); in lwp_tty_delete()
437 cv_destroy(&tp->t_outwait); in lwp_tty_delete()
438 cv_destroy(&tp->t_bgwait); in lwp_tty_delete()
439 cv_destroy(&tp->t_dcdwait); in lwp_tty_delete()
440 cv_destroy(&tp->t_outserwait); in lwp_tty_delete()
442 if (tp->t_mtx == &tp->t_mtxobj) in lwp_tty_delete()
443 rt_mutex_detach(&tp->t_mtxobj); in lwp_tty_delete()
444 ttydevsw_free(tp); in lwp_tty_delete()
445 rt_device_unregister(&tp->parent); in lwp_tty_delete()
446 rt_free(tp); in lwp_tty_delete()
452 void tty_info(struct lwp_tty *tp) in tty_info() argument