Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

ircomm_tty.c File Reference

#include <linux/init.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/termios.h>
#include <linux/tty.h>
#include <linux/interrupt.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <net/irda/irda.h>
#include <net/irda/irmod.h>
#include <net/irda/ircomm_core.h>
#include <net/irda/ircomm_param.h>
#include <net/irda/ircomm_tty_attach.h>
#include <net/irda/ircomm_tty.h>

Include dependency graph for ircomm_tty.c:

Go to the source code of this file.

Functions

static int ircomm_tty_open (struct tty_struct *tty, struct file *filp)
static void ircomm_tty_close (struct tty_struct *tty, struct file *filp)
static int ircomm_tty_write (struct tty_struct *tty, int from_user, const unsigned char *buf, int count)
static int ircomm_tty_write_room (struct tty_struct *tty)
static void ircomm_tty_throttle (struct tty_struct *tty)
static void ircomm_tty_unthrottle (struct tty_struct *tty)
static int ircomm_tty_chars_in_buffer (struct tty_struct *tty)
static void ircomm_tty_flush_buffer (struct tty_struct *tty)
static void ircomm_tty_send_xchar (struct tty_struct *tty, char ch)
static void ircomm_tty_wait_until_sent (struct tty_struct *tty, int timeout)
static void ircomm_tty_hangup (struct tty_struct *tty)
static void ircomm_tty_do_softint (void *private_)
static void ircomm_tty_shutdown (struct ircomm_tty_cb *self)
static int ircomm_tty_data_indication (void *instance, void *sap, struct sk_buff *skb)
static int ircomm_tty_control_indication (void *instance, void *sap, struct sk_buff *skb)
static void ircomm_tty_flow_indication (void *instance, void *sap, LOCAL_FLOW cmd)
static int ircomm_tty_read_proc (char *buf, char **start, off_t offset, int len, int *eof, void *unused)
int __init ircomm_tty_init (void)
static int ircomm_tty_startup (struct ircomm_tty_cb *self)
static int ircomm_tty_block_til_ready (struct ircomm_tty_cb *self, struct file *filp)
void ircomm_tty_start (struct tty_struct *tty)
void ircomm_tty_stop (struct tty_struct *tty)
void ircomm_tty_check_modem_status (struct ircomm_tty_cb *self)
static int ircomm_tty_line_info (struct ircomm_tty_cb *self, char *buf)

Variables

static struct tty_driver driver
static int ircomm_tty_refcount
static struct tty_struct * ircomm_tty_table [NR_PTYS]
static struct termiosircomm_tty_termios [NR_PTYS]
static struct termiosircomm_tty_termios_locked [NR_PTYS]
hashbin_tircomm_tty = NULL


Function Documentation

static int ircomm_tty_block_til_ready struct ircomm_tty_cb self,
struct file filp
[static]
 

Definition at line 237 of file ircomm_tty.c.

References ASYNC_CALLOUT_ACTIVE, ASYNC_CLOSING, ASYNC_HUP_NOTIFY, ASYNC_INITIALIZED, ASYNC_NORMAL_ACTIVE, ASYNC_PGRP_LOCKOUT, ASYNC_SESSION_LOCKOUT, termios::c_cflag, CBAUD, cli, CLOCAL, current, ircomm_params::dce, EAGAIN, EBUSY, ERESTARTSYS, ircomm_tty_cb::flags, IRCOMM_CD, IRCOMM_DTE, IRCOMM_DTR, ircomm_param_request(), IRCOMM_RTS, IRCOMM_TTY_READY, IRDA_DEBUG, ircomm_tty_cb::normal_termios, NULL, O_NONBLOCK, ircomm_tty_cb::open_count, ircomm_tty_cb::open_wait, ircomm_tty_cb::pgrp, restore_flags, save_flags, schedule(), SERIAL_TYPE_CALLOUT, ircomm_tty_cb::session, ircomm_tty_cb::settings, signal_pending, ircomm_tty_cb::state, TASK_INTERRUPTIBLE, TASK_RUNNING, TRUE, tty, and tty_hung_up_p().

