iPXE
Data Structures | Macros | 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
 

Macros

#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 *)
 

Macro Definition Documentation

◆ CONGENB

#define CONGENB   0 /* Enable congestion control in the DP83840. */

Definition at line 7 of file eepro100.h.

◆ TX_FIFO

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

Definition at line 8 of file eepro100.h.

◆ RX_FIFO

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

Definition at line 9 of file eepro100.h.

◆ TX_DMA_COUNT

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

Definition at line 10 of file eepro100.h.

◆ RX_DMA_COUNT

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

Definition at line 11 of file eepro100.h.

◆ CU_CMD_TIMEOUT

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

Definition at line 12 of file eepro100.h.

◆ LINK_CHECK_PERIOD

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

Definition at line 13 of file eepro100.h.

◆ RFD_PACKET_LEN

#define RFD_PACKET_LEN   1518

Definition at line 15 of file eepro100.h.

◆ RFD_IOB_LEN

#define RFD_IOB_LEN   1536

Definition at line 16 of file eepro100.h.

◆ RFD_HEADER_LEN

#define RFD_HEADER_LEN   16

Definition at line 17 of file eepro100.h.

◆ CB_ALIGN

#define CB_ALIGN   2 /* Alignment of command blocks */

Definition at line 18 of file eepro100.h.

◆ RFD_COUNT

#define RFD_COUNT   4

Definition at line 20 of file eepro100.h.

◆ TCB_COUNT

#define TCB_COUNT   4

Definition at line 21 of file eepro100.h.

◆ RX_RING_BYTES

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

Definition at line 22 of file eepro100.h.

◆ TX_RING_BYTES

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

Definition at line 23 of file eepro100.h.

◆ EEPROM_ADDR_MAC_0

#define EEPROM_ADDR_MAC_0   0

Definition at line 26 of file eepro100.h.

◆ EEPROM_ADDR_MDIO_REGISTER

#define EEPROM_ADDR_MDIO_REGISTER   6

Definition at line 27 of file eepro100.h.

◆ EE_SHIFT_CLK

#define EE_SHIFT_CLK   0x01 /* EEPROM shift clock. */

Definition at line 89 of file eepro100.h.

◆ EE_CS

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

Definition at line 90 of file eepro100.h.

◆ EE_DATA_WRITE

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

Definition at line 91 of file eepro100.h.

◆ EE_DATA_READ

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

Definition at line 92 of file eepro100.h.

◆ EE_ENB

#define EE_ENB   ( 0x4800 | EE_CS )

Definition at line 93 of file eepro100.h.

Enumeration Type Documentation

◆ CSROffsets

enum CSROffsets
Enumerator
SCBStatus 
SCBCmd 
SCBPointer 
CSRPort 
CSRFlash 
CSREeprom 
CSRCtrlMDI 
CSREarlyRx 

Definition at line 30 of file eepro100.h.

30  {
31  SCBStatus=0, SCBCmd=2, SCBPointer = 4,
32  CSRPort=8, CSRFlash=12, CSREeprom = 14,
33  CSRCtrlMDI=16, CSREarlyRx=20
34 };

◆ SCBCmdBits

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.

37  {
38  /* SCB Interrupt Masks - SDM Table 14 */
39  SCBMaskCmdDone=0x8000, SCBMaskRxDone=0x4000, SCBMaskCmdIdle=0x2000,
40  SCBMaskRxSuspend=0x1000, SCBMaskEarlyRx=0x0800, SCBMaskFlowCtl=0x0400,
41  SCBTriggerIntr=0x0200, SCBMaskAll=0x0100,
42  /* SCB Control Commands - SDM Table 14-16 */
43  CUStart=0x0010, CUResume=0x0020, CUStatsAddr=0x0040,
44  CUShowStats=0x0050, CUCmdBase=0x0060, CUDumpStats=0x0070,
45  RUStart=0x0001, RUResume=0x0002, RUAbort=0x0004,
46  RUAddrLoad=0x0006, RUResumeNoResources=0x0007
47 };

◆ SCBPortCmds

Enumerator
PortReset 
PortSelfTest 
PortPartialReset 
PortDump 

Definition at line 49 of file eepro100.h.

◆ ActionCommands

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

Definition at line 54 of file eepro100.h.

54  {
55  CmdNOp = 0, CmdIASetup = 1, CmdConfigure = 2,
56  CmdMulticastList = 3, CmdTx = 4, CmdTDR = 5,
57  CmdDump = 6, CmdDiagnose = 7,
58  /* And some extra flags: */
59  CmdEndOfList = 0x8000,
60  CmdSuspend = 0x4000, CmdIntr = 0x2000, CmdTxFlex = 0x0008
61 };
Definition: eepro100.h:56

◆ TCBBits

enum TCBBits
Enumerator
TCB_C 
TCB_OK 
TCB_U 

Definition at line 63 of file eepro100.h.

63  {
64  TCB_C=0x8000, TCB_OK=0x2000, TCB_U=0x1000
65 };
Definition: eepro100.h:64
Definition: eepro100.h:64

◆ RFDBits

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.

