Author: imp
Date: Wed Mar 11 08:12:28 2009
New Revision: 189681
URL: http://svn.freebsd.org/changeset/base/189681

Log:
  Add support for Hitachi HT-4840-11.  This card is supposedly just like
  the J181, but not quite.  This card's CIS has some quirks that means
  we have to ignore CFE's 1-9.

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      Wed Mar 11 08:11:11 2009        
(r189680)
+++ head/sys/dev/fe/if_fe_pccard.c      Wed Mar 11 08:12:28 2009        
(r189681)
@@ -64,6 +64,7 @@ static const struct fe_pccard_product {
        int mpp_flags;
 #define MPP_MBH10302 1
 #define MPP_ANYFUNC 2
+#define MPP_SKIP_TO_CFE_10 4
 } fe_pccard_products[] = {
        /* These need to be first */
        { PCMCIA_CARD(FUJITSU2, FMV_J181), MPP_MBH10302 },
@@ -80,6 +81,7 @@ static const struct fe_pccard_product {
        { 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(RATOC, REX_R280), 0 },
        { PCMCIA_CARD(XIRCOM, CE), MPP_ANYFUNC },
         { { NULL } }
@@ -91,6 +93,7 @@ fe_pccard_probe(device_t dev)
        int             error;
        uint32_t        fcn = PCCARD_FUNCTION_UNSPEC;
         const struct fe_pccard_product *pp;
+       int i;
 
         if ((pp = (const struct fe_pccard_product *)pccard_product_lookup(dev,
            (const struct pccard_product *)fe_pccard_products,
@@ -105,6 +108,16 @@ 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 (pccard_select_cfe(dev, i) == 0)
+                                       goto good;
+                       }
+                       device_printf(dev,
+                           "Hitachi HT-4840-11 workaround failed\n");
+                       return ENXIO;
+               }
+       good:;
                return (0);
         }
         return (ENXIO);
@@ -126,6 +139,7 @@ static driver_t fe_pccard_driver = {
 };
 
 DRIVER_MODULE(fe, pccard, fe_pccard_driver, fe_devclass, 0, 0);
+MODULE_DEPEND(fe, pccard, 1, 1, 1);
 
 static int fe_probe_mbh(device_t, const struct fe_pccard_product *);
 static int fe_probe_tdk(device_t, const struct fe_pccard_product *);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to