Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
eth16i.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>
#include <linux/io.h>
#include <asm/dma.h>

Go to the source code of this file.

Data Structures

struct  eth16i_local
 

Macros

#define BITSET(ioaddr, bnum)   ((outb(((inb(ioaddr)) | (bnum)), ioaddr)))
 
#define BITCLR(ioaddr, bnum)   ((outb(((inb(ioaddr)) & (~(bnum))), ioaddr)))
 
#define ETH16I_IO_EXTENT   32
 
#define TX_TIMEOUT   (400*HZ/1000)
 
#define MAX_RX_LOOP   20
 
#define ETH16I_INTR_ON   0xef8a /* Higher is receive mask */
 
#define ETH16I_INTR_OFF   0x0000
 
#define PKT_GOOD   BIT(5)
 
#define PKT_GOOD_RMT   BIT(4)
 
#define PKT_SHORT   BIT(3)
 
#define PKT_ALIGN_ERR   BIT(2)
 
#define PKT_CRC_ERR   BIT(1)
 
#define PKT_RX_BUF_OVERFLOW   BIT(0)
 
#define TX_STATUS_REG   0
 
#define TX_DONE   BIT(7)
 
#define NET_BUSY   BIT(6)
 
#define TX_PKT_RCD   BIT(5)
 
#define CR_LOST   BIT(4)
 
#define TX_JABBER_ERR   BIT(3)
 
#define COLLISION   BIT(2)
 
#define COLLISIONS_16   BIT(1)
 
#define RX_STATUS_REG   1
 
#define RX_PKT   BIT(7) /* Packet received */
 
#define BUS_RD_ERR   BIT(6)
 
#define SHORT_PKT_ERR   BIT(3)
 
#define ALIGN_ERR   BIT(2)
 
#define CRC_ERR   BIT(1)
 
#define RX_BUF_OVERFLOW   BIT(0)
 
#define TX_INTR_REG   2
 
#define TX_INTR_DONE   BIT(7)
 
#define TX_INTR_COL   BIT(2)
 
#define TX_INTR_16_COL   BIT(1)
 
#define RX_INTR_REG   3
 
#define RX_INTR_RECEIVE   BIT(7)
 
#define RX_INTR_SHORT_PKT   BIT(3)
 
#define RX_INTR_CRC_ERR   BIT(1)
 
#define RX_INTR_BUF_OVERFLOW   BIT(0)
 
#define TRANSMIT_MODE_REG   4
 
#define LOOPBACK_CONTROL   BIT(1)
 
#define CONTROL_OUTPUT   BIT(2)
 
#define RECEIVE_MODE_REG   5
 
#define RX_BUFFER_EMPTY   BIT(6)
 
#define ACCEPT_BAD_PACKETS   BIT(5)
 
#define RECEIVE_SHORT_ADDR   BIT(4)
 
#define ACCEPT_SHORT_PACKETS   BIT(3)
 
#define REMOTE_RESET   BIT(2)
 
#define ADDRESS_FILTER_MODE   BIT(1) | BIT(0)
 
#define REJECT_ALL   0
 
#define ACCEPT_ALL   3
 
#define MODE_1   1 /* NODE ID, BC, MC, 2-24th bit */
 
#define MODE_2   2 /* NODE ID, BC, MC, Hash Table */
 
#define CONFIG_REG_0   6
 
#define DLC_EN   BIT(7)
 
#define SRAM_CYCLE_TIME_100NS   BIT(6)
 
#define SYSTEM_BUS_WIDTH_8   BIT(5) /* 1 = 8bit, 0 = 16bit */
 
#define BUFFER_WIDTH_8   BIT(4) /* 1 = 8bit, 0 = 16bit */
 
#define TBS1   BIT(3)
 
#define TBS0   BIT(2)
 
#define SRAM_BS1   BIT(1) /* 00=8kb, 01=16kb */
 
#define SRAM_BS0   BIT(0) /* 10=32kb, 11=64kb */
 
#define ETH16I_TX_BUF_SIZE   3 /* 2 = 8kb, 3 = 16kb */
 
#define TX_BUF_1x2048   0
 
#define TX_BUF_2x2048   1
 
#define TX_BUF_2x4098   2
 
#define TX_BUF_2x8192   3
 
#define CONFIG_REG_1   7
 
#define POWERUP   BIT(5)
 
#define TRANSMIT_START_REG   10
 
#define TRANSMIT_START_RB   2
 
#define TX_START   BIT(7) /* Rest of register bit indicate*/
 
#define NODE_ID_0   8
 
#define NODE_ID_RB   0
 
#define HASH_TABLE_0   8
 
#define HASH_TABLE_RB   1
 
