I knocked up a debug version of etherh.c, built it into my kernel, and
came up with this:
etherh[eth0]: Starting find...
etherh[eth0]: Finished find.
etherh[eth0]: Scanning card at 0x0.
etherh[eth0]: Found card, initialising expansion card 0xc01ff3e0.
etherh[eth0]: Doing real probe on device 0xc0153e64...
etherh[eth0]: Identified as `600 '.
etherh[eth0]: Performing card setup...
etherh[eth0]: Completed card setup.
eth0: etherh 600 found at 8000ae00, IRQ11, ether address 00:c0:32:00:00:22
etherh[eth0]: Setting interface type (dev->mem_end=0xec).
10baseT
etherh[eth0]: Resetting card...
etherh[eth0]: Reset completed successfully.
etherh[eth0]: Setting interface type (dev->mem_end=0xec).
etherh[eth0]: Calling NS8390_init()...
etherh[eth1]: Starting find...
etherh[eth1]: Finished find.
etherh[eth1]: Doing real proe on device 0xc0153d84.
etherh[eth1]: Probing for device 0xc0153d84...
etherh[eth1]: Identified as `'.
Hope this helps. Debug driver diff attached.
--
Chris <[EMAIL PROTECTED]> ( http://www.fluff.org/chris )
--- /usr/src/linux/2.2.6/rmk/drivers/acorn/net/etherh.c Wed May 5 17:38:32 1999
+++ etherh.c Sat May 8 12:32:09 1999
@@ -13,6 +13,8 @@
* RMK 1.03 Added support for EtherLan500 cards
* 23-11-1997 RMK 1.04 Added media autodetection
* 16-04-1998 RMK 1.05 Improved media autodetection
+ * 08-05-1999 cmr 1.06 Fixed to stop it breaking resetting, and
+ * corrected a few textual messages
*
* Insmod Module Parameters
* ------------------------
@@ -49,6 +51,7 @@
#define NET_DEBUG 0
#define DEBUG_INIT 2
+#define ETHERH_DEBUG
static unsigned int net_debug = NET_DEBUG;
static const card_ids __init etherh_cids[] = {
@@ -59,9 +62,9 @@
};
MODULE_AUTHOR("Russell King");
-MODULE_DESCRIPTION("i3 EtherH driver");
+MODULE_DESCRIPTION("i-cubed EtherH driver");
-static char *version = "etherh [500/600/600A] ethernet driver (c) 1998 R.M.King
v1.05\n";
+static char *version = "EtherH 500/600/600A Ethernet NIC driver (c) 1999 Russell King
+v1.06\n";
#define ETHERH500_DATAPORT 0x200 /* MEMC */
#define ETHERH500_NS8390 0x000 /* MEMC */
@@ -109,6 +112,7 @@
unsigned long addr;
unsigned long flags;
+ ETHERH_DEBUG printk ("etherh[%s]: Setting interface type
+(dev->mem_end=0x%x).\n", dev->name, dev->mem_end);
save_flags_cli(flags);
/* set the interface type */
@@ -174,7 +178,9 @@
static void
etherh_reset(struct device *dev)
{
+ ETHERH_DEBUG printk ("etherh[%s]: Resetting card...\n", dev->name);
outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, dev->base_addr);
+ ETHERH_DEBUG printk ("etherh[%s]: Reset completed successfully.\n",
+dev->name);
etherh_setif(dev);
}
@@ -326,6 +332,7 @@
{
MOD_INC_USE_COUNT;
+ ETHERH_DEBUG printk ("etherh[%s]: Initialising board.\n", dev->name);
if (request_irq(dev->irq, ei_interrupt, 0, "etherh", dev)) {
MOD_DEC_USE_COUNT;
return -EAGAIN;
@@ -342,6 +349,7 @@
static int
etherh_close(struct device *dev)
{
+ ETHERH_DEBUG printk ("etherh[%s]: Closing board.\n", dev->name);
ei_close (dev);
free_irq (dev->irq, dev);
@@ -360,6 +368,8 @@
const char *dev_type;
const char *if_type;
+ ETHERH_DEBUG printk ("etherh[%s]: Probing for device 0x%x...\n", dev->name,
+dev);
+
addr = dev->base_addr;
if (net_debug && version_printed++ == 0)
@@ -378,14 +388,18 @@
default:
dev_type = "";
}
+ ETHERH_DEBUG printk ("etherh[%s]: Identified as `%s'.\n", dev->name,
+dev_type);
reg0 = inb (addr);
if (reg0 == 0xff) {
if (net_debug & DEBUG_INIT)
printk ("%s: etherh error: NS8390 command register wrong\n",
dev->name);
+ ETHERH_DEBUG printk ("etherh[%s]: NS8390 command register wrong.\n",
+dev->name);
return -ENODEV;
}
+ ETHERH_DEBUG printk ("etherh[%s]: Performing card setup...\n", dev->name);
+
outb (E8390_NODMA | E8390_PAGE1 | E8390_STOP, addr + E8390_CMD);
tmp = inb (addr + 13);
outb (0xff, addr + 13);
@@ -394,10 +408,12 @@
if (inb (addr + EN0_COUNTER0) != 0) {
if (net_debug & DEBUG_INIT)
printk ("%s: etherh error: NS8390 not found\n", dev->name);
+ ETHERH_DEBUG printk ("etherh[%s]: NS8390 not found.\n", dev->name);
outb (reg0, addr);
outb (tmp, addr + 13);
return -ENODEV;
}
+ ETHERH_DEBUG printk ("etherh[%s]: Completed card setup.\n", dev->name);
if (ethdev_init (dev))
return -ENOMEM;
@@ -424,11 +440,11 @@
/* select 10bT */
ei_status.interface_num = 0;
- if_type = "10BaseT";
+ if_type = "10baseT";
etherh_setif(dev);
mdelay(1);
if (!etherh_getifstat(dev)) {
- if_type = "10Base2";
+ if_type = "10base2";
ei_status.interface_num = 1;
etherh_setif(dev);
}
@@ -438,6 +454,7 @@
printk("%s\n", if_type);
etherh_reset(dev);
+ ETHERH_DEBUG printk ("etherh[%s]: Calling NS8390_init()...\n", dev->name);
NS8390_init (dev, 0);
return 0;
}
@@ -445,12 +462,14 @@
static void etherh_irq_enable(ecard_t *ec, int irqnr)
{
unsigned int ctrl_addr = (unsigned int)ec->irq_data;
+ ETHERH_DEBUG printk ("etherh: Enabling IRQ %d.\n", irqnr);
outb(inb(ctrl_addr) | ETHERH_CP_IE, ctrl_addr);
}
static void etherh_irq_disable(ecard_t *ec, int irqnr)
{
unsigned int ctrl_addr = (unsigned int)ec->irq_data;
+ ETHERH_DEBUG printk ("etherh: Disabling IRQ %d.\n", irqnr);
outb(inb(ctrl_addr) & ~ETHERH_CP_IE, ctrl_addr);
}
@@ -502,21 +521,25 @@
if (!dev)
return ENODEV;
+ ETHERH_DEBUG printk ("etherh[%s]: Starting find...\n", dev->name);
ecard_startfind();
+ ETHERH_DEBUG printk ("etherh[%s]: Finished find.\n", dev->name);
if (!dev->base_addr) {
struct expansion_card *ec;
-
+ ETHERH_DEBUG printk ("etherh[%s]: Scanning card at 0x%x.\n",
+dev->name, dev->base_addr);
if ((ec = ecard_find (0, etherh_cids)) == NULL)
return ENODEV;
-
+
+ ETHERH_DEBUG printk ("etherh[%s]: Found card, initialising expansion
+card 0x%x.\n", dev->name, ec);
etherh_initdev(ec, dev);
}
+ ETHERH_DEBUG printk ("etherh[%s]: Doing real probe on device 0x%x.\n",
+dev->name, dev);
return etherh_probe1(dev);
}
-#endif
-#ifdef MODULE
+#else
+
#define MAX_ETHERH_CARDS 2
static int io[MAX_ETHERH_CARDS];
@@ -567,7 +590,7 @@
my_ethers[i] = dev;
if (register_netdev(dev) != 0) {
- printk (KERN_WARNING "No etherh card found at %08lX\n",
dev->base_addr);
+ printk (KERN_WARNING "No EtherH card found at %08lX\n",
+dev->base_addr);
if (ec[i]) {
ecard_release(ec[i]);
ec[i] = NULL;