Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
3c574_cs.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.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/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/ioport.h>
#include <linux/bitops.h>
#include <linux/mii.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/ds.h>
#include <asm/uaccess.h>
#include <asm/io.h>

Go to the source code of this file.

Data Structures

struct  el3_private
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define INT_MODULE_PARM(n, v)   static int n = v; module_param(n, int, 0)
 
#define TX_TIMEOUT   ((800*HZ)/1000)
 
#define EL3_DATA   0x00
 
#define EL3_CMD   0x0e
 
#define EL3_STATUS   0x0e
 
#define EL3WINDOW(win_num)   outw(SelectWindow + (win_num), ioaddr + EL3_CMD)
 
#define MEDIA_TP   0x00C0 /* Enable link beat and jabber for 10baseT. */
 
#define MDIO_SHIFT_CLK   0x01
 
#define MDIO_DIR_WRITE   0x04
 
#define MDIO_DATA_WRITE0   (0x00 | MDIO_DIR_WRITE)
 
#define MDIO_DATA_WRITE1   (0x02 | MDIO_DIR_WRITE)
 
#define MDIO_DATA_READ   0x02
 
#define MDIO_ENB_IN   0x00
 

Enumerations

enum  el3_cmds {
  TotalReset = 0<<11, SelectWindow = 1<<11, StartCoax = 2<<11, RxDisable = 3<<11,
  RxEnable = 4<<11, RxReset = 5<<11, RxDiscard = 8<<11, TxEnable = 9<<11,
  TxDisable = 10<<11, TxReset = 11<<11, FakeIntr = 12<<11, AckIntr = 13<<11,
  SetIntrEnb = 14<<11, SetStatusEnb = 15<<11, SetRxFilter = 16<<11, SetRxThreshold = 17<<11,
  SetTxThreshold = 18<<11, SetTxStart = 19<<11, StatsEnable = 21<<11, StatsDisable = 22<<11,
  StopCoax = 23<<11
}
 
enum  elxl_status {
  IntLatch = 0x0001, AdapterFailure = 0x0002, TxComplete = 0x0004, TxAvailable = 0x0008,
  RxComplete = 0x0010, RxEarly = 0x0020, IntReq = 0x0040, StatsFull = 0x0080,
  CmdBusy = 0x1000
}
 
enum  RxFilter {
  RxStation = 1, RxMulticast = 2, RxBroadcast = 4, RxProm = 8,
  RxStation = 1, RxMulticast = 2, RxBroadcast = 4, RxProm = 8,
  RxStation = 1, RxMulticast = 2, RxBroadcast = 4, RxProm = 8,
  RxStation = 1, RxMulticast = 2, RxBroadcast = 4, RxProm = 8,
  RxStation = 1, RxMulticast = 2, RxBroadcast = 4, RxProm = 8
}
 
enum  Window0 {
  Wn0IRQ = 0x08, Wn0EepromCmd = 0x200A, Wn0EepromData = 0x200C, Wn0EepromCmd = 10,
  Wn0EepromData = 12, IntrStatus =0x0E, Wn0EepromCmd = 10, Wn0EepromData = 12,
  IntrStatus =0x0E
}
 
enum  Win0_EEPROM_cmds {
  EEPROM_Read = 0x200, EEPROM_WRITE = 0x100, EEPROM_ERASE = 0x300, EEPROM_EWENB = 0x30,
  EEPROM_EWDIS = 0x00
}
 
enum  Window1 {
  TX_FIFO = 0x10, RX_FIFO = 0x10, RxErrors = 0x14, RxStatus = 0x18,
  Timer = 0x1A, TxStatus = 0x1B, TxFree = 0x1C, TX_FIFO = 0x10,
  RX_FIFO = 0x10, RxErrors = 0x14, RxStatus = 0x18, Timer =0x1A,
  TxStatus = 0x1B, TxFree = 0x0C, RunnerRdCtrl = 0x16, RunnerWrCtrl = 0x1c,
  TX_FIFO = 0x10, RX_FIFO = 0x10, RxErrors = 0x14, RxStatus = 0x18,
  Timer =0x1A, TxStatus = 0x1B, TxFree = 0x1C
}
 
