Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
3c515.c File Reference
#include <linux/module.h>
#include <linux/isapnp.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/in.h>
#include <linux/ioport.h>
#include <linux/skbuff.h>
#include <linux/etherdevice.h>
#include <linux/interrupt.h>
#include <linux/timer.h>
#include <linux/ethtool.h>
#include <linux/bitops.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/delay.h>

Go to the source code of this file.

Data Structures

struct  boom_rx_desc
 
struct  boom_tx_desc
 
struct  corkscrew_private
 
struct  media_table
 

Macros

#define DRV_NAME   "3c515"
 
#define DRV_VERSION   "0.99t-ac"
 
#define DRV_RELDATE   "28-Oct-2002"
 
#define CORKSCREW   1
 
#define AUTOMEDIA   1
 
#define VORTEX_BUS_MASTER
 
#define TX_RING_SIZE   16
 
#define RX_RING_SIZE   16
 
#define PKT_BUF_SZ   1536 /* Size of each temporary Rx buffer. */
 
#define NEW_MULTICAST
 
#define MAX_UNITS   8
 
#define DRIVER_DEBUG   1
 
#define WAIT_TX_AVAIL   200
 
#define TX_TIMEOUT   ((4*HZ)/10) /* Time in jiffies before concluding Tx hung */
 
#define CORKSCREW_TOTAL_SIZE   0x20
 
#define CORKSCREW_ID   10
 
#define EL3WINDOW(win_num)   outw(SelectWindow + (win_num), ioaddr + EL3_CMD)
 
#define EL3_CMD   0x0e
 
#define EL3_STATUS   0x0e
 

Enumerations

enum  corkscrew_cmd {
  TotalReset = 0 << 11, SelectWindow = 1 << 11, StartCoax = 2 << 11, RxDisable = 3 << 11,
  RxEnable = 4 << 11, RxReset = 5 << 11, UpStall = 6 << 11, UpUnstall = (6 << 11) + 1,
  DownStall = (6 << 11) + 2, DownUnstall = (6 << 11) + 3, 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, StartDMAUp = 20 << 11, StartDMADown = (20 << 11) + 1,
  StatsEnable = 21 << 11, StatsDisable = 22 << 11, StopCoax = 23 << 11
}
 
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  corkscrew_status {
  IntLatch = 0x0001, AdapterFailure = 0x0002, TxComplete = 0x0004, TxAvailable = 0x0008,
  RxComplete = 0x0010, RxEarly = 0x0020, IntReq = 0x0040, StatsFull = 0x0080,
  DMADone = 1 << 8, DownComplete = 1 << 9, UpComplete = 1 << 10, DMAInProgress = 1 << 11,
  CmdInProgress = 1 << 12
}
 
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  Window0 {
  Wn0IRQ = 0x08, Wn0EepromCmd = 0x200A, Wn0EepromData = 0x200C, Wn0EepromCmd = 10,
  Wn0EepromData = 12, IntrStatus =0x0E, Wn0EepromCmd = 10, Wn0EepromData = 12,
  IntrStatus =0x0E
}
 
enum  Win0_EEPROM_bits {
  EEPROM_Read = 0x80, EEPROM_WRITE = 0x40, EEPROM_ERASE = 0xC0, EEPROM_EWENB = 0x30,
  EEPROM_EWDIS = 0x00, EEPROM_Read = 0x80, EEPROM_WRITE = 0x40, EEPROM_ERASE = 0xC0,
  EEPROM_EWENB = 0x30, EEPROM_EWDIS = 0x00
}
 
enum  eeprom_offset {
  PhysAddr01 = 0, PhysAddr23 = 1, PhysAddr45 = 2, ModelID = 3,
  EtherLink3ID = 7, PhysAddr01 =0, PhysAddr23 =1, PhysAddr45 =2,
  ModelID =3, EtherLink3ID =7, IFXcvrIO =8, IRQLine =9,
  NodeAddr01 =10, NodeAddr23 =11, NodeAddr45 =12, DriverTune =13,
  Checksum =15
}
 
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
}
 
