Lines Matching defs:tty

36  * registers as a tty device AND a network device (if dosyncppp option
70 #include <linux/tty.h>
820 static int tiocmget(struct tty_struct *tty);
821 static int tiocmset(struct tty_struct *tty,
908 static void mgsl_wait_until_sent(struct tty_struct *tty, int timeout);
954 static void ldisc_receive_buf(struct tty_struct *tty,
958 if (!tty)
960 ld = tty_ldisc_ref(tty);
963 ld->ops->receive_buf(tty, data, flags, count);
970 * Arguments: tty pointer to tty info structure
973 static void mgsl_stop(struct tty_struct *tty)
975 struct mgsl_struct *info = tty->driver_data;
978 if (mgsl_paranoia_check(info, tty->name, "mgsl_stop"))
993 * Arguments: tty pointer to tty info structure
996 static void mgsl_start(struct tty_struct *tty)
998 struct mgsl_struct *info = tty->driver_data;
1001 if (mgsl_paranoia_check(info, tty->name, "mgsl_start"))
1118 struct tty_struct *tty = info->port.tty;
1125 if (tty)
1126 tty_wakeup(tty);
1260 if (info->port.tty->stopped || info->port.tty->hw_stopped) {
1351 if (info->port.tty)
1352 tty_hangup(info->port.tty);
1358 if (info->port.tty->hw_stopped) {
1362 info->port.tty->hw_stopped = 0;
1371 if (info->port.tty)
1372 info->port.tty->hw_stopped = 1;
1406 if (info->port.tty->stopped || info->port.tty->hw_stopped) {
1488 /* discard char if tty control flags say so */
1497 do_SAK(info->port.tty);
1780 if (capable(CAP_SYS_ADMIN) && info->port.tty)
1781 set_bit(TTY_IO_ERROR, &info->port.tty->flags);
1789 if (info->port.tty)
1790 clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
1845 if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) {
1854 if (info->port.tty)
1855 set_bit(TTY_IO_ERROR, &info->port.tty->flags);
1888 if (info->netcount || info->port.tty->termios.c_cflag & CREAD)
1901 if (!info->port.tty)
1908 cflag = info->port.tty->termios.c_cflag;
1952 * allow tty settings to override, otherwise keep the
1956 info->params.data_rate = tty_get_baud_rate(info->port.tty);
1967 /* process tty input control flags */
1970 if (I_INPCK(info->port.tty))
1972 if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty))
1975 if (I_IGNPAR(info->port.tty))
1977 if (I_IGNBRK(info->port.tty)) {
1982 if (I_IGNPAR(info->port.tty))
1994 * Arguments: tty pointer to tty information structure
1999 static int mgsl_put_char(struct tty_struct *tty, unsigned char ch)
2001 struct mgsl_struct *info = tty->driver_data;
2010 if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char"))
2036 * Arguments: tty pointer to tty information structure
2039 static void mgsl_flush_chars(struct tty_struct *tty)
2041 struct mgsl_struct *info = tty->driver_data;
2048 if (mgsl_paranoia_check(info, tty->name, "mgsl_flush_chars"))
2051 if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
2083 * tty pointer to tty information structure
2089 static int mgsl_write(struct tty_struct * tty,
2093 struct mgsl_struct *info = tty->driver_data;
2100 if (mgsl_paranoia_check(info, tty->name, "mgsl_write"))
2191 if (info->xmit_cnt && !tty->stopped && !tty->hw_stopped) {
2210 * Arguments: tty pointer to tty info structure
2213 static int mgsl_write_room(struct tty_struct *tty)
2215 struct mgsl_struct *info = tty->driver_data;
2218 if (mgsl_paranoia_check(info, tty->name, "mgsl_write_room"))
2245 * Arguments: tty pointer to tty info structure
2248 static int mgsl_chars_in_buffer(struct tty_struct *tty)
2250 struct mgsl_struct *info = tty->driver_data;
2256 if (mgsl_paranoia_check(info, tty->name, "mgsl_chars_in_buffer"))
2279 * Arguments: tty pointer to tty info structure
2282 static void mgsl_flush_buffer(struct tty_struct *tty)
2284 struct mgsl_struct *info = tty->driver_data;
2291 if (mgsl_paranoia_check(info, tty->name, "mgsl_flush_buffer"))
2299 tty_wakeup(tty);
2306 * Arguments: tty pointer to tty info structure
2310 static void mgsl_send_xchar(struct tty_struct *tty, char ch)
2312 struct mgsl_struct *info = tty->driver_data;
2319 if (mgsl_paranoia_check(info, tty->name, "mgsl_send_xchar"))
2336 * Arguments: tty pointer to tty info structure
2339 static void mgsl_throttle(struct tty_struct * tty)
2341 struct mgsl_struct *info = tty->driver_data;
2348 if (mgsl_paranoia_check(info, tty->name, "mgsl_throttle"))
2351 if (I_IXOFF(tty))
2352 mgsl_send_xchar(tty, STOP_CHAR(tty));
2354 if (C_CRTSCTS(tty)) {
2366 * Arguments: tty pointer to tty info structure
2369 static void mgsl_unthrottle(struct tty_struct * tty)
2371 struct mgsl_struct *info = tty->driver_data;
2378 if (mgsl_paranoia_check(info, tty->name, "mgsl_unthrottle"))
2381 if (I_IXOFF(tty)) {
2385 mgsl_send_xchar(tty, START_CHAR(tty));
2388 if (C_CRTSCTS(tty)) {
2828 static int tiocmget(struct tty_struct *tty)
2830 struct mgsl_struct *info = tty->driver_data;
2853 static int tiocmset(struct tty_struct *tty,
2856 struct mgsl_struct *info = tty->driver_data;
2881 * Arguments: tty pointer to tty instance data
2885 static int mgsl_break(struct tty_struct *tty, int break_state)
2887 struct mgsl_struct * info = tty->driver_data;
2894 if (mgsl_paranoia_check(info, tty->name, "mgsl_break"))
2913 static int msgl_get_icount(struct tty_struct *tty,
2917 struct mgsl_struct * info = tty->driver_data;
2943 * tty pointer to tty instance data
2949 static int mgsl_ioctl(struct tty_struct *tty,
2952 struct mgsl_struct * info = tty->driver_data;
2958 if (mgsl_paranoia_check(info, tty->name, "mgsl_ioctl"))
2962 if (tty_io_error(tty))
3012 * tty pointer to tty structure
3017 static void mgsl_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
3019 struct mgsl_struct *info = tty->driver_data;
3024 tty->driver->name );
3029 if ((old_termios->c_cflag & CBAUD) && !C_BAUD(tty)) {
3037 if (!(old_termios->c_cflag & CBAUD) && C_BAUD(tty)) {
3039 if (!C_CRTSCTS(tty) || !tty_throttled(tty))
3047 if (old_termios->c_cflag & CRTSCTS && !C_CRTSCTS(tty)) {
3048 tty->hw_stopped = 0;
3049 mgsl_start(tty);
3061 * tty pointer to open tty structure
3066 static void mgsl_close(struct tty_struct *tty, struct file * filp)
3068 struct mgsl_struct * info = tty->driver_data;
3070 if (mgsl_paranoia_check(info, tty->name, "mgsl_close"))
3077 if (tty_port_close_start(&info->port, tty, filp) == 0)
3082 mgsl_wait_until_sent(tty, info->timeout);
3083 mgsl_flush_buffer(tty);
3084 tty_ldisc_flush(tty);
3088 tty_port_close_end(&info->port, tty);
3089 info->port.tty = NULL;
3093 tty->driver->name, info->port.count);
3103 * tty pointer to tty info structure
3108 static void mgsl_wait_until_sent(struct tty_struct *tty, int timeout)
3110 struct mgsl_struct * info = tty->driver_data;
3120 if (mgsl_paranoia_check(info, tty->name, "mgsl_wait_until_sent"))
3176 * Arguments: tty pointer to associated tty object
3179 static void mgsl_hangup(struct tty_struct *tty)
3181 struct mgsl_struct * info = tty->driver_data;
3187 if (mgsl_paranoia_check(info, tty->name, "mgsl_hangup"))
3190 mgsl_flush_buffer(tty);
3195 info->port.tty = NULL;
3240 * tty pointer to tty info structure
3246 static int block_til_ready(struct tty_struct *tty, struct file * filp,
3258 __FILE__,__LINE__, tty->driver->name );
3260 if (filp->f_flags & O_NONBLOCK || tty_io_error(tty)) {
3266 if (C_CLOCAL(tty))
3281 __FILE__,__LINE__, tty->driver->name, port->count );
3289 if (C_BAUD(tty) && tty_port_initialized(port))
3311 __FILE__,__LINE__, tty->driver->name, port->count );
3313 tty_unlock(tty);
3315 tty_lock(tty);
3328 __FILE__,__LINE__, tty->driver->name, port->count );
3337 static int mgsl_install(struct tty_driver *driver, struct tty_struct *tty)
3340 int line = tty->index;
3353 if (mgsl_paranoia_check(info, tty->name, "mgsl_open"))
3355 tty->driver_data = info;
3357 return tty_port_install(&info->port, driver, tty);
3363 * Perform serial-specific initialization for the tty structure.
3365 * Arguments: tty pointer to tty info structure
3370 static int mgsl_open(struct tty_struct *tty, struct file * filp)
3372 struct mgsl_struct *info = tty->driver_data;
3376 info->port.tty = tty;
3380 __FILE__,__LINE__,tty->driver->name, info->port.count);
3400 retval = block_til_ready(tty, filp, info);
3415 if (tty->count == 1)
3416 info->port.tty = NULL; /* tty layer will release tty struct */
4204 * perform tty device initialization
4235 printk("%s %s, tty major#%d\n",
4252 printk("%s(%d) failed to unregister tty driver err=%d\n",
6310 struct tty_struct *tty = info->port.tty;
6453 ldisc_receive_buf(tty, info->intermediate_rxbuffer, info->flag_buf, framesize);
6508 struct tty_struct *tty = info->port.tty;
6625 ldisc_receive_buf(tty, info->intermediate_rxbuffer, info->flag_buf, framesize);
7532 /* arbitrate between network and tty opens */