enum  Window3 {
  Wn3_Config = 0, Wn3_MAC_Ctrl = 6, Wn3_Options = 8, Wn3_Config =0,
  Wn3_MAC_Ctrl =6, Wn3_Options =8, Wn3_Config =0, Wn3_MaxPktSize =4,
  Wn3_MAC_Ctrl =6, Wn3_Options =8
}
 
enum  wn3_config {
  Ram_size = 7, Ram_width = 8, Ram_speed = 0x30, Rom_size = 0xc0,
  Ram_split_shift = 16, Ram_split = 3 << Ram_split_shift, Xcvr_shift = 20, Xcvr = 7 << Xcvr_shift,
  Autoselect = 0x1000000, Ram_size = 7, Ram_width = 8, Ram_speed = 0x30,
  Rom_size = 0xc0, Ram_split_shift = 16, Ram_split = 3 << Ram_split_shift, Xcvr_shift = 20,
  Xcvr = 7 << Xcvr_shift, Autoselect = 0x1000000
}
 
enum  Window4 {
  Wn4_NetDiag = 6, Wn4_Media = 10, Wn4_FIFODiag = 4, Wn4_NetDiag = 6,
  Wn4_PhysicalMgmt =8, Wn4_Media = 10, Wn4_FIFODiag = 4, Wn4_NetDiag = 6,
  Wn4_PhysicalMgmt =8, Wn4_Media = 10
}
 

Functions

 MODULE_AUTHOR ("David Hinds <[email protected]>")
 
 MODULE_DESCRIPTION ("3Com 3c574 series PCMCIA ethernet driver")
 
 MODULE_LICENSE ("GPL")
 
 INT_MODULE_PARM (max_interrupt_work, 32)
 
 INT_MODULE_PARM (full_duplex, 0)
 
 INT_MODULE_PARM (auto_polarity, 1)
 
 MODULE_DEVICE_TABLE (pcmcia, tc574_ids)
 
 module_init (init_tc574)
 
 module_exit (exit_tc574)
 

Macro Definition Documentation

#define EL3_CMD   0x0e

Definition at line 129 of file 3c574_cs.c.

#define EL3_DATA   0x00

Definition at line 128 of file 3c574_cs.c.

#define EL3_STATUS   0x0e

Definition at line 130 of file 3c574_cs.c.

#define EL3WINDOW (   win_num)    outw(SelectWindow + (win_num), ioaddr + EL3_CMD)

Definition at line 132 of file 3c574_cs.c.

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

Definition at line 107 of file 3c574_cs.c.

#define MDIO_DATA_READ   0x02

Definition at line 528 of file 3c574_cs.c.

#define MDIO_DATA_WRITE0   (0x00 | MDIO_DIR_WRITE)

Definition at line 526 of file 3c574_cs.c.

#define MDIO_DATA_WRITE1   (0x02 | MDIO_DIR_WRITE)

Definition at line 527 of file 3c574_cs.c.

#define MDIO_DIR_WRITE   0x04

Definition at line 525 of file 3c574_cs.c.

#define MDIO_ENB_IN   0x00

Definition at line 529 of file 3c574_cs.c.

#define MDIO_SHIFT_CLK   0x01

Definition at line 524 of file 3c574_cs.c.

#define MEDIA_TP   0x00C0 /* Enable link beat and jabber for 10baseT. */

Definition at line 196 of file 3c574_cs.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 72 of file 3c574_cs.c.

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

Definition at line 122 of file 3c574_cs.c.

Enumeration Type Documentation

