Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
cosa.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/fs.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/hdlc.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/netdevice.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/device.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/byteorder.h>
#include "cosa.h"

Go to the source code of this file.

Data Structures

struct  channel_data
 
struct  cosa_data
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define COSA_MAX_ID_STRING   128
 
#define COSA_MAX_NAME   (sizeof("cosaXXXcXXX")+1)
 
#define COSA_FW_RESET   (1<<0) /* Is the ROM monitor active? */
 
#define COSA_FW_DOWNLOAD   (1<<1) /* Is the microcode downloaded? */
 
#define COSA_FW_START   (1<<2) /* Is the microcode running? */
 
#define CARD_MINOR_BITS
 
#define MAX_CARDS   16
 
#define DRIVER_RX_READY   0x0001
 
#define DRIVER_TX_READY   0x0002
 
#define DRIVER_TXMAP_SHIFT   2
 
#define DRIVER_TXMAP_MASK   0x0c /* FIXME: 0xfc for 8-channel version */
 
#define TXBIT   0
 
#define RXBIT   1
 
#define IRQBIT   2
 
#define COSA_MTU   2000 /* FIXME: I don't know this exactly */
 
#define TX_TIMEOUT   (5*HZ)
 
#define cosa_outb   outb
 
#define cosa_outw   outw
 
#define cosa_inb   inb
 
#define cosa_inw   inw
 
#define is_8bit(cosa)   (!(cosa->datareg & 0x08))
 
#define cosa_getstatus(cosa)   (cosa_inb(cosa->statusreg))
 
#define cosa_putstatus(cosa, stat)   (cosa_outb(stat, cosa->statusreg))
 
#define cosa_getdata16(cosa)   (cosa_inw(cosa->datareg))
 
#define cosa_getdata8(cosa)   (cosa_inb(cosa->datareg))
 
#define cosa_putdata16(cosa, dt)   (cosa_outw(dt, cosa->datareg))
 
#define cosa_putdata8(cosa, dt)   (cosa_outb(dt, cosa->datareg))
 

Functions

 module_init (cosa_init)
 
 module_exit (cosa_exit)
 

Macro Definition Documentation

#define CARD_MINOR_BITS
Value:
4 /* How many bits in minor number are reserved
* for the single card */

Definition at line 186 of file cosa.c.

#define COSA_FW_DOWNLOAD   (1<<1) /* Is the microcode downloaded? */

Definition at line 141 of file cosa.c.

#define COSA_FW_RESET   (1<<0) /* Is the ROM monitor active? */

Definition at line 140 of file cosa.c.

#define COSA_FW_START   (1<<2) /* Is the microcode running? */

Definition at line 142 of file cosa.c.

#define cosa_getdata16 (   cosa)    (cosa_inw(cosa->datareg))

Definition at line 263 of file cosa.c.

#define cosa_getdata8 (   cosa)    (cosa_inb(cosa->datareg))

Definition at line 264 of file cosa.c.

#define cosa_getstatus (   cosa)    (cosa_inb(cosa->statusreg))

Definition at line 261 of file cosa.c.

#define cosa_inb   inb

Definition at line 255 of file cosa.c.

#define cosa_inw   inw

Definition at line 256 of file cosa.c.

#define COSA_MAX_ID_STRING   128

Definition at line 103 of file cosa.c.

#define COSA_MAX_NAME   (sizeof("cosaXXXcXXX")+1)

Definition at line 106 of file cosa.c.

#define COSA_MTU   2000 /* FIXME: I don't know this exactly */

Definition at line 207 of file cosa.c.

#define cosa_outb   outb

Definition at line 253 of file cosa.c.

#define cosa_outw   outw

Definition at line 254 of file cosa.c.

#define cosa_putdata16 (   cosa,
  dt 
)    (cosa_outw(dt, cosa->datareg))

Definition at line 265 of file cosa.c.

#define cosa_putdata8 (   cosa,
  dt 
)    (cosa_outb(dt, cosa->datareg))

Definition at line 266 of file cosa.c.

#define cosa_putstatus (   cosa,
  stat 
)    (cosa_outb(stat, cosa->statusreg))

Definition at line 262 of file cosa.c.

#define DRIVER_RX_READY   0x0001

Definition at line 194 of file cosa.c.

#define DRIVER_TX_READY   0x0002

Definition at line 195 of file cosa.c.

#define DRIVER_TXMAP_MASK   0x0c /* FIXME: 0xfc for 8-channel version */

Definition at line 197 of file cosa.c.

#define DRIVER_TXMAP_SHIFT   2

Definition at line 196 of file cosa.c.

#define IRQBIT   2

Definition at line 205 of file cosa.c.

#define is_8bit (   cosa)    (!(cosa->datareg & 0x08))

Definition at line 259 of file cosa.c.

#define MAX_CARDS   16

Definition at line 191 of file cosa.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 77 of file cosa.c.

#define RXBIT   1

Definition at line 204 of file cosa.c.

#define TX_TIMEOUT   (5*HZ)

Definition at line 213 of file cosa.c.

#define TXBIT   0

Definition at line 203 of file cosa.c.

Function Documentation

module_exit ( cosa_exit  )
module_init ( cosa_init  )