eepro100.h File Reference

Go to the source code of this file.

Data Structures

struct  ifec_stats
struct  ifec_tcb
struct  ifec_rfd
struct  ifec_ias
struct  ifec_cfg
struct  ifec_private

Defines

#define CONGENB   0
#define TX_FIFO   8
#define RX_FIFO   8
#define TX_DMA_COUNT   0
#define RX_DMA_COUNT   0
#define CU_CMD_TIMEOUT   1000
#define LINK_CHECK_PERIOD   1000
#define RFD_PACKET_LEN   1518
#define RFD_IOB_LEN   1536
#define RFD_HEADER_LEN   16
#define CB_ALIGN   2
#define RFD_COUNT   4
#define TCB_COUNT   4
#define RX_RING_BYTES   ( RFD_COUNT * sizeof ( struct ifec_rfd ) )
#define TX_RING_BYTES   ( TCB_COUNT * sizeof ( struct ifec_tcb ) )
#define EEPROM_ADDR_MAC_0   0
#define EEPROM_ADDR_MDIO_REGISTER   6
#define EE_SHIFT_CLK   0x01
#define EE_CS   0x02
#define EE_DATA_WRITE   0x04
#define EE_DATA_READ   0x08
#define EE_ENB   ( 0x4800 | EE_CS )

Enumerations

enum  CSROffsets {
  SCBStatus = 0, SCBCmd = 2, SCBPointer = 4, CSRPort = 8,
  CSRFlash = 12, CSREeprom = 14, CSRCtrlMDI = 16, CSREarlyRx = 20
}
enum  SCBCmdBits {
  SCBMaskCmdDone = 0x8000, SCBMaskRxDone = 0x4000, SCBMaskCmdIdle = 0x2000, SCBMaskRxSuspend = 0x1000,
  SCBMaskEarlyRx = 0x0800, SCBMaskFlowCtl = 0x0400, SCBTriggerIntr = 0x0200, SCBMaskAll = 0x0100,
  CUStart = 0x0010, CUResume = 0x0020, CUStatsAddr = 0x0040, CUShowStats = 0x0050,
  CUCmdBase = 0x0060, CUDumpStats = 0x0070, RUStart = 0x0001, RUResume = 0x0002,
  RUAbort = 0x0004, RUAddrLoad = 0x0006, RUResumeNoResources = 0x0007
}
enum  SCBPortCmds { PortReset = 0, PortSelfTest = 1, PortPartialReset = 2, PortDump = 3 }
enum  ActionCommands {
  CmdNOp = 0, CmdIASetup = 1, CmdConfigure = 2, CmdMulticastList = 3,
  CmdTx = 4, CmdTDR = 5, CmdDump = 6, CmdDiagnose = 7,
  CmdEndOfList = 0x8000, CmdSuspend = 0x4000, CmdIntr = 0x2000, CmdTxFlex = 0x0008
}
enum  TCBBits { TCB_C = 0x8000, TCB_OK = 0x2000, TCB_U = 0x1000 }
enum  RFDBits {
  RFDRxCol = 0x0001, RFDIAMatch = 0x0002, RFDNoMatch = 0x0004, RFDReserved3 = 0x0008,
  RFDRxErr = 0x0010, RFDEthType = 0x0020, RFDReserved6 = 0x0040, RFDShort = 0x0080,
  RFDDMAOverrun = 0x0100, RFDNoBufs = 0x0200, RFDCRCAlign = 0x0400, RFDCRCError = 0x0800,
  RFDReserved12 = 0x1000, RFD_OK = 0x2000, RFDComplete = 0x8000, RFDMaskCount = 0x3FFF
}
enum  phy_chips {
  NonSuchPhy = 0, I82553AB, I82553C, I82503,
  DP83840, S80C240, S80C24, PhyUndefined,
  DP83840A = 10
}

Functions

 FILE_LICENCE (GPL2_OR_LATER)
