24 #include <linux/module.h>
26 #include <linux/string.h>
27 #include <linux/kernel.h>
28 #include <linux/errno.h>
30 #include <linux/netdevice.h>
40 #define DRV_NAME "hp-plus"
43 static unsigned int hpplus_portlist[]
__initdata =
44 {0x200, 0x240, 0x280, 0x2C0, 0x300, 0x320, 0x340, 0};
72 #define HP_PAGING 0x02
73 #define HPP_OPTION 0x04
74 #define HPP_OUT_ADDR 0x08
75 #define HPP_IN_ADDR 0x0A
76 #define HP_DATAPORT 0x0c
77 #define NIC_OFFSET 0x10
78 #define HP_IO_EXTENT 32
80 #define HP_START_PG 0x00
81 #define HP_STOP_PG 0x80
105 const unsigned char *
buf,
int start_page);
111 const unsigned char *
buf,
int start_page);
125 if (base_addr > 0x1ff)
126 return hpp_probe1(dev, base_addr);
127 else if (base_addr != 0)
130 for (i = 0; hpplus_portlist[
i]; i++) {
131 if (hpp_probe1(dev, hpplus_portlist[i]) == 0)
151 err = do_hpp_probe(dev);
162 .ndo_open = hpp_open,
163 .ndo_stop = hpp_close,
171 #ifdef CONFIG_NET_POLL_CONTROLLER
172 .ndo_poll_controller = eip_poll,
182 const char name[] =
"HP-PC-LAN+";
184 static unsigned version_printed;
190 if (
inw(ioaddr +
HP_ID) != 0x4850 ||
196 if (
ei_debug && version_printed++ == 0)
199 printk(
"%s: %s at %#3x, ", dev->
name, name, ioaddr);
205 unsigned char inval =
inb(ioaddr + 8 + i);
209 checksum +=
inb(ioaddr + 14);
213 if (checksum != 0xff) {
214 printk(
" bad checksum %2.2x.\n", checksum);
226 int irq =
inb(ioaddr + 13) & 0x0f;
231 mem_start =
inw(ioaddr + 9) << 8;
232 printk(
", IRQ %d, memory address %#x.\n", irq, mem_start);
235 printk(
", IRQ %d, programmed-I/O mode.\n", irq);
254 ei_status.block_input = &hpp_io_block_input;
255 ei_status.block_output = &hpp_io_block_output;
256 ei_status.get_8390_hdr = &hpp_io_get_8390_hdr;
260 ei_status.block_input = &hpp_mem_block_input;
261 ei_status.block_output = &hpp_mem_block_output;
262 ei_status.get_8390_hdr = &hpp_mem_get_8390_hdr;
339 if (
ei_debug > 1)
printk(
"resetting the 8390 time=%ld...", jiffies);
351 printk(
"%s: hp_reset_8390() did not complete.\n", dev->
name);
398 hpp_mem_block_input(
struct net_device *dev,
int count,
struct sk_buff *skb,
int ring_offset)
418 hpp_io_block_output(
struct net_device *dev,
int count,
419 const unsigned char *buf,
int start_page)
427 hpp_mem_block_output(
struct net_device *dev,
int count,
428 const unsigned char *buf,
int start_page)
441 #define MAX_HPP_CARDS 4
442 static struct net_device *dev_hpp[MAX_HPP_CARDS];
443 static int io[MAX_HPP_CARDS];
444 static int irq[MAX_HPP_CARDS];
459 int this_dev, found = 0;
461 for (this_dev = 0; this_dev < MAX_HPP_CARDS; this_dev++) {
462 if (io[this_dev] == 0) {
463 if (this_dev != 0)
break;
464 printk(
KERN_NOTICE "hp-plus.c: Presently autoprobing (not recommended) for a single card.\n");
466 dev = alloc_eip_netdev();
469 dev->
irq = irq[this_dev];
471 if (do_hpp_probe(dev) == 0) {
472 dev_hpp[found++] =
dev;
476 printk(
KERN_WARNING "hp-plus.c: No HP-Plus card found (i/o = 0x%x).\n", io[this_dev]);
484 static void cleanup_card(
struct net_device *dev)
496 for (this_dev = 0; this_dev < MAX_HPP_CARDS; this_dev++) {