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@xxxxxxxxxxxxxxx Link: https://lore.kernel.org/r/1622958877-2026-1-git-send-email-schmitzmic@xxxxxxxxx Signed-off-by: Michael Schmitz <schmitzmic@xxxxxxxxx> --- 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