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

irtty.c File Reference

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/tty.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/rtnetlink.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <asm/termios.h>
#include <net/irda/irda.h>
#include <net/irda/irtty.h>
#include <net/irda/wrapper.h>
#include <net/irda/timer.h>
#include <net/irda/irda_device.h>

Include dependency graph for irtty.c:

Go to the source code of this file.

Functions

static int irtty_hard_xmit (struct sk_buff *skb, struct device *dev)
static int irtty_net_init (struct device *dev)
static int irtty_net_open (struct device *dev)
static int irtty_net_close (struct device *dev)
static int irtty_net_ioctl (struct device *dev, struct ifreq *rq, int cmd)
static struct net_device_statsirtty_net_get_stats (struct device *dev)
static int irtty_open (struct tty_struct *tty)
static void irtty_close (struct tty_struct *tty)
static int irtty_ioctl (struct tty_struct *, void *, int, void *)
static int irtty_receive_room (struct tty_struct *tty)
static void irtty_write_wakeup (struct tty_struct *tty)
static void irtty_receive_buf (struct tty_struct *, const unsigned char *, char *, int)
static int irtty_is_receiving (struct irtty_cb *self)
static int irtty_set_dtr_rts (struct device *dev, int dtr, int rts)
static int irtty_raw_write (struct device *dev, __u8 *buf, int len)
static int irtty_raw_read (struct device *dev, __u8 *buf, int len)
static int irtty_set_mode (struct device *dev, int mode)
static int irtty_change_speed (struct irda_task *task)
int __init irtty_init (void)
static void irtty_stop_receiver (struct irtty_cb *self, int stop)
static void __irtty_change_speed (struct irtty_cb *self, __u32 speed)
static int irtty_change_speed_complete (struct irda_task *task)

Variables

static hashbin_tirtty = NULL
static struct tty_ldisc irda_ldisc
static int qos_mtt_bits = 0x03
char * driver_name = "irtty"


Function Documentation

static void __irtty_change_speed struct irtty_cb self,
__u32  speed
[static]
 

Definition at line 347 of file irtty.c.

References ASSERT, B115200, B1200, B19200, B2400, B38400, B4800, B57600, B9600, termios::c_cflag, CBAUD, IRDA_DEBUG, IRTTY_MAGIC, and NULL.

Referenced by irtty_change_speed().

static int irtty_change_speed struct irda_task task  )  [static]
 

Definition at line 402 of file irtty.c.

References __irtty_change_speed(), ASSERT, ERROR, IRDA_DEBUG, IRDA_TASK_CHILD_DONE, IRDA_TASK_CHILD_INIT, IRDA_TASK_CHILD_WAIT, IRDA_TASK_DONE, irda_task_execute(), IRDA_TASK_INIT, irda_task_next_state(), IRDA_TASK_WAIT, jiffies, MSECS_TO_JIFFIES, NULL, speed, and WARNING.

Referenced by irtty_net_ioctl(), and irtty_write_wakeup().

Here is the call graph for this function:

static int irtty_change_speed_complete struct irda_task task  )  [static]
 

Definition at line 611 of file irtty.c.

References ASSERT, irda_task::instance, IRDA_DEBUG, mark_bh, NET_BH, and NULL.

Referenced by irtty_write_wakeup().

static void irtty_close struct tty_struct *  tty  )  [static]
 

Definition at line 273 of file irtty.c.

References ASSERT, hashbin_remove(), irda_device_dongle_cleanup(), irda_task_delete(), IRTTY_MAGIC, kfree(), MOD_DEC_USE_COUNT, NULL, rtnl_lock(), rtnl_unlock(), and unregister_netdevice.

Referenced by irtty_init().

Here is the call graph for this function:

static int irtty_hard_xmit struct sk_buff skb,
struct device *  dev
[static]
 

Definition at line 637 of file irtty.c.

References ASSERT, async_wrap_skb(), sk_buff::data, dev_kfree_skb, EBUSY, FALSE, irda_get_speed, irda_lock(), jiffies, NULL, and speed.