Referenced by ircomm_tty_open().

Here is the call graph for this function:

static int ircomm_tty_chars_in_buffer struct tty_struct *  tty  )  [static]
 

Definition at line 905 of file ircomm_tty.c.

References ASSERT, cli, IRCOMM_TTY_MAGIC, len, NULL, restore_flags, and save_flags.

Referenced by ircomm_tty_init().

void ircomm_tty_check_modem_status struct ircomm_tty_cb self  ) 
 

Definition at line 1040 of file ircomm_tty.c.

References ASSERT, ASYNC_CALLOUT_ACTIVE, ASYNC_CALLOUT_NOHUP, ASYNC_CHECK_CD, ASYNC_CTS_FLOW, ircomm_tty_cb::flags, IMMEDIATE_BH, IRCOMM_CD, IRCOMM_CTS, IRCOMM_DCE_DELTA_ANY, IRCOMM_DELTA_CD, IRCOMM_TTY_MAGIC, IRDA_DEBUG, ircomm_tty_cb::line, ircomm_tty_cb::magic, mark_bh, NULL, ircomm_tty_cb::open_wait, queue_task, status, tq_immediate, ircomm_tty_cb::tqueue, tty, and tty_hangup().

Referenced by ircomm_param_dce(), ircomm_param_dte(), and ircomm_tty_state_ready().

Here is the call graph for this function:

static void ircomm_tty_close struct tty_struct *  tty,
struct file filp
[static]
 

Definition at line 499 of file ircomm_tty.c.

References ASSERT, ASYNC_CALLOUT_ACTIVE, ASYNC_CLOSING, ASYNC_CLOSING_WAIT_NONE, ASYNC_NORMAL_ACTIVE, cli, current, ERROR, IRCOMM_TTY_MAGIC, ircomm_tty_shutdown(), IRDA_DEBUG, MOD_DEC_USE_COUNT, NULL, restore_flags, save_flags, schedule_timeout, TASK_INTERRUPTIBLE, tty_hung_up_p(), and tty_wait_until_sent().

Referenced by ircomm_tty_init().

Here is the call graph for this function:

static int ircomm_tty_control_indication void *  instance,
void *  sap,
struct sk_buff skb
[static]
 

Definition at line 1155 of file ircomm_tty.c.

References ASSERT, sk_buff::data, dev_kfree_skb, ircomm_param_info, IRCOMM_TTY_MAGIC, IRDA_DEBUG, IRDA_MIN, irda_param_extract_all(), sk_buff::len, and NULL.

Referenced by ircomm_tty_startup().

Here is the call graph for this function:

static int ircomm_tty_data_indication void *  instance,
void *  sap,
struct sk_buff skb
[static]
 

Definition at line 1106 of file ircomm_tty.c.

References ASSERT, sk_buff::data, dev_kfree_skb, FLOW_START, ircomm_param_request(), IRCOMM_POLL, ircomm_tty_link_established(), IRCOMM_TTY_MAGIC, ircomm_tty_send_initial_parameters(), IRDA_DEBUG, sk_buff::len, NULL, and TRUE.

Referenced by ircomm_tty_startup().

Here is the call graph for this function:

static void ircomm_tty_do_softint void *  private_  )  [static]
 

Definition at line 614 of file ircomm_tty.c.

References cli, FLOW_START, ircomm_control_request(), IRCOMM_TTY_DATA_REQUEST, ircomm_tty_do_event(), IRCOMM_TTY_MAGIC, IRDA_DEBUG, NULL, restore_flags, save_flags, and tty.

Referenced by ircomm_tty_open().

Here is the call graph for this function:

static void ircomm_tty_flow_indication void *  instance,
void *  sap,
LOCAL_FLOW  cmd
[static]
 

Definition at line 1183 of file ircomm_tty.c.

References ASSERT, FLOW_START, FLOW_STOP, IMMEDIATE_BH, IRCOMM_TTY_MAGIC, IRDA_DEBUG, mark_bh, NULL, queue_task, tq_immediate, and tty.

