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

w83977af_ir.c File Reference

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/malloc.h>
#include <linux/init.h>
#include <linux/rtnetlink.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/byteorder.h>
#include <net/irda/irda.h>
#include <net/irda/irmod.h>
#include <net/irda/wrapper.h>
#include <net/irda/irda_device.h>
#include <net/irda/w83977af.h>
#include <net/irda/w83977af_ir.h>

Include dependency graph for w83977af_ir.c:

Go to the source code of this file.

Defines

#define CONFIG_USE_W977_PNP
#define PIO_MAX_SPEED   115200
#define CHIP_IO_EXTENT   8

Functions

static int w83977af_open (int i, unsigned int iobase, unsigned int irq, unsigned int dma)
static int w83977af_close (struct w83977af_ir *self)
static int w83977af_probe (int iobase, int irq, int dma)
static int w83977af_dma_receive (struct w83977af_ir *self)
static int w83977af_dma_receive_complete (struct w83977af_ir *self)
static int w83977af_hard_xmit (struct sk_buff *skb, struct device *dev)
static int w83977af_pio_write (int iobase, __u8 *buf, int len, int fifo_size)
static void w83977af_dma_write (struct w83977af_ir *self, int iobase)
static void w83977af_change_speed (struct w83977af_ir *self, __u32 speed)
static void w83977af_interrupt (int irq, void *dev_id, struct pt_regs *regs)
static int w83977af_is_receiving (struct w83977af_ir *self)
static int w83977af_net_init (struct device *dev)
static int w83977af_net_open (struct device *dev)
static int w83977af_net_close (struct device *dev)
static int w83977af_net_ioctl (struct device *dev, struct ifreq *rq, int cmd)
static struct net_device_statsw83977af_net_get_stats (struct device *dev)
int __init w83977af_init (void)
void w83977af_dma_xmit_complete (struct w83977af_ir *self)
static void w83977af_pio_receive (struct w83977af_ir *self)
static __u8 w83977af_sir_interrupt (struct w83977af_ir *self, int isr)
static __u8 w83977af_fir_interrupt (struct w83977af_ir *self, int isr)

Variables

static char * driver_name = "w83977af_ir"
static int qos_mtt_bits = 0x07
static unsigned int io [] = { 0x180, ~0, ~0, ~0 }
static unsigned int irq [] = { 11, 0, 0, 0 }
static unsigned int dma [] = { 1, 0, 0, 0 }
static unsigned int efbase [] = { W977_EFIO_BASE, W977_EFIO2_BASE }
static unsigned int efio = W977_EFIO_BASE
static struct w83977af_irdev_self [] = { NULL, NULL, NULL, NULL}


Define Documentation

#define CHIP_IO_EXTENT   8
 

Definition at line 76 of file w83977af_ir.c.

#define CONFIG_USE_W977_PNP
 

Definition at line 70 of file w83977af_ir.c.

#define PIO_MAX_SPEED   115200
 

Definition at line 71 of file w83977af_ir.c.

Referenced by w83977af_change_speed(), w83977af_hard_xmit(), and w83977af_interrupt().


Function Documentation

void w83977af_change_speed struct w83977af_ir self,
__u32  speed
[static]
 

Definition at line 422 of file w83977af_ir.c.

References ABHL, ABLL, ADCR2, ADCR2_RXFS32, ADCR2_TXFS32, HCR_FIR, HCR_MIR_1152, HCR_MIR_576, HCR_SIR, ICR, ICR_EFSFI, ICR_ERBRI, inb, iobase, IRDA_DEBUG, outb, PIO_MAX_SPEED, set, SET0, SET2, SSR, switch_bank(), UFR, UFR_EN_FIFO, w83977af_dma_receive(), x00, x01, x02, x03, x06, and x0c().

Referenced by w83977af_dma_xmit_complete(), w83977af_net_ioctl(), and w83977af_sir_interrupt().

Here is the call graph for this function:

static int w83977af_close struct w83977af_ir self  )  [static]
 

Definition at line 278 of file w83977af_ir.c.

References efio, chipio_t::fir_base, chipio_t::fir_ext, iobuff_t::head, w83977af_ir::io, iobase, IRDA_DEBUG, kfree(), w83977af_ir::netdev, release_region, rtnl_lock(), rtnl_unlock(), w83977af_ir::rx_buff, w83977af_ir::tx_buff, unregister_netdevice, W977_DEVICE_IR, w977_efm_enter(), w977_efm_exit(), w977_select_device(), w977_write_reg(), x00, and x30.