static int ifec_pci_probe (struct pci_device *, const struct pci_device_id *)
static void ifec_pci_remove (struct pci_device *pci)
static void ifec_net_close (struct net_device *)
static void ifec_net_irq (struct net_device *, int enable)
static int ifec_net_open (struct net_device *)
static void ifec_net_poll (struct net_device *)
static int ifec_net_transmit (struct net_device *, struct io_buffer *iobuf)
static void ifec_init_eeprom (struct net_device *)
static int ifec_link_check (struct net_device *)
static void ifec_link_update (struct net_device *)
static int ifec_mdio_read (struct net_device *, int phy, int location)
static void ifec_mdio_setup (struct net_device *, int options)
static int ifec_mdio_write (struct net_device *, int phy, int loc, int val)
static void ifec_reset (struct net_device *)
static void ifec_free (struct net_device *)
static void ifec_rfd_init (struct ifec_rfd *rfd, s16 command, u32 link)
static void ifec_rx_process (struct net_device *)
static void ifec_reprime_ru (struct net_device *)
static void ifec_check_ru_status (struct net_device *, unsigned short)
static int ifec_get_rx_desc (struct net_device *, int, int, int)
static void ifec_refill_rx_ring (struct net_device *)
static int ifec_rx_setup (struct net_device *)
static int ifec_scb_cmd (struct net_device *, u32 ptr, u8 cmd)
static int ifec_scb_cmd_wait (struct net_device *)
static void ifec_tx_process (struct net_device *)
static int ifec_tx_setup (struct net_device *)
static void ifec_tx_wake (struct net_device *)


Define Documentation

#define CONGENB   0

Definition at line 7 of file eepro100.h.

Referenced by ifec_mdio_setup().

#define TX_FIFO   8

Definition at line 8 of file eepro100.h.

Referenced by t515_transmit().

#define RX_FIFO   8

Definition at line 9 of file eepro100.h.

Referenced by t515_poll().

#define TX_DMA_COUNT   0

Definition at line 10 of file eepro100.h.

#define RX_DMA_COUNT   0

Definition at line 11 of file eepro100.h.

#define CU_CMD_TIMEOUT   1000

Definition at line 12 of file eepro100.h.

Referenced by ifec_scb_cmd_wait().

#define LINK_CHECK_PERIOD   1000

Definition at line 13 of file eepro100.h.

Referenced by ifec_net_poll().

#define RFD_PACKET_LEN   1518

Definition at line 15 of file eepro100.h.

Referenced by ifec_rfd_init().

#define RFD_IOB_LEN   1536

Definition at line 16 of file eepro100.h.

#define RFD_HEADER_LEN   16

Definition at line 17 of file eepro100.h.

Referenced by ifec_get_rx_desc().

#define CB_ALIGN   2

Definition at line 18 of file eepro100.h.

Referenced by ifec_net_open(), and ifec_tx_setup().

#define RFD_COUNT   4

Definition at line 20 of file eepro100.h.

Referenced by ifec_free(), ifec_refill_rx_ring(), ifec_rx_process(), and ifec_rx_setup().

#define TCB_COUNT   4

Definition at line 21 of file eepro100.h.

Referenced by ifec_tx_setup().

#define RX_RING_BYTES   ( RFD_COUNT * sizeof ( struct ifec_rfd ) )

Definition at line 22 of file eepro100.h.

Referenced by sis190_free(), and sis190_open().

#define TX_RING_BYTES   ( TCB_COUNT * sizeof ( struct ifec_tcb ) )

Definition at line 23 of file eepro100.h.

Referenced by ifec_free(), ifec_tx_setup(), sis190_free(), and sis190_open().

#define EEPROM_ADDR_MAC_0   0

Definition at line 26 of file eepro100.h.

Referenced by ifec_pci_probe().

#define EEPROM_ADDR_MDIO_REGISTER   6

Definition at line 27 of file eepro100.h.

Referenced by ifec_pci_probe().

#define EE_SHIFT_CLK   0x01

Definition at line 89 of file eepro100.h.

#define EE_CS   0x02

Definition at line 90 of file eepro100.h.

#define EE_DATA_WRITE   0x04

Definition at line 91 of file eepro100.h.

#define EE_DATA_READ   0x08

Definition at line 92 of file eepro100.h.

#define EE_ENB   ( 0x4800 | EE_CS )

Definition at line 93 of file eepro100.h.


Enumeration Type Documentation

enum CSROffsets

Enumerator:
SCBStatus 
SCBCmd 
SCBPointer 
CSRPort 
CSRFlash 
CSREeprom 
CSRCtrlMDI 
CSREarlyRx 

Definition at line 30 of file eepro100.h.

00030                 {
00031         SCBStatus=0,             SCBCmd=2,              SCBPointer = 4,
00032         CSRPort=8,               CSRFlash=12,           CSREeprom = 14,
00033         CSRCtrlMDI=16,           CSREarlyRx=20
00034 };

