Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
sis190.c File Reference
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/netdevice.h>
#include <linux/rtnetlink.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/pci.h>
#include <linux/mii.h>
#include <linux/delay.h>
#include <linux/crc32.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <asm/irq.h>

Go to the source code of this file.

Data Structures

struct  TxDesc
 
struct  RxDesc
 
struct  sis190_private
 
struct  sis190_phy
 
struct  mii_chip_info
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define PHY_MAX_ADDR   32
 
#define PHY_ID_ANY   0x1f
 
#define MII_REG_ANY   0x1f
 
#define DRV_VERSION   "1.4"
 
#define DRV_NAME   "sis190"
 
#define SIS190_DRIVER_NAME   DRV_NAME " Gigabit Ethernet driver " DRV_VERSION
 
#define sis190_rx_skb   netif_rx
 
#define sis190_rx_quota(count, quota)   count
 
#define NUM_TX_DESC   64 /* [8..1024] */
 
#define NUM_RX_DESC   64 /* [8..8192] */
 
#define TX_RING_BYTES   (NUM_TX_DESC * sizeof(struct TxDesc))
 
#define RX_RING_BYTES   (NUM_RX_DESC * sizeof(struct RxDesc))
 
#define RX_BUF_SIZE   1536
 
#define RX_BUF_MASK   0xfff8
 
#define SIS190_REGS_SIZE   0x80
 
#define SIS190_TX_TIMEOUT   (6*HZ)
 
#define SIS190_PHY_TIMEOUT   (10*HZ)
 
#define SIS190_MSG_DEFAULT
 
#define EhnMIIread   0x0000
 
#define EhnMIIwrite   0x0020
 
#define EhnMIIdataShift   16
 
#define EhnMIIpmdShift   6 /* 7016 only */
 
#define EhnMIIregShift   11
 
#define EhnMIIreq   0x0010
 
#define EhnMIInotDone   0x0010
 
#define SIS_W8(reg, val)   writeb ((val), ioaddr + (reg))
 
#define SIS_W16(reg, val)   writew ((val), ioaddr + (reg))
 
#define SIS_W32(reg, val)   writel ((val), ioaddr + (reg))
 
#define SIS_R8(reg)   readb (ioaddr + (reg))
 
#define SIS_R16(reg)   readw (ioaddr + (reg))
 
#define SIS_R32(reg)   readl (ioaddr + (reg))
 
#define SIS_PCI_COMMIT()   SIS_R32(IntrControl)
 
#define ErrMask   (OVRUN | SHORT | LIMIT | MIIER | NIBON | COLON | ABORT)
 
#define TxErrMask   (WND | TABRT | FIFO | LINK)
 

Enumerations

enum  sis190_registers {
  TxControl = 0x00, TxDescStartAddr = 0x04, rsv0 = 0x08, TxSts = 0x0c,
  RxControl = 0x10, RxDescStartAddr = 0x14, rsv1 = 0x18, RxSts = 0x1c,
  IntrStatus = 0x20, IntrMask = 0x24, IntrControl = 0x28, IntrTimer = 0x2c,
  PMControl = 0x30, rsv2 = 0x34, ROMControl = 0x38, ROMInterface = 0x3c,
  StationControl = 0x40, GMIIControl = 0x44, GIoCR = 0x48, GIoCtrl = 0x4c,
  TxMacControl = 0x50, TxLimit = 0x54, RGDelay = 0x58, rsv3 = 0x5c,
  RxMacControl = 0x60, RxMacAddr = 0x62, RxHashTable = 0x68, RxWolCtrl = 0x70,
  RxWolData = 0x74, RxMPSControl = 0x78, rsv4 = 0x7c
}
 