Here is the call graph for this function:

int w83977af_dma_receive struct w83977af_ir self  )  [static]
 

Definition at line 738 of file w83977af_ir.c.

References ADCR1, ADCR1_ADV_SL, ADCR1_D_CHSW, ASSERT, clear_dma_ff, cli, iobuff_t::data, disable_dma(), chipio_t::dma, DMA_MODE_READ, enable_dma(), HCR_EN_DMA, inb, w83977af_ir::io, IO_RECV, iobase, IRDA_DEBUG, NULL, outb, restore_flags, w83977af_ir::rx_buff, save_flags, set, SET0, SET2, set_dma_addr(), set_dma_count(), set_dma_mode(), setup_dma(), SSR, switch_bank(), iobuff_t::truesize, UFR, UFR_EN_FIFO, UFR_RXF_RST, UFR_RXTL, UFR_TXTL, and virt_to_bus.

Referenced by w83977af_change_speed(), w83977af_fir_interrupt(), and w83977af_net_open().

Here is the call graph for this function:

int w83977af_dma_receive_complete struct w83977af_ir self  )  [static]
 

Definition at line 811 of file w83977af_ir.c.

References iobuff_t::data, sk_buff::data, sk_buff::dev, st_fifo::entries, ETH_P_IRDA, FALSE, FS_FO, FS_FO_CRC_ERR, FS_FO_ERR_MSK, FS_FO_FSF_OV, FS_FO_FSFDR, FS_FO_LST_FR, FS_FO_MX_LEX, FS_FO_PHY_ERR, FS_FO_RX_OV, st_fifo::head, htons(), inb, w83977af_ir::io, iobase, IRDA_DEBUG, KERN_INFO, st_fifo::len, st_fifo_entry::len, len, sk_buff::mac, memcpy, netif_rx(), NULL, outb, printk, sk_buff::protocol, RFLFH, RFLFL, w83977af_ir::rx_buff, set, SET0, SET5, chipio_t::speed, SSR, st_fifo_entry::status, status, switch_bank(), st_fifo::tail, TRUE, udelay, USR, and USR_RDR.

Referenced by w83977af_fir_interrupt().

Here is the call graph for this function:

static void w83977af_dma_write struct w83977af_ir self,
int  iobase
[static]
 

Definition at line 588 of file w83977af_ir.c.

References ADCR1, ADCR1_ADV_SL, ADCR1_D_CHSW, clear_dma_ff, cli, iobuff_t::data, disable_dma(), chipio_t::dma, DMA_MODE_READ, DMA_MODE_WRITE, enable_dma(), HCR_EN_DMA, HCR_TX_WT, inb, w83977af_ir::io, IO_XMIT, IRDA_DEBUG, iobuff_t::len, outb, restore_flags, save_flags, set, SET0, SET2, set_dma_addr(), set_dma_count(), set_dma_mode(), setup_dma(), SSR, switch_bank(), w83977af_ir::tx_buff, and virt_to_bus.

Referenced by w83977af_fir_interrupt(), and w83977af_hard_xmit().

Here is the call graph for this function:

void w83977af_dma_xmit_complete struct w83977af_ir self  ) 
 

Definition at line 685 of file w83977af_ir.c.

References ASSERT, AUDR, AUDR_UNDR, HCR_EN_DMA, inb, iobase, IRDA_DEBUG, jiffies, mark_bh, NET_BH, w83977af_ir::new_speed, NULL, outb, set, SET0, SSR, switch_bank(), and w83977af_change_speed().

Referenced by w83977af_fir_interrupt().

Here is the call graph for this function:

static __u8 w83977af_fir_interrupt struct w83977af_ir self,
int  isr
[static]
 

Definition at line 1038 of file w83977af_ir.c.

References chipio_t::direction, ICR_EDMAI, ICR_EFSFI, ICR_ETMRI, inb, w83977af_ir::io, IO_XMIT, iobase, IR_MSL, IR_MSL_EN_TMR, ISR_DMA_I, ISR_FEND_I, ISR_FSF_I, ISR_TMR_I, outb, set, SET4, SSR, switch_bank(), TMRH, TMRL, w83977af_dma_receive(), w83977af_dma_receive_complete(), w83977af_dma_write(), w83977af_dma_xmit_complete(), x00, and x01.

