Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
tty_port.c File Reference
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/timer.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/wait.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/module.h>

Go to the source code of this file.

Functions

void tty_port_init (struct tty_port *port)
 
 EXPORT_SYMBOL (tty_port_init)
 
void tty_port_link_device (struct tty_port *port, struct tty_driver *driver, unsigned index)
 
 EXPORT_SYMBOL_GPL (tty_port_link_device)
 
struct devicetty_port_register_device (struct tty_port *port, struct tty_driver *driver, unsigned index, struct device *device)
 
 EXPORT_SYMBOL_GPL (tty_port_register_device)
 
struct devicetty_port_register_device_attr (struct tty_port *port, struct tty_driver *driver, unsigned index, struct device *device, void *drvdata, const struct attribute_group **attr_grp)
 
 EXPORT_SYMBOL_GPL (tty_port_register_device_attr)
 
int tty_port_alloc_xmit_buf (struct tty_port *port)
 
 EXPORT_SYMBOL (tty_port_alloc_xmit_buf)
 
void tty_port_free_xmit_buf (struct tty_port *port)
 
 EXPORT_SYMBOL (tty_port_free_xmit_buf)
 
void tty_port_put (struct tty_port *port)
 
 EXPORT_SYMBOL (tty_port_put)
 
struct tty_structtty_port_tty_get (struct tty_port *port)
 
 EXPORT_SYMBOL (tty_port_tty_get)
 
void tty_port_tty_set (struct tty_port *port, struct tty_struct *tty)
 
 EXPORT_SYMBOL (tty_port_tty_set)
 
void tty_port_hangup (struct tty_port *port)
 
 EXPORT_SYMBOL (tty_port_hangup)
 
int tty_port_carrier_raised (struct tty_port *port)
 
 EXPORT_SYMBOL (tty_port_carrier_raised)
 
void tty_port_raise_dtr_rts (struct tty_port *port)
 
 EXPORT_SYMBOL (tty_port_raise_dtr_rts)
 
void tty_port_lower_dtr_rts (struct tty_port *port)
 
 EXPORT_SYMBOL (tty_port_lower_dtr_rts)
 
int tty_port_block_til_ready (struct tty_port *port, struct tty_struct *tty, struct file *filp)
 
 EXPORT_SYMBOL (tty_port_block_til_ready)
 
int tty_port_close_start (struct tty_port *port, struct tty_struct *tty, struct file *filp)
 
 EXPORT_SYMBOL (tty_port_close_start)
 
void tty_port_close_end (struct tty_port *port, struct tty_struct *tty)
 
 EXPORT_SYMBOL (tty_port_close_end)
 
void tty_port_close (struct tty_port *port, struct tty_struct *tty, struct file *filp)
 
 EXPORT_SYMBOL (tty_port_close)
 
int tty_port_install (struct tty_port *port, struct tty_driver *driver, struct tty_struct *tty)
 
 EXPORT_SYMBOL_GPL (tty_port_install)
 
int tty_port_open (struct tty_port *port, struct tty_struct *tty, struct file *filp)
 
 EXPORT_SYMBOL (tty_port_open)
 

Function Documentation

EXPORT_SYMBOL ( tty_port_init  )
EXPORT_SYMBOL ( tty_port_alloc_xmit_buf  )
EXPORT_SYMBOL ( tty_port_free_xmit_buf  )
EXPORT_SYMBOL ( tty_port_put  )
EXPORT_SYMBOL ( tty_port_tty_get  )
EXPORT_SYMBOL ( tty_port_tty_set  )
EXPORT_SYMBOL ( tty_port_hangup  )
EXPORT_SYMBOL ( tty_port_carrier_raised  )
EXPORT_SYMBOL ( tty_port_raise_dtr_rts  )
EXPORT_SYMBOL ( tty_port_lower_dtr_rts  )
EXPORT_SYMBOL ( tty_port_block_til_ready  )
EXPORT_SYMBOL ( tty_port_close_start  )
EXPORT_SYMBOL ( tty_port_close_end  )
EXPORT_SYMBOL ( tty_port_close  )
EXPORT_SYMBOL ( tty_port_open  )
EXPORT_SYMBOL_GPL ( tty_port_link_device  )
EXPORT_SYMBOL_GPL ( tty_port_register_device  )
EXPORT_SYMBOL_GPL ( tty_port_register_device_attr  )
EXPORT_SYMBOL_GPL ( tty_port_install  )
int tty_port_alloc_xmit_buf ( struct tty_port port)

Definition at line 100 of file tty_port.c.

int tty_port_block_til_ready ( struct tty_port port,
struct tty_struct tty,
struct file filp 
)

tty_port_block_til_ready - Waiting logic for tty open : the tty port being opened : the tty device being bound : the file pointer of the opener