Referenced by irtty_open().

Here is the call graph for this function:

int __init irtty_init void   ) 
 

Definition at line 77 of file irtty.c.

References ENOMEM, ERROR, file, hashbin_new(), HB_LOCAL, irtty_close(), irtty_ioctl(), irtty_open(), irtty_receive_buf(), irtty_receive_room(), irtty_write_wakeup(), KERN_WARNING, long, memset, N_IRDA, NULL, printk, status, TTY_LDISC_MAGIC, and tty_register_ldisc().

Referenced by irda_device_init().

Here is the call graph for this function:

static int irtty_ioctl struct tty_struct *  ,
void *  ,
int  ,
void * 
[static]
 

Definition at line 490 of file irtty.c.

References _IOC_DIR, _IOC_READ, _IOC_SIZE, _IOC_WRITE, ASSERT, copy_to_user, dongle, EBADR, EFAULT, ENODEV, ENOIOCTLCMD, irda_device_dongle_init(), irda_task_execute(), IRTTY_IOCGET, IRTTY_IOCTDONGLE, IRTTY_MAGIC, irtty_raw_read(), irtty_raw_write(), irtty_set_dtr_rts(), irtty_set_mode(), dongle_t::issue, memset, n_tty_ioctl(), irtty_info::name, NULL, dongle_reg::open, dongle_t::read, dongle_t::set_dtr_rts, dongle_t::set_mode, size, strncpy, TCGETA, TCGETS, verify_area(), VERIFY_READ, VERIFY_WRITE, and dongle_t::write.

Referenced by irtty_init().

Here is the call graph for this function:

static int irtty_is_receiving struct irtty_cb self  )  [static]
 

Definition at line 748 of file irtty.c.

References OUTSIDE_FRAME, irtty_cb::rx_buff, and iobuff_t::state.

Referenced by irtty_net_ioctl().

static int irtty_net_close struct device *  dev  )  [static]
 

Definition at line 924 of file irtty.c.

References ASSERT, irlap_close(), IRTTY_MAGIC, irtty_stop_receiver(), MOD_DEC_USE_COUNT, NULL, and TRUE.

Referenced by irtty_open().

Here is the call graph for this function:

static struct net_device_stats * irtty_net_get_stats struct device *  dev  )  [static]
 

Definition at line 1036 of file irtty.c.

Referenced by irtty_open().

static int irtty_net_init struct device *  dev  )  [static]
 

Definition at line 886 of file irtty.c.

References irda_device_setup().

Referenced by irtty_open().

Here is the call graph for this function:

static int irtty_net_ioctl struct device *  dev,
struct ifreq rq,
int  cmd
[static]
 

Definition at line 954 of file irtty.c.

References ASSERT, CAP_NET_ADMIN, capable, cli, dongle, EOPNOTSUPP, EPERM, in_interrupt, IRDA_DEBUG, irda_device_dongle_init(), irda_device_set_media_busy(), irda_task_execute(), irq, irtty_change_speed(), irtty_is_receiving(), IRTTY_MAGIC, irtty_raw_read(), irtty_raw_write(), irtty_set_dtr_rts(), irtty_set_mode(), dongle_t::issue, NULL, dongle_reg::open, dongle_t::read, restore_flags, save_flags, dongle_t::set_dtr_rts, dongle_t::set_mode, SIOCGRECEIVING, SIOCSBANDWIDTH, SIOCSDONGLE, SIOCSDTRRTS, SIOCSMEDIABUSY, SIOCSMODE, TRUE, and dongle_t::write.

Referenced by irtty_open().

Here is the call graph for this function:

static int irtty_net_open struct device *  dev  )  [static]
 

Definition at line 896 of file irtty.c.

References ASSERT, FALSE, IRDA_DEBUG, irlap_open(), IRTTY_MAGIC, irtty_stop_receiver(), MOD_INC_USE_COUNT, and NULL.

Referenced by irtty_open().

Here is the call graph for this function:

static int irtty_open struct tty_struct *  tty  )  [static]
 

