Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
serial.h File Reference
#include <linux/kref.h>
#include <linux/mutex.h>
#include <linux/sysrq.h>
#include <linux/kfifo.h>

Go to the source code of this file.

Data Structures

struct  usb_serial_port
 
struct  usb_serial
 
struct  usb_serial_driver
 

Macros

#define SERIAL_TTY_MAJOR   188 /* Nice legal number now */
 
#define SERIAL_TTY_MINORS   254 /* loads of devices :) */
 
#define SERIAL_TTY_NO_MINOR   255 /* No minor was assigned */
 
#define MAX_NUM_PORTS   8
 
#define RELEVANT_IFLAG(iflag)   (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
 
#define USB_SERIAL_WRITE_BUSY   0
 
#define to_usb_serial_port(d)   container_of(d, struct usb_serial_port, dev)
 
#define to_usb_serial(d)   container_of(d, struct usb_serial, kref)
 
#define to_usb_serial_driver(d)   container_of(d, struct usb_serial_driver, driver)
 
#define dev_err_console(usport, fmt,...)
 
#define usb_serial_module_driver(__name, __serial_drivers, __ids)
 
#define module_usb_serial_driver(__serial_drivers, __ids)   usb_serial_module_driver(KBUILD_MODNAME, __serial_drivers, __ids)
 

Functions

int usb_serial_register_drivers (struct usb_serial_driver *const serial_drivers[], const char *name, const struct usb_device_id *id_table)
 
void usb_serial_deregister_drivers (struct usb_serial_driver *const serial_drivers[])
 
void usb_serial_port_softint (struct usb_serial_port *port)
 
int usb_serial_suspend (struct usb_interface *intf, pm_message_t message)
 
int usb_serial_resume (struct usb_interface *intf)
 
struct usb_serialusb_serial_get_by_index (unsigned int minor)
 
void usb_serial_put (struct usb_serial *serial)
 
int usb_serial_generic_open (struct tty_struct *tty, struct usb_serial_port *port)
 
int usb_serial_generic_write (struct tty_struct *tty, struct usb_serial_port *port, const unsigned char *buf, int count)
 
void usb_serial_generic_close (struct usb_serial_port *port)
 
int usb_serial_generic_resume (struct usb_serial *serial)
 
int usb_serial_generic_write_room (struct tty_struct *tty)
 
int usb_serial_generic_chars_in_buffer (struct tty_struct *tty)
 
void usb_serial_generic_read_bulk_callback (struct urb *urb)
 
void usb_serial_generic_write_bulk_callback (struct urb *urb)
 
void usb_serial_generic_throttle (struct tty_struct *tty)
 
void usb_serial_generic_unthrottle (struct tty_struct *tty)
 
void usb_serial_generic_disconnect (struct usb_serial *serial)
 
void usb_serial_generic_release (struct usb_serial *serial)
 
int usb_serial_generic_register (void)
 
void usb_serial_generic_deregister (void)
 
int usb_serial_generic_submit_read_urbs (struct usb_serial_port *port, gfp_t mem_flags)
 
void usb_serial_generic_process_read_urb (struct urb *urb)
 
int usb_serial_generic_prepare_write_buffer (struct usb_serial_port *port, void *dest, size_t size)
 
int usb_serial_handle_sysrq_char (struct usb_serial_port *port, unsigned int ch)
 
int usb_serial_handle_break (struct usb_serial_port *port)
 
void usb_serial_handle_dcd_change (struct usb_serial_port *usb_port, struct tty_struct *tty, unsigned int status)
 
int usb_serial_bus_register (struct usb_serial_driver *device)
 
void usb_serial_bus_deregister (struct usb_serial_driver *device)
 

Variables

struct usb_serial_port __attribute__
 
struct usb_serial_driver usb_serial_generic_device
 
struct bus_type usb_serial_bus_type
 
struct tty_driverusb_serial_tty_driver
 

Macro Definition Documentation

#define dev_err_console (   usport,
  fmt,
  ... 
)
Value:
do { \
static bool __print_once; \
struct usb_serial_port *__port = (usport); \
if (!__port->port.console || !__print_once) { \
__print_once = true; \
dev_err(&__port->dev, fmt, ##__VA_ARGS__); \
} \
} while (0)

Definition at line 366 of file serial.h.

#define MAX_NUM_PORTS   8

Definition at line 26 of file serial.h.

#define module_usb_serial_driver (   __serial_drivers,
  __ids 
)    usb_serial_module_driver(KBUILD_MODNAME, __serial_drivers, __ids)

Definition at line 401 of file serial.h.

#define RELEVANT_IFLAG (   iflag)    (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))

Definition at line 29 of file serial.h.

#define SERIAL_TTY_MAJOR   188 /* Nice legal number now */

Definition at line 21 of file serial.h.

#define SERIAL_TTY_MINORS   254 /* loads of devices :) */

Definition at line 22 of file serial.h.

#define SERIAL_TTY_NO_MINOR   255 /* No minor was assigned */

Definition at line 23 of file serial.h.

#define to_usb_serial (   d)    container_of(d, struct usb_serial, kref)

Definition at line 171 of file serial.h.

#define to_usb_serial_driver (   d)    container_of(d, struct usb_serial_driver, driver)

