From d557a26b8046f4455ceecf4d56c5933b014756e2 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 15 Mar 2009 02:31:34 +0000 Subject: [PATCH] Generalize the workaround for the Hitachi HT-4840-11. The Contec C-NET(PC) has a cfe at location 1 that has both an odd irq mask (it matches pc98 machines, so maybe it was a flag for pc98 operation) as well as a memory map. Since this driver doesn't know how to cope, we start with cfe2, which is purely an I/O space mapped and that seems to make it work. I say 'seems' here, because the card I have doesn't seem to have the right dongle for full testing... --- sys/dev/fe/if_fe_pccard.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/dev/fe/if_fe_pccard.c b/sys/dev/fe/if_fe_pccard.c index 40c10ee1b972..e72a0a8bc53c 100644 --- a/sys/dev/fe/if_fe_pccard.c +++ b/sys/dev/fe/if_fe_pccard.c @@ -62,9 +62,10 @@ static int fe_pccard_detach(device_t); static const struct fe_pccard_product { struct pccard_product mpp_product; int mpp_flags; + int mpp_cfe; #define MPP_MBH10302 1 #define MPP_ANYFUNC 2 -#define MPP_SKIP_TO_CFE_10 4 +#define MPP_SKIP_TO_CFE 4 } fe_pccard_products[] = { /* These need to be first */ { PCMCIA_CARD(FUJITSU2, FMV_J181), MPP_MBH10302 }, @@ -77,11 +78,11 @@ static const struct fe_pccard_product { #if 0 /* XXX 86960-based? */ { PCMCIA_CARD(TDK, LAK_DFL9610), 0 }, #endif - { PCMCIA_CARD(CONTEC, CNETPC), 0 }, + { PCMCIA_CARD(CONTEC, CNETPC), MPP_SKIP_TO_CFE, 2 }, { PCMCIA_CARD(FUJITSU, LA501), 0 }, { PCMCIA_CARD(FUJITSU, LA10S), 0 }, { PCMCIA_CARD(FUJITSU, NE200T), MPP_MBH10302 },/* Sold by Eagle */ - { PCMCIA_CARD(HITACHI, HT_4840), MPP_MBH10302 | MPP_SKIP_TO_CFE_10}, + { PCMCIA_CARD(HITACHI, HT_4840), MPP_MBH10302 | MPP_SKIP_TO_CFE, 10 }, { PCMCIA_CARD(RATOC, REX_R280), 0 }, { PCMCIA_CARD(XIRCOM, CE), MPP_ANYFUNC }, { { NULL } } @@ -108,13 +109,13 @@ fe_pccard_probe(device_t dev) return (error); if (fcn != PCCARD_FUNCTION_NETWORK) return (ENXIO); - if (pp->mpp_flags & MPP_SKIP_TO_CFE_10) { - for (i = 10; i < 27; i++) { + if (pp->mpp_flags & MPP_SKIP_TO_CFE) { + for (i = pp->mpp_cfe; i < 32; i++) { if (pccard_select_cfe(dev, i) == 0) goto good; } device_printf(dev, - "Hitachi HT-4840-11 workaround failed\n"); + "Failed to map CFE %d or higher\n", pp->mpp_cfe); return ENXIO; } good:;