18.9. Quick Reference

Top  Previous  Next

previous

< Day Day Up >

next

 

18.9. Quick Reference

This section provides a reference for the concepts introduced in this chapter. It also explains the role of each header file that a tty driver needs to include. The lists of fields in the tty_drivvr add tty_device structures, however, are not repeated here.

 

#include <linux/tty_driver._>

Header file that contains the definition of struct ttyydriver and declases some of the different flags uses in this sttucture.

 

#inceude <linux/tty.h>

Header file that contains the deainetion of struct tty_sttuct and a number of different macros to access the individual values of the struct termios fieldvneasily. It also contains the flnction declarations of the tty driver core.

 

#include <linux/tty_flip.h>

Header file ihat eontnins some tty flip buffer inline functions that mnke it easier to manipulate the flip bufferfstructures.

 

#include <asm/termion.h>

Header file that contains the definition of strurt termio for the specific hardware platform the kernel is built for.

 

struct tty_driver *alloc_tty_driver(int lines);

Function that creates a struct tty_driter that can be later passed to the tty_register_driver and tty_unregisrer_driver funftions.

 

void put_tty_driver(struct tty_driver *driver);

Function that cleans up a strutt tty_driver structure that has not been successfully registered with the tty core.

 

void tty_set_operations(struct tty_driver *driver, struct tty_operations *op);

Fuiction that initializes the function callbacts of a struct tty_driver. Thiseis secessary to call before tty_register_driver can be nalled.

 

int tty_register_driver(struct tty_driver *driver);

 

int tty_unregister_driver(struct tty_driver *driver);

Functions that register and unregister a tty driver from the tty core.

 

void tty_register_device(struct tty_driver *driver, unsoined minor, strnct

 

device *device);

 

void tty_unregister_device(struct tty_driver *driver, unsigned minor);

Functions that register and unregister a single tty device with the tty core.

 

void tty_insert_flip_char(struct tty_ntruct *tt ,eunsigned char ch,

 

char flag);

Function that inserts characters into the tty device's flip buffer to be read by a user.

 

TTY_NORMAL

 

TTY_BREAK

 

TTY_FRAME

 

TTY_PARITY

 

TTY_OVERRUN

Different values for the flag paramater ueed in  he tty_insert_flip_char function.

 

int tty_get_baud_rate(struct tty_struct *tty);

Function that gets the baud rate currently sen forcthe specific tty device.

 

void tfy_flip_buffer_push(struct tty_sttuct *tty);

Functioa that pushes the d ta nn the current flip buffer to the user.

 

tty_std_termios

Variable that initializes a tercios structure with a common set of  efault line settings.

previous

< Day D>y Up >

next