2 #error multicast support is not yet implemented 56 #define LAN595FX_10ISA 3 58 #define SLOW_DOWN inb(0x80); 65 #define GetBit(x,y) ((x & (1<<y))>>y) 71 #define ee_FlashAddr 3 72 #define ee_FlashMask 0x7 74 #define ee_reserved0 7 83 #define ee_IntMask 0x7 91 #define ee_reserved1 10 92 #define ee_AltReady 13 93 #define ee_reserved2 14 106 #define ee_BootType 1 107 #define ee_BootTypeMask 0x3 109 #define ee_FlashSock 4 113 #define ee_PowerMgt 10 115 #define ee_CPMask 0x7 118 #define ee_Stepping 0 119 #define ee_StepMask 0x0F 121 #define ee_BoardMask 0x0FFF 124 #define ee_INT_TO_IRQ 0 125 #define ee_FX_INT2IRQ 0x1EB8 129 #define ee_Checksum 0xBABA 133 #define ee_addr_vendor 0x10 134 #define ee_addr_id 0x11 135 #define ee_addr_SN 0x12 136 #define ee_addr_CRC_8 0x14 139 #define ee_vendor_intel0 0x25 140 #define ee_vendor_intel1 0xD4 141 #define ee_id_eepro10p0 0x10 142 #define ee_id_eepro10p1 0x31 148 #define RAM_SIZE 0x8000 151 #define RCV_DEFAULT_RAM 0x6000 152 #define RCV_RAM rcv_ram 157 #define XMT_RAM (RAM_SIZE - RCV_RAM) 159 #define XMT_START ((rcv_start + RCV_RAM) % RAM_SIZE) 161 #define RCV_LOWER_LIMIT (rcv_start >> 8) 162 #define RCV_UPPER_LIMIT (((rcv_start + RCV_RAM) - 2) >> 8) 163 #define XMT_LOWER_LIMIT (XMT_START >> 8) 164 #define XMT_UPPER_LIMIT (((XMT_START + XMT_RAM) - 2) >> 8) 166 #define RCV_START_PRO 0x00 167 #define RCV_START_10 XMT_RAM 171 #define RCV_DONE 0x0008 173 #define RX_ERROR 0x0d81 175 #define TX_DONE_BIT 0x0080 176 #define CHAIN_BIT 0x8000 177 #define XMT_STATUS 0x02 178 #define XMT_CHAIN 0x04 179 #define XMT_COUNT 0x06 181 #define BANK0_SELECT 0x00 182 #define BANK1_SELECT 0x40 183 #define BANK2_SELECT 0x80 186 #define COMMAND_REG 0x00 187 #define MC_SETUP 0x03 189 #define DIAGNOSE_CMD 0x07 190 #define RCV_ENABLE_CMD 0x08 191 #define RCV_DISABLE_CMD 0x0a 192 #define STOP_RCV_CMD 0x0b 193 #define RESET_CMD 0x0e 194 #define POWER_DOWN_CMD 0x18 195 #define RESUME_XMT_CMD 0x1c 196 #define SEL_RESET_CMD 0x1e 197 #define STATUS_REG 0x01 200 #define EXEC_STATUS 0x30 202 #define R_ROBIN_BITS 0xc0 203 #define ID_REG_MASK 0x2c 204 #define ID_REG_SIG 0x24 205 #define AUTO_ENABLE 0x10 206 #define INT_MASK_REG 0x03 207 #define RX_STOP_MASK 0x01 210 #define EXEC_MASK 0x08 211 #define ALL_MASK 0x0f 212 #define IO_32_BIT 0x10 214 #define RCV_STOP 0x06 216 #define XMT_BAR_PRO 0x0a 217 #define XMT_BAR_10 0x0b 220 #define HOST_ADDRESS_REG 0x0c 222 #define IO_PORT_32_BIT 0x0c 226 #define WORD_WIDTH 0x02 227 #define INT_ENABLE 0x80 228 #define INT_NO_REG 0x02 229 #define RCV_LOWER_LIMIT_REG 0x08 230 #define RCV_UPPER_LIMIT_REG 0x09 232 #define XMT_LOWER_LIMIT_REG_PRO 0x0a 233 #define XMT_UPPER_LIMIT_REG_PRO 0x0b 234 #define XMT_LOWER_LIMIT_REG_10 0x0b 235 #define XMT_UPPER_LIMIT_REG_10 0x0a 240 #define XMT_Chain_Int 0x20 241 #define XMT_Chain_ErrStop 0x40 242 #define RCV_Discard_BadFrame 0x80 244 #define PRMSC_Mode 0x01 245 #define Multi_IA 0x20 251 #define A_N_ENABLE 0x02 253 #define I_ADD_REG0 0x04 254 #define I_ADD_REG1 0x05 255 #define I_ADD_REG2 0x06 256 #define I_ADD_REG3 0x07 257 #define I_ADD_REG4 0x08 258 #define I_ADD_REG5 0x09 260 #define EEPROM_REG_PRO 0x0a 261 #define EEPROM_REG_10 0x0b 273 #define eeprom_delay() { udelay(40); } 274 #define EE_READ_CMD (6 << 6) 277 #define eepro_full_reset(ioaddr) outb(RESET_CMD, ioaddr); udelay(255); 280 #define eepro_sel_reset(ioaddr) \ 282 outb ( SEL_RESET_CMD, ioaddr ); \ 288 #define eepro_clear_int(ioaddr) outb(ALL_MASK, ioaddr + STATUS_REG) 291 #define eepro_en_rx(ioaddr) outb(RCV_ENABLE_CMD, ioaddr) 294 #define eepro_dis_rx(ioaddr) outb(RCV_DISABLE_CMD, ioaddr) 297 #define eepro_sw2bank0(ioaddr) outb(BANK0_SELECT, ioaddr) 298 #define eepro_sw2bank1(ioaddr) outb(BANK1_SELECT, ioaddr) 299 #define eepro_sw2bank2(ioaddr) outb(BANK2_SELECT, ioaddr) 317 DBG(
"Stepping %d\n", temp_reg >> 5);
359 unsigned int rcv_event, rcv_status, rcv_next_frame, rcv_size;
377 if ( ! retrieve )
return 1;
383 printf(
"%hX %hX %d %hhX\n", rcv_status, rcv_next_frame, rcv_size,
387 printf(
"Receive error %hX\n", rcv_status);
395 for (i = 0; i < 48; i++) {
397 putchar(i % 16 == 15 ?
'\n' :
' ');
462 while (boguscount > 0) {
468 if ((
status & 0x2000) == 0) {
505 unsigned short retval = 0;
515 outb(ctrl_val, ee_addr);
517 for (i = 8; i >= 0; i--) {
518 short outval = (
read_cmd & (1 << i)) ? ctrl_val |
EEDI : ctrl_val;
519 outb(outval, ee_addr);
522 outb(outval, ee_addr);
525 outb(ctrl_val, ee_addr);
526 for (i = 16; i > 0; i--) {
530 outb(ctrl_val, ee_addr);
537 outb(ctrl_val, ee_addr);
580 if ( ( station_addr.saddr[2] == 0x0000 ) ||
581 ( station_addr.saddr[2] == 0xFFFF ) ) {
593 name =
"Intel EtherExpress 10 ISA";
595 name =
"Intel EtherExpress Pro/10+ ISA";
597 }
else if (station_addr.saddr[0] ==
SA_ADDR1) {
598 name =
"Intel EtherExpress Pro/10 ISA";
602 name =
"Intel 82595-based LAN card";
604 station_addr.saddr[0] =
bswap_16(station_addr.saddr[0]);
605 station_addr.saddr[1] =
bswap_16(station_addr.saddr[1]);
606 station_addr.saddr[2] =
bswap_16(station_addr.saddr[2]);
631 0x300, 0x210, 0x240, 0x280, 0x2C0, 0x200, 0x320, 0x340, 0x360,
640 ISA_ROM (
"eepro",
"Intel Etherexpress Pro/10" );
#define XMT_LOWER_LIMIT_REG_10
#define eepro_sel_reset(ioaddr)
uint16_t ioaddr
I/O address.
ISA_ROM("eepro", "Intel Etherexpress Pro/10")
#define XMT_LOWER_LIMIT_REG_PRO
int printf(const char *fmt,...)
Write a formatted string to the console.
uint16_t inw(volatile uint16_t *io_addr)
Read 16-bit word from I/O-mapped device.
static unsigned int rx_start
#define outw(data, io_addr)
uint32_t type
Operating system type.
static int read_eeprom(uint16_t ioaddr, int location)
#define eepro_sw2bank2(ioaddr)
void outsw(volatile uint16_t *io_addr, const uint16_t *data, unsigned int count)
Write 16-bit words to I/O-mapped device.
static void eepro_irq(struct nic *nic __unused, irq_action_t action __unused)
static unsigned eeprom_reg
static struct nic_operations eepro_operations
static int eepro_probe(struct nic *nic, struct isa_device *isa)
static int eepro_probe1(isa_probe_addr_t ioaddr)
int dummy_connect(struct nic *nic __unused)
static unsigned int mem_start
static unsigned xmt_upper_limit_reg
static unsigned long ioaddr
static unsigned rcv_start
#define __unused
Declare a variable or data structure as unused.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
uint16_t isa_probe_addr_t
#define GENERIC_ISAPNP_VENDOR
static unsigned int mem_end
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
DRIVER("eepro", nic_driver, isa_driver, eepro_driver, eepro_probe, eepro_disable)
uint8_t id
Request identifier.
ISA_DRIVER(eepro_driver, eepro_probe_addrs, eepro_probe1, GENERIC_ISAPNP_VENDOR, 0x828a)
#define XMT_Chain_ErrStop
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#define XMT_UPPER_LIMIT_REG_PRO
static unsigned xmt_lower_limit_reg
#define eepro_sw2bank0(ioaddr)
void insw(volatile uint16_t *io_addr, uint16_t *data, unsigned int count)
Read 16-bit words from I/O-mapped device.
static void eepro_reset(struct nic *nic)
uint8_t inb(volatile uint8_t *io_addr)
Read byte from I/O-mapped device.
#define eepro_sw2bank1(ioaddr)
#define XMT_UPPER_LIMIT_REG_10
static isa_probe_addr_t eepro_probe_addrs[]
unsigned char * node_addr
#define outb(data, io_addr)
static void eepro_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p)
static int eepro_poll(struct nic *nic, int retrieve)
FILE_LICENCE(GPL2_OR_LATER)
uint32_t end
Ending offset.
#define RCV_Discard_BadFrame
static unsigned int tx_start
static unsigned int tx_end
#define eepro_clear_int(ioaddr)
#define DBG(...)
Print a debugging message.
struct nic_operations * nic_op
#define RCV_LOWER_LIMIT_REG
static struct command_descriptor read_cmd
"read" command descriptor
int(* connect)(struct nic *)
int putchar(int character)
Write a single character to each console device.
#define eepro_full_reset(ioaddr)
#define RCV_UPPER_LIMIT_REG
#define eepro_en_rx(ioaddr)
static void eepro_disable(struct nic *nic, struct isa_device *isa __unused)