root/drivers/net/eth82586.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * eth82586.h: Intel EtherExpress defines
   3  *
   4  * Written 1995 by John Sullivan
   5  * See eexpress.c for furthur details
   6  * documentation and usage to do.
   7  */
   8 
   9 /*
  10  * EtherExpress card register addresses
  11  * as offsets from the base IO region (dev->base_addr)
  12  */
  13 
  14 #define DATAPORT 0x0000
  15 #define WRITE_PTR 0x0002
  16 #define READ_PTR 0x0004
  17 #define SIGNAL_CA 0x0006
  18 #define SET_IRQ 0x0007
  19 #define SM_PTR 0x0008
  20 #define MEM_Ctrl 0x000b
  21 #define MEM_Page_Ctrl 0x000c
  22 #define Config 0x000d
  23 #define EEPROM_Ctrl 0x000e
  24 #define ID_PORT 0x000f
  25 
  26 /*
  27  * offset to shadowed memory, 0 <= x <= 31. We don't use this yet,
  28  * but may in the future. Is shadow memory access any faster than
  29  * dataport access?
  30  */
  31 #define SM_ADDR(x) (0x4000+((x&0x10)<<10)+(x&0xf))
  32 
  33 /* Always mirrors eexp-memory at 0x0008-0x000f */
  34 #define SCB_STATUS 0xc008
  35 #define SCB_CMD 0xc00a
  36 #define SCB_CBL 0xc00c
  37 #define SCB_RFA 0xc00e
  38 
  39 
  40 
  41 /*
  42  * card register defines
  43  */
  44 
  45 /* SET_IRQ */
  46 #define SIRQ_en 0x08
  47 #define SIRQ_dis 0x00
  48 
  49 /* Config */
  50 #define set_loopback outb(inb(ioaddr+Config)|0x02,ioaddr+Config)
  51 #define clear_loopback outb(inb(ioaddr+Config)&0xfd,ioaddr+Config)
  52 
  53 /* EEPROM_Ctrl */
  54 #define EC_Clk 0x01
  55 #define EC_CS  0x02
  56 #define EC_Wr  0x04
  57 #define EC_Rd  0x08
  58 #define ASIC_RST 0x40
  59 #define i586_RST  0x80
  60 
  61 #define eeprom_delay() { int _i = 40; while (--_i>0) { __SLOW_DOWN_IO; }}
  62 
  63 /*
  64  * i82586 Memory Configuration
  65  */
  66 
  67 /* (System Configuration Pointer) System start up block, read after 586_RST */
  68 #define SCP_START 0xfff6
  69 
  70 
  71 /* Intermediate System Configuration Pointer */
  72 #define ISCP_START 0x0000
  73 /* System Command Block */
  74 #define SCB_START 0x0008
  75 
  76 /*
  77  * Start of buffer region. If we have 64k memory, eexp_hw_probe() may raise
  78  * NUM_TX_BUFS. RX_BUF_END is set to the end of memory, and all space between
  79  * the transmit buffer region and end of memory used for as many receive buffers
  80  * as we can fit. See eexp_hw_[(rx)(tx)]init().
  81  */
  82 #define TX_BUF_START 0x0100
  83 #define TX_BUF_SIZE ((24+ETH_FRAME_LEN+31)&~0x1f)
  84 unsigned short NUM_TX_BUFS=4;
  85 unsigned short RX_BUF_START;
  86 #define RX_BUF_SIZE ((32+ETH_FRAME_LEN+31)&~0x1f)
  87 unsigned short RX_BUF_END=0x7ff6; /* updated automatically to 0xfff6 on 64k cards */
  88 unsigned short NUM_RX_BUFS = 4;
  89 
  90 
  91 
  92 /*
  93  * SCB defines
  94  */
  95 
  96 /* these functions take the SCB status word and test the relavent status bit */
  97 #define SCB_complete(s) ((s&0x8000)!=0)
  98 #define SCB_rxdframe(s) ((s&0x4000)!=0)
  99 #define SCB_CUdead(s) ((s&0x2000)!=0)
 100 #define SCB_RUdead(s) ((s&0x1000)!=0)
 101 #define SCB_ack(s) (s & 0xf000)
 102 
 103 /* Command unit status: 0=idle, 1=suspended, 2=active */
 104 #define SCB_CUstat(s) ((s&0x0300)>>8)
 105 
 106 /* Receive unit status: 0=idle, 1=suspended, 2=out of resources, 4=ready */
 107 #define SCB_RUstat(s) ((s&0x0070)>>4)
 108 
 109 /* SCB commands */
 110 #define SCB_CUnop     0x0000
 111 #define SCB_CUstart   0x0100
 112 #define SCB_CUresume  0x0200
 113 #define SCB_CUsuspend 0x0300
 114 #define SCB_CUabort   0x0400
 115 
 116 /* ? */
 117 #define SCB_resetchip 0x0080
 118 
 119 #define SCB_RUnop     0x0000
 120 #define SCB_RUstart   0x0010
 121 #define SCB_RUresume  0x0020
 122 #define SCB_RUsuspend 0x0030
 123 #define SCB_RUabort   0x0040
 124 
 125 
 126 /*
 127  * Command block defines
 128  */
 129 
 130 #define Stat_Done(s)   ((s&0x8000)!=0)
 131 #define Stat_Busy(s)   ((s&0x4000)!=0)
 132 #define Stat_OK(s)     ((s&0x2000)!=0)
 133 #define Stat_Abort(s)  ((s&0x1000)!=0)
 134 #define Stat_STFail    ((s&0x0800)!=0)
 135 #define Stat_TNoCar(s) ((s&0x0400)!=0)
 136 #define Stat_TNoCTS(s) ((s&0x0200)!=0)
 137 #define Stat_TNoDMA(s) ((s&0x0100)!=0)
 138 #define Stat_TDefer(s) ((s&0x0080)!=0)
 139 #define Stat_TColl(s)  ((s&0x0040)!=0)
 140 #define Stat_TXColl(s) ((s&0x0020)!=0)
 141 #define Stat_NoColl(s) (s&0x000f)
 142 
 143 /* Cmd_END will end AFTER the command if this is the first
 144  * command block after an SCB_CUstart, but BEFORE the command
 145  * for all subsequent commands. Best strategy is to place
 146  * Cmd_INT on the last command in the sequence, followed by a
 147  * dummy Cmd_Nop with Cmd_END after this.
 148  */
 149 #define Cmd_END     0x8000
 150 #define Cmd_SUS     0x4000
 151 #define Cmd_INT     0x2000
 152 
 153 #define Cmd_Nop     0x0000
 154 #define Cmd_SetAddr 0x0001
 155 #define Cmd_Config  0x0002
 156 #define Cmd_MCast   0x0003
 157 #define Cmd_Xmit    0x0004
 158 #define Cmd_TDR     0x0005
 159 #define Cmd_Dump    0x0006
 160 #define Cmd_Diag    0x0007
 161 
 162 
 163 /*
 164  * Frame Descriptor (Receive block) defines
 165  */
 166 
 167 #define FD_Done(s)  ((s&0x8000)!=0)
 168 #define FD_Busy(s)  ((s&0x4000)!=0)
 169 #define FD_OK(s)    ((s&0x2000)!=0)
 170 
 171 #define FD_CRC(s)   ((s&0x0800)!=0)
 172 #define FD_Align(s) ((s&0x0400)!=0)
 173 #define FD_Resrc(s) ((s&0x0200)!=0)
 174 #define FD_DMA(s)   ((s&0x0100)!=0)
 175 #define FD_Short(s) ((s&0x0080)!=0)
 176 #define FD_NoEOF(s) ((s&0x0040)!=0)

/* [previous][next][first][last][top][bottom][index][help] */