Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
nmclan_cs.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/in.h>
#include <linux/delay.h>
#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/ioport.h>
#include <linux/bitops.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
#include <asm/uaccess.h>
#include <asm/io.h>

Go to the source code of this file.

Data Structures

struct  _mace_statistics
 
struct  _mace_private
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRV_NAME   "nmclan_cs"
 
#define DRV_VERSION   "0.16"
 
#define MULTI_TX   0
 
#define RESET_ON_TIMEOUT   1
 
#define TX_INTERRUPTABLE   1
 
#define RESET_XILINX   0
 
#define MACE_LADRF_LEN   8
 
#define MACE_MAX_IR_ITERATIONS   10
 
#define MACE_MAX_RX_ITERATIONS   12
 
#define AM2150_MAX_TX_FRAMES   4
 
#define AM2150_MAX_RX_FRAMES   12
 
#define AM2150_RCV   0x00
 
#define AM2150_XMT   0x04
 
#define AM2150_XMT_SKIP   0x09
 
#define AM2150_RCV_NEXT   0x0A
 
#define AM2150_RCV_FRAME_COUNT   0x0B
 
#define AM2150_MACE_BANK   0x0C
 
#define AM2150_MACE_BASE   0x10
 
#define MACE_RCVFIFO   0
 
#define MACE_XMTFIFO   1
 
#define MACE_XMTFC   2
 
#define MACE_XMTFS   3
 
#define MACE_XMTRC   4
 
#define MACE_RCVFC   5
 
#define MACE_RCVFS   6
 
#define MACE_FIFOFC   7
 
#define MACE_IR   8
 
#define MACE_IMR   9
 
#define MACE_PR   10
 
#define MACE_BIUCC   11
 
#define MACE_FIFOCC   12
 
#define MACE_MACCC   13
 
#define MACE_PLSCC   14
 
#define MACE_PHYCC   15
 
#define MACE_CHIPIDL   16
 
#define MACE_CHIPIDH   17
 
#define MACE_IAC   18
 
#define MACE_LADRF   20
 
#define MACE_PADR   21
 
#define MACE_MPC   24
 
#define MACE_RNTPC   26
 
#define MACE_RCVCC   27
 
#define MACE_UTR   29
 
#define MACE_RTR1   30
 
#define MACE_RTR2   31
 
#define MACE_XMTRC_EXDEF   0x80
 
#define MACE_XMTRC_XMTRC   0x0F
 
#define MACE_XMTFS_XMTSV   0x80
 
#define MACE_XMTFS_UFLO   0x40
 
#define MACE_XMTFS_LCOL   0x20
 
#define MACE_XMTFS_MORE   0x10
 
#define MACE_XMTFS_ONE   0x08
 
#define MACE_XMTFS_DEFER   0x04
 
#define MACE_XMTFS_LCAR   0x02
 
#define MACE_XMTFS_RTRY   0x01
 
#define MACE_RCVFS_RCVSTS   0xF000
 
#define MACE_RCVFS_OFLO   0x8000
 
#define MACE_RCVFS_CLSN   0x4000
 
#define MACE_RCVFS_FRAM   0x2000
 
#define MACE_RCVFS_FCS   0x1000
 
#define MACE_FIFOFC_RCVFC   0xF0
 
#define MACE_FIFOFC_XMTFC   0x0F
 
#define MACE_IR_JAB   0x80
 
#define MACE_IR_BABL   0x40
 
#define MACE_IR_CERR   0x20
 
#define MACE_IR_RCVCCO   0x10
 
#define MACE_IR_RNTPCO   0x08
 
#define MACE_IR_MPCO   0x04
 
#define MACE_IR_RCVINT   0x02
 
#define MACE_IR_XMTINT   0x01
 
#define MACE_MACCC_PROM   0x80
 
#define MACE_MACCC_DXMT2PD   0x40
 
#define MACE_MACCC_EMBA   0x20
 
#define MACE_MACCC_RESERVED   0x10
 
#define MACE_MACCC_DRCVPA   0x08
 
#define MACE_MACCC_DRCVBC   0x04
 
#define MACE_MACCC_ENXMT   0x02
 
#define MACE_MACCC_ENRCV   0x01
 
#define MACE_PHYCC_LNKFL   0x80
 
#define MACE_PHYCC_DLNKTST   0x40
 
#define MACE_PHYCC_REVPOL   0x20
 
#define MACE_PHYCC_DAPC   0x10
 