enum SCBCmdBits

Enumerator:
SCBMaskCmdDone 
SCBMaskRxDone 
SCBMaskCmdIdle 
SCBMaskRxSuspend 
SCBMaskEarlyRx 
SCBMaskFlowCtl 
SCBTriggerIntr 
SCBMaskAll 
CUStart 
CUResume 
CUStatsAddr 
CUShowStats 
CUCmdBase 
CUDumpStats 
RUStart 
RUResume 
RUAbort 
RUAddrLoad 
RUResumeNoResources 

Definition at line 37 of file eepro100.h.

00037                 {
00038         /* SCB Interrupt Masks - SDM Table 14 */
00039         SCBMaskCmdDone=0x8000,   SCBMaskRxDone=0x4000,  SCBMaskCmdIdle=0x2000,
00040         SCBMaskRxSuspend=0x1000, SCBMaskEarlyRx=0x0800, SCBMaskFlowCtl=0x0400,
00041         SCBTriggerIntr=0x0200,   SCBMaskAll=0x0100,
00042         /* SCB Control Commands - SDM Table 14-16 */
00043         CUStart=0x0010,          CUResume=0x0020,       CUStatsAddr=0x0040,
00044         CUShowStats=0x0050,      CUCmdBase=0x0060,      CUDumpStats=0x0070,
00045         RUStart=0x0001,          RUResume=0x0002,       RUAbort=0x0004,
00046         RUAddrLoad=0x0006,       RUResumeNoResources=0x0007
00047 };

Enumerator:
PortReset 
PortSelfTest 
PortPartialReset 
PortDump 

Definition at line 49 of file eepro100.h.

00049                  {
00050         PortReset=0, PortSelfTest=1, PortPartialReset=2, PortDump=3
00051 };

Enumerator:
CmdNOp 
CmdIASetup 
CmdConfigure 
CmdMulticastList 
CmdTx 
CmdTDR 
CmdDump 
CmdDiagnose 
CmdEndOfList 
CmdSuspend 
CmdIntr 
CmdTxFlex 

Definition at line 54 of file eepro100.h.

00054                     {
00055         CmdNOp = 0,              CmdIASetup = 1,        CmdConfigure = 2,
00056         CmdMulticastList = 3,    CmdTx = 4,             CmdTDR = 5,
00057         CmdDump = 6,             CmdDiagnose = 7,
00058         /* And some extra flags: */
00059         CmdEndOfList = 0x8000,
00060         CmdSuspend = 0x4000,     CmdIntr = 0x2000,      CmdTxFlex = 0x0008
00061 };

enum TCBBits

Enumerator:
TCB_C 
TCB_OK 
TCB_U 

Definition at line 63 of file eepro100.h.

00063              {
00064         TCB_C=0x8000,            TCB_OK=0x2000,         TCB_U=0x1000
00065 };

enum RFDBits

Enumerator:
RFDRxCol 
RFDIAMatch 
RFDNoMatch 
RFDReserved3 
RFDRxErr 
RFDEthType 
RFDReserved6 
RFDShort 
RFDDMAOverrun 
RFDNoBufs 
RFDCRCAlign 
RFDCRCError 
RFDReserved12 
RFD_OK 
RFDComplete 
RFDMaskCount 

Definition at line 67 of file eepro100.h.

00067              {
00068         /* Status Word Bits */
00069         RFDRxCol=0x0001,         RFDIAMatch=0x0002,     RFDNoMatch=0x0004,
00070         RFDReserved3=0x0008,     RFDRxErr=0x0010,       RFDEthType=0x0020,
00071         RFDReserved6=0x0040,     RFDShort=0x0080,       RFDDMAOverrun=0x0100,
00072         RFDNoBufs=0x0200,        RFDCRCAlign=0x0400,    RFDCRCError=0x0800,
00073         RFDReserved12=0x1000,    RFD_OK=0x2000,         RFDComplete=0x8000,
00074         /* Command Word Bits */
00075         //RFD_SF=0x0008,           RFDSuspend=0x4000,     RFDEndOfList=0x8000,
00076         /* Other */
00077         RFDMaskCount=0x3FFF
00078 };

enum phy_chips

Enumerator:
NonSuchPhy 
I82553AB 
I82553C 
I82503 
DP83840 
S80C240 
S80C24 
PhyUndefined 
DP83840A 

Definition at line 80 of file eepro100.h.