Referenced by ircomm_tty_startup().

static void ircomm_tty_flush_buffer struct tty_struct *  tty  )  [static]
 

Definition at line 592 of file ircomm_tty.c.

References ASSERT, IMMEDIATE_BH, IRCOMM_TTY_MAGIC, mark_bh, NULL, queue_task, and tq_immediate.

Referenced by ircomm_tty_init().

static void ircomm_tty_hangup struct tty_struct *  tty  )  [static]
 

Definition at line 972 of file ircomm_tty.c.

References ASSERT, ASYNC_CALLOUT_ACTIVE, ASYNC_NORMAL_ACTIVE, IRCOMM_TTY_MAGIC, ircomm_tty_shutdown(), IRDA_DEBUG, and NULL.

Referenced by ircomm_tty_init().

Here is the call graph for this function:

int __init ircomm_tty_init void   ) 
 

Definition at line 90 of file ircomm_tty.c.

References B9600, termios::c_cflag, tty_driver::chars_in_buffer, CLOCAL, tty_driver::close, CREAD, CS8, tty_driver::driver_name, ENOMEM, ERROR, tty_driver::flags, tty_driver::flush_buffer, tty_driver::hangup, hashbin_new(), HB_LOCAL, HUPCL, tty_driver::init_termios, tty_driver::ioctl, ircomm_tty_chars_in_buffer(), ircomm_tty_close(), ircomm_tty_flush_buffer(), ircomm_tty_hangup(), ircomm_tty_ioctl(), IRCOMM_TTY_MAJOR, IRCOMM_TTY_MINOR, ircomm_tty_open(), IRCOMM_TTY_PORTS, ircomm_tty_read_proc(), ircomm_tty_refcount, ircomm_tty_send_xchar(), ircomm_tty_set_termios(), ircomm_tty_start(), ircomm_tty_stop(), ircomm_tty_table, ircomm_tty_throttle(), ircomm_tty_unthrottle(), ircomm_tty_wait_until_sent(), ircomm_tty_write(), ircomm_tty_write_room(), tty_driver::magic, tty_driver::major, memset, tty_driver::minor_start, tty_driver::name, NULL, tty_driver::num, tty_driver::open, tty_driver::read_proc, tty_driver::refcount, tty_driver::send_xchar, SERIAL_TYPE_NORMAL, tty_driver::set_termios, tty_driver::start, tty_driver::stop, tty_driver::subtype, tty_driver::table, tty_driver::termios, tty_driver::termios_locked, tty_driver::throttle, TTY_DRIVER_MAGIC, TTY_DRIVER_REAL_RAW, TTY_DRIVER_TYPE_SERIAL, tty_register_driver(), tty_std_termios, tty_driver::type, tty_driver::unthrottle, tty_driver::wait_until_sent, tty_driver::write, and tty_driver::write_room.

Referenced by irda_init().

Here is the call graph for this function:

static int ircomm_tty_line_info struct ircomm_tty_cb self,
char *  buf
[static]
 

Definition at line 1212 of file ircomm_tty.c.

References ASYNC_CALLOUT_ACTIVE, ASYNC_CHECK_CD, ASYNC_CLOSING, ASYNC_CTS_FLOW, ASYNC_INITIALIZED, ASYNC_LOW_LATENCY, ASYNC_NORMAL_ACTIVE, ircomm_tty_cb::client, ircomm_params::data_rate, ircomm_params::dce, ircomm_params::dte, ircomm_tty_cb::flags, ircomm_params::flow_control, IRCOMM_3_WIRE, IRCOMM_3_WIRE_RAW, IRCOMM_9_WIRE, IRCOMM_CD, IRCOMM_CTS, IRCOMM_DSR, IRCOMM_DSR_DTR_IN, IRCOMM_DSR_DTR_OUT, IRCOMM_DTR, IRCOMM_ENQ_ACK_IN, IRCOMM_ENQ_ACK_OUT, IRCOMM_RI, IRCOMM_RTS, IRCOMM_RTS_CTS_IN, IRCOMM_RTS_CTS_OUT, ircomm_tty_state, IRCOMM_XON_XOFF_IN, IRCOMM_XON_XOFF_OUT, ircomm_tty_cb::max_data_size, ircomm_tty_cb::max_header_size, ircomm_params::null_modem, ircomm_tty_cb::open_count, ircomm_params::port_name, ircomm_tty_cb::service_type, ircomm_tty_cb::settings, sprintf(), ircomm_tty_cb::state, and ircomm_tty_cb::tty.

