sis190.h File Reference

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <byteswap.h>
#include <errno.h>
#include <mii.h>
#include <gpxe/ethernet.h>
#include <gpxe/if_ether.h>
#include <gpxe/io.h>
#include <gpxe/iobuf.h>
#include <gpxe/malloc.h>
#include <gpxe/netdevice.h>
#include <gpxe/pci.h>
#include <gpxe/timer.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

Defines

#define PCI_VENDOR_ID_SI   0x1039
#define PHY_MAX_ADDR   32
#define PHY_ID_ANY   0x1f
#define MII_REG_ANY   0x1f
#define DRV_VERSION   "1.3"
#define DRV_NAME   "sis190"
#define SIS190_DRIVER_NAME   DRV_NAME " Gigabit Ethernet driver " DRV_VERSION
#define PFX   DRV_NAME ": "
#define sis190_rx_quota(count, quota)   count
#define NUM_TX_DESC   8
#define NUM_RX_DESC   8
#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 RING_ALIGNMENT   256
#define SIS190_REGS_SIZE   0x80
#define EhnMIIread   0x0000
#define EhnMIIwrite   0x0020
#define EhnMIIdataShift   16
#define EhnMIIpmdShift   6
#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)

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

 FILE_LICENCE (GPL_ANY)
static void sis190_phy_task (struct sis190_private *tp)
static void sis190_free (struct net_device *dev)
static void sis190_init_rxfilter (struct net_device *dev)

Variables

static struct mii_chip_info mii_chip_table []
struct {
   const char *   name
sis_chip_info []


Define Documentation

#define PCI_VENDOR_ID_SI   0x1039

Definition at line 25 of file sis190.h.

#define PHY_MAX_ADDR   32

Definition at line 27 of file sis190.h.

Referenced by sis190_mii_probe().

#define PHY_ID_ANY   0x1f

Definition at line 28 of file sis190.h.

Referenced by sis190_mii_probe().

#define MII_REG_ANY   0x1f

Definition at line 29 of file sis190.h.

Referenced by sis190_mii_probe().

#define DRV_VERSION   "1.3"

Definition at line 31 of file sis190.h.

#define DRV_NAME   "sis190"

Definition at line 32 of file sis190.h.

#define SIS190_DRIVER_NAME   DRV_NAME " Gigabit Ethernet driver " DRV_VERSION

Definition at line 33 of file sis190.h.

#define PFX   DRV_NAME ": "

#define sis190_rx_quota ( count,
quota   )     count

Definition at line 36 of file sis190.h.

#define NUM_TX_DESC   8

Definition at line 38 of file sis190.h.

#define NUM_RX_DESC   8

Definition at line 39 of file sis190.h.

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

Definition at line 40 of file sis190.h.

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

Definition at line 41 of file sis190.h.

#define RX_BUF_SIZE   1536

Definition at line 42 of file sis190.h.

#define RX_BUF_MASK   0xfff8

Definition at line 43 of file sis190.h.

Referenced by sis190_give_to_asic().

#define RING_ALIGNMENT   256

Definition at line 45 of file sis190.h.

Referenced by sis190_open().

#define SIS190_REGS_SIZE   0x80

Definition at line 47 of file sis190.h.

Referenced by sis190_init_board().

#define EhnMIIread   0x0000

Definition at line 50 of file sis190.h.

Referenced by mdio_read().

#define EhnMIIwrite   0x0020

Definition at line 51 of file sis190.h.

Referenced by mdio_write().

#define EhnMIIdataShift   16

Definition at line 52 of file sis190.h.

Referenced by mdio_read(), and mdio_write().

#define EhnMIIpmdShift   6

Definition at line 53 of file sis190.h.

Referenced by mdio_read(), and mdio_write().

#define EhnMIIregShift   11

Definition at line 54 of file sis190.h.

Referenced by mdio_read(), and mdio_write().

#define EhnMIIreq   0x0010

Definition at line 55 of file sis190.h.

Referenced by mdio_read(), and mdio_write().

#define EhnMIInotDone   0x0010

Definition at line 56 of file sis190.h.

Referenced by __mdio_cmd().

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

Definition at line 59 of file sis190.h.

Referenced by sis190_init_rxfilter().

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

Definition at line 60 of file sis190.h.

Referenced by sis190_hw_start(), sis190_init_rxfilter(), and sis190_set_rx_mode().

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

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

Definition at line 62 of file sis190.h.

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

Definition at line 63 of file sis190.h.