#define BUFFER_MEM_PORT_LB   8
 
#define DATAPORT   BUFFER_MEM_PORT_LB
 
#define BUFFER_MEM_PORT_HB   9
 
#define COL_16_REG   11
 
#define HALT_ON_16   0x00
 
#define RETRANS_AND_HALT_ON_16   0x02
 
#define MAX_COL_16   10
 
#define TRANSCEIVER_MODE_REG   13
 
#define TRANSCEIVER_MODE_RB   2
 
#define IO_BASE_UNLOCK   BIT(7)
 
#define LOWER_SQUELCH_TRESH   BIT(6)
 
#define LINK_TEST_DISABLE   BIT(5)
 
#define AUI_SELECT   BIT(4)
 
#define DIS_AUTO_PORT_SEL   BIT(3)
 
#define FILTER_SELF_RX_REG   14
 
#define SKIP_RX_PACKET   BIT(2)
 
#define FILTER_SELF_RECEIVE   BIT(0)
 
#define EEPROM_CTRL_REG   16
 
#define EEPROM_DATA_REG   17
 
#define CS_0   0x00
 
#define CS_1   0x20
 
#define SK_0   0x00
 
#define SK_1   0x40
 
#define DI_0   0x00
 
#define DI_1   0x80
 
#define EEPROM_READ   0x80
 
#define E_NODEID_0   0x02
 
#define E_NODEID_1   0x03
 
#define E_NODEID_2   0x04
 
#define E_PORT_SELECT   0x14
 
#define E_PORT_BNC   0x00
 
#define E_PORT_DIX   0x01
 
#define E_PORT_TP   0x02
 
#define E_PORT_AUTO   0x03
 
#define E_PORT_FROM_EPROM   0x04
 
#define E_PRODUCT_CFG   0x30
 
#define eeprom_slow_io()   do { int _i = 40; while(--_i > 0) { inb(0x80); }}while(0)
 
#define JUMPERLESS_CONFIG   19
 
#define ID_ROM_0   24
 
#define ID_ROM_7   31
 
#define RESET   ID_ROM_0
 
#define NUM_OF_ISA_IRQS   4
 
#define EISA_IRQ_REG   0xc89
 
#define NUM_OF_EISA_IRQS   8
 
#define ETH16I_DEBUG   0
 

Functions

struct net_device *__init eth16i_probe (int unit)
 

Macro Definition Documentation

#define ACCEPT_ALL   3

Definition at line 242 of file eth16i.c.

#define ACCEPT_BAD_PACKETS   BIT(5)

Definition at line 235 of file eth16i.c.

#define ACCEPT_SHORT_PACKETS   BIT(3)

Definition at line 237 of file eth16i.c.

#define ADDRESS_FILTER_MODE   BIT(1) | BIT(0)

Definition at line 240 of file eth16i.c.

#define ALIGN_ERR   BIT(2)

Definition at line 210 of file eth16i.c.

#define AUI_SELECT   BIT(4)

Definition at line 301 of file eth16i.c.

#define BITCLR (   ioaddr,
  bnum 
)    ((outb(((inb(ioaddr)) & (~(bnum))), ioaddr)))

Definition at line 172 of file eth16i.c.

#define BITSET (   ioaddr,
  bnum 
)    ((outb(((inb(ioaddr)) | (bnum)), ioaddr)))

Definition at line 171 of file eth16i.c.

#define BUFFER_MEM_PORT_HB   9

Definition at line 285 of file eth16i.c.

#define BUFFER_MEM_PORT_LB   8

Definition at line 283 of file eth16i.c.

#define BUFFER_WIDTH_8   BIT(4) /* 1 = 8bit, 0 = 16bit */

Definition at line 251 of file eth16i.c.

#define BUS_RD_ERR   BIT(6)

Definition at line 208 of file eth16i.c.

#define COL_16_REG   11

Definition at line 288 of file eth16i.c.

#define COLLISION   BIT(2)

Definition at line 202 of file eth16i.c.

#define COLLISIONS_16   BIT(1)

Definition at line 203 of file eth16i.c.

#define CONFIG_REG_0   6

Definition at line 247 of file eth16i.c.

#define CONFIG_REG_1   7

Definition at line 266 of file eth16i.c.

#define CONTROL_OUTPUT   BIT(2)

Definition at line 230 of file eth16i.c.

#define CR_LOST   BIT(4)

Definition at line 200 of file eth16i.c.

#define CRC_ERR   BIT(1)

Definition at line 211 of file eth16i.c.

#define CS_0   0x00

Definition at line 316 of file eth16i.c.

#define CS_1   0x20

Definition at line 317 of file eth16i.c.

#define DATAPORT   BUFFER_MEM_PORT_LB