Referenced by w83977af_interrupt().

Here is the call graph for this function:

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

Definition at line 502 of file w83977af_ir.c.

References async_wrap_skb(), sk_buff::data, dev_kfree_skb, EBUSY, FALSE, ICR, ICR_EDMAI, ICR_ETMRI, ICR_ETXTHI, inb, IO_XMIT, iobase, IR_MSL, IR_MSL_EN_TMR, IRDA_DEBUG, irda_get_mtt, irda_get_speed, irda_lock(), jiffies, sk_buff::len, memcpy, outb, PIO_MAX_SPEED, set, SET0, SET4, speed, SSR, switch_bank(), TMRH, TMRL, udelay, w83977af_dma_write(), x0f, and xff.

Referenced by w83977af_open().

Here is the call graph for this function:

int __init w83977af_init void   ) 
 

Definition at line 116 of file w83977af_ir.c.

References check_region, CHIP_IO_EXTENT, dma, ENODEV, i, io, ioaddr, IRDA_DEBUG, irq, and w83977af_open().

Referenced by irda_device_init().

Here is the call graph for this function:

static void w83977af_interrupt int  irq,
void *  dev_id,
struct pt_regs regs
[static]
 

Definition at line 1117 of file w83977af_ir.c.

References dev, device, driver_name, ICR, inb, iobase, ISR, isr, KERN_WARNING, outb, PIO_MAX_SPEED, printk, set, SET0, SSR, switch_bank(), w83977af_fir_interrupt(), and w83977af_sir_interrupt().

Referenced by w83977af_net_open().

Here is the call graph for this function:

static int w83977af_is_receiving struct w83977af_ir self  )  [static]
 

Definition at line 1164 of file w83977af_ir.c.

References ASSERT, FALSE, inb, w83977af_ir::io, iobase, NULL, outb, OUTSIDE_FRAME, RXFDTH, set, SET2, chipio_t::speed, SSR, status, switch_bank(), TRUE, and x3f.

Referenced by w83977af_net_ioctl().

Here is the call graph for this function:

static int w83977af_net_close struct device *  dev  )  [static]
 

Definition at line 1278 of file w83977af_ir.c.

References ASSERT, disable_dma(), free_dma(), free_irq(), ICR, inb, iobase, IRDA_DEBUG, irlap_close(), MOD_DEC_USE_COUNT, NULL, outb, set, SET0, SSR, and switch_bank().

Referenced by w83977af_open().

Here is the call graph for this function:

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

Definition at line 1376 of file w83977af_ir.c.

Referenced by w83977af_open().

static int w83977af_net_init struct device *  dev  )  [static]
 

Definition at line 1195 of file w83977af_ir.c.

References IRDA_DEBUG, and irda_device_setup().

Referenced by w83977af_open().

Here is the call graph for this function:

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

Definition at line 1329 of file w83977af_ir.c.

References ASSERT, CAP_NET_ADMIN, capable, cli, EOPNOTSUPP, EPERM, in_interrupt, IRDA_DEBUG, irda_device_set_media_busy(), irq, NULL, restore_flags, ret, save_flags, SIOCGRECEIVING, SIOCSBANDWIDTH, SIOCSMEDIABUSY, TRUE, w83977af_change_speed(), and w83977af_is_receiving().

Referenced by w83977af_open().

Here is the call graph for this function:

static int w83977af_net_open struct device *  dev  )  [static]
 

Definition at line 1214 of file w83977af_ir.c.

References ASSERT, EAGAIN, free_irq(), ICR, ICR_EFSFI, ICR_ERBRI, inb, iobase, IRDA_DEBUG, irlap_open(), MOD_INC_USE_COUNT, NULL, outb, request_dma(), request_irq(), set, SET0, SSR, switch_bank(), w83977af_dma_receive(), and w83977af_interrupt().

Referenced by w83977af_open().

Here is the call graph for this function:

int w83977af_open int  i,
unsigned int  iobase,
unsigned int  irq,
unsigned int  dma
[static]
 

Definition at line 158 of file w83977af_ir.c.