enum el3_cmds
Enumerator:
TotalReset 
SelectWindow 
StartCoax 
RxDisable 
RxEnable 
RxReset 
RxDiscard 
TxEnable 
TxDisable 
TxReset 
FakeIntr 
AckIntr 
SetIntrEnb 
SetStatusEnb 
SetRxFilter 
SetRxThreshold 
SetTxThreshold 
SetTxStart 
StatsEnable 
StatsDisable 
StopCoax 

Definition at line 136 of file 3c574_cs.c.

Enumerator:
IntLatch 
AdapterFailure 
TxComplete 
TxAvailable 
RxComplete 
RxEarly 
IntReq 
StatsFull 
CmdBusy 

Definition at line 146 of file 3c574_cs.c.

enum RxFilter
Enumerator:
RxStation 
RxMulticast 
RxBroadcast 
RxProm 
RxStation 
RxMulticast 
RxBroadcast 
RxProm 
RxStation 
RxMulticast 
RxBroadcast 
RxProm 
RxStation 
RxMulticast 
RxBroadcast 
RxProm 
RxStation 
RxMulticast 
RxBroadcast 
RxProm 

Definition at line 152 of file 3c574_cs.c.

Enumerator:
EEPROM_Read 
EEPROM_WRITE 
EEPROM_ERASE 
EEPROM_EWENB 
EEPROM_EWDIS 

Definition at line 161 of file 3c574_cs.c.

enum Window0
Enumerator:
Wn0IRQ 
Wn0EepromCmd 
Wn0EepromData 
Wn0EepromCmd 
Wn0EepromData 
IntrStatus 
Wn0EepromCmd 
Wn0EepromData 
IntrStatus 

Definition at line 156 of file 3c574_cs.c.

enum Window1
Enumerator:
TX_FIFO 
RX_FIFO 
RxErrors 
RxStatus 
Timer 
TxStatus 
TxFree 
TX_FIFO 
RX_FIFO 
RxErrors 
RxStatus 
Timer 
TxStatus 
TxFree 
RunnerRdCtrl 
RunnerWrCtrl 
TX_FIFO 
RX_FIFO 
RxErrors 
RxStatus 
Timer 
TxStatus 
TxFree 

Definition at line 170 of file 3c574_cs.c.

enum Window3
Enumerator:
Wn3_Config 
Wn3_MAC_Ctrl 
Wn3_Options 
Wn3_Config 
Wn3_MAC_Ctrl 
Wn3_Options 
Wn3_Config 
Wn3_MaxPktSize 
Wn3_MAC_Ctrl 
Wn3_Options 

Definition at line 177 of file 3c574_cs.c.

enum Window4
Enumerator:
Wn4_NetDiag 
Wn4_Media 
Wn4_FIFODiag 
Wn4_NetDiag 
Wn4_PhysicalMgmt 
Wn4_Media 
Wn4_FIFODiag 
Wn4_NetDiag 
Wn4_PhysicalMgmt 
Wn4_Media 

Definition at line 192 of file 3c574_cs.c.

enum wn3_config
Enumerator:
Ram_size 
Ram_width 
Ram_speed 
Rom_size 
Ram_split_shift 
Ram_split 
Xcvr_shift 
Xcvr 
Autoselect 
Ram_size 
Ram_width 
Ram_speed 
Rom_size 
Ram_split_shift 
Ram_split 
Xcvr_shift 
Xcvr 
Autoselect 

Definition at line 180 of file 3c574_cs.c.

Function Documentation

INT_MODULE_PARM ( max_interrupt_work  ,
32   
)
INT_MODULE_PARM ( full_duplex  ,
 
)
INT_MODULE_PARM ( auto_polarity  ,
 
)
MODULE_AUTHOR ( "David Hinds <[email protected]>"  )
MODULE_DESCRIPTION ( "3Com 3c574 series PCMCIA ethernet driver"  )
MODULE_DEVICE_TABLE ( pcmcia  ,
tc574_ids   
)
module_exit ( exit_tc574  )
module_init ( init_tc574  )
MODULE_LICENSE ( "GPL"  )