Lines Matching refs:pti

261 	struct ptmx_ioctl *pti = pty_get_ioctl(dev, PF_OPEN_S, &driver);  in ptsopen()  local
262 if (pti == NULL) { in ptsopen()
265 if (!(pti->pt_flags & PF_UNLOCKED)) { in ptsopen()
269 struct tty *tp = pti->pt_tty; in ptsopen()
299 pti->pt_flags |= PF_OPEN_S; in ptsopen()
325 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, &driver); in ptsclose() local
328 if (pti == NULL) { in ptsclose()
332 tp = pti->pt_tty; in ptsclose()
365 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, NULL); in ptsread() local
370 if (pti == NULL) { in ptsread()
373 tp = pti->pt_tty; in ptsread()
393 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, NULL); in ptswrite() local
397 if (pti == NULL) { in ptswrite()
400 tp = pti->pt_tty; in ptswrite()
425 struct ptmx_ioctl *pti = pty_get_ioctl(tp->t_dev, 0, NULL); in ptsstart() local
426 if (pti == NULL) { in ptsstart()
432 if (pti->pt_flags & PF_STOPPED) { in ptsstart()
433 pti->pt_flags &= ~PF_STOPPED; in ptsstart()
434 pti->pt_send = TIOCPKT_START; in ptsstart()
457 struct ptmx_ioctl *pti = pty_get_ioctl(tp->t_dev, 0, NULL); in ptcwakeup() local
458 if (pti == NULL) { in ptcwakeup()
463 selwakeup(&pti->pt_selr); in ptcwakeup()
465 ptcwakeup_knote(&pti->pt_selr, 1); in ptcwakeup()
468 selwakeup(&pti->pt_selw); in ptcwakeup()
470 ptcwakeup_knote(&pti->pt_selw, 1); in ptcwakeup()
478 struct ptmx_ioctl *pti = pty_get_ioctl(dev, PF_OPEN_M, &driver); in ptcopen() local
479 if (pti == NULL) { in ptcopen()
481 } else if (pti == (struct ptmx_ioctl*)-1) { in ptcopen()
485 struct tty *tp = pti->pt_tty; in ptcopen()
510 pti->pt_flags = PF_UNLOCKED; in ptcopen()
511 pti->pt_send = 0; in ptcopen()
512 pti->pt_ucntl = 0; in ptcopen()
523 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, &driver); in ptcclose() local
527 if (!pti) { in ptcclose()
531 tp = pti->pt_tty; in ptcclose()
557 SLIST_FOREACH(kn, &pti->pt_selr.si_note, kn_selnext) { in ptcclose()
558 KNOTE_DETACH(&pti->pt_selr.si_note, kn); in ptcclose()
560 selthreadclear(&pti->pt_selr); in ptcclose()
561 SLIST_FOREACH(kn, &pti->pt_selw.si_note, kn_selnext) { in ptcclose()
562 KNOTE_DETACH(&pti->pt_selw.si_note, kn); in ptcclose()
564 selthreadclear(&pti->pt_selw); in ptcclose()
581 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, NULL); local
586 if (pti == NULL) {
589 tp = pti->pt_tty;
600 if (pti->pt_flags & PF_PKT && pti->pt_send) {
601 error = ureadc((int)pti->pt_send, uio);
605 if (pti->pt_send & TIOCPKT_IOCTL) {
626 pti->pt_send = 0;
629 if (pti->pt_flags & PF_UCNTL && pti->pt_ucntl) {
630 error = ureadc((int)pti->pt_ucntl, uio);
634 pti->pt_ucntl = 0;
653 if (pti->pt_flags & (PF_PKT | PF_UCNTL)) {
679 struct ptmx_ioctl *pti = pty_get_ioctl(tp->t_dev, 0, NULL); local
682 if (pti == NULL) {
689 pti->pt_flags |= PF_STOPPED;
691 pti->pt_flags &= ~PF_STOPPED;
693 pti->pt_send |= flush;
715 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, NULL); local
719 if (pti == NULL) {
722 tp = pti->pt_tty;
767 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, &driver); local
771 if (pti == NULL) {
774 tp = pti->pt_tty;
795 (((pti->pt_flags & PF_PKT) && pti->pt_send) ||
796 ((pti->pt_flags & PF_UCNTL) && pti->pt_ucntl))) {
800 selrecord(p, &pti->pt_selr, wql);
817 selrecord(p, &pti->pt_selw, wql);
841 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, NULL); local
849 if (pti == NULL) {
852 tp = pti->pt_tty;
927 struct ptmx_ioctl *pti = pty_get_ioctl(dev, 0, &driver); local
932 if (pti == NULL || pti->pt_tty == NULL) {
940 tp = pti->pt_tty;
966 if (pti->pt_flags & PF_PKT) {
967 pti->pt_send |= TIOCPKT_IOCTL;
973 (pti->pt_flags & PF_PKT)) {
974 pti->pt_send |= TIOCPKT_IOCTL;
992 if (pti->pt_flags & PF_UCNTL) {
996 pti->pt_flags |= PF_PKT;
998 pti->pt_flags &= ~PF_PKT;
1004 if (pti->pt_flags & PF_PKT) {
1008 pti->pt_flags |= PF_UCNTL;
1010 pti->pt_flags &= ~PF_UCNTL;
1055 error = _devfs_setattr(pti->pt_devhandle, 0620, kauth_getuid(), GID_TTY);
1087 pti->pt_flags |= PF_UNLOCKED;
1107 if (pti->pt_flags & PF_UCNTL && (cmd & ~0xff) == UIOCCMD(0)) {
1110 pti->pt_ucntl = (u_char)cmd;
1133 if ((tp->t_lflag & EXTPROC) && (pti->pt_flags & PF_PKT)) {
1148 pti->pt_send |= TIOCPKT_IOCTL;
1157 if (pti->pt_flags & PF_NOSTOP) {
1159 pti->pt_send &= ~TIOCPKT_NOSTOP;
1160 pti->pt_send |= TIOCPKT_DOSTOP;
1161 pti->pt_flags &= ~PF_NOSTOP;
1166 pti->pt_send &= ~TIOCPKT_DOSTOP;
1167 pti->pt_send |= TIOCPKT_NOSTOP;
1168 pti->pt_flags |= PF_NOSTOP;