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

nsc-ircc.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 <asm/hardirq.h>
#include <net/irda/wrapper.h>
#include <net/irda/irda.h>
#include <net/irda/irmod.h>
#include <net/irda/irlap_frame.h>
#include <net/irda/irda_device.h>
#include <net/irda/nsc-ircc.h>

Include dependency graph for nsc-ircc.c:

Go to the source code of this file.

Defines

#define CHIP_IO_EXTENT   8
#define BROKEN_DONGLE_ID

Functions

static int nsc_ircc_probe_108 (nsc_chip_t *chip, chipio_t *info)
static int nsc_ircc_probe_338 (nsc_chip_t *chip, chipio_t *info)
static int nsc_ircc_init_108 (nsc_chip_t *chip, chipio_t *info)
static int nsc_ircc_init_338 (nsc_chip_t *chip, chipio_t *info)
static int nsc_ircc_open (int i, chipio_t *info)
static int nsc_ircc_setup (chipio_t *info)
static void nsc_ircc_pio_receive (struct nsc_ircc_cb *self)
static int nsc_ircc_dma_receive (struct nsc_ircc_cb *self)
static int nsc_ircc_dma_receive_complete (struct nsc_ircc_cb *self, int iobase)
static int nsc_ircc_hard_xmit_sir (struct sk_buff *skb, struct device *dev)
static int nsc_ircc_hard_xmit_fir (struct sk_buff *skb, struct device *dev)
static int nsc_ircc_pio_write (int iobase, __u8 *buf, int len, int fifo_size)
static void nsc_ircc_dma_xmit (struct nsc_ircc_cb *self, int iobase)
static void nsc_ircc_change_speed (struct nsc_ircc_cb *self, __u32 baud)
static void nsc_ircc_interrupt (int irq, void *dev_id, struct pt_regs *regs)
static int nsc_ircc_is_receiving (struct nsc_ircc_cb *self)
static int nsc_ircc_read_dongle_id (int iobase)
static void nsc_ircc_init_dongle_interface (int iobase, int dongle_id)
static int nsc_ircc_net_init (struct device *dev)
static int nsc_ircc_net_open (struct device *dev)
static int nsc_ircc_net_close (struct device *dev)
static int nsc_ircc_net_ioctl (struct device *dev, struct ifreq *rq, int cmd)
static struct net_device_statsnsc_ircc_net_get_stats (struct device *dev)
int __init nsc_ircc_init (void)
static void nsc_ircc_change_dongle_speed (int iobase, int speed, int dongle_id)
static int nsc_ircc_dma_xmit_complete (struct nsc_ircc_cb *self)
static void nsc_ircc_sir_interrupt (struct nsc_ircc_cb *self, int eir)
static void nsc_ircc_fir_interrupt (struct nsc_ircc_cb *self, int iobase, int eir)

Variables

static char * driver_name = "nsc-ircc"
static int qos_mtt_bits = 0x07
static int dongle_id = 0
static unsigned int io [] = { ~0, ~0, ~0, ~0 }
static unsigned int irq [] = { 0, 0, 0, 0, 0 }
static unsigned int dma [] = { 0, 0, 0, 0, 0 }
static nsc_chip_t chips []
static struct nsc_ircc_cbdev_self [] = { NULL, NULL, NULL, NULL }
static char * dongle_types []


Define Documentation

#define BROKEN_DONGLE_ID
 

Definition at line 74 of file nsc-ircc.c.

#define CHIP_IO_EXTENT   8
 

Definition at line 73 of file nsc-ircc.c.

Referenced by ircc_init(), ircc_open(), nsc_ircc_init(), nsc_ircc_open(), toshoboe_open(), w83977af_init(), and w83977af_open().


Function Documentation

static void nsc_ircc_change_dongle_speed int  iobase,
int  speed,
int  dongle_id
[static]
 

Definition at line 882 of file nsc-ircc.c.

References BANK0, BANK7, BSR, cli, dongle_types, inb, IRDA_DEBUG, MCR, outb, restore_flags, save_flags, switch_bank(), x00, x01, x62, and x80.

Referenced by nsc_ircc_change_speed().

Here is the call graph for this function:

static void nsc_ircc_change_speed struct nsc_ircc_cb self,
__u32  baud
[static]
 

Definition at line 969 of file nsc-ircc.c.