enum  sis190_register_content {
  SoftInt = 0x40000000, Timeup = 0x20000000, PauseFrame = 0x00080000, MagicPacket = 0x00040000,
  WakeupFrame = 0x00020000, LinkChange = 0x00010000, RxQEmpty = 0x00000080, RxQInt = 0x00000040,
  TxQ1Empty = 0x00000020, TxQ1Int = 0x00000010, TxQ0Empty = 0x00000008, TxQ0Int = 0x00000004,
  RxHalt = 0x00000002, TxHalt = 0x00000001, CmdReset = 0x10, CmdRxEnb = 0x08,
  CmdTxEnb = 0x01, RxBufEmpty = 0x01, Cfg9346_Lock = 0x00, Cfg9346_Unlock = 0xc0,
  AcceptErr = 0x20, AcceptRunt = 0x10, AcceptBroadcast = 0x0800, AcceptMulticast = 0x0400,
  AcceptMyPhys = 0x0200, AcceptAllPhys = 0x0100, RxCfgFIFOShift = 13, RxCfgDMAShift = 8,
  TxInterFrameGapShift = 24, TxDMAShift = 8, LinkStatus = 0x02, FullDup = 0x01,
  TBILinkOK = 0x02000000
}
 
enum  _DescStatusBit {
  OWNbit = 0x80000000, INTbit = 0x40000000, CRCbit = 0x00020000, PADbit = 0x00010000,
  RingEnd = 0x80000000, LSEN = 0x08000000, IPCS = 0x04000000, TCPCS = 0x02000000,
  UDPCS = 0x01000000, BSTEN = 0x00800000, EXTEN = 0x00400000, DEFEN = 0x00200000,
  BKFEN = 0x00100000, CRSEN = 0x00080000, COLEN = 0x00040000, THOL3 = 0x30000000,
  THOL2 = 0x20000000, THOL1 = 0x10000000, THOL0 = 0x00000000, WND = 0x00080000,
  TABRT = 0x00040000, FIFO = 0x00020000, LINK = 0x00010000, ColCountMask = 0x0000ffff,
  IPON = 0x20000000, TCPON = 0x10000000, UDPON = 0x08000000, Wakup = 0x00400000,
  Magic = 0x00200000, Pause = 0x00100000, DEFbit = 0x00200000, BCAST = 0x000c0000,
  MCAST = 0x00080000, UCAST = 0x00040000, TAGON = 0x80000000, RxDescCountMask = 0x7f000000,
  ABORT = 0x00800000, SHORT = 0x00400000, LIMIT = 0x00200000, MIIER = 0x00100000,
  OVRUN = 0x00080000, NIBON = 0x00040000, COLON = 0x00020000, CRCOK = 0x00010000,
  RxSizeMask = 0x0000ffff
}
 
enum  sis190_eeprom_access_register_bits {
  EECS = 0x00000001, EECLK = 0x00000002, EEDO = 0x00000008, EEDI = 0x00000004,
  EEREQ = 0x00000080, EEROP = 0x00000200, EEWOP = 0x00000100
}
 
enum  sis190_eeprom_address { EEPROMSignature = 0x00, EEPROMCLK = 0x01, EEPROMInfo = 0x02, EEPROMMACAddr = 0x03 }
 
enum  sis190_feature { F_HAS_RGMII = 1, F_PHY_88E1111 = 2, F_PHY_BCM5461 = 4 }
 
enum  sis190_phy_type { UNKNOWN = 0x00, HOME = 0x01, LAN = 0x02, MIX = 0x03 }
 

Functions

 MODULE_DEVICE_TABLE (pci, sis190_pci_tbl)
 
 MODULE_DESCRIPTION ("SiS sis190/191 Gigabit Ethernet driver")
 
 module_param (rx_copybreak, int, 0)
 
 MODULE_PARM_DESC (rx_copybreak,"Copy breakpoint for copy-only-tiny-frames")
 
 module_param_named (debug, debug.msg_enable, int, 0)
 
 MODULE_PARM_DESC (debug,"Debug verbosity level (0=none, ..., 16=all)")
 
 MODULE_AUTHOR ("K.M. Liu <[email protected]>, Ueimor <[email protected]>")
 
 MODULE_VERSION (DRV_VERSION)
 
 MODULE_LICENSE ("GPL")
 
 module_init (sis190_init_module)
 
 module_exit (sis190_cleanup_module)
 