#define MACE_PHYCC_LRT   0x08
 
#define MACE_PHYCC_ASEL   0x04
 
#define MACE_PHYCC_RWAKE   0x02
 
#define MACE_PHYCC_AWAKE   0x01
 
#define MACE_IAC_ADDRCHG   0x80
 
#define MACE_IAC_PHYADDR   0x04
 
#define MACE_IAC_LOGADDR   0x02
 
#define MACE_UTR_RTRE   0x80
 
#define MACE_UTR_RTRD   0x40
 
#define MACE_UTR_RPA   0x20
 
#define MACE_UTR_FCOLL   0x10
 
#define MACE_UTR_RCVFCSE   0x08
 
#define MACE_UTR_LOOP_INCL_MENDEC   0x06
 
#define MACE_UTR_LOOP_NO_MENDEC   0x04
 
#define MACE_UTR_LOOP_EXTERNAL   0x02
 
#define MACE_UTR_LOOP_NONE   0x00
 
#define MACE_UTR_RESERVED   0x01
 
#define MACEBANK(win_num)   outb((win_num), ioaddr + AM2150_MACE_BANK)
 
#define MACE_IMR_DEFAULT
 
#define MACE_IMR_DEFAULT   0x00 /* New statistics handling: grab everything */
 
#define TX_TIMEOUT   ((400*HZ)/1000)
 
#define INT_MODULE_PARM(n, v)   static int n = v; module_param(n, int, 0)
 

Typedefs

typedef struct _mace_statistics mace_statistics
 
typedef struct _mace_private mace_private
 

Functions

 MODULE_DESCRIPTION ("New Media PCMCIA ethernet driver")
 
 MODULE_LICENSE ("GPL")
 
 INT_MODULE_PARM (if_port, 0)
 
 MODULE_DEVICE_TABLE (pcmcia, nmclan_ids)
 
 module_init (init_nmclan_cs)
 
 module_exit (exit_nmclan_cs)
 

Macro Definition Documentation

#define AM2150_MACE_BANK   0x0C

Definition at line 192 of file nmclan_cs.c.

#define AM2150_MACE_BASE   0x10

Definition at line 193 of file nmclan_cs.c.

#define AM2150_MAX_RX_FRAMES   12

Definition at line 184 of file nmclan_cs.c.

#define AM2150_MAX_TX_FRAMES   4

Definition at line 183 of file nmclan_cs.c.

#define AM2150_RCV   0x00

Definition at line 187 of file nmclan_cs.c.

#define AM2150_RCV_FRAME_COUNT   0x0B

Definition at line 191 of file nmclan_cs.c.

#define AM2150_RCV_NEXT   0x0A

Definition at line 190 of file nmclan_cs.c.

#define AM2150_XMT   0x04

Definition at line 188 of file nmclan_cs.c.

#define AM2150_XMT_SKIP   0x09

Definition at line 189 of file nmclan_cs.c.

#define DRV_NAME   "nmclan_cs"

Definition at line 116 of file nmclan_cs.c.

#define DRV_VERSION   "0.16"

Definition at line 117 of file nmclan_cs.c.

#define INT_MODULE_PARM (   n,
  v 
)    static int n = v; module_param(n, int, 0)

Definition at line 393 of file nmclan_cs.c.

#define MACE_BIUCC   11

Definition at line 207 of file nmclan_cs.c.

#define MACE_CHIPIDH   17

Definition at line 213 of file nmclan_cs.c.

#define MACE_CHIPIDL   16

Definition at line 212 of file nmclan_cs.c.

#define MACE_FIFOCC   12

Definition at line 208 of file nmclan_cs.c.

#define MACE_FIFOFC   7

Definition at line 203 of file nmclan_cs.c.

#define MACE_FIFOFC_RCVFC   0xF0

Definition at line 248 of file nmclan_cs.c.

#define MACE_FIFOFC_XMTFC   0x0F

Definition at line 249 of file nmclan_cs.c.

#define MACE_IAC   18

Definition at line 214 of file nmclan_cs.c.

#define MACE_IAC_ADDRCHG   0x80

Definition at line 278 of file nmclan_cs.c.

#define MACE_IAC_LOGADDR   0x02

Definition at line 280 of file nmclan_cs.c.

#define MACE_IAC_PHYADDR   0x04

Definition at line 279 of file nmclan_cs.c.

#define MACE_IMR   9

Definition at line 205 of file nmclan_cs.c.

