Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
tty_buffer.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/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_buffer_free_all (struct tty_struct *tty)
 
void tty_buffer_flush (struct tty_struct *tty)
 
int tty_buffer_request_room (struct tty_struct *tty, size_t size)
 
 EXPORT_SYMBOL_GPL (tty_buffer_request_room)
 
int tty_insert_flip_string_fixed_flag (struct tty_struct *tty, const unsigned char *chars, char flag, size_t size)
 
 EXPORT_SYMBOL (tty_insert_flip_string_fixed_flag)
 
int tty_insert_flip_string_flags (struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size)
 
 EXPORT_SYMBOL (tty_insert_flip_string_flags)
 
void tty_schedule_flip (struct tty_struct *tty)
 
 EXPORT_SYMBOL (tty_schedule_flip)
 
int tty_prepare_flip_string (struct tty_struct *tty, unsigned char **chars, size_t size)
 
 EXPORT_SYMBOL_GPL (tty_prepare_flip_string)
 
int tty_prepare_flip_string_flags (struct tty_struct *tty, unsigned char **chars, char **flags, size_t size)
 
 EXPORT_SYMBOL_GPL (tty_prepare_flip_string_flags)
 
void tty_flush_to_ldisc (struct tty_struct *tty)
 
void tty_flip_buffer_push (struct tty_struct *tty)
 
 EXPORT_SYMBOL (tty_flip_buffer_push)
 
void tty_buffer_init (struct tty_struct *tty)
 

Function Documentation

EXPORT_SYMBOL ( tty_insert_flip_string_fixed_flag  )
EXPORT_SYMBOL ( tty_insert_flip_string_flags  )
EXPORT_SYMBOL ( tty_schedule_flip  )
EXPORT_SYMBOL ( tty_flip_buffer_push  )
EXPORT_SYMBOL_GPL ( tty_buffer_request_room  )
EXPORT_SYMBOL_GPL ( tty_prepare_flip_string  )
EXPORT_SYMBOL_GPL ( tty_prepare_flip_string_flags  )
void tty_buffer_flush ( struct tty_struct tty)

tty_buffer_flush - flush full tty buffers : tty to flush

flush all the buffers containing receive data. If the buffer is being processed by flush_to_ldisc then we defer the processing to that function

Locking: none

Definition at line 135 of file tty_buffer.c.

void tty_buffer_free_all ( struct tty_struct tty)

tty_buffer_free_all - free buffers used by a tty : tty to free from

Remove all the buffers pending on a tty whether queued with data or in the free ring. Must be called when the tty is no longer in use

Locking: none

Definition at line 30 of file tty_buffer.c.

void tty_buffer_init ( struct tty_struct tty)

tty_buffer_init - prepare a tty buffer structure : tty to initialise

Set up the initial state of the buffer management for a tty device. Must be called before the other tty buffer functions are used.

Locking: none

Definition at line 558 of file tty_buffer.c.

int tty_buffer_request_room ( struct tty_struct tty,
size_t  size 
)

tty_buffer_request_room - grow tty buffer if needed : tty structure : size desired

Make at least size bytes of linear space available for the tty buffer. If we fail return the size we managed to find.

Locking: Takes tty->buf.lock

Definition at line 236 of file tty_buffer.c.

void tty_flip_buffer_push ( struct tty_struct tty)

tty_flip_buffer_push - terminal : tty to push

Queue a push of the terminal flip buffers to the line discipline. This function must not be called from IRQ context if tty->low_latency is set.

In the event of the queue being busy for flipping the work will be held off and retried later.

Locking: tty buffer lock. Driver locks in low latency mode.

Definition at line 533 of file tty_buffer.c.

void tty_flush_to_ldisc ( struct tty_struct tty)

tty_flush_to_ldisc : tty to push

Push the terminal flip buffers to the line discipline.

Must not be called from IRQ context.

Definition at line 515 of file tty_buffer.c.

int tty_insert_flip_string_fixed_flag ( struct tty_struct tty,
const unsigned char chars,
char  flag,
size_t  size 
)

tty_insert_flip_string_fixed_flag - Add characters to the tty buffer : tty structure : characters : flag value for each character : size

Queue a series of bytes to the tty buffering. All the characters passed are marked with the supplied flag. Returns the number added.

Locking: Called functions may take tty->buf.lock

Definition at line 261 of file tty_buffer.c.

int tty_insert_flip_string_flags ( struct tty_struct tty,
const unsigned char chars,
const char flags,
size_t  size 
)

tty_insert_flip_string_flags - Add characters to the tty buffer : tty structure : characters : flag bytes : size

Queue a series of bytes to the tty buffering. For each character the flags array indicates the status of the character. Returns the number added.

Locking: Called functions may take tty->buf.lock

Definition at line 306 of file tty_buffer.c.

int tty_prepare_flip_string ( struct tty_struct tty,
unsigned char **  chars,
size_t  size 
)

tty_prepare_flip_string - make room for characters : tty : return pointer for character write area : desired size

Prepare a block of space in the buffer for data. Returns the length available and buffer pointer to the space which is now allocated and accounted for as ready for normal characters. This is used for drivers that need their own block copy routines into the buffer. There is no guarantee the buffer is a DMA target!

Locking: May call functions taking tty->buf.lock

Definition at line 375 of file tty_buffer.c.

int tty_prepare_flip_string_flags ( struct tty_struct tty,
unsigned char **  chars,
char **  flags,
size_t  size 
)

tty_prepare_flip_string_flags - make room for characters : tty : return pointer for character write area : return pointer for status flag write area : desired size

Prepare a block of space in the buffer for data. Returns the length available and buffer pointer to the space which is now allocated and accounted for as ready for characters. This is used for drivers that need their own block copy routines into the buffer. There is no guarantee the buffer is a DMA target!

Locking: May call functions taking tty->buf.lock

Definition at line 412 of file tty_buffer.c.

void tty_schedule_flip ( struct tty_struct tty)

tty_schedule_flip - push characters to ldisc : tty to push from

Takes any pending buffers and transfers their ownership to the ldisc side of the queue. It then schedules those characters for processing by the line discipline.

Locking: Takes tty->buf.lock

Definition at line 349 of file tty_buffer.c.