00080                {
00081         NonSuchPhy=0,            I82553AB,              I82553C,
00082         I82503,                  DP83840,               S80C240,
00083         S80C24,                  PhyUndefined,          DP83840A=10
00084 };


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

static int ifec_pci_probe ( struct pci_device ,
const struct pci_device_id  
) [static]

static void ifec_pci_remove ( struct pci_device pci  )  [static]

static void ifec_net_close ( struct net_device  )  [static]

static void ifec_net_irq ( struct net_device ,
int  enable 
) [static]

static int ifec_net_open ( struct net_device  )  [static]

static void ifec_net_poll ( struct net_device  )  [static]

static int ifec_net_transmit ( struct net_device ,
struct io_buffer iobuf 
) [static]

static void ifec_init_eeprom ( struct net_device  )  [static]

static int ifec_link_check ( struct net_device  )  [static]

static void ifec_link_update ( struct net_device  )  [static]

static int ifec_mdio_read ( struct net_device ,
int  phy,
int  location 
) [static]

static void ifec_mdio_setup ( struct net_device ,
int  options 
) [static]

static int ifec_mdio_write ( struct net_device ,
int  phy,
int  loc,
int  val 
) [static]

static void ifec_reset ( struct net_device  )  [static]

static void ifec_free ( struct net_device  )  [static]

static void ifec_rfd_init ( struct ifec_rfd rfd,
s16  command,
u32  link 
) [static]

static void ifec_rx_process ( struct net_device  )  [static]

static void ifec_reprime_ru ( struct net_device  )  [static]

static void ifec_check_ru_status ( struct net_device ,
unsigned  short 
) [static]

static int ifec_get_rx_desc ( struct net_device ,
int  ,
int  ,
int   
) [static]

static void ifec_refill_rx_ring ( struct net_device  )  [static]

static int ifec_rx_setup ( struct net_device  )  [static]

static int ifec_scb_cmd ( struct net_device ,
u32  ptr,
u8  cmd 
) [static]

static int ifec_scb_cmd_wait ( struct net_device  )  [static]

static void ifec_tx_process ( struct net_device  )  [static]

static int ifec_tx_setup ( struct net_device  )  [static]

static void ifec_tx_wake ( struct net_device  )  [static]

Definition at line 1117 of file eepro100.c.

References CmdSuspend, ifec_tcb::command, ifec_private::configured, CUResume, CUStart, DBG2, DBGP, ifec_scb_cmd(), ifec_scb_cmd_wait(), inw, ifec_private::ioaddr, ioaddr, ifec_tcb::next, outb, outl, net_device::priv, priv, SCBCmd, SCBPointer, SCBStatus, ifec_private::tcb_head, and virt_to_bus().

Referenced by ifec_net_transmit().

01118 {
01119         struct ifec_private *priv = netdev->priv;
01120         unsigned long ioaddr = priv->ioaddr;
01121         struct ifec_tcb *tcb = priv->tcb_head->next;
01122 
01123         DBGP ( "ifec_tx_wake\n" );
01124 
01125         /* For the special case of the first transmit, we issue a START. The
01126          * card won't RESUME after the configure command. */
01127         if ( priv->configured ) {
01128                 priv->configured = 0;
01129                 ifec_scb_cmd ( netdev, virt_to_bus ( tcb ), CUStart );
01130                 ifec_scb_cmd_wait ( netdev );
01131                 return;
01132         }
01133 
01134         /* Resume if suspended. */
01135         switch ( ( inw ( ioaddr + SCBStatus ) >> 6 ) & 0x3 ) {
01136         case 0:  /* Idle - We should not reach this state. */
01137                 DBG2 ( "ifec_tx_wake: tx idle!\n" );
01138                 ifec_scb_cmd ( netdev, virt_to_bus ( tcb ), CUStart );
01139                 ifec_scb_cmd_wait ( netdev );
01140                 return;
01141         case 1:  /* Suspended */
01142                 DBG2 ( "s" );
01143                 break;
01144         default: /* Active */
01145                 DBG2 ( "a" );
01146         }
01147         ifec_scb_cmd_wait ( netdev );
01148         outl ( 0, ioaddr + SCBPointer );
01149         priv->tcb_head->command &= ~CmdSuspend;
01150         /* Immediately issue Resume command */
01151         outb ( CUResume, ioaddr + SCBCmd );
01152         ifec_scb_cmd_wait ( netdev );
01153 }


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