Definition at line 284 of file eth16i.c.

#define DI_0   0x00

Definition at line 320 of file eth16i.c.

#define DI_1   0x80

Definition at line 321 of file eth16i.c.

#define DIS_AUTO_PORT_SEL   BIT(3)

Definition at line 302 of file eth16i.c.

#define DLC_EN   BIT(7)

Definition at line 248 of file eth16i.c.

#define E_NODEID_0   0x02

Definition at line 327 of file eth16i.c.

#define E_NODEID_1   0x03

Definition at line 328 of file eth16i.c.

#define E_NODEID_2   0x04

Definition at line 329 of file eth16i.c.

#define E_PORT_AUTO   0x03

Definition at line 334 of file eth16i.c.

#define E_PORT_BNC   0x00

Definition at line 331 of file eth16i.c.

#define E_PORT_DIX   0x01

Definition at line 332 of file eth16i.c.

#define E_PORT_FROM_EPROM   0x04

Definition at line 335 of file eth16i.c.

#define E_PORT_SELECT   0x14

Definition at line 330 of file eth16i.c.

#define E_PORT_TP   0x02

Definition at line 333 of file eth16i.c.

#define E_PRODUCT_CFG   0x30

Definition at line 336 of file eth16i.c.

#define EEPROM_CTRL_REG   16

Definition at line 310 of file eth16i.c.

#define EEPROM_DATA_REG   17

Definition at line 313 of file eth16i.c.

#define EEPROM_READ   0x80

Definition at line 324 of file eth16i.c.

#define eeprom_slow_io ( )    do { int _i = 40; while(--_i > 0) { inb(0x80); }}while(0)

Definition at line 340 of file eth16i.c.

#define EISA_IRQ_REG   0xc89

Definition at line 366 of file eth16i.c.

#define ETH16I_DEBUG   0

Definition at line 373 of file eth16i.c.

#define ETH16I_INTR_OFF   0x0000

Definition at line 185 of file eth16i.c.

#define ETH16I_INTR_ON   0xef8a /* Higher is receive mask */

Definition at line 184 of file eth16i.c.

#define ETH16I_IO_EXTENT   32

Definition at line 175 of file eth16i.c.

#define ETH16I_TX_BUF_SIZE   3 /* 2 = 8kb, 3 = 16kb */

Definition at line 258 of file eth16i.c.

#define FILTER_SELF_RECEIVE   BIT(0)

Definition at line 307 of file eth16i.c.

#define FILTER_SELF_RX_REG   14

Definition at line 305 of file eth16i.c.

#define HALT_ON_16   0x00

Definition at line 289 of file eth16i.c.

#define HASH_TABLE_0   8

Definition at line 279 of file eth16i.c.

#define HASH_TABLE_RB   1

Definition at line 280 of file eth16i.c.

#define ID_ROM_0   24

Definition at line 346 of file eth16i.c.

#define ID_ROM_7   31

Definition at line 347 of file eth16i.c.

#define IO_BASE_UNLOCK   BIT(7)

Definition at line 298 of file eth16i.c.

#define JUMPERLESS_CONFIG   19

Definition at line 343 of file eth16i.c.

#define LINK_TEST_DISABLE   BIT(5)

Definition at line 300 of file eth16i.c.

#define LOOPBACK_CONTROL   BIT(1)

Definition at line 229 of file eth16i.c.

#define LOWER_SQUELCH_TRESH   BIT(6)

Definition at line 299 of file eth16i.c.

#define MAX_COL_16   10

Definition at line 293 of file eth16i.c.

#define MAX_RX_LOOP   20

Definition at line 181 of file eth16i.c.

#define MODE_1   1 /* NODE ID, BC, MC, 2-24th bit */

Definition at line 243 of file eth16i.c.

#define MODE_2   2 /* NODE ID, BC, MC, Hash Table */

Definition at line 244 of file eth16i.c.

#define NET_BUSY   BIT(6)

Definition at line 198 of file eth16i.c.

#define NODE_ID_0   8

Definition at line 275 of file eth16i.c.

#define NODE_ID_RB   0

Definition at line 276 of file eth16i.c.

#define NUM_OF_EISA_IRQS   8

Definition at line 367 of file eth16i.c.

#define NUM_OF_ISA_IRQS   4

Definition at line 362 of file eth16i.c.

#define PKT_ALIGN_ERR   BIT(2)

Definition at line 191 of file eth16i.c.

#define PKT_CRC_ERR   BIT(1)

Definition at line 192 of file eth16i.c.

#define PKT_GOOD   BIT(5)

Definition at line 188 of file eth16i.c.

#define PKT_GOOD_RMT   BIT(4)

Definition at line 189 of file eth16i.c.

