26 #include <linux/module.h>
27 #include <linux/kernel.h>
28 #include <linux/errno.h>
30 #include <linux/netdevice.h>
43 static unsigned int hppclan_portlist[]
__initdata =
44 { 0x300, 0x320, 0x340, 0x280, 0x2C0, 0x200, 0x240, 0};
46 #define HP_IO_EXTENT 32
48 #define HP_DATAPORT 0x0c
50 #define HP_CONFIGURE 0x08
53 #define HP_DATAON 0x10
54 #define NIC_OFFSET 0x10
56 #define HP_START_PG 0x00
57 #define HP_8BSTOP_PG 0x80
58 #define HP_16BSTOP_PG 0xFF
68 const unsigned char *
buf,
int start_page);
74 static char irqmap[16]
__initdata= { 0, 0, 4, 6, 8,10, 0,14, 0, 4, 2,12,0,0,0,0};
87 if (base_addr > 0x1ff)
88 return hp_probe1(dev, base_addr);
89 else if (base_addr != 0)
92 for (i = 0; hppclan_portlist[
i]; i++) {
93 if (hp_probe1(dev, hppclan_portlist[i]) == 0)
113 err = do_hp_probe(dev);
127 static unsigned version_printed;
135 if (
inb(ioaddr) != 0x08
136 ||
inb(ioaddr+1) != 0x00
137 ||
inb(ioaddr+2) != 0x09
138 ||
inb(ioaddr+14) == 0x57) {
145 if ((board_id =
inb(ioaddr +
HP_ID)) & 0x80) {
153 if (
ei_debug && version_printed++ == 0)
156 printk(
"%s: %s (ID %02x) at %#3x,", dev->
name, name, board_id, ioaddr);
165 static const int irq_16list[] = { 11, 10, 5, 3, 4, 7, 9, 0};
166 static const int irq_8list[] = { 7, 5, 3, 4, 9, 0};
167 const int *irqp = wordmode ? irq_16list : irq_8list;
177 printk(
" selecting IRQ %d.\n", irq);
184 printk(
" no free IRQ lines.\n");
192 printk (
" unable to get IRQ %d.\n", dev->
irq);
208 ei_status.get_8390_hdr = hp_get_8390_hdr;
210 ei_status.block_output = hp_block_output;
230 if (
ei_debug > 1)
printk(
"resetting the 8390 time=%ld...", jiffies);
240 printk(
"%s: hp_reset_8390() did not complete.\n", dev->
name);
277 int xfer_count =
count;
290 buf[count-1] =
inb(nic_base - NIC_OFFSET +
HP_DATAPORT), xfer_count++;
298 int addr = (high << 8) + low;
300 if (((ring_offset + xfer_count) & 0xff) != (addr & 0xff))
301 printk(
"%s: RX transfer address mismatch, %#4.4x vs. %#4.4x (actual).\n",
302 dev->
name, ring_offset + xfer_count, addr);
308 hp_block_output(
struct net_device *dev,
int count,
309 const unsigned char *buf,
int start_page)
323 #ifdef NE8390_RW_BUGFIX
356 int addr = (high << 8) + low;
357 if ((start_page << 8) + count !=
addr)
358 printk(
"%s: TX Transfer address mismatch, %#4.4x vs. %#4.4x.\n",
375 #define MAX_HP_CARDS 4
376 static struct net_device *dev_hp[MAX_HP_CARDS];
377 static int io[MAX_HP_CARDS];
378 static int irq[MAX_HP_CARDS];
393 int this_dev, found = 0;
395 for (this_dev = 0; this_dev < MAX_HP_CARDS; this_dev++) {
396 if (io[this_dev] == 0) {
397 if (this_dev != 0)
break;
398 printk(
KERN_NOTICE "hp.c: Presently autoprobing (not recommended) for a single card.\n");
400 dev = alloc_eip_netdev();
403 dev->
irq = irq[this_dev];
405 if (do_hp_probe(dev) == 0) {
406 dev_hp[found++] =
dev;
418 static void cleanup_card(
struct net_device *dev)
429 for (this_dev = 0; this_dev < MAX_HP_CARDS; this_dev++) {