References ASSERT, BANK0, BANK2, BANK5, BGDH, BGDL, BSR, dev, device, chipio_t::dongle_id, EXCR2, EXCR2_RFSIZ, EXCR2_TFSIZ, FCR, FCR_FIFO_EN, FCR_RXSR, FCR_RXTH, FCR_TXSR, FCR_TXTH, IER, IER_RXHDL_IE, IER_SFIF_IE, inb, nsc_ircc_cb::io, IRDA_DEBUG, MCR, MCR_FIR, MCR_MIR, MCR_SIR, MCR_TX_DFR, nsc_ircc_change_dongle_speed(), nsc_ircc_dma_receive(), nsc_ircc_hard_xmit_fir(), nsc_ircc_hard_xmit_sir(), NULL, outb, switch_bank(), x00, x01, x02, x03, x04, x06, and x0c().

Referenced by nsc_ircc_dma_xmit_complete(), nsc_ircc_net_ioctl(), and nsc_ircc_sir_interrupt().

Here is the call graph for this function:

static int nsc_ircc_dma_receive struct nsc_ircc_cb self  )  [static]
 

Definition at line 1381 of file nsc-ircc.c.

References BANK0, BANK2, BSR, bsr, iobuff_t::data, chipio_t::dma, DMA_RX_MODE, ECR1, ECR1_DMANF, ECR1_EXT_SL, FCR, FCR_FIFO_EN, FCR_RXSR, inb, nsc_ircc_cb::io, IO_RECV, MCR, MCR_DMA_EN, outb, nsc_ircc_cb::rx_buff, setup_dma(), switch_bank(), and iobuff_t::truesize.

Referenced by nsc_ircc_change_speed(), and nsc_ircc_fir_interrupt().

Here is the call graph for this function:

static int nsc_ircc_dma_receive_complete struct nsc_ircc_cb self,
int  iobase
[static]
 

Definition at line 1433 of file nsc-ircc.c.

References BANK0, BANK4, BANK5, BSR, iobuff_t::data, sk_buff::data, sk_buff::dev, st_fifo::entries, ETH_P_IRDA, FALSE, chipio_t::fifo_size, FRM_ST, FRM_ST_BAD_CRC, FRM_ST_ERR_MSK, FRM_ST_LOST_FR, FRM_ST_MAX_LEN, FRM_ST_OVR1, FRM_ST_OVR2, FRM_ST_PHY_ERR, FRM_ST_VLD, get_fast_time(), st_fifo::head, htons(), inb, nsc_ircc_cb::io, IRCR1, IRCR1_TMR_EN, IRDA_DEBUG, st_fifo::len, st_fifo_entry::len, len, LSR, LSR_RXDA, sk_buff::mac, MAX_RX_WINDOW, memcpy, netif_rx(), NULL, outb, st_fifo::pending_bytes, sk_buff::protocol, RFLFH, RFLFL, nsc_ircc_cb::rx_buff, chipio_t::speed, nsc_ircc_cb::stamp, st_fifo_entry::status, status, switch_bank(), st_fifo::tail, TMRH, TMRL, TRUE, WARNING, x00, and x02.

Referenced by nsc_ircc_fir_interrupt().

Here is the call graph for this function:

static void nsc_ircc_dma_xmit struct nsc_ircc_cb self,
int  iobase
[static]
 

Definition at line 1231 of file nsc-ircc.c.

References BANK0, BANK2, BSR, bsr, chipio_t::dma, DMA_TX_MODE, ECR1, ECR1_DMANF, ECR1_DMASWP, ECR1_EXT_SL, inb, nsc_ircc_cb::io, IO_XMIT, MCR, MCR_DMA_EN, MCR_IR_PLS, MCR_TX_DFR, outb, tx_fifo::ptr, tx_fifo::queue, setup_dma(), switch_bank(), and nsc_ircc_cb::tx_fifo.

Referenced by nsc_ircc_dma_xmit_complete(), nsc_ircc_fir_interrupt(), and nsc_ircc_hard_xmit_fir().

Here is the call graph for this function:

static int nsc_ircc_dma_xmit_complete struct nsc_ircc_cb self  )  [static]
 

Definition at line 1309 of file nsc-ircc.c.

References ASCR, ASCR_TXUR, BANK0, BSR, FALSE, tx_fifo::free, inb, IRDA_DEBUG, tx_fifo::len, mark_bh, MAX_TX_WINDOW, MCR, MCR_DMA_EN, NET_BH, nsc_ircc_cb::new_speed, nsc_ircc_change_speed(), nsc_ircc_dma_xmit(), outb, ret, switch_bank(), TRUE, and nsc_ircc_cb::tx_fifo.

Referenced by nsc_ircc_fir_interrupt().