Macro Definition Documentation

#define DRV_NAME   "sis190"

Definition at line 44 of file sis190.c.

#define DRV_VERSION   "1.4"

Definition at line 43 of file sis190.c.

#define EhnMIIdataShift   16

Definition at line 67 of file sis190.c.

#define EhnMIInotDone   0x0010

Definition at line 71 of file sis190.c.

#define EhnMIIpmdShift   6 /* 7016 only */

Definition at line 68 of file sis190.c.

#define EhnMIIread   0x0000

Definition at line 65 of file sis190.c.

#define EhnMIIregShift   11

Definition at line 69 of file sis190.c.

#define EhnMIIreq   0x0010

Definition at line 70 of file sis190.c.

#define EhnMIIwrite   0x0020

Definition at line 66 of file sis190.c.

#define ErrMask   (OVRUN | SHORT | LIMIT | MIIER | NIBON | COLON | ABORT)
#define MII_REG_ANY   0x1f

Definition at line 41 of file sis190.c.

#define NUM_RX_DESC   64 /* [8..8192] */

Definition at line 51 of file sis190.c.

#define NUM_TX_DESC   64 /* [8..1024] */

Definition at line 50 of file sis190.c.

#define PHY_ID_ANY   0x1f

Definition at line 40 of file sis190.c.

#define PHY_MAX_ADDR   32

Definition at line 39 of file sis190.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 22 of file sis190.c.

#define RX_BUF_MASK   0xfff8

Definition at line 55 of file sis190.c.

#define RX_BUF_SIZE   1536

Definition at line 54 of file sis190.c.

#define RX_RING_BYTES   (NUM_RX_DESC * sizeof(struct RxDesc))

Definition at line 53 of file sis190.c.

#define SIS190_DRIVER_NAME   DRV_NAME " Gigabit Ethernet driver " DRV_VERSION

Definition at line 45 of file sis190.c.

#define SIS190_MSG_DEFAULT
Value:
NETIF_MSG_LINK | NETIF_MSG_IFUP | \
NETIF_MSG_IFDOWN)

Definition at line 60 of file sis190.c.

#define SIS190_PHY_TIMEOUT   (10*HZ)

Definition at line 59 of file sis190.c.

#define SIS190_REGS_SIZE   0x80

Definition at line 57 of file sis190.c.

#define sis190_rx_quota (   count,
  quota 
)    count

Definition at line 48 of file sis190.c.

#define sis190_rx_skb   netif_rx

Definition at line 47 of file sis190.c.

#define SIS190_TX_TIMEOUT   (6*HZ)

Definition at line 58 of file sis190.c.

#define SIS_PCI_COMMIT ( )    SIS_R32(IntrControl)

Definition at line 81 of file sis190.c.

#define SIS_R16 (   reg)    readw (ioaddr + (reg))

Definition at line 78 of file sis190.c.

#define SIS_R32 (   reg)    readl (ioaddr + (reg))

Definition at line 79 of file sis190.c.

#define SIS_R8 (   reg)    readb (ioaddr + (reg))

Definition at line 77 of file sis190.c.

#define SIS_W16 (   reg,
  val 
)    writew ((val), ioaddr + (reg))

Definition at line 75 of file sis190.c.

#define SIS_W32 (   reg,
  val 
)    writel ((val), ioaddr + (reg))

Definition at line 76 of file sis190.c.

#define SIS_W8 (   reg,
  val 
)    writeb ((val), ioaddr + (reg))

Definition at line 74 of file sis190.c.

#define TX_RING_BYTES   (NUM_TX_DESC * sizeof(struct TxDesc))

Definition at line 52 of file sis190.c.

#define TxErrMask   (WND | TABRT | FIFO | LINK)

Enumeration Type Documentation