Implement the core POSIX/SuS tty behaviour when opening a tty device. Handles:

  • hangup (both before and during)
  • non blocking open
  • rts/dtr/dcd
  • signals
  • port flags and counts

The passed tty_port must implement the carrier_raised method if it can do carrier detect and the dtr_rts method if it supports software management of these lines. Note that the dtr/rts raise is done each iteration as a hangup may have previously dropped them while we wait.

Definition at line 288 of file tty_port.c.

int tty_port_carrier_raised ( struct tty_port port)

tty_port_carrier_raised - carrier raised check : tty port

Wrapper for the carrier detect logic. For the moment this is used to hide some internal details. This will eventually become entirely internal to the tty port.

Definition at line 228 of file tty_port.c.

void tty_port_close ( struct tty_port port,
struct tty_struct tty,
struct file filp 
)

Definition at line 468 of file tty_port.c.

void tty_port_close_end ( struct tty_port port,
struct tty_struct tty 
)

Definition at line 446 of file tty_port.c.

int tty_port_close_start ( struct tty_port port,
struct tty_struct tty,
struct file filp 
)

Definition at line 382 of file tty_port.c.

void tty_port_free_xmit_buf ( struct tty_port port)

Definition at line 113 of file tty_port.c.

void tty_port_hangup ( struct tty_port port)

tty_port_hangup - hangup helper : tty port

Perform port level tty hangup flag and count changes. Drop the tty reference.

Definition at line 200 of file tty_port.c.

void tty_port_init ( struct tty_port port)

Definition at line 21 of file tty_port.c.

int tty_port_install ( struct tty_port port,
struct tty_driver driver,
struct tty_struct tty 
)

tty_port_install - generic tty->ops->install handler : tty_port of the device : tty_driver for this device : tty to be installed

It is the same as tty_standard_install except the provided is linked to a concrete tty specified by . Use this or tty_port_register_device (or both). Call tty_port_link_device as a last resort.

Definition at line 490 of file tty_port.c.

void tty_port_link_device ( struct tty_port port,
struct tty_driver driver,
unsigned  index 
)

tty_port_link_device - link tty and tty_port : tty_port of the device : tty_driver for this device : index of the tty

Provide the tty layer wit ha link from a tty (specified by ) to a tty_port (). Use this only if neither tty_port_register_device nor tty_port_install is used in the driver. If used, this has to be called before tty_register_driver.

Definition at line 47 of file tty_port.c.

void tty_port_lower_dtr_rts ( struct tty_port port)

tty_port_lower_dtr_rts - Lower DTR/RTS : tty port

Wrapper for the DTR/RTS raise logic. For the moment this is used to hide some internal details. This will eventually become entirely internal to the tty port.

Definition at line 261 of file tty_port.c.

int tty_port_open ( struct tty_port port,
struct tty_struct tty,
struct file filp 
)

Definition at line 498 of file tty_port.c.

void tty_port_put ( struct tty_port port)

Definition at line 135 of file tty_port.c.

void tty_port_raise_dtr_rts ( struct tty_port port)

tty_port_raise_dtr_rts - Raise DTR/RTS : tty port

Wrapper for the DTR/RTS raise logic. For the moment this is used to hide some internal details. This will eventually become entirely internal to the tty port.

Definition at line 245 of file tty_port.c.

struct device* tty_port_register_device ( struct tty_port port,
struct tty_driver driver,
unsigned  index,
struct device device 
)
read

tty_port_register_device - register tty device : tty_port of the device : tty_driver for this device : index of the tty : parent if exists, otherwise NULL

It is the same as tty_register_device except the provided is linked to a concrete tty specified by . Use this or tty_port_install (or both). Call tty_port_link_device as a last resort.

Definition at line 67 of file tty_port.c.

struct device* tty_port_register_device_attr ( struct tty_port port,
struct tty_driver driver,
unsigned  index,
struct device device,
void drvdata,
const struct attribute_group **  attr_grp 
)
read

tty_port_register_device_attr - register tty device : tty_port of the device : tty_driver for this device : index of the tty : parent if exists, otherwise NULL : Driver data to be set to device. : Attribute group to be set on device.

It is the same as tty_register_device_attr except the provided is linked to a concrete tty specified by . Use this or tty_port_install (or both). Call tty_port_link_device as a last resort.

Definition at line 89 of file tty_port.c.

struct tty_struct* tty_port_tty_get ( struct tty_port port)
read

tty_port_tty_get - get a tty reference : tty port

Return a refcount protected tty instance or NULL if the port is not associated with a tty (eg due to close or hangup)

Definition at line 150 of file tty_port.c.

void tty_port_tty_set ( struct tty_port port,
struct tty_struct tty 
)

tty_port_tty_set - set the tty of a port : tty port : the tty

Associate the port and tty pair. Manages any internal refcounts. Pass NULL to deassociate a port

Definition at line 171 of file tty_port.c.