#define MACE_IMR_DEFAULT
Value:
(0xFF - \
( \
MACE_IR_CERR | \
MACE_IR_RCVCCO | \
MACE_IR_RNTPCO | \
MACE_IR_MPCO | \
MACE_IR_RCVINT | \
MACE_IR_XMTINT \
) \
)

Definition at line 308 of file nmclan_cs.c.

#define MACE_IMR_DEFAULT   0x00 /* New statistics handling: grab everything */

Definition at line 308 of file nmclan_cs.c.

#define MACE_IR   8

Definition at line 204 of file nmclan_cs.c.

#define MACE_IR_BABL   0x40

Definition at line 252 of file nmclan_cs.c.

#define MACE_IR_CERR   0x20

Definition at line 253 of file nmclan_cs.c.

#define MACE_IR_JAB   0x80

Definition at line 251 of file nmclan_cs.c.

#define MACE_IR_MPCO   0x04

Definition at line 256 of file nmclan_cs.c.

#define MACE_IR_RCVCCO   0x10

Definition at line 254 of file nmclan_cs.c.

#define MACE_IR_RCVINT   0x02

Definition at line 257 of file nmclan_cs.c.

#define MACE_IR_RNTPCO   0x08

Definition at line 255 of file nmclan_cs.c.

#define MACE_IR_XMTINT   0x01

Definition at line 258 of file nmclan_cs.c.

#define MACE_LADRF   20

Definition at line 216 of file nmclan_cs.c.

#define MACE_LADRF_LEN   8

Definition at line 162 of file nmclan_cs.c.

#define MACE_MACCC   13

Definition at line 209 of file nmclan_cs.c.

#define MACE_MACCC_DRCVBC   0x04

Definition at line 265 of file nmclan_cs.c.

#define MACE_MACCC_DRCVPA   0x08

Definition at line 264 of file nmclan_cs.c.

#define MACE_MACCC_DXMT2PD   0x40

Definition at line 261 of file nmclan_cs.c.

#define MACE_MACCC_EMBA   0x20

Definition at line 262 of file nmclan_cs.c.

#define MACE_MACCC_ENRCV   0x01

Definition at line 267 of file nmclan_cs.c.

#define MACE_MACCC_ENXMT   0x02

Definition at line 266 of file nmclan_cs.c.

#define MACE_MACCC_PROM   0x80

Definition at line 260 of file nmclan_cs.c.

#define MACE_MACCC_RESERVED   0x10

Definition at line 263 of file nmclan_cs.c.

#define MACE_MAX_IR_ITERATIONS   10

Definition at line 166 of file nmclan_cs.c.

#define MACE_MAX_RX_ITERATIONS   12

Definition at line 167 of file nmclan_cs.c.

#define MACE_MPC   24

Definition at line 220 of file nmclan_cs.c.

#define MACE_PADR   21

Definition at line 217 of file nmclan_cs.c.

#define MACE_PHYCC   15

Definition at line 211 of file nmclan_cs.c.

#define MACE_PHYCC_ASEL   0x04

Definition at line 274 of file nmclan_cs.c.

#define MACE_PHYCC_AWAKE   0x01

Definition at line 276 of file nmclan_cs.c.

#define MACE_PHYCC_DAPC   0x10

Definition at line 272 of file nmclan_cs.c.

#define MACE_PHYCC_DLNKTST   0x40

Definition at line 270 of file nmclan_cs.c.

#define MACE_PHYCC_LNKFL   0x80

Definition at line 269 of file nmclan_cs.c.

#define MACE_PHYCC_LRT   0x08

Definition at line 273 of file nmclan_cs.c.

#define MACE_PHYCC_REVPOL   0x20

Definition at line 271 of file nmclan_cs.c.

#define MACE_PHYCC_RWAKE   0x02

Definition at line 275 of file nmclan_cs.c.

#define MACE_PLSCC   14

Definition at line 210 of file nmclan_cs.c.

#define MACE_PR   10

Definition at line 206 of file nmclan_cs.c.

#define MACE_RCVCC   27

Definition at line 223 of file nmclan_cs.c.

#define MACE_RCVFC   5

Definition at line 201 of file nmclan_cs.c.

#define MACE_RCVFIFO   0

Definition at line 196 of file nmclan_cs.c.

#define MACE_RCVFS   6

Definition at line 202 of file nmclan_cs.c.

#define MACE_RCVFS_CLSN   0x4000