Referenced by sis190_init_rxfilter().

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

 
#define SIS_PCI_COMMIT (  )     SIS_R32(IntrControl)


Enumeration Type Documentation

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 68 of file sis190.h.

00068                       {
00069         TxControl               = 0x00,
00070         TxDescStartAddr         = 0x04,
00071         rsv0                    = 0x08, // reserved
00072         TxSts                   = 0x0c, // unused (Control/Status)
00073         RxControl               = 0x10,
00074         RxDescStartAddr         = 0x14,
00075         rsv1                    = 0x18, // reserved
00076         RxSts                   = 0x1c, // unused
00077         IntrStatus              = 0x20,
00078         IntrMask                = 0x24,
00079         IntrControl             = 0x28,
00080         IntrTimer               = 0x2c, // unused (Interupt Timer)
00081         PMControl               = 0x30, // unused (Power Mgmt Control/Status)
00082         rsv2                    = 0x34, // reserved
00083         ROMControl              = 0x38,
00084         ROMInterface            = 0x3c,
00085         StationControl          = 0x40,
00086         GMIIControl             = 0x44,
00087         GIoCR                   = 0x48, // unused (GMAC IO Compensation)
00088         GIoCtrl                 = 0x4c, // unused (GMAC IO Control)
00089         TxMacControl            = 0x50,
00090         TxLimit                 = 0x54, // unused (Tx MAC Timer/TryLimit)
00091         RGDelay                 = 0x58, // unused (RGMII Tx Internal Delay)
00092         rsv3                    = 0x5c, // reserved
00093         RxMacControl            = 0x60,
00094         RxMacAddr               = 0x62,
00095         RxHashTable             = 0x68,
00096         // Undocumented         = 0x6c,
00097         RxWolCtrl               = 0x70,
00098         RxWolData               = 0x74, // unused (Rx WOL Data Access)
00099         RxMPSControl            = 0x78, // unused (Rx MPS Control)
00100         rsv4                    = 0x7c, // reserved
00101 };

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 103 of file sis190.h.

00103                              {
00104         /* IntrStatus */
00105         SoftInt                 = 0x40000000,   // unused
00106         Timeup                  = 0x20000000,   // unused
00107         PauseFrame              = 0x00080000,   // unused
00108         MagicPacket             = 0x00040000,   // unused
00109         WakeupFrame             = 0x00020000,   // unused
00110         LinkChange              = 0x00010000,
00111         RxQEmpty                = 0x00000080,
00112         RxQInt                  = 0x00000040,
00113         TxQ1Empty               = 0x00000020,   // unused
00114         TxQ1Int                 = 0x00000010,
00115         TxQ0Empty               = 0x00000008,   // unused
00116         TxQ0Int                 = 0x00000004,
00117         RxHalt                  = 0x00000002,
00118         TxHalt                  = 0x00000001,
00119 
00120         /* {Rx/Tx}CmdBits */
00121         CmdReset                = 0x10,
00122         CmdRxEnb                = 0x08,         // unused
00123         CmdTxEnb                = 0x01,
00124         RxBufEmpty              = 0x01,         // unused
00125 
00126         /* Cfg9346Bits */
00127         Cfg9346_Lock            = 0x00,         // unused
00128         Cfg9346_Unlock          = 0xc0,         // unused
00129 
00130         /* RxMacControl */
00131         AcceptErr               = 0x20,         // unused
00132         AcceptRunt              = 0x10,         // unused
00133         AcceptBroadcast         = 0x0800,
00134         AcceptMulticast         = 0x0400,
00135         AcceptMyPhys            = 0x0200,
00136         AcceptAllPhys           = 0x0100,
00137 
00138         /* RxConfigBits */
00139         RxCfgFIFOShift          = 13,
00140         RxCfgDMAShift           = 8,            // 0x1a in RxControl ?
00141 
00142         /* TxConfigBits */
00143         TxInterFrameGapShift    = 24,
00144         TxDMAShift              = 8, /* DMA burst value (0-7) is shift this many bits */
00145 
00146         LinkStatus              = 0x02,         // unused
00147         FullDup                 = 0x01,         // unused
00148 
00149         /* TBICSRBit */
00150         TBILinkOK               = 0x02000000,   // unused
00151 };

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 167 of file sis190.h.