67  {
68  /* Status Word Bits */
69  RFDRxCol=0x0001, RFDIAMatch=0x0002, RFDNoMatch=0x0004,
70  RFDReserved3=0x0008, RFDRxErr=0x0010, RFDEthType=0x0020,
71  RFDReserved6=0x0040, RFDShort=0x0080, RFDDMAOverrun=0x0100,
72  RFDNoBufs=0x0200, RFDCRCAlign=0x0400, RFDCRCError=0x0800,
73  RFDReserved12=0x1000, RFD_OK=0x2000, RFDComplete=0x8000,
74  /* Command Word Bits */
75  //RFD_SF=0x0008, RFDSuspend=0x4000, RFDEndOfList=0x8000,
76  /* Other */
77  RFDMaskCount=0x3FFF
78 };

◆ phy_chips

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()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ ifec_pci_probe()

static int ifec_pci_probe ( struct pci_device pci)
static

◆ ifec_pci_remove()

static void ifec_pci_remove ( struct pci_device pci)
static

◆ ifec_net_close()

static void ifec_net_close ( struct net_device )
static

◆ ifec_net_irq()

static void ifec_net_irq ( struct net_device ,
int  enable 
)
static

◆ ifec_net_open()

static int ifec_net_open ( struct net_device )
static

◆ ifec_net_poll()

static void ifec_net_poll ( struct net_device )
static

◆ ifec_net_transmit()

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

◆ ifec_init_eeprom()

static void ifec_init_eeprom ( struct net_device )
static

◆ ifec_mdio_read()

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

◆ ifec_mdio_setup()

static void ifec_mdio_setup ( struct net_device ,
int  options 
)
static

◆ ifec_mdio_write()

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

◆ ifec_reset()

static void ifec_reset ( struct net_device )
static

◆ ifec_free()

static void ifec_free ( struct net_device )
static

◆ ifec_rfd_init()

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

◆ ifec_rx_process()

static void ifec_rx_process ( struct net_device )
static

◆ ifec_reprime_ru()

static void ifec_reprime_ru ( struct net_device )
static

◆ ifec_check_ru_status()

static void ifec_check_ru_status ( struct net_device ,
unsigned short   
)
static

◆ ifec_get_rx_desc()

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

◆ ifec_refill_rx_ring()

static void ifec_refill_rx_ring ( struct net_device )
static

◆ ifec_rx_setup()

static int ifec_rx_setup ( struct net_device )
static

◆ ifec_scb_cmd()

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

◆ ifec_scb_cmd_wait()

static int ifec_scb_cmd_wait ( struct net_device )
static

◆ ifec_tx_process()

static void ifec_tx_process ( struct net_device )
static

◆ ifec_tx_setup()

static int ifec_tx_setup ( struct net_device )
static

◆ ifec_tx_wake()

static void ifec_tx_wake ( struct net_device )
static

Definition at line 1072 of file eepro100.c.

1073 {
1074  struct ifec_private *priv = netdev->priv;
1075  unsigned long ioaddr = priv->ioaddr;
1076  struct ifec_tcb *tcb = priv->tcb_head->next;
1077 
1078  DBGP ( "ifec_tx_wake\n" );
1079 
1080  /* For the special case of the first transmit, we issue a START. The
1081  * card won't RESUME after the configure command. */
1082  if ( priv->configured ) {
1083  priv->configured = 0;
1084  ifec_scb_cmd ( netdev, virt_to_bus ( tcb ), CUStart );
1086  return;
1087  }
1088 
1089  /* Resume if suspended. */
1090  switch ( ( inw ( ioaddr + SCBStatus ) >> 6 ) & 0x3 ) {
1091  case 0: /* Idle - We should not reach this state. */
1092  DBG2 ( "ifec_tx_wake: tx idle!\n" );
1093  ifec_scb_cmd ( netdev, virt_to_bus ( tcb ), CUStart );
1095  return;
1096  case 1: /* Suspended */
1097  DBG2 ( "s" );
1098  break;
1099  default: /* Active */
1100  DBG2 ( "a" );
1101  }
1103  outl ( 0, ioaddr + SCBPointer );
1104  priv->tcb_head->command &= ~CmdSuspend;
1105  /* Immediately issue Resume command */
1106  outb ( CUResume, ioaddr + SCBCmd );
1108 }
uint16_t inw(volatile uint16_t *io_addr)
Read 16-bit word from I/O-mapped device.
static int ifec_scb_cmd(struct net_device *netdev, u32 ptr, u8 cmd)
Definition: eepro100.c:942
static unsigned long ioaddr
Definition: davicom.c:129
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
Definition: io.h:183
#define DBGP(...)
Definition: compiler.h:532
void * priv
Driver private data.
Definition: netdevice.h:431
static struct net_device * netdev
Definition: gdbudp.c:52
#define outl(data, io_addr)
Definition: io.h:329
#define outb(data, io_addr)
Definition: io.h:309
static int ifec_scb_cmd_wait(struct net_device *netdev)
Definition: eepro100.c:964
static struct tlan_private * priv
Definition: tlan.c:224
#define DBG2(...)
Definition: compiler.h:515

References CmdSuspend, CUResume, CUStart, DBG2, DBGP, ifec_scb_cmd(), ifec_scb_cmd_wait(), inw(), ioaddr, netdev, outb, outl, priv, net_device::priv, SCBCmd, SCBPointer, SCBStatus, and virt_to_bus().

Referenced by ifec_net_transmit().