Lines Matching full:psc
115 struct pts_softc *psc = tty_softc(tp); in ptsdev_read() local
130 if (psc->pts_flags & PTS_PKT && psc->pts_pkt) { in ptsdev_read()
131 pkt = psc->pts_pkt; in ptsdev_read()
132 psc->pts_pkt = 0; in ptsdev_read()
148 if (psc->pts_flags & PTS_PKT) { in ptsdev_read()
166 if (psc->pts_flags & PTS_FINISHED) in ptsdev_read()
174 error = cv_wait_sig(&psc->pts_outwait, tp->t_mtx); in ptsdev_read()
189 struct pts_softc *psc = tty_softc(tp); in ptsdev_write() local
223 if (psc->pts_flags & PTS_FINISHED) { in ptsdev_write()
236 error = cv_wait_sig(&psc->pts_inwait, tp->t_mtx); in ptsdev_write()
262 struct pts_softc *psc = tty_softc(tp); in ptsdev_ioctl() local
327 if (psc->pts_unit < 0) in ptsdev_ioctl()
329 *(unsigned int *)data = psc->pts_unit; in ptsdev_ioctl()
367 psc->pts_flags |= PTS_PKT; in ptsdev_ioctl()
369 psc->pts_flags &= ~PTS_PKT; in ptsdev_ioctl()
389 struct pts_softc *psc = tty_softc(tp); in ptsdev_poll() local
394 if (psc->pts_flags & PTS_FINISHED) { in ptsdev_poll()
403 (psc->pts_flags & PTS_PKT && psc->pts_pkt)) in ptsdev_poll()
425 selrecord(td, &psc->pts_outpoll); in ptsdev_poll()
427 selrecord(td, &psc->pts_inpoll); in ptsdev_poll()
444 struct pts_softc *psc = tty_softc(tp); in pts_kqops_read_detach() local
446 knlist_remove(&psc->pts_outpoll.si_note, kn, 0); in pts_kqops_read_detach()
454 struct pts_softc *psc = tty_softc(tp); in pts_kqops_read_event() local
456 if (psc->pts_flags & PTS_FINISHED) { in pts_kqops_read_event()
470 struct pts_softc *psc = tty_softc(tp); in pts_kqops_write_detach() local
472 knlist_remove(&psc->pts_inpoll.si_note, kn, 0); in pts_kqops_write_detach()
480 struct pts_softc *psc = tty_softc(tp); in pts_kqops_write_event() local
482 if (psc->pts_flags & PTS_FINISHED) { in pts_kqops_write_event()
506 struct pts_softc *psc = tty_softc(tp); in ptsdev_kqfilter() local
514 knlist_add(&psc->pts_outpoll.si_note, kn, 1); in ptsdev_kqfilter()
518 knlist_add(&psc->pts_inpoll.si_note, kn, 1); in ptsdev_kqfilter()
534 struct pts_softc *psc = tty_softc(tp); in ptsdev_stat() local
549 if (psc->pts_cdev != NULL) in ptsdev_stat()
550 sb->st_ino = sb->st_rdev = dev2udev(psc->pts_cdev); in ptsdev_stat()
624 struct pts_softc *psc = tty_softc(tp); in ptsdrv_outwakeup() local
626 cv_broadcast(&psc->pts_outwait); in ptsdrv_outwakeup()
627 selwakeup(&psc->pts_outpoll); in ptsdrv_outwakeup()
628 KNOTE_LOCKED(&psc->pts_outpoll.si_note, 0); in ptsdrv_outwakeup()
634 struct pts_softc *psc = tty_softc(tp); in ptsdrv_inwakeup() local
636 cv_broadcast(&psc->pts_inwait); in ptsdrv_inwakeup()
637 selwakeup(&psc->pts_inpoll); in ptsdrv_inwakeup()
638 KNOTE_LOCKED(&psc->pts_inpoll.si_note, 0); in ptsdrv_inwakeup()
644 struct pts_softc *psc = tty_softc(tp); in ptsdrv_open() local
646 psc->pts_flags &= ~PTS_FINISHED; in ptsdrv_open()
654 struct pts_softc *psc = tty_softc(tp); in ptsdrv_close() local
657 psc->pts_flags |= PTS_FINISHED; in ptsdrv_close()
665 struct pts_softc *psc = tty_softc(tp); in ptsdrv_pktnotify() local
673 psc->pts_pkt &= ~TIOCPKT_START; in ptsdrv_pktnotify()
676 psc->pts_pkt &= ~TIOCPKT_STOP; in ptsdrv_pktnotify()
679 psc->pts_pkt &= ~TIOCPKT_DOSTOP; in ptsdrv_pktnotify()
682 psc->pts_pkt &= ~TIOCPKT_NOSTOP; in ptsdrv_pktnotify()
686 psc->pts_pkt |= event; in ptsdrv_pktnotify()
693 struct pts_softc *psc = softc; in ptsdrv_free() local
696 if (psc->pts_unit >= 0) in ptsdrv_free()
697 free_unr(pts_pool, psc->pts_unit); in ptsdrv_free()
699 chgptscnt(psc->pts_cred->cr_ruidinfo, -1, 0); in ptsdrv_free()
700 racct_sub_cred(psc->pts_cred, RACCT_NPTS, 1); in ptsdrv_free()
701 crfree(psc->pts_cred); in ptsdrv_free()
703 seldrain(&psc->pts_inpoll); in ptsdrv_free()
704 seldrain(&psc->pts_outpoll); in ptsdrv_free()
705 knlist_destroy(&psc->pts_inpoll.si_note); in ptsdrv_free()
706 knlist_destroy(&psc->pts_outpoll.si_note); in ptsdrv_free()
710 if (psc->pts_cdev != NULL) in ptsdrv_free()
711 destroy_dev_sched(psc->pts_cdev); in ptsdrv_free()
714 free(psc, M_PTS); in ptsdrv_free()
735 struct pts_softc *psc; in pts_alloc() local
763 psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO); in pts_alloc()
764 cv_init(&psc->pts_inwait, "ptsin"); in pts_alloc()
765 cv_init(&psc->pts_outwait, "ptsout"); in pts_alloc()
767 psc->pts_unit = unit; in pts_alloc()
768 psc->pts_cred = crhold(cred); in pts_alloc()
770 tp = tty_alloc(&pts_class, psc); in pts_alloc()
771 knlist_init_mtx(&psc->pts_inpoll.si_note, tp->t_mtx); in pts_alloc()
772 knlist_init_mtx(&psc->pts_outpoll.si_note, tp->t_mtx); in pts_alloc()
775 tty_makedev(tp, td->td_ucred, "pts/%u", psc->pts_unit); in pts_alloc()
789 struct pts_softc *psc; in pts_alloc_external() local
809 psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO); in pts_alloc_external()
810 cv_init(&psc->pts_inwait, "ptsin"); in pts_alloc_external()
811 cv_init(&psc->pts_outwait, "ptsout"); in pts_alloc_external()
813 psc->pts_unit = -1; in pts_alloc_external()
814 psc->pts_cdev = dev; in pts_alloc_external()
815 psc->pts_cred = crhold(cred); in pts_alloc_external()
817 tp = tty_alloc(&pts_class, psc); in pts_alloc_external()
818 knlist_init_mtx(&psc->pts_inpoll.si_note, tp->t_mtx); in pts_alloc_external()
819 knlist_init_mtx(&psc->pts_outpoll.si_note, tp->t_mtx); in pts_alloc_external()