00167                     {
00168         /* _Desc.status */
00169         OWNbit          = 0x80000000, // RXOWN/TXOWN
00170         INTbit          = 0x40000000, // RXINT/TXINT
00171         CRCbit          = 0x00020000, // CRCOFF/CRCEN
00172         PADbit          = 0x00010000, // PREADD/PADEN
00173         /* _Desc.size */
00174         RingEnd         = 0x80000000,
00175         /* TxDesc.status */
00176         LSEN            = 0x08000000, // TSO ? -- FR
00177         IPCS            = 0x04000000,
00178         TCPCS           = 0x02000000,
00179         UDPCS           = 0x01000000,
00180         BSTEN           = 0x00800000,
00181         EXTEN           = 0x00400000,
00182         DEFEN           = 0x00200000,
00183         BKFEN           = 0x00100000,
00184         CRSEN           = 0x00080000,
00185         COLEN           = 0x00040000,
00186         THOL3           = 0x30000000,
00187         THOL2           = 0x20000000,
00188         THOL1           = 0x10000000,
00189         THOL0           = 0x00000000,
00190 
00191         WND             = 0x00080000,
00192         TABRT           = 0x00040000,
00193         FIFO            = 0x00020000,
00194         LINK            = 0x00010000,
00195         ColCountMask    = 0x0000ffff,
00196         /* RxDesc.status */
00197         IPON            = 0x20000000,
00198         TCPON           = 0x10000000,
00199         UDPON           = 0x08000000,
00200         Wakup           = 0x00400000,
00201         Magic           = 0x00200000,
00202         Pause           = 0x00100000,
00203         DEFbit          = 0x00200000,
00204         BCAST           = 0x000c0000,
00205         MCAST           = 0x00080000,
00206         UCAST           = 0x00040000,
00207         /* RxDesc.PSize */
00208         TAGON           = 0x80000000,
00209         RxDescCountMask = 0x7f000000, // multi-desc pkt when > 1 ? -- FR
00210         ABORT           = 0x00800000,
00211         SHORT           = 0x00400000,
00212         LIMIT           = 0x00200000,
00213         MIIER           = 0x00100000,
00214         OVRUN           = 0x00080000,
00215         NIBON           = 0x00040000,
00216         COLON           = 0x00020000,
00217         CRCOK           = 0x00010000,
00218         RxSizeMask      = 0x0000ffff
00219         /*
00220         * The asic could apparently do vlan, TSO, jumbo (sis191 only) and
00221         * provide two (unused with Linux) Tx queues. No publically
00222         * available documentation alas.
00223         */
00224 };

Enumerator:
EECS 
EECLK 
EEDO 
EEDI 
EEREQ 
EEROP 
EEWOP 

Definition at line 226 of file sis190.h.

00226                                         {
00227         EECS    = 0x00000001,   // unused
00228         EECLK   = 0x00000002,   // unused
00229         EEDO    = 0x00000008,   // unused
00230         EEDI    = 0x00000004,   // unused
00231         EEREQ   = 0x00000080,
00232         EEROP   = 0x00000200,
00233         EEWOP   = 0x00000100    // unused
00234 };

Enumerator:
EEPROMSignature 
EEPROMCLK 
EEPROMInfo 
EEPROMMACAddr 

Definition at line 237 of file sis190.h.

00237                            {
00238         EEPROMSignature = 0x00,
00239         EEPROMCLK       = 0x01, // unused
00240         EEPROMInfo      = 0x02,
00241         EEPROMMACAddr   = 0x03
00242 };

Enumerator:
F_HAS_RGMII 
F_PHY_88E1111 
F_PHY_BCM5461 

Definition at line 244 of file sis190.h.

00244                     {
00245         F_HAS_RGMII     = 1,
00246         F_PHY_88E1111   = 2,
00247         F_PHY_BCM5461   = 4
00248 };

Enumerator:
UNKNOWN 
HOME 
LAN 
MIX 

Definition at line 277 of file sis190.h.

00277                      {
00278         UNKNOWN = 0x00,
00279         HOME    = 0x01,
00280         LAN     = 0x02,
00281         MIX     = 0x03
00282 };


Function Documentation

FILE_LICENCE ( GPL_ANY   ) 

static void sis190_phy_task ( struct sis190_private tp  )  [static]

static void sis190_free ( struct net_device dev  )  [static]

static void sis190_init_rxfilter ( struct net_device dev  )  [inline, static]


Variable Documentation

struct mii_chip_info mii_chip_table[] [static]

Referenced by sis190_init_phy(), and sis900_probe().

const char* name

Definition at line 301 of file sis190.h.

struct { ... } sis_chip_info[] [static]


Generated on Tue Apr 6 20:01:39 2010 for gPXE by  doxygen 1.5.7.1