#define PKT_RX_BUF_OVERFLOW   BIT(0)

Definition at line 193 of file eth16i.c.

#define PKT_SHORT   BIT(3)

Definition at line 190 of file eth16i.c.

#define POWERUP   BIT(5)

Definition at line 267 of file eth16i.c.

#define RECEIVE_MODE_REG   5

Definition at line 233 of file eth16i.c.

#define RECEIVE_SHORT_ADDR   BIT(4)

Definition at line 236 of file eth16i.c.

#define REJECT_ALL   0

Definition at line 241 of file eth16i.c.

#define REMOTE_RESET   BIT(2)

Definition at line 238 of file eth16i.c.

#define RESET   ID_ROM_0

Definition at line 348 of file eth16i.c.

#define RETRANS_AND_HALT_ON_16   0x02

Definition at line 290 of file eth16i.c.

#define RX_BUF_OVERFLOW   BIT(0)

Definition at line 212 of file eth16i.c.

#define RX_BUFFER_EMPTY   BIT(6)

Definition at line 234 of file eth16i.c.

#define RX_INTR_BUF_OVERFLOW   BIT(0)

Definition at line 225 of file eth16i.c.

#define RX_INTR_CRC_ERR   BIT(1)

Definition at line 224 of file eth16i.c.

#define RX_INTR_RECEIVE   BIT(7)

Definition at line 222 of file eth16i.c.

#define RX_INTR_REG   3

Definition at line 221 of file eth16i.c.

#define RX_INTR_SHORT_PKT   BIT(3)

Definition at line 223 of file eth16i.c.

#define RX_PKT   BIT(7) /* Packet received */

Definition at line 207 of file eth16i.c.

#define RX_STATUS_REG   1

Definition at line 206 of file eth16i.c.

#define SHORT_PKT_ERR   BIT(3)

Definition at line 209 of file eth16i.c.

#define SK_0   0x00

Definition at line 318 of file eth16i.c.

#define SK_1   0x40

Definition at line 319 of file eth16i.c.

#define SKIP_RX_PACKET   BIT(2)

Definition at line 306 of file eth16i.c.

#define SRAM_BS0   BIT(0) /* 10=32kb, 11=64kb */

Definition at line 255 of file eth16i.c.

#define SRAM_BS1   BIT(1) /* 00=8kb, 01=16kb */

Definition at line 254 of file eth16i.c.

#define SRAM_CYCLE_TIME_100NS   BIT(6)

Definition at line 249 of file eth16i.c.

#define SYSTEM_BUS_WIDTH_8   BIT(5) /* 1 = 8bit, 0 = 16bit */

Definition at line 250 of file eth16i.c.

#define TBS0   BIT(2)

Definition at line 253 of file eth16i.c.

#define TBS1   BIT(3)

Definition at line 252 of file eth16i.c.

#define TRANSCEIVER_MODE_RB   2

Definition at line 297 of file eth16i.c.

#define TRANSCEIVER_MODE_REG   13

Definition at line 296 of file eth16i.c.

#define TRANSMIT_MODE_REG   4

Definition at line 228 of file eth16i.c.

#define TRANSMIT_START_RB   2

Definition at line 271 of file eth16i.c.

#define TRANSMIT_START_REG   10

Definition at line 270 of file eth16i.c.

#define TX_BUF_1x2048   0

Definition at line 260 of file eth16i.c.

#define TX_BUF_2x2048   1

Definition at line 261 of file eth16i.c.

#define TX_BUF_2x4098   2

Definition at line 262 of file eth16i.c.

#define TX_BUF_2x8192   3

Definition at line 263 of file eth16i.c.

#define TX_DONE   BIT(7)

Definition at line 197 of file eth16i.c.

#define TX_INTR_16_COL   BIT(1)

Definition at line 218 of file eth16i.c.

#define TX_INTR_COL   BIT(2)

Definition at line 217 of file eth16i.c.

#define TX_INTR_DONE   BIT(7)

Definition at line 216 of file eth16i.c.

#define TX_INTR_REG   2

Definition at line 215 of file eth16i.c.

#define TX_JABBER_ERR   BIT(3)

Definition at line 201 of file eth16i.c.

#define TX_PKT_RCD   BIT(5)

Definition at line 199 of file eth16i.c.

#define TX_START   BIT(7) /* Rest of register bit indicate*/

Definition at line 272 of file eth16i.c.

#define TX_STATUS_REG   0

Definition at line 196 of file eth16i.c.

#define TX_TIMEOUT   (400*HZ/1000)

Definition at line 178 of file eth16i.c.

Function Documentation

struct net_device* __init eth16i_probe ( int  unit)
read

Definition at line 455 of file eth16i.c.