static int smbsim_serial_open(struct tty_struct *tty, struct file *filp) { SMBSIM_SERIAL_DEV *dev = smbsim_serial_devs + tty->index; TRACE_MSG(TRACE_LEVEL_INFO, TRACE_FLAG_DEFAULT, "0x%p\n", dev); return tty_port_open(&dev->tty_port, tty, filp); }
static int acm_tty_open(struct tty_struct *tty, struct file *filp) { struct acm *acm = tty->driver_data; dev_dbg(tty->dev, "%s\n", __func__); return tty_port_open(&acm->port, tty, filp); }
static int ram_console_tty_open(struct tty_struct *tty, struct file *filp) { tty->driver_data = &ram_console_port; printk("ram_console_tty open\n"); // tty_set_ldisc(N_TTY); return tty_port_open(&ram_console_port.port, tty, filp); }
static int ipoctal_open(struct tty_struct *tty, struct file *file) { struct ipoctal_channel *channel; channel = dev_get_drvdata(tty->dev); tty->driver_data = channel; return tty_port_open(&channel->tty_port, tty, file); }
/* * This function can be called multiple times for a given tty_struct, which is * why we initialize bc->ttys in ehv_bc_tty_port_activate() instead. * * The tty layer will still call this function even if the device was not * registered (i.e. tty_register_device() was not called). This happens * because tty_register_device() is optional and some legacy drivers don't * use it. So we need to check for that. */ static int ehv_bc_tty_open(struct tty_struct *ttys, struct file *filp) { struct ehv_bc_data *bc = &bcs[ttys->index]; if (!bc->dev) return -ENODEV; return tty_port_open(&bc->port, ttys, filp); }
static int kgdb_nmi_tty_open(struct tty_struct *tty, struct file *file) { struct kgdb_nmi_tty_priv *priv = tty->driver_data; unsigned int mode = file->f_flags & O_ACCMODE; int ret; ret = tty_port_open(&priv->port, tty, file); if (!ret && (mode == O_RDONLY || mode == O_RDWR)) atomic_inc(&kgdb_nmi_num_readers); return ret; }
/* * This routine is called whenever a serial port is opened. It * enables interrupts for a serial port, linking in its async structure into * the IRQ chain. It also performs the serial-specific * initialization for the tty structure. */ static int rs_open(struct tty_struct *tty, struct file * filp) { struct serial_state *info = rs_table + tty->index; struct tty_port *port = &info->port; tty->driver_data = info; tty->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; /* * figure out which console to use (should be one already) */ console = console_drivers; while (console) { if ((console->flags & CON_ENABLED) && console->write) break; console = console->next; } return tty_port_open(port, tty, filp); }
static int ntty_open(struct tty_struct *tty, struct file *filp) { struct port *port = tty->driver_data; return tty_port_open(&port->port, tty, filp); }
static int tpk_open(struct tty_struct *tty, struct file *filp) { tty->driver_data = &tpk_port; return tty_port_open(&tpk_port.port, tty, filp); }
static int goldfish_tty_open(struct tty_struct *tty, struct file *filp) { struct goldfish_tty *qtty = &goldfish_ttys[tty->index]; return tty_port_open(&qtty->port, tty, filp); }
static int smd_tty_open(struct tty_struct *tty, struct file *f) { struct smd_tty_info *info = smd_tty + tty->index; return tty_port_open(&info->port, tty, f); }
static int rpmsgtty_open(struct tty_struct *tty, struct file *filp) { return tty_port_open(tty->port, tty, filp); }
static int gdm_tty_open(struct tty_struct *tty, struct file *filp) { struct gdm *gdm = tty->driver_data; return tty_port_open(&gdm->port, tty, filp); }