Referenced by ircomm_tty_read_proc().

Here is the call graph for this function:

static int ircomm_tty_open struct tty_struct *  tty,
struct file filp
[static]
 

Definition at line 381 of file ircomm_tty.c.

References ASYNC_CLOSING, ASYNC_HUP_NOTIFY, ASYNC_LOW_LATENCY, current, EAGAIN, ENODEV, ENOMEM, ERESTARTSYS, ERROR, FLOW_STOP, hashbin_find(), hashbin_insert(), HZ, init_timer(), interruptible_sleep_on(), IRCOMM_3_WIRE, IRCOMM_3_WIRE_RAW, IRCOMM_9_WIRE, ircomm_tty_block_til_ready(), ircomm_tty_do_softint(), IRCOMM_TTY_MAGIC, IRCOMM_TTY_PORTS, ircomm_tty_startup(), IRDA_DEBUG, kmalloc(), line, memset, MINOR, MOD_DEC_USE_COUNT, MOD_INC_USE_COUNT, NULL, tty_hung_up_p(), and x10.

Referenced by ircomm_tty_init().

Here is the call graph for this function:

static int ircomm_tty_read_proc char *  buf,
char **  start,
off_t  offset,
int  len,
int *  eof,
void *  unused
[static]
 

Definition at line 1323 of file ircomm_tty.c.

References count, done, hashbin_get_first(), hashbin_get_next(), ircomm_tty_line_info(), IRCOMM_TTY_MAGIC, l, and NULL.

Referenced by ircomm_tty_init().

Here is the call graph for this function:

static void ircomm_tty_send_xchar struct tty_struct *  tty,
char  ch
[static]
 

Definition at line 999 of file ircomm_tty.c.

References IRDA_DEBUG.

Referenced by ircomm_tty_init(), ircomm_tty_throttle(), and ircomm_tty_unthrottle().

static void ircomm_tty_shutdown struct ircomm_tty_cb self  )  [static]
 

Definition at line 925 of file ircomm_tty.c.

References ASSERT, ASYNC_INITIALIZED, cli, ircomm_tty_cb::ctrl_skb, del_timer(), dev_kfree_skb, ircomm_tty_cb::flags, ircomm_tty_cb::ircomm, ircomm_close(), ircomm_tty_detach_cable(), IRCOMM_TTY_MAGIC, IRDA_DEBUG, ircomm_tty_cb::magic, NULL, restore_flags, save_flags, ircomm_tty_cb::tx_skb, and ircomm_tty_cb::watchdog_timer.

Referenced by ircomm_tty_close(), and ircomm_tty_hangup().

Here is the call graph for this function:

void ircomm_tty_start struct tty_struct *  tty  ) 
 

Definition at line 1010 of file ircomm_tty.c.

References FLOW_START, and ircomm_flow_request().

Referenced by ircomm_tty_init(), and ircomm_tty_set_termios().

Here is the call graph for this function:

static int ircomm_tty_startup struct ircomm_tty_cb self  )  [static]
 

Definition at line 180 of file ircomm_tty.c.

References ASSERT, ASYNC_INITIALIZED, notify_t::connect_confirm, notify_t::connect_indication, notify_t::data_indication, notify_t::disconnect_indication, ENODEV, ERROR, ircomm_tty_cb::flags, notify_t::flow_indication, notify_t::instance, ircomm_tty_cb::ircomm, ircomm_open(), ircomm_tty_attach_cable(), ircomm_tty_connect_confirm(), ircomm_tty_connect_indication(), ircomm_tty_control_indication(), ircomm_tty_data_indication(), ircomm_tty_disconnect_indication(), ircomm_tty_flow_indication(), IRCOMM_TTY_MAGIC, IRDA_DEBUG, irda_notify_init(), ircomm_tty_cb::line, ircomm_tty_cb::magic, notify_t::name, NOTIFY_MAX_NAME, NULL, ircomm_tty_cb::service_type, strncpy, and notify_t::udata_indication.

