Lines Matching defs:ldisc
42 * callers who will do ldisc lookups and cannot sleep.
51 * @new_ldisc: pointer to the ldisc object
56 * Locking: takes %tty_ldiscs_lock to guard against ldisc races
75 * @ldisc: ldisc number
80 * Locking: takes %tty_ldiscs_lock to guard against ldisc races
83 void tty_unregister_ldisc(struct tty_ldisc_ops *ldisc)
88 tty_ldiscs[ldisc->num] = NULL;
122 * tty_ldisc_get - take a reference to an ldisc
124 * @disc: ldisc number
137 * Locking: takes %tty_ldiscs_lock to guard against ldisc races
148 * Get the ldisc ops - we may need to request them to be loaded
155 request_module("tty-ldisc-%d", disc);
173 * tty_ldisc_put - release the ldisc
223 * tty_ldisc_ref_wait - wait for the tty ldisc
230 * descriptor, otherwise valid ldisc reference
234 * change, such as an existing ldisc reference (which we check for).
237 * to wait for any ldisc lifetime events to finish.
244 ld = tty->ldisc;
252 * tty_ldisc_ref - get the tty ldisc
264 ld = tty->ldisc;
273 * tty_ldisc_deref - free a tty ldisc reference
379 * @tty: tty to flush ldisc for
395 * tty_set_termios_ldisc - set ldisc field
402 * The line discipline-related tty_struct fields are reset to prevent the ldisc
403 * driver from re-using stale information for the new ldisc instance.
419 * @tty: tty we are opening the ldisc on
444 * @tty: tty we are opening the ldisc on
460 * tty_ldisc_failto - helper for ldisc failback
461 * @tty: tty to open the ldisc on
462 * @ld: ldisc we are trying to fail back to
464 * Helper to try and recover a tty when switching back to the old ldisc fails
475 tty->ldisc = disc;
484 * tty_ldisc_restore - helper for tty ldisc change
486 * @old: previous ldisc
497 pr_warn("Falling back ldisc for %s.\n", name);
505 panic("Couldn't open N_NULL ldisc for %s.", name);
515 * ldisc change logic has to protect itself against any overlapping ldisc
533 if (!tty->ldisc) {
539 if (tty->ldisc->ops->num == disc)
548 old_ldisc = tty->ldisc;
554 tty->ldisc = new_ldisc;
564 if (tty->ldisc->ops->num != old_ldisc->ops->num && tty->ops->set_ldisc) {
571 * At this point we hold a reference to the new ldisc and a
572 * reference to the old ldisc, or we hold two references to
573 * the old ldisc (if it was restored as part of error cleanup
575 * the old ldisc is correct.
594 * tty_ldisc_kill - teardown ldisc
597 * Perform final close of the ldisc and reset @tty->ldisc
602 if (!tty->ldisc)
605 * Now kill off the ldisc
607 tty_ldisc_close(tty, tty->ldisc);
608 tty_ldisc_put(tty->ldisc);
610 tty->ldisc = NULL;
630 * tty_ldisc_reinit - reinitialise the tty ldisc
636 * opening the new non-%N_TTY instance, the instance is dropped and @tty->ldisc
653 if (tty->ldisc) {
654 tty_ldisc_close(tty, tty->ldisc);
655 tty_ldisc_put(tty->ldisc);
659 tty->ldisc = ld;
661 retval = tty_ldisc_open(tty, tty->ldisc);
663 tty_ldisc_put(tty->ldisc);
664 tty->ldisc = NULL;
670 * tty_ldisc_hangup - hangup ldisc reset
678 * Locking: We can take the ldisc mutex as the rest of the code is careful to
688 tty_ldisc_debug(tty, "%p: hangup\n", tty->ldisc);
717 if (tty->ldisc) {
739 int retval = tty_ldisc_open(tty, tty->ldisc);
749 retval = tty_ldisc_open(o_tty, o_tty->ldisc);
751 tty_ldisc_close(tty, tty->ldisc);
763 * the line discpline layer. On exit, each tty's ldisc is %NULL.
789 * tty_ldisc_init - ldisc setup for new tty
801 tty->ldisc = ld;
806 * tty_ldisc_deinit - ldisc cleanup for new tty
815 if (tty->ldisc)
816 tty_ldisc_put(tty->ldisc);
817 tty->ldisc = NULL;