iPXE
Data Structures | Defines | Enumerations | Functions
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 /* Enable congestion control in the DP83840. */
#define TX_FIFO   8 /* Tx FIFO threshold in 4 byte units, 0-15 */
#define RX_FIFO   8 /* Rx FIFO threshold, default 32 bytes. */
#define TX_DMA_COUNT   0 /* Tx DMA burst length, 0-127, default 0. */
#define RX_DMA_COUNT   0 /* Rx DMA length, 0 means no preemption. */
#define CU_CMD_TIMEOUT   1000 /* CU command accept timeout in microseconds */
#define LINK_CHECK_PERIOD   1000 /* # of poll() calls between link checks */
#define RFD_PACKET_LEN   1518
#define RFD_IOB_LEN   1536
#define RFD_HEADER_LEN   16
#define CB_ALIGN   2 /* Alignment of command blocks */
#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 /* EEPROM shift clock. */
#define EE_CS   0x02 /* EEPROM chip select. */
#define EE_DATA_WRITE   0x04 /* EEPROM chip data in. */
#define EE_DATA_READ   0x08 /* EEPROM chip data out. */
#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 *pci)
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_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 /* Enable congestion control in the DP83840. */

Definition at line 7 of file eepro100.h.

Referenced by ifec_mdio_setup().

#define TX_FIFO   8 /* Tx FIFO threshold in 4 byte units, 0-15 */

Definition at line 8 of file eepro100.h.

#define RX_FIFO   8 /* Rx FIFO threshold, default 32 bytes. */

Definition at line 9 of file eepro100.h.

#define TX_DMA_COUNT   0 /* Tx DMA burst length, 0-127, default 0. */

Definition at line 10 of file eepro100.h.

#define RX_DMA_COUNT   0 /* Rx DMA length, 0 means no preemption. */

Definition at line 11 of file eepro100.h.

#define CU_CMD_TIMEOUT   1000 /* CU command accept timeout in microseconds */

Definition at line 12 of file eepro100.h.

Referenced by ifec_scb_cmd_wait().

#define LINK_CHECK_PERIOD   1000 /* # of poll() calls between link checks */

Definition at line 13 of file eepro100.h.

#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 /* Alignment of command blocks */

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 ) )
#define TX_RING_BYTES   ( TCB_COUNT * sizeof ( struct ifec_tcb ) )
#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 /* EEPROM shift clock. */

Definition at line 89 of file eepro100.h.

#define EE_CS   0x02 /* EEPROM chip select. */

Definition at line 90 of file eepro100.h.

#define EE_DATA_WRITE   0x04 /* EEPROM chip data in. */

Definition at line 91 of file eepro100.h.

#define EE_DATA_READ   0x08 /* EEPROM chip data out. */

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.

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.

                {
        /* SCB Interrupt Masks - SDM Table 14 */
        SCBMaskCmdDone=0x8000,   SCBMaskRxDone=0x4000,  SCBMaskCmdIdle=0x2000,
        SCBMaskRxSuspend=0x1000, SCBMaskEarlyRx=0x0800, SCBMaskFlowCtl=0x0400,
        SCBTriggerIntr=0x0200,   SCBMaskAll=0x0100,
        /* SCB Control Commands - SDM Table 14-16 */
        CUStart=0x0010,          CUResume=0x0020,       CUStatsAddr=0x0040,
        CUShowStats=0x0050,      CUCmdBase=0x0060,      CUDumpStats=0x0070,
        RUStart=0x0001,          RUResume=0x0002,       RUAbort=0x0004,
        RUAddrLoad=0x0006,       RUResumeNoResources=0x0007
};
Enumerator:
PortReset 
PortSelfTest 
PortPartialReset 
PortDump 

Definition at line 49 of file eepro100.h.

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

Definition at line 54 of file eepro100.h.

                    {
        CmdNOp = 0,              CmdIASetup = 1,        CmdConfigure = 2,
        CmdMulticastList = 3,    CmdTx = 4,             CmdTDR = 5,
        CmdDump = 6,             CmdDiagnose = 7,
        /* And some extra flags: */
        CmdEndOfList = 0x8000,
        CmdSuspend = 0x4000,     CmdIntr = 0x2000,      CmdTxFlex = 0x0008
};
enum TCBBits
Enumerator:
TCB_C 
TCB_OK 
TCB_U 

Definition at line 63 of file eepro100.h.

             {
        TCB_C=0x8000,            TCB_OK=0x2000,         TCB_U=0x1000
};
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.

             {
        /* Status Word Bits */
        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,
        /* Command Word Bits */
        //RFD_SF=0x0008,           RFDSuspend=0x4000,     RFDEndOfList=0x8000,
        /* Other */
        RFDMaskCount=0x3FFF
};
enum phy_chips
Enumerator:
NonSuchPhy 
I82553AB 
I82553C 
I82503 
DP83840 
S80C240 
S80C24 
PhyUndefined 
DP83840A 

Definition at line 80 of file eepro100.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER  )
static int ifec_pci_probe ( struct pci_device pci) [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_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 1072 of file eepro100.c.

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

Referenced by ifec_net_transmit().

{
        struct ifec_private *priv = netdev->priv;
        unsigned long ioaddr = priv->ioaddr;
        struct ifec_tcb *tcb = priv->tcb_head->next;

        DBGP ( "ifec_tx_wake\n" );

        /* For the special case of the first transmit, we issue a START. The
         * card won't RESUME after the configure command. */
        if ( priv->configured ) {
                priv->configured = 0;
                ifec_scb_cmd ( netdev, virt_to_bus ( tcb ), CUStart );
                ifec_scb_cmd_wait ( netdev );
                return;
        }

        /* Resume if suspended. */
        switch ( ( inw ( ioaddr + SCBStatus ) >> 6 ) & 0x3 ) {
        case 0:  /* Idle - We should not reach this state. */
                DBG2 ( "ifec_tx_wake: tx idle!\n" );
                ifec_scb_cmd ( netdev, virt_to_bus ( tcb ), CUStart );
                ifec_scb_cmd_wait ( netdev );
                return;
        case 1:  /* Suspended */
                DBG2 ( "s" );
                break;
        default: /* Active */
                DBG2 ( "a" );
        }
        ifec_scb_cmd_wait ( netdev );
        outl ( 0, ioaddr + SCBPointer );
        priv->tcb_head->command &= ~CmdSuspend;
        /* Immediately issue Resume command */
        outb ( CUResume, ioaddr + SCBCmd );
        ifec_scb_cmd_wait ( netdev );
}