[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1624145073-12674-4-git-send-email-schmitzmic@gmail.com>
Date: Sun, 20 Jun 2021 11:24:33 +1200
From: Michael Schmitz <schmitzmic@...il.com>
To: linux-m68k@...r.kernel.org, geert@...ux-m68k.org
Cc: alex@...ik.de, Michael Schmitz <schmitzmic@...il.com>,
netdev@...r.kernel.org
Subject: [PATCH netdev v6 3/3] net/8390: apne.c - autoprobe 100 Mbit mode in apne.c driver
Add experimental autoprobe code to detect 16 bit/100 MBit
cards to the APNE driver. Autoprobe uses the same code utilized
in apne_probe1 to identify the 8390 chip - failure to identify
the chip in 8 bit mode will switch the PCMCIA interface to 16
bit mode. This code is still untested!
This patch depends on patch "m68k: io_mm.h - add APNE 100
MBit support" sent to linux-m68k, and must not be applied
before that one!
CC: netdev@...r.kernel.org
Link: https://lore.kernel.org/r/1622958877-2026-1-git-send-email-schmitzmic@gmail.com
Signed-off-by: Michael Schmitz <schmitzmic@...il.com>
---
drivers/net/ethernet/8390/apne.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/net/ethernet/8390/apne.c b/drivers/net/ethernet/8390/apne.c
index 4dd721e..ec165f8 100644
--- a/drivers/net/ethernet/8390/apne.c
+++ b/drivers/net/ethernet/8390/apne.c
@@ -156,6 +156,22 @@ struct net_device * __init apne_probe(int unit)
return ERR_PTR(-ENODEV);
}
+ /* Reset card. Who knows what dain-bramaged state it was left in. */
+ {
+ unsigned long reset_end_time = jiffies + msecs_to_jiffies(20);
+
+ outb(inb(IOBASE + NE_RESET), IOBASE + NE_RESET);
+
+ while ((inb(IOBASE + NE_EN0_ISR) & ENISR_RESET) == 0)
+ if (time_after(jiffies, reset_end_time)) {
+ pr_info("Card not found (no reset ack).\n");
+ isa_type = ISA_TYPE_AG16;
+ break;
+ }
+
+ outb(0xff, IOBASE + NE_EN0_ISR); /* Ack all intr. */
+ }
+
dev = alloc_ei_netdev();
if (!dev)
return ERR_PTR(-ENOMEM);
--
2.7.4
Powered by blists - more mailing lists