Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
de2104x.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/ethtool.h>
#include <linux/compiler.h>
#include <linux/rtnetlink.h>
#include <linux/crc32.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
#include <asm/unaligned.h>

Go to the source code of this file.

Data Structures

struct  de_srom_media_block
 
struct  de_srom_info_leaf
 
struct  de_desc
 
struct  media_info
 
struct  ring_info
 
struct  de_private
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRV_NAME   "de2104x"
 
#define DRV_VERSION   "0.7"
 
#define DRV_RELDATE   "Mar 17, 2004"
 
#define DE_DEF_MSG_ENABLE
 
#define DSL   0
 
#define DE_RX_RING_SIZE   64
 
#define DE_TX_RING_SIZE   64
 
#define DE_RING_BYTES
 
#define NEXT_TX(N)   (((N) + 1) & (DE_TX_RING_SIZE - 1))
 
#define NEXT_RX(N)   (((N) + 1) & (DE_RX_RING_SIZE - 1))
 
#define TX_BUFFS_AVAIL(CP)
 
#define PKT_BUF_SZ   1536 /* Size of each temporary Rx buffer.*/
 
#define RX_OFFSET   2
 
#define DE_SETUP_SKB   ((struct sk_buff *) 1)
 
#define DE_DUMMY_SKB   ((struct sk_buff *) 2)
 
#define DE_SETUP_FRAME_WORDS   96
 
#define DE_EEPROM_WORDS   256
 
#define DE_EEPROM_SIZE   (DE_EEPROM_WORDS * sizeof(u16))
 
#define DE_MAX_MEDIA   5
 
#define DE_MEDIA_TP_AUTO   0
 
#define DE_MEDIA_BNC   1
 
#define DE_MEDIA_AUI   2
 
#define DE_MEDIA_TP   3
 
#define DE_MEDIA_TP_FD   4
 
#define DE_MEDIA_INVALID   DE_MAX_MEDIA
 
#define DE_MEDIA_FIRST   0
 
#define DE_MEDIA_LAST   (DE_MAX_MEDIA - 1)
 
#define DE_AUI_BNC   (SUPPORTED_AUI | SUPPORTED_BNC)
 
#define DE_TIMER_LINK   (60 * HZ)
 
#define DE_TIMER_NO_LINK   (5 * HZ)
 
#define DE_NUM_REGS   16
 
#define DE_REGS_SIZE   (DE_NUM_REGS * sizeof(u32))
 
#define DE_REGS_VER   1
 
#define TX_TIMEOUT   (6*HZ)
 
#define FULL_DUPLEX_MAGIC   0x6969
 
#define dr32(reg)   ioread32(de->regs + (reg))
 
#define dw32(reg, val)   iowrite32((val), de->regs + (reg))
 

Enumerations

enum  {
  BusMode = 0x00, TxPoll = 0x08, RxPoll = 0x10, RxRingAddr = 0x18,
  TxRingAddr = 0x20, MacStatus = 0x28, MacMode = 0x30, IntrMask = 0x38,
  RxMissed = 0x40, ROMCmd = 0x48, CSR11 = 0x58, SIAStatus = 0x60,
  CSR13 = 0x68, CSR14 = 0x70, CSR15 = 0x78, PCIPM = 0x40,
  CmdReset = (1 << 0), CacheAlign16 = 0x00008000, BurstLen4 = 0x00000400, DescSkipLen = (DSL << 2),
  NormalTxPoll = (1 << 0), NormalRxPoll = (1 << 0), DescOwn = (1 << 31), RxError = (1 << 15),
  RxErrLong = (1 << 7), RxErrCRC = (1 << 1), RxErrFIFO = (1 << 0), RxErrRunt = (1 << 11),
  RxErrFrame = (1 << 14), RingEnd = (1 << 25), FirstFrag = (1 << 29), LastFrag = (1 << 30),
  TxError = (1 << 15), TxFIFOUnder = (1 << 1), TxLinkFail = (1 << 2) | (1 << 10) | (1 << 11), TxMaxCol = (1 << 8),
  TxOWC = (1 << 9), TxJabber = (1 << 14), SetupFrame = (1 << 27), TxSwInt = (1 << 31),
  IntrOK = (1 << 16), IntrErr = (1 << 15), RxIntr = (1 << 6), RxEmpty = (1 << 7),
  TxIntr = (1 << 0), TxEmpty = (1 << 2), PciErr = (1 << 13), TxState = (1 << 22) | (1 << 21) | (1 << 20),
  RxState = (1 << 19) | (1 << 18) | (1 << 17), LinkFail = (1 << 12), LinkPass = (1 << 4), RxStopped = (1 << 8),
  TxStopped = (1 << 1), TxEnable = (1 << 13), RxEnable = (1 << 1), RxTx = TxEnable | RxEnable,
  FullDuplex = (1 << 9), AcceptAllMulticast = (1 << 7), AcceptAllPhys = (1 << 6), BOCnt = (1 << 5),
  MacModeClear, EE_SHIFT_CLK = 0x02, EE_CS = 0x01, EE_DATA_WRITE = 0x04,
  EE_WRITE_0 = 0x01, EE_WRITE_1 = 0x05, EE_DATA_READ = 0x08, EE_ENB = (0x4800 | EE_CS),
  EE_READ_CMD = 6, RxMissedOver = (1 << 16), RxMissedMask = 0xffff, SROMC0InfoLeaf = 27,
  MediaBlockMask = 0x3f, MediaCustomCSRs = (1 << 6), PM_Sleep = (1 << 31), PM_Snooze = (1 << 30),
  PM_Mask = PM_Sleep | PM_Snooze, NWayState = (1 << 14) | (1 << 13) | (1 << 12), NWayRestart = (1 << 12), NonselPortActive = (1 << 9),
  SelPortActive = (1 << 8), LinkFailStatus = (1 << 2), NetCxnErr = (1 << 1)
}
 