Definition at line 244 of file nmclan_cs.c.

#define MACE_RCVFS_FCS   0x1000

Definition at line 246 of file nmclan_cs.c.

#define MACE_RCVFS_FRAM   0x2000

Definition at line 245 of file nmclan_cs.c.

#define MACE_RCVFS_OFLO   0x8000

Definition at line 243 of file nmclan_cs.c.

#define MACE_RCVFS_RCVSTS   0xF000

Definition at line 242 of file nmclan_cs.c.

#define MACE_RNTPC   26

Definition at line 222 of file nmclan_cs.c.

#define MACE_RTR1   30

Definition at line 226 of file nmclan_cs.c.

#define MACE_RTR2   31

Definition at line 227 of file nmclan_cs.c.

#define MACE_UTR   29

Definition at line 225 of file nmclan_cs.c.

#define MACE_UTR_FCOLL   0x10

Definition at line 285 of file nmclan_cs.c.

#define MACE_UTR_LOOP_EXTERNAL   0x02

Definition at line 289 of file nmclan_cs.c.

#define MACE_UTR_LOOP_INCL_MENDEC   0x06

Definition at line 287 of file nmclan_cs.c.

#define MACE_UTR_LOOP_NO_MENDEC   0x04

Definition at line 288 of file nmclan_cs.c.

#define MACE_UTR_LOOP_NONE   0x00

Definition at line 290 of file nmclan_cs.c.

#define MACE_UTR_RCVFCSE   0x08

Definition at line 286 of file nmclan_cs.c.

#define MACE_UTR_RESERVED   0x01

Definition at line 291 of file nmclan_cs.c.

#define MACE_UTR_RPA   0x20

Definition at line 284 of file nmclan_cs.c.

#define MACE_UTR_RTRD   0x40

Definition at line 283 of file nmclan_cs.c.

#define MACE_UTR_RTRE   0x80

Definition at line 282 of file nmclan_cs.c.

#define MACE_XMTFC   2

Definition at line 198 of file nmclan_cs.c.

#define MACE_XMTFIFO   1

Definition at line 197 of file nmclan_cs.c.

#define MACE_XMTFS   3

Definition at line 199 of file nmclan_cs.c.

#define MACE_XMTFS_DEFER   0x04

Definition at line 238 of file nmclan_cs.c.

#define MACE_XMTFS_LCAR   0x02

Definition at line 239 of file nmclan_cs.c.

#define MACE_XMTFS_LCOL   0x20

Definition at line 235 of file nmclan_cs.c.

#define MACE_XMTFS_MORE   0x10

Definition at line 236 of file nmclan_cs.c.

#define MACE_XMTFS_ONE   0x08

Definition at line 237 of file nmclan_cs.c.

#define MACE_XMTFS_RTRY   0x01

Definition at line 240 of file nmclan_cs.c.

#define MACE_XMTFS_UFLO   0x40

Definition at line 234 of file nmclan_cs.c.

#define MACE_XMTFS_XMTSV   0x80

Definition at line 233 of file nmclan_cs.c.

#define MACE_XMTRC   4

Definition at line 200 of file nmclan_cs.c.

#define MACE_XMTRC_EXDEF   0x80

Definition at line 230 of file nmclan_cs.c.

#define MACE_XMTRC_XMTRC   0x0F

Definition at line 231 of file nmclan_cs.c.

#define MACEBANK (   win_num)    outb((win_num), ioaddr + AM2150_MACE_BANK)

Definition at line 294 of file nmclan_cs.c.

#define MULTI_TX   0

Definition at line 124 of file nmclan_cs.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 114 of file nmclan_cs.c.

#define RESET_ON_TIMEOUT   1

Definition at line 125 of file nmclan_cs.c.

#define RESET_XILINX   0

Definition at line 127 of file nmclan_cs.c.

#define TX_INTERRUPTABLE   1

Definition at line 126 of file nmclan_cs.c.

#define TX_TIMEOUT   ((400*HZ)/1000)

Definition at line 310 of file nmclan_cs.c.

Typedef Documentation

Function Documentation

INT_MODULE_PARM ( if_port  ,
 
)
MODULE_DESCRIPTION ( "New Media PCMCIA ethernet driver )
MODULE_DEVICE_TABLE ( pcmcia  ,
nmclan_ids   
)
module_exit ( exit_nmclan_cs  )
module_init ( init_nmclan_cs  )
MODULE_LICENSE ( "GPL"  )