enum  Win4_Media_bits {
  Media_SQE = 0x0008, Media_10TP = 0x00C0, Media_Lnk = 0x0080, Media_LnkBeat = 0x0800,
  Media_SQE = 0x0008, Media_10TP = 0x00C0, Media_Lnk = 0x0080, Media_LnkBeat = 0x0800
}
 
enum  Window7 {
  Wn7_MasterAddr = 0, Wn7_MasterLen = 6, Wn7_MasterStatus = 12, Wn7_MasterAddr = 0,
  Wn7_VlanEtherType =4, Wn7_MasterLen = 6, Wn7_MasterStatus = 12
}
 
enum  MasterCtrl {
  PktStatus = 0x400, DownListPtr = 0x404, FragAddr = 0x408, FragLen,
  TxFreeThreshold = 0x40f, UpPktStatus = 0x410, UpListPtr = 0x418, PktStatus = 0x20,
  DownListPtr = 0x24, FragAddr = 0x28, FragLen = 0x2c, TxFreeThreshold = 0x2f,
  UpPktStatus = 0x30, UpListPtr = 0x38
}
 
enum  rx_desc_status {
  RxDComplete = 0x00008000, RxDError = 0x4000, RxDComplete =0x00008000, RxDError =0x4000,
  IPChksumErr =1<<25, TCPChksumErr =1<<26, UDPChksumErr =1<<27, IPChksumValid =1<<29,
  TCPChksumValid =1<<30, UDPChksumValid =1<<31
}
 
enum  xcvr_types {
  XCVR_10baseT = 0, XCVR_AUI, XCVR_10baseTOnly, XCVR_10base2,
  XCVR_100baseTx, XCVR_100baseFx, XCVR_MII = 6, XCVR_Default = 8,
  XCVR_10baseT =0, XCVR_AUI, XCVR_10baseTOnly, XCVR_10base2,
  XCVR_100baseTx, XCVR_100baseFx, XCVR_MII =6, XCVR_NWAY =8,
  XCVR_ExtMII =9, XCVR_Default =10
}
 