Functions

 MODULE_AUTHOR ("Jeff Garzik <[email protected]>")
 
 MODULE_DESCRIPTION ("Intel/Digital 21040/1 series PCI Ethernet driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_VERSION)
 
 module_param (debug, int, 0)
 
 MODULE_PARM_DESC (debug,"de2104x bitmapped message enable number")
 
 module_param (rx_copybreak, int, 0)
 
 MODULE_PARM_DESC (rx_copybreak,"de2104x Breakpoint at which Rx packets are copied")
 
 MODULE_DEVICE_TABLE (pci, de_pci_tbl)
 
 module_init (de_init)
 
 module_exit (de_exit)
 

Variables

struct de_srom_media_block __packed
 

Macro Definition Documentation

#define DE_AUI_BNC   (SUPPORTED_AUI | SUPPORTED_BNC)

Definition at line 124 of file de2104x.c.

#define DE_DEF_MSG_ENABLE
Value:
NETIF_MSG_PROBE | \
NETIF_MSG_LINK | \
NETIF_MSG_IFDOWN | \
NETIF_MSG_IFUP | \
NETIF_MSG_RX_ERR | \
NETIF_MSG_TX_ERR)

Definition at line 79 of file de2104x.c.

#define DE_DUMMY_SKB   ((struct sk_buff *) 2)

Definition at line 110 of file de2104x.c.

#define DE_EEPROM_SIZE   (DE_EEPROM_WORDS * sizeof(u16))

Definition at line 113 of file de2104x.c.

#define DE_EEPROM_WORDS   256

Definition at line 112 of file de2104x.c.

#define DE_MAX_MEDIA   5

Definition at line 114 of file de2104x.c.

#define DE_MEDIA_AUI   2

Definition at line 118 of file de2104x.c.

#define DE_MEDIA_BNC   1

Definition at line 117 of file de2104x.c.

#define DE_MEDIA_FIRST   0

Definition at line 122 of file de2104x.c.

#define DE_MEDIA_INVALID   DE_MAX_MEDIA

Definition at line 121 of file de2104x.c.

#define DE_MEDIA_LAST   (DE_MAX_MEDIA - 1)

Definition at line 123 of file de2104x.c.

#define DE_MEDIA_TP   3

Definition at line 119 of file de2104x.c.

#define DE_MEDIA_TP_AUTO   0

Definition at line 116 of file de2104x.c.

#define DE_MEDIA_TP_FD   4

Definition at line 120 of file de2104x.c.

#define DE_NUM_REGS   16

Definition at line 129 of file de2104x.c.

#define DE_REGS_SIZE   (DE_NUM_REGS * sizeof(u32))

Definition at line 130 of file de2104x.c.

#define DE_REGS_VER   1

Definition at line 131 of file de2104x.c.

#define DE_RING_BYTES
Value:
((sizeof(struct de_desc) * DE_RX_RING_SIZE) + \
(sizeof(struct de_desc) * DE_TX_RING_SIZE))

Definition at line 96 of file de2104x.c.

#define DE_RX_RING_SIZE   64

Definition at line 94 of file de2104x.c.

#define DE_SETUP_FRAME_WORDS   96

