Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Mar 2009 02:31:34 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r189843 - head/sys/dev/fe
Message-ID:  <200903150231.n2F2VYTg014527@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sun Mar 15 02:31:34 2009
New Revision: 189843
URL: http://svn.freebsd.org/changeset/base/189843

Log:
  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...

Modified:
  head/sys/dev/fe/if_fe_pccard.c

Modified: head/sys/dev/fe/if_fe_pccard.c
==============================================================================
--- head/sys/dev/fe/if_fe_pccard.c	Sun Mar 15 01:39:16 2009	(r189842)
+++ head/sys/dev/fe/if_fe_pccard.c	Sun Mar 15 02:31:34 2009	(r189843)
@@ -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:;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903150231.n2F2VYTg014527>