Functions

 MODULE_AUTHOR ("Donald Becker <[email protected]>")
 
 MODULE_DESCRIPTION ("3Com 3c515 Corkscrew driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_VERSION)
 
struct net_devicetc515_probe (int unit)
 

Macro Definition Documentation

#define AUTOMEDIA   1

Definition at line 46 of file 3c515.c.

#define CORKSCREW   1

Definition at line 32 of file 3c515.c.

#define CORKSCREW_ID   10

Definition at line 114 of file 3c515.c.

#define CORKSCREW_TOTAL_SIZE   0x20

Definition at line 106 of file 3c515.c.

#define DRIVER_DEBUG   1

Definition at line 91 of file 3c515.c.

#define DRV_NAME   "3c515"

Definition at line 25 of file 3c515.c.

#define DRV_RELDATE   "28-Oct-2002"

Definition at line 27 of file 3c515.c.

#define DRV_VERSION   "0.99t-ac"

Definition at line 26 of file 3c515.c.

#define EL3_CMD   0x0e

Definition at line 176 of file 3c515.c.

#define EL3_STATUS   0x0e

Definition at line 177 of file 3c515.c.

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

Definition at line 175 of file 3c515.c.

#define MAX_UNITS   8

Definition at line 82 of file 3c515.c.

#define NEW_MULTICAST

Definition at line 79 of file 3c515.c.

#define PKT_BUF_SZ   1536 /* Size of each temporary Rx buffer. */

Definition at line 58 of file 3c515.c.

#define RX_RING_SIZE   16

Definition at line 57 of file 3c515.c.

#define TX_RING_SIZE   16

Definition at line 56 of file 3c515.c.

#define TX_TIMEOUT   ((4*HZ)/10) /* Time in jiffies before concluding Tx hung */

Definition at line 101 of file 3c515.c.

#define VORTEX_BUS_MASTER

Definition at line 52 of file 3c515.c.

#define WAIT_TX_AVAIL   200

Definition at line 98 of file 3c515.c.

Enumeration Type Documentation

Enumerator:
TotalReset 
SelectWindow 
StartCoax 
RxDisable 
RxEnable 
RxReset 
UpStall 
UpUnstall 
DownStall 
DownUnstall 
RxDiscard 
TxEnable 
TxDisable 
TxReset 
FakeIntr 
AckIntr 
SetIntrEnb 
SetStatusEnb 
SetRxFilter 
SetRxThreshold 
SetTxThreshold 
SetTxStart 
StartDMAUp 
StartDMADown 
StatsEnable 
StatsDisable 
StopCoax 

Definition at line 185 of file 3c515.c.

Enumerator:
IntLatch 
AdapterFailure 
TxComplete 
TxAvailable 
RxComplete 
RxEarly 
IntReq 
StatsFull 
DMADone 
DownComplete 
UpComplete 
DMAInProgress 
CmdInProgress 

Definition at line 204 of file 3c515.c.

Enumerator:
PhysAddr01 
PhysAddr23 
PhysAddr45 
ModelID 
EtherLink3ID 
PhysAddr01 
PhysAddr23 
PhysAddr45 
ModelID 
EtherLink3ID 
IFXcvrIO 
IRQLine 
NodeAddr01 
NodeAddr23 
NodeAddr45 
DriverTune 
Checksum 

Definition at line 237 of file 3c515.c.

enum MasterCtrl
Enumerator:
PktStatus 
DownListPtr 
FragAddr 
FragLen 
TxFreeThreshold 
UpPktStatus 
UpListPtr 
PktStatus 
DownListPtr 
FragAddr 
FragLen 
TxFreeThreshold 
UpPktStatus 
UpListPtr 

Definition at line 271 of file 3c515.c.

Enumerator:
RxDComplete 
RxDError 
RxDComplete 
RxDError 
IPChksumErr 
TCPChksumErr 
UDPChksumErr 
IPChksumValid 
TCPChksumValid 
UDPChksumValid 

Definition at line 288 of file 3c515.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 199 of file 3c515.c.

Enumerator:
EEPROM_Read 
EEPROM_WRITE 
EEPROM_ERASE 
EEPROM_EWENB 
EEPROM_EWDIS 
EEPROM_Read 
EEPROM_WRITE 
EEPROM_ERASE 
EEPROM_EWENB 
EEPROM_EWDIS 

Definition at line 230 of file 3c515.c.

Enumerator:
Media_SQE 
Media_10TP 
Media_Lnk 
Media_LnkBeat 
Media_SQE 
Media_10TP 
Media_Lnk 
Media_LnkBeat 

Definition at line 260 of file 3c515.c.

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

Definition at line 220 of file 3c515.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 215 of file 3c515.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 242 of file 3c515.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 257 of file 3c515.c.

enum Window7
Enumerator:
Wn7_MasterAddr 
Wn7_MasterLen 
Wn7_MasterStatus 
Wn7_MasterAddr 
Wn7_VlanEtherType 
Wn7_MasterLen 
Wn7_MasterStatus 

Definition at line 266 of file 3c515.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 245 of file 3c515.c.

enum xcvr_types
Enumerator:
XCVR_10baseT 
XCVR_AUI 
XCVR_10baseTOnly 
XCVR_10base2 
XCVR_100baseTx 
XCVR_100baseFx 
XCVR_MII 
XCVR_Default 
XCVR_10baseT 
XCVR_AUI 
XCVR_10baseTOnly 
XCVR_10base2 
XCVR_100baseTx 
XCVR_100baseFx 
XCVR_MII 
XCVR_NWAY 
XCVR_ExtMII 
XCVR_Default 

Definition at line 330 of file 3c515.c.

Function Documentation

MODULE_AUTHOR ( "Donald Becker <[email protected]>"  )
MODULE_DESCRIPTION ( "3Com 3c515 Corkscrew driver"  )
MODULE_LICENSE ( "GPL"  )
MODULE_VERSION ( DRV_VERSION  )
struct net_device* tc515_probe ( int  unit)
read

Definition at line 429 of file 3c515.c.