Definition at line 111 of file de2104x.c.

#define DE_SETUP_SKB   ((struct sk_buff *) 1)

Definition at line 109 of file de2104x.c.

#define DE_TIMER_LINK   (60 * HZ)

Definition at line 126 of file de2104x.c.

#define DE_TIMER_NO_LINK   (5 * HZ)

Definition at line 127 of file de2104x.c.

#define DE_TX_RING_SIZE   64

Definition at line 95 of file de2104x.c.

#define dr32 (   reg)    ioread32(de->regs + (reg))

Definition at line 374 of file de2104x.c.

#define DRV_NAME   "de2104x"

Definition at line 32 of file de2104x.c.

#define DRV_RELDATE   "Mar 17, 2004"

Definition at line 34 of file de2104x.c.

#define DRV_VERSION   "0.7"

Definition at line 33 of file de2104x.c.

#define DSL   0

Definition at line 89 of file de2104x.c.

#define dw32 (   reg,
  val 
)    iowrite32((val), de->regs + (reg))

Definition at line 375 of file de2104x.c.

#define FULL_DUPLEX_MAGIC   0x6969

Definition at line 140 of file de2104x.c.

#define NEXT_RX (   N)    (((N) + 1) & (DE_RX_RING_SIZE - 1))

Definition at line 100 of file de2104x.c.

#define NEXT_TX (   N)    (((N) + 1) & (DE_TX_RING_SIZE - 1))

Definition at line 99 of file de2104x.c.

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

Definition at line 106 of file de2104x.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 30 of file de2104x.c.

#define RX_OFFSET   2

Definition at line 107 of file de2104x.c.

#define TX_BUFFS_AVAIL (   CP)
Value:
(((CP)->tx_tail <= (CP)->tx_head) ? \
(CP)->tx_tail + (DE_TX_RING_SIZE - 1) - (CP)->tx_head : \
(CP)->tx_tail - (CP)->tx_head - 1)

Definition at line 101 of file de2104x.c.

#define TX_TIMEOUT   (6*HZ)

Definition at line 134 of file de2104x.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
BusMode 
TxPoll 
RxPoll 
RxRingAddr 
TxRingAddr 
MacStatus 
MacMode 
IntrMask 
RxMissed 
ROMCmd 
CSR11 
SIAStatus 
CSR13 
CSR14 
CSR15 
PCIPM 
CmdReset 
CacheAlign16 
BurstLen4 
DescSkipLen 
NormalTxPoll 
NormalRxPoll 
DescOwn 
RxError 
RxErrLong 
RxErrCRC 
RxErrFIFO 
RxErrRunt 
RxErrFrame 
RingEnd 
FirstFrag 
LastFrag 
TxError 
TxFIFOUnder 
TxLinkFail 
TxMaxCol 
TxOWC 
TxJabber 
SetupFrame 
TxSwInt 
IntrOK 
IntrErr 
RxIntr 
RxEmpty 
TxIntr 
TxEmpty 
PciErr 
TxState 
RxState 
LinkFail 
LinkPass 
RxStopped 
TxStopped 
TxEnable 
RxEnable 
RxTx 
FullDuplex 
AcceptAllMulticast 
AcceptAllPhys 
BOCnt 
MacModeClear 
EE_SHIFT_CLK 
EE_CS 
EE_DATA_WRITE 
EE_WRITE_0 
EE_WRITE_1 
EE_DATA_READ 
EE_ENB 
EE_READ_CMD 
RxMissedOver 
RxMissedMask 
SROMC0InfoLeaf 
MediaBlockMask 
MediaCustomCSRs 
PM_Sleep 
PM_Snooze 
PM_Mask 
NWayState 
NWayRestart 
NonselPortActive 
SelPortActive 
LinkFailStatus 
NetCxnErr 

Definition at line 142 of file de2104x.c.

Function Documentation

MODULE_AUTHOR ( "Jeff Garzik <[email protected]>"  )
MODULE_DESCRIPTION ( "Intel/Digital 21040/1 series PCI Ethernet driver )
MODULE_DEVICE_TABLE ( pci  ,
de_pci_tbl   
)
module_exit ( de_exit  )
module_init ( de_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
 
)
module_param ( rx_copybreak  ,
int  ,
 
)
MODULE_PARM_DESC ( debug  ,
"de2104x bitmapped message enable number  
)
MODULE_PARM_DESC ( rx_copybreak  ,
"de2104x Breakpoint at which Rx packets are copied"   
)
MODULE_VERSION ( DRV_VERSION  )

Variable Documentation