Here is the call graph for this function:

static void nsc_ircc_fir_interrupt struct nsc_ircc_cb self,
int  iobase,
int  eir
[static]
 

Definition at line 1675 of file nsc-ircc.c.

References ASCR, ASCR_CTE, BANK0, BANK4, BSR, chipio_t::direction, EIR_DMA_EV, EIR_SFIF_EV, EIR_TMR_EV, IER_DMA_IE, IER_SFIF_IE, IER_TMR_IE, inb, nsc_ircc_cb::io, IO_XMIT, IRCR1, irda_device_txqueue_empty(), nsc_ircc_dma_receive(), nsc_ircc_dma_receive_complete(), nsc_ircc_dma_xmit(), nsc_ircc_dma_xmit_complete(), outb, and switch_bank().

Referenced by nsc_ircc_interrupt().

Here is the call graph for this function:

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

Definition at line 1121 of file nsc-ircc.c.

References BANK0, BANK4, BSR, sk_buff::data, dev_kfree_skb, diff, EBUSY, FALSE, tx_fifo::free, get_fast_time(), IER, IER_DMA_IE, IER_TMR_IE, inb, nsc_ircc_cb::io, IO_XMIT, IRCR1, IRCR1_TMR_EN, irda_get_mtt, irda_get_speed, irda_lock(), tx_fifo::len, sk_buff::len, nsc_ircc_cb::lock, MAX_TX_WINDOW, memcpy, nsc_ircc_cb::now, nsc_ircc_dma_xmit(), out, outb, tx_fifo::queue, chipio_t::speed, speed, spin_lock_irqsave, spin_unlock_irqrestore, switch_bank(), TMRH, TMRL, nsc_ircc_cb::tx_fifo, udelay, x0f, and xff.

Referenced by nsc_ircc_change_speed().

Here is the call graph for this function:

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

Definition at line 1073 of file nsc-ircc.c.

References ASSERT, async_wrap_skb(), BANK0, BSR, iobuff_t::data, dev_kfree_skb, EBUSY, FALSE, IER, IER_TXLDL_IE, inb, nsc_ircc_cb::io, irda_get_speed, irda_lock(), nsc_ircc_cb::lock, NULL, outb, chipio_t::speed, speed, spin_lock_irqsave, spin_unlock_irqrestore, switch_bank(), iobuff_t::truesize, and nsc_ircc_cb::tx_buff.

Referenced by nsc_ircc_change_speed(), and nsc_ircc_open().

Here is the call graph for this function:

int __init nsc_ircc_init void   ) 
 

Definition at line 157 of file nsc-ircc.c.

Referenced by irda_device_init().

static int nsc_ircc_init_108 nsc_chip_t chip,
chipio_t info
[static]
 

Definition at line 438 of file nsc-ircc.c.

References chipio_t::cfg_base, chipio_t::dma, ERROR, chipio_t::fir_base, chipio_t::irq, outb, temp, x00, x03, x08, x10, x14, and x18.

static int nsc_ircc_init_338 nsc_chip_t chip,
chipio_t info
[static]
 

Definition at line 582 of file nsc-ircc.c.

Referenced by nsc_ircc_probe().

static void nsc_ircc_init_dongle_interface int  iobase,
int  dongle_id
[static]
 

Definition at line 795 of file nsc-ircc.c.

References BANK0, BANK7, BSR, dongle_types, inb, IRDA_DEBUG, MCR, outb, switch_bank(), x00, x28, x48, and x62.

Referenced by nsc_ircc_open().

Here is the call graph for this function:

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

Definition at line 1738 of file nsc-ircc.c.

References BANK0, BSR, bsr, dev, device, driver_name, EIR, nsc_ircc_cb::ier, IER, inb, nsc_ircc_cb::io, nsc_ircc_cb::lock, nsc_ircc_fir_interrupt(), nsc_ircc_sir_interrupt(), outb, chipio_t::speed, spin_lock, spin_unlock, switch_bank(), and WARNING.

Referenced by nsc_ircc_net_open().

Here is the call graph for this function:

static int nsc_ircc_is_receiving struct nsc_ircc_cb self  )  [static]
 

Definition at line 1785 of file nsc-ircc.c.

References ASSERT, BANK2, BSR, FALSE, inb, nsc_ircc_cb::io, nsc_ircc_cb::lock, NULL, outb, OUTSIDE_FRAME, RXFLV, chipio_t::speed, spin_lock_irqsave, spin_unlock_irqrestore, status, switch_bank(), TRUE, and x3f.