Definition at line 293 of file serial.h.

#define to_usb_serial_port (   d)    container_of(d, struct usb_serial_port, dev)

Definition at line 121 of file serial.h.

#define usb_serial_module_driver (   __name,
  __serial_drivers,
  __ids 
)
Value:
static int __init usb_serial_module_init(void) \
{ \
return usb_serial_register_drivers(__serial_drivers, \
__name, __ids); \
} \
module_init(usb_serial_module_init); \
static void __exit usb_serial_module_exit(void) \
{ \
usb_serial_deregister_drivers(__serial_drivers); \
} \
module_exit(usb_serial_module_exit);

Definition at line 388 of file serial.h.

#define USB_SERIAL_WRITE_BUSY   0

Definition at line 32 of file serial.h.

Function Documentation

void usb_serial_bus_deregister ( struct usb_serial_driver device)

Definition at line 192 of file bus.c.

int usb_serial_bus_register ( struct usb_serial_driver device)

Definition at line 179 of file bus.c.

void usb_serial_deregister_drivers ( struct usb_serial_driver *const  serial_drivers[])

usb_serial_deregister_drivers - deregister drivers for a usb-serial module : NULL-terminated array of pointers to drivers to be deregistered

Deregisters all the drivers in the array and deregisters and frees the struct usb_driver that was created by the call to usb_serial_register_drivers().

Definition at line 1444 of file usb-serial.c.

int usb_serial_generic_chars_in_buffer ( struct tty_struct tty)

Definition at line 249 of file generic.c.

void usb_serial_generic_close ( struct usb_serial_port port)

Definition at line 128 of file generic.c.

void usb_serial_generic_deregister ( void  )

Definition at line 78 of file generic.c.

void usb_serial_generic_disconnect ( struct usb_serial serial)

Definition at line 519 of file generic.c.

int usb_serial_generic_open ( struct tty_struct tty,
struct usb_serial_port port 
)

Definition at line 86 of file generic.c.

int usb_serial_generic_prepare_write_buffer ( struct usb_serial_port port,
void dest,
size_t  size 
)

Definition at line 134 of file generic.c.

void usb_serial_generic_process_read_urb ( struct urb urb)

Definition at line 312 of file generic.c.

void usb_serial_generic_read_bulk_callback ( struct urb urb)

Definition at line 342 of file generic.c.

int usb_serial_generic_register ( void  )

Definition at line 61 of file generic.c.

void usb_serial_generic_release ( struct usb_serial serial)

Definition at line 529 of file generic.c.

int usb_serial_generic_resume ( struct usb_serial serial)

Definition at line 491 of file generic.c.

int usb_serial_generic_submit_read_urbs ( struct usb_serial_port port,
gfp_t  mem_flags 
)

Definition at line 291 of file generic.c.

void usb_serial_generic_throttle ( struct tty_struct tty)

Definition at line 409 of file generic.c.

void usb_serial_generic_unthrottle ( struct tty_struct tty)

Definition at line 422 of file generic.c.

int usb_serial_generic_write ( struct tty_struct tty,
struct usb_serial_port port,
const unsigned char buf,
int  count 
)

usb_serial_generic_write - generic write function for serial USB devices : Pointer to &struct tty_struct for the device : Pointer to the &usb_serial_port structure for the device : Pointer to the data to write : Number of bytes to write

Returns the number of characters actually written, which may be anything from zero to . If an error occurs, it returns the negative errno value.

Definition at line 211 of file generic.c.

void usb_serial_generic_write_bulk_callback ( struct urb urb)

Definition at line 378 of file generic.c.

int usb_serial_generic_write_room ( struct tty_struct tty)

Definition at line 232 of file generic.c.

struct usb_serial* usb_serial_get_by_index ( unsigned int  minor)
read
int usb_serial_handle_break ( struct usb_serial_port port)

Definition at line 459 of file generic.c.

void usb_serial_handle_dcd_change ( struct usb_serial_port usb_port,
struct tty_struct tty,
unsigned int  status 
)

usb_serial_handle_dcd_change - handle a change of carrier detect state : usb_serial_port structure for the open port : tty_struct structure for the port : new carrier detect status, nonzero if active

Definition at line 476 of file generic.c.

int usb_serial_handle_sysrq_char ( struct usb_serial_port port,
unsigned int  ch 
)

Definition at line 452 of file generic.c.

void usb_serial_port_softint ( struct usb_serial_port port)

Definition at line 528 of file usb-serial.c.

void usb_serial_put ( struct usb_serial serial)

Definition at line 158 of file usb-serial.c.

int usb_serial_register_drivers ( struct usb_serial_driver *const  serial_drivers[],
const char name,
const struct usb_device_id id_table 
)

Definition at line 1371 of file usb-serial.c.

int usb_serial_resume ( struct usb_interface intf)

Definition at line 1145 of file usb-serial.c.

int usb_serial_suspend ( struct usb_interface intf,
pm_message_t  message 
)

Definition at line 1118 of file usb-serial.c.

Variable Documentation

struct bus_type usb_serial_bus_type

Definition at line 171 of file bus.c.

struct usb_serial_driver usb_serial_generic_device
struct tty_driver* usb_serial_tty_driver

Definition at line 1197 of file usb-serial.c.