References check_region, CHIP_IO_EXTENT, dev, dev_alloc(), device, driver_name, ENODEV, ENOMEM, ERROR, FALSE, chipio_t::fir_base, IFF_DMA, IFF_FIR, IFF_MIR, IFF_PIO, IFF_SIR, w83977af_ir::io, IR_115200, IR_1152000, IR_19200, IR_38400, IR_4000000, IR_57600, IR_576000, IR_9600, IRDA_DEBUG, irda_init_max_qos_capabilies(), irda_qos_bits_to_value(), KERN_ERR, kfree(), kmalloc(), memset, MESSAGE, NULL, OUTSIDE_FRAME, printk, qos_mtt_bits, register_netdevice, request_region, ret, rtnl_lock(), rtnl_unlock(), w83977af_hard_xmit(), w83977af_net_close(), w83977af_net_get_stats(), w83977af_net_init(), w83977af_net_ioctl(), w83977af_net_open(), and w83977af_probe().

Referenced by w83977af_init().

Here is the call graph for this function:

static void w83977af_pio_receive struct w83977af_ir self  )  [static]
 

Definition at line 941 of file w83977af_ir.c.

References ASSERT, async_unwrap_char(), byte, inb, iobase, IRDA_DEBUG, w83977af_ir::netdev, NULL, RBR, w83977af_ir::rx_buff, w83977af_ir::stats, USR, and USR_RDR.

Referenced by w83977af_sir_interrupt().

Here is the call graph for this function:

static int w83977af_pio_write int  iobase,
__u8 buf,
int  len,
int  fifo_size
[static]
 

Definition at line 643 of file w83977af_ir.c.

References inb, inb_p, IRDA_DEBUG, outb, set, SET0, SSR, switch_bank(), TBR, USR, and USR_TSRE.

Referenced by w83977af_sir_interrupt().

Here is the call graph for this function:

int w83977af_probe int  iobase,
int  irq,
int  dma
[static]
 

Definition at line 323 of file w83977af_ir.c.

References ADCR1, ADCR1_ADV_SL, ADCR2, ADCR2_RXFS32, ADCR2_TXFS32, APEDCRC, AUID, efbase, efio, ENBNKSEL, HCR_EN_IRQ, HCR_SIR, inb, IRDA_DEBUG, MESSAGE, outb, SET0, SET2, SET3, SET4, SET7, switch_bank(), UFR, UFR_EN_FIFO, UFR_RXF_RST, UFR_RXTL, UFR_TXF_RST, UFR_TXTL, version, W977_DEVICE_IR, w977_efm_enter(), w977_efm_exit(), w977_select_device(), w977_write_reg(), x00, x01, x04, x10, x1f, x30, x40, x60, x61, x70, x74, x75, xf0, and xff.

Referenced by w83977af_open().

Here is the call graph for this function:

static __u8 w83977af_sir_interrupt struct w83977af_ir self,
int  isr
[static]
 

Definition at line 966 of file w83977af_ir.c.

References AUDR, AUDR_SFEND, ICR_ERBRI, ICR_ETBREI, ICR_ETXTHI, inb, IO_RECV, IO_XMIT, iobase, IRDA_DEBUG, ISR_RXTH_I, ISR_TXEMP_I, ISR_TXTH_I, mark_bh, NET_BH, outb, set, SET0, SSR, switch_bank(), w83977af_change_speed(), w83977af_pio_receive(), and w83977af_pio_write().

Referenced by w83977af_interrupt().

Here is the call graph for this function:


Variable Documentation

struct w83977af_ir* dev_self[] = { NULL, NULL, NULL, NULL} [static]
 

Definition at line 88 of file w83977af_ir.c.

unsigned int dma[] = { 1, 0, 0, 0 } [static]
 

Definition at line 84 of file w83977af_ir.c.

char* driver_name = "w83977af_ir" [static]
 

Definition at line 73 of file w83977af_ir.c.

unsigned int efbase[] = { W977_EFIO_BASE, W977_EFIO2_BASE } [static]
 

Definition at line 85 of file w83977af_ir.c.

Referenced by w83977af_probe().

unsigned int efio = W977_EFIO_BASE [static]
 

Definition at line 86 of file w83977af_ir.c.

Referenced by w83977af_close(), and w83977af_probe().

unsigned int io[] = { 0x180, ~0, ~0, ~0 } [static]
 

Definition at line 78 of file w83977af_ir.c.

unsigned int irq[] = { 11, 0, 0, 0 } [static]
 

Definition at line 82 of file w83977af_ir.c.

int qos_mtt_bits = 0x07 [static]
 

Definition at line 74 of file w83977af_ir.c.