Referenced by nsc_ircc_net_ioctl().

Here is the call graph for this function:

static int nsc_ircc_net_close struct device *  dev  )  [static]
 

Definition at line 1902 of file nsc-ircc.c.

References ASSERT, BANK0, BSR, disable_dma(), chipio_t::dma, free_dma(), free_irq(), IER, inb, nsc_ircc_cb::io, IRDA_DEBUG, nsc_ircc_cb::irlap, irlap_close(), chipio_t::irq, MOD_DEC_USE_COUNT, NULL, outb, and switch_bank().

Referenced by nsc_ircc_open().

Here is the call graph for this function:

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

Definition at line 2001 of file nsc-ircc.c.

Referenced by nsc_ircc_open().

static int nsc_ircc_net_init struct device *  dev  )  [static]
 

Definition at line 1821 of file nsc-ircc.c.

References IRDA_DEBUG, and irda_device_setup().

Referenced by nsc_ircc_open().

Here is the call graph for this function:

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

Definition at line 1952 of file nsc-ircc.c.

References ASSERT, CAP_NET_ADMIN, capable, cli, EOPNOTSUPP, EPERM, in_interrupt, IRDA_DEBUG, irda_device_set_media_busy(), irq, nsc_ircc_cb::netdev, nsc_ircc_change_speed(), nsc_ircc_is_receiving(), NULL, restore_flags, ret, save_flags, SIOCGRECEIVING, SIOCSBANDWIDTH, SIOCSMEDIABUSY, and TRUE.

Referenced by nsc_ircc_open().

Here is the call graph for this function:

static int nsc_ircc_net_open struct device *  dev  )  [static]
 

Definition at line 1839 of file nsc-ircc.c.

References ASSERT, BANK0, BSR, chipio_t::dma, driver_name, EAGAIN, free_irq(), IER, IER_LS_IE, IER_RXHDL_IE, inb, nsc_ircc_cb::io, IRDA_DEBUG, irlap_open(), chipio_t::irq, MOD_INC_USE_COUNT, nsc_ircc_interrupt(), NULL, outb, nsc_ircc_cb::qos, request_dma(), request_irq(), switch_bank(), and WARNING.

Referenced by nsc_ircc_open().

Here is the call graph for this function:

static int nsc_ircc_open int  i,
chipio_t info
[static]
 

Definition at line 256 of file nsc-ircc.c.

References chipio_t::cfg_base, check_region, CHIP_IO_EXTENT, dev, dev_alloc(), device, chipio_t::dma, dongle_id, dongle_types, driver_name, ENODEV, ENOMEM, ERROR, FALSE, chipio_t::fir_base, IFF_DMA, IFF_DONGLE, IFF_FIR, IFF_MIR, IFF_PIO, IFF_SIR, nsc_ircc_cb::index, 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(), chipio_t::irq, kfree(), kmalloc(), memset, MESSAGE, nsc_ircc_hard_xmit_sir(), nsc_ircc_init_dongle_interface(), nsc_ircc_net_close(), nsc_ircc_net_get_stats(), nsc_ircc_net_init(), nsc_ircc_net_ioctl(), nsc_ircc_net_open(), nsc_ircc_read_dongle_id(), nsc_ircc_setup(), NULL, OUTSIDE_FRAME, qos_mtt_bits, register_netdevice, request_region, ret, rtnl_lock(), rtnl_unlock(), spin_lock_init, and WARNING.

Referenced by nsc_ircc_init().

Here is the call graph for this function:

static void nsc_ircc_pio_receive struct nsc_ircc_cb self  )  [static]
 

Definition at line 1588 of file nsc-ircc.c.

References async_unwrap_char(), byte, inb, LSR, LSR_RXDA, nsc_ircc_cb::netdev, nsc_ircc_cb::rx_buff, and nsc_ircc_cb::stats.

Referenced by nsc_ircc_sir_interrupt().

Here is the call graph for this function:

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

Definition at line 1268 of file nsc-ircc.c.

References BANK0, BSR, inb, inb_p, IRDA_DEBUG, LSR, LSR_TXEMP, outb, and switch_bank().

Referenced by nsc_ircc_sir_interrupt().

Here is the call graph for this function:

static int nsc_ircc_probe_108 nsc_chip_t chip,
chipio_t info
[static]
 

Definition at line 488 of file nsc-ircc.c.

References CFG_BAIC, chipio_t::cfg_base, CFG_CSRT, CFG_MCTL, chipio_t::dma, chipio_t::enabled, chipio_t::fir_base, inb, IRDA_DEBUG, chipio_t::irq, outb, reg, chipio_t::sir_base, chipio_t::suspended, x03, and x07.

