Lines Matching refs:pti
268 struct ptmx_ioctl *pti = pty_get_ioctl(dev, PF_OPEN_S, &driver); in ptsopen() local
269 if (pti == NULL) { in ptsopen()
272 if (!(pti->pt_flags & PF_UNLOCKED)) { in ptsopen()
277 struct tty *tp = pti->pt_tty; in ptsopen()
339 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, &driver); in ptsclose() local
342 if (pti == NULL) { in ptsclose()
346 tp = pti->pt_tty; in ptsclose()
379 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, NULL); in ptsread() local
384 if (pti == NULL) { in ptsread()
387 tp = pti->pt_tty; in ptsread()
407 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, NULL); in ptswrite() local
411 if (pti == NULL) { in ptswrite()
414 tp = pti->pt_tty; in ptswrite()
439 struct ptmx_ioctl *pti = pty_get_ioctl(tp->t_dev, 0, NULL); in ptsstart() local
440 if (pti == NULL) { in ptsstart()
446 if (pti->pt_flags & PF_STOPPED) { in ptsstart()
447 pti->pt_flags &= ~PF_STOPPED; in ptsstart()
448 pti->pt_send = TIOCPKT_START; in ptsstart()
471 struct ptmx_ioctl *pti = pty_get_ioctl(tp->t_dev, 0, NULL); in ptcwakeup() local
472 if (pti == NULL) { in ptcwakeup()
477 selwakeup(&pti->pt_selr); in ptcwakeup()
479 ptcwakeup_knote(&pti->pt_selr, 1); in ptcwakeup()
482 selwakeup(&pti->pt_selw); in ptcwakeup()
484 ptcwakeup_knote(&pti->pt_selw, 1); in ptcwakeup()
492 struct ptmx_ioctl *pti = pty_get_ioctl(dev, PF_OPEN_M, &driver); in ptcopen() local
493 if (pti == NULL) { in ptcopen()
495 } else if (pti == (struct ptmx_ioctl*)-1) { in ptcopen()
499 struct tty *tp = pti->pt_tty; in ptcopen()
524 pti->pt_flags = PF_UNLOCKED; in ptcopen()
525 pti->pt_send = 0; in ptcopen()
526 pti->pt_ucntl = 0; in ptcopen()
537 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, &driver); in ptcclose() local
542 if (!pti) { in ptcclose()
546 tp = pti->pt_tty; in ptcclose()
604 knote(&pti->pt_selr.si_note, NOTE_REVOKE, true); in ptcclose()
605 selthreadclear(&pti->pt_selr); in ptcclose()
606 knote(&pti->pt_selw.si_note, NOTE_REVOKE, true); in ptcclose()
607 selthreadclear(&pti->pt_selw); in ptcclose()
624 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, NULL); local
629 if (pti == NULL) {
632 tp = pti->pt_tty;
643 if (pti->pt_flags & PF_PKT && pti->pt_send) {
644 error = ureadc((int)pti->pt_send, uio);
648 if (pti->pt_send & TIOCPKT_IOCTL) {
669 pti->pt_send = 0;
672 if (pti->pt_flags & PF_UCNTL && pti->pt_ucntl) {
673 error = ureadc((int)pti->pt_ucntl, uio);
677 pti->pt_ucntl = 0;
696 if (pti->pt_flags & (PF_PKT | PF_UCNTL)) {
722 struct ptmx_ioctl *pti = pty_get_ioctl(tp->t_dev, 0, NULL); local
725 if (pti == NULL) {
732 pti->pt_flags |= PF_STOPPED;
734 pti->pt_flags &= ~PF_STOPPED;
736 pti->pt_send |= flush;
758 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, NULL); local
762 if (pti == NULL) {
765 tp = pti->pt_tty;
810 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, &driver); local
814 if (pti == NULL) {
817 tp = pti->pt_tty;
838 (((pti->pt_flags & PF_PKT) && pti->pt_send) ||
839 ((pti->pt_flags & PF_UCNTL) && pti->pt_ucntl))) {
843 selrecord(p, &pti->pt_selr, wql);
860 selrecord(p, &pti->pt_selw, wql);
884 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, NULL); local
892 if (pti == NULL) {
895 tp = pti->pt_tty;
970 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, &driver); local
975 if (pti == NULL || pti->pt_tty == NULL) {
983 tp = pti->pt_tty;
1009 if (pti->pt_flags & PF_PKT) {
1010 pti->pt_send |= TIOCPKT_IOCTL;
1016 (pti->pt_flags & PF_PKT)) {
1017 pti->pt_send |= TIOCPKT_IOCTL;
1035 if (pti->pt_flags & PF_UCNTL) {
1039 pti->pt_flags |= PF_PKT;
1041 pti->pt_flags &= ~PF_PKT;
1047 if (pti->pt_flags & PF_PKT) {
1051 pti->pt_flags |= PF_UCNTL;
1053 pti->pt_flags &= ~PF_UCNTL;
1098 error = _devfs_setattr(pti->pt_devhandle, 0620, kauth_getuid(), GID_TTY);
1130 pti->pt_flags |= PF_UNLOCKED;
1165 if (pti->pt_flags & PF_UCNTL && (cmd & ~0xff) == UIOCCMD(0)) {
1168 pti->pt_ucntl = (u_char)cmd;
1191 if ((tp->t_lflag & EXTPROC) && (pti->pt_flags & PF_PKT)) {
1206 pti->pt_send |= TIOCPKT_IOCTL;
1215 if (pti->pt_flags & PF_NOSTOP) {
1217 pti->pt_send &= ~TIOCPKT_NOSTOP;
1218 pti->pt_send |= TIOCPKT_DOSTOP;
1219 pti->pt_flags &= ~PF_NOSTOP;
1224 pti->pt_send &= ~TIOCPKT_DOSTOP;
1225 pti->pt_send |= TIOCPKT_NOSTOP;
1226 pti->pt_flags |= PF_NOSTOP;