Referenced by ircomm_tty_open().

Here is the call graph for this function:

void ircomm_tty_stop struct tty_struct *  tty  ) 
 

Definition at line 1023 of file ircomm_tty.c.

References ASSERT, FLOW_STOP, ircomm_flow_request(), IRCOMM_TTY_MAGIC, and NULL.

Referenced by ircomm_tty_init().

Here is the call graph for this function:

static void ircomm_tty_throttle struct tty_struct *  tty  )  [static]
 

Definition at line 844 of file ircomm_tty.c.

References ASSERT, CRTSCTS, FLOW_STOP, IRCOMM_DELTA_RTS, IRCOMM_DTE, ircomm_flow_request(), ircomm_param_request(), IRCOMM_RTS, IRCOMM_TTY_MAGIC, ircomm_tty_send_xchar(), IRDA_DEBUG, NULL, and TRUE.

Referenced by ircomm_tty_init().

Here is the call graph for this function:

static void ircomm_tty_unthrottle struct tty_struct *  tty  )  [static]
 

Definition at line 875 of file ircomm_tty.c.

References ASSERT, CRTSCTS, FLOW_START, IRCOMM_DELTA_RTS, IRCOMM_DTE, ircomm_flow_request(), ircomm_param_request(), IRCOMM_RTS, IRCOMM_TTY_MAGIC, ircomm_tty_send_xchar(), IRDA_DEBUG, NULL, and TRUE.

Referenced by ircomm_tty_init().

Here is the call graph for this function:

static void ircomm_tty_wait_until_sent struct tty_struct *  tty,
int  timeout
[static]
 

Definition at line 811 of file ircomm_tty.c.

References ASSERT, current, IRCOMM_TTY_MAGIC, IRDA_DEBUG, IRDA_MIN, jiffies, MSECS_TO_JIFFIES, NULL, schedule_timeout, signal_pending, TASK_INTERRUPTIBLE, TASK_RUNNING, and time_after.

Referenced by ircomm_tty_init().

static int ircomm_tty_write struct tty_struct *  tty,
int  from_user,
const unsigned char *  buf,
int  count
[static]
 

Definition at line 676 of file ircomm_tty.c.

References ASSERT, cli, copy_from_user, ENOBUFS, IMMEDIATE_BH, IRCOMM_TTY_MAGIC, IRDA_DEBUG, sk_buff::len, len, mark_bh, memcpy, NULL, queue_task, restore_flags, save_flags, size, and tq_immediate.

Referenced by ircomm_tty_init().

static int ircomm_tty_write_room struct tty_struct *  tty  )  [static]
 

Definition at line 779 of file ircomm_tty.c.

References ASSERT, cli, IRCOMM_TTY_MAGIC, IRDA_DEBUG, NULL, restore_flags, and save_flags.

Referenced by ircomm_tty_init().


Variable Documentation

struct tty_driver driver [static]
 

Definition at line 75 of file ircomm_tty.c.

hashbin_t* ircomm_tty = NULL
 

Definition at line 82 of file ircomm_tty.c.

Referenced by ircomm_tty_discovery_indication().

int ircomm_tty_refcount [static]
 

Definition at line 76 of file ircomm_tty.c.

Referenced by ircomm_tty_init().

struct tty_struct* ircomm_tty_table[NR_PTYS] [static]
 

Definition at line 78 of file ircomm_tty.c.

Referenced by ircomm_tty_init().

struct termios* ircomm_tty_termios[NR_PTYS] [static]
 

Definition at line 79 of file ircomm_tty.c.

struct termios* ircomm_tty_termios_locked[NR_PTYS] [static]
 

Definition at line 80 of file ircomm_tty.c.