static int nsc_ircc_probe_338 nsc_chip_t chip,
chipio_t info
[static]
 

Definition at line 595 of file nsc-ircc.c.

References chipio_t::cfg_base, CFG_FAR, CFG_FER, CFG_PNP0, CFG_PNP1, CFG_PNP3, CFG_PTR, chipio_t::dma, chipio_t::enabled, chipio_t::fir_base, inb, IRDA_DEBUG, chipio_t::irq, outb, reg, chipio_t::sir_base, chipio_t::suspended, and x03.

static int nsc_ircc_read_dongle_id int  iobase  )  [static]
 

Definition at line 756 of file nsc-ircc.c.

References BANK0, BANK7, BSR, dongle_id, inb, outb, switch_bank(), udelay, and x00.

Referenced by nsc_ircc_open(), and nsc_ircc_probe().

Here is the call graph for this function:

static int nsc_ircc_setup chipio_t info  )  [static]
 

Definition at line 699 of file nsc-ircc.c.

References BANK0, BANK2, BANK3, BANK5, BANK6, chipio_t::cfg_base, driver_name, ECR1, ECR1_EXT_SL, ERROR, EXCR2, EXCR2_RFSIZ, EXCR2_TFSIZ, FCR, FCR_FIFO_EN, FCR_RXSR, FCR_RXTH, FCR_TXSR, FCR_TXTH, chipio_t::fir_base, IER, IER_RXHDL_IE, inb, MESSAGE, MID, outb, switch_bank(), version, x02, x20, and xf0.

Referenced by nsc_ircc_open().

Here is the call graph for this function:

static void nsc_ircc_sir_interrupt struct nsc_ircc_cb self,
int  eir
[static]
 

Definition at line 1609 of file nsc-ircc.c.

References EIR_RXHDL_EV, EIR_TXEMP_EV, EIR_TXLDL_EV, IER_RXHDL_IE, IER_SFIF_IE, IER_TXEMP_IE, IER_TXLDL_IE, IO_RECV, IO_XMIT, IRDA_DEBUG, mark_bh, NET_BH, nsc_ircc_change_speed(), nsc_ircc_pio_receive(), and nsc_ircc_pio_write().

Referenced by nsc_ircc_interrupt().

Here is the call graph for this function:


Variable Documentation

nsc_chip_t chips[] [static]
 

Initial value:

 {
        { "PC87108", { 0x150, 0x398, 0xea }, 0x05, 0x10, 0xf0, 
          nsc_ircc_probe_108, nsc_ircc_init_108 },
        { "PC87338", { 0x398, 0x15c, 0x2e }, 0x08, 0xb0, 0xf0, 
          nsc_ircc_probe_338, nsc_ircc_init_338 },
        { NULL }
}

Definition at line 93 of file nsc-ircc.c.

Referenced by ncr885e_probe(), sim710_detect(), and sym53c8xx_detect().

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

Definition at line 102 of file nsc-ircc.c.

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

Definition at line 85 of file nsc-ircc.c.

int dongle_id = 0 [static]
 

Definition at line 80 of file nsc-ircc.c.

Referenced by nsc_ircc_open(), nsc_ircc_probe(), and nsc_ircc_read_dongle_id().

char* dongle_types[] [static]
 

Initial value:

 {
        "Differential serial interface",
        "Differential serial interface",
        "Reserved",
        "Reserved",
        "Sharp RY5HD01",
        "Reserved",
        "Single-ended serial interface",
        "Consumer-IR only",
        "HP HSDL-2300, HP HSDL-3600/HSDL-3610",
        "IBM31T1100 or Temic TFDS6000/TFDS6500",
        "Reserved",
        "Reserved",
        "HP HSDL-1100/HSDL-2100",
        "HP HSDL-1100/HSDL-2100"
        "Supports SIR Mode only",
        "No dongle connected",
}

Definition at line 104 of file nsc-ircc.c.

Referenced by nsc_ircc_change_dongle_speed(), nsc_ircc_init_dongle_interface(), nsc_ircc_open(), and nsc_ircc_probe().

char* driver_name = "nsc-ircc" [static]
 

Definition at line 76 of file nsc-ircc.c.

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

Definition at line 83 of file nsc-ircc.c.

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

Definition at line 84 of file nsc-ircc.c.

int qos_mtt_bits = 0x07 [static]
 

Definition at line 79 of file nsc-ircc.c.