Definition at line 146 of file irtty.c.

References ASSERT, dev, dev_alloc(), device, EEXIST, ENOMEM, ERROR, FALSE, hashbin_insert(), IFF_PIO, IFF_SIR, IR_115200, IR_19200, IR_38400, IR_57600, IR_9600, irda_init_max_qos_capabilies(), IRDA_IRLAP, irda_qos_bits_to_value(), irtty_hard_xmit(), IRTTY_MAGIC, irtty_net_close(), irtty_net_get_stats(), irtty_net_init(), irtty_net_ioctl(), irtty_net_open(), KERN_ERR, kfree(), kmalloc(), memset, MESSAGE, MINOR, MOD_INC_USE_COUNT, name, NULL, OUTSIDE_FRAME, printk, qos_mtt_bits, register_netdevice, rtnl_lock(), rtnl_unlock(), and sprintf().

Referenced by irtty_init().

Here is the call graph for this function:

static int irtty_raw_read struct device *  dev,
__u8 buf,
int  len
[static]
 

Definition at line 832 of file irtty.c.

References ASSERT, count, current, IRTTY_MAGIC, iobuff_t::len, MSECS_TO_JIFFIES, NULL, OUTSIDE_FRAME, irtty_cb::rx_buff, schedule_timeout, TASK_INTERRUPTIBLE, and timeout.

Referenced by irtty_ioctl(), and irtty_net_ioctl().

static int irtty_raw_write struct device *  dev,
__u8 buf,
int  len
[static]
 

Definition at line 870 of file irtty.c.

References ASSERT, IRTTY_MAGIC, and NULL.

Referenced by irtty_ioctl(), and irtty_net_ioctl().

static void irtty_receive_buf struct tty_struct *  ,
const unsigned char *  ,
char *  ,
int 
[static]
 

Definition at line 561 of file irtty.c.

References async_unwrap_char(), IRDA_DEBUG, irda_device_set_media_busy(), IRDA_IRLAP, IRDA_RAW, jiffies, and TRUE.

Referenced by irtty_init().

Here is the call graph for this function:

static int irtty_receive_room struct tty_struct *  tty  )  [static]
 

Definition at line 685 of file irtty.c.

References IRDA_DEBUG.

Referenced by irtty_init().

static int irtty_set_dtr_rts struct device *  dev,
int  dtr,
int  rts
[static]
 

Definition at line 759 of file irtty.c.

References fs, get_ds, get_fs, IRDA_DEBUG, NULL, set_fs, TIOCM_DTR, TIOCM_OUT2, TIOCM_RTS, TIOCMSET, and tty.

Referenced by irtty_ioctl(), and irtty_net_ioctl().

int irtty_set_mode struct device *  dev,
int  mode
[static]
 

Definition at line 804 of file irtty.c.

References ASSERT, infrared_mode, IRDA_DEBUG, NULL, and OUTSIDE_FRAME.

Referenced by irtty_ioctl(), and irtty_net_ioctl().

static void irtty_stop_receiver struct irtty_cb self,
int  stop
[static]
 

Definition at line 325 of file irtty.c.

References termios::c_cflag, CREAD, and irtty_cb::tty.

Referenced by irtty_net_close(), and irtty_net_open().

static void irtty_write_wakeup struct tty_struct *  tty  )  [static]
 

Definition at line 698 of file irtty.c.

References ASSERT, IRDA_DEBUG, irda_task_execute(), irtty_change_speed(), irtty_change_speed_complete(), IRTTY_MAGIC, mark_bh, NET_BH, and NULL.

Referenced by irtty_init().

Here is the call graph for this function:


Variable Documentation

char* driver_name = "irtty"
 

Definition at line 75 of file irtty.c.

struct tty_ldisc irda_ldisc [static]
 

Definition at line 46 of file irtty.c.

hashbin_t* irtty = NULL [static]
 

Definition at line 45 of file irtty.c.

int qos_mtt_bits = 0x03 [static]
 

Definition at line 48 of file irtty.c.