Enumerator:
OWNbit 
INTbit 
CRCbit 
PADbit 
RingEnd 
LSEN 
IPCS 
TCPCS 
UDPCS 
BSTEN 
EXTEN 
DEFEN 
BKFEN 
CRSEN 
COLEN 
THOL3 
THOL2 
THOL1 
THOL0 
WND 
TABRT 
FIFO 
LINK 
ColCountMask 
IPON 
TCPON 
UDPON 
Wakup 
Magic 
Pause 
DEFbit 
BCAST 
MCAST 
UCAST 
TAGON 
RxDescCountMask 
ABORT 
SHORT 
LIMIT 
MIIER 
OVRUN 
NIBON 
COLON 
CRCOK 
RxSizeMask 

Definition at line 182 of file sis190.c.

Enumerator:
EECS 
EECLK 
EEDO 
EEDI 
EEREQ 
EEROP 
EEWOP 

Definition at line 241 of file sis190.c.

Enumerator:
EEPROMSignature 
EEPROMCLK 
EEPROMInfo 
EEPROMMACAddr 

Definition at line 252 of file sis190.c.

Enumerator:
F_HAS_RGMII 
F_PHY_88E1111 
F_PHY_BCM5461 

Definition at line 259 of file sis190.c.

Enumerator:
UNKNOWN 
HOME 
LAN 
MIX 

Definition at line 303 of file sis190.c.

Enumerator:
SoftInt 
Timeup 
PauseFrame 
MagicPacket 
WakeupFrame 
LinkChange 
RxQEmpty 
RxQInt 
TxQ1Empty 
TxQ1Int 
TxQ0Empty 
TxQ0Int 
RxHalt 
TxHalt 
CmdReset 
CmdRxEnb 
CmdTxEnb 
RxBufEmpty 
Cfg9346_Lock 
Cfg9346_Unlock 
AcceptErr 
AcceptRunt 
AcceptBroadcast 
AcceptMulticast 
AcceptMyPhys 
AcceptAllPhys 
RxCfgFIFOShift 
RxCfgDMAShift 
TxInterFrameGapShift 
TxDMAShift 
LinkStatus 
FullDup 
TBILinkOK 

Definition at line 118 of file sis190.c.

Enumerator:
TxControl 
TxDescStartAddr 
rsv0 
TxSts 
RxControl 
RxDescStartAddr 
rsv1 
RxSts 
IntrStatus 
IntrMask 
IntrControl 
IntrTimer 
PMControl 
rsv2 
ROMControl 
ROMInterface 
StationControl 
GMIIControl 
GIoCR 
GIoCtrl 
TxMacControl 
TxLimit 
RGDelay 
rsv3 
RxMacControl 
RxMacAddr 
RxHashTable 
RxWolCtrl 
RxWolData 
RxMPSControl 
rsv4 

Definition at line 83 of file sis190.c.

Function Documentation

MODULE_AUTHOR ( "K.M. Liu <[email protected] ,
Ueimor< romieu @fr.zoreil.com >"   
)
MODULE_DESCRIPTION ( "SiS sis190/191 Gigabit Ethernet driver )
MODULE_DEVICE_TABLE ( pci  ,
sis190_pci_tbl   
)
module_exit ( sis190_cleanup_module  )
module_init ( sis190_init_module  )
MODULE_LICENSE ( "GPL"  )
module_param ( rx_copybreak  ,
int  ,
 
)
module_param_named ( debug  ,
debug.  msg_enable,
int  ,
 
)
MODULE_PARM_DESC ( rx_copybreak  ,
"Copy breakpoint for copy-only-tiny-frames"   
)
MODULE_PARM_DESC ( debug  ,
"Debug verbosity level (0=none, ..., 16=all)"   
)
MODULE_VERSION ( DRV_VERSION  )

Variable Documentation

u32 msg_enable

Definition at line 344 of file sis190.c.

const char* name

Definition at line 327 of file sis190.c.