From owner-svn-src-all@FreeBSD.ORG Sun Mar 15 02:31:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11DD4106564A; Sun, 15 Mar 2009 02:31:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9EF08FC12; Sun, 15 Mar 2009 02:31:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2F2VY98014528; Sun, 15 Mar 2009 02:31:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2F2VYTg014527; Sun, 15 Mar 2009 02:31:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903150231.n2F2VYTg014527@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Mar 2009 02:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189843 - head/sys/dev/fe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Mar 2009 02:31:35 -0000 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:;