tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

cdce alternate interface settings support



A month ago a message was posted about the Surfboard cable modem not
working using the usb cdce driver. This is because the Surfboard
uses an alternate interface setting, that the driver does not support.
I thought about adding a loop checking all the alternates, but am
currently thinking this is really device specific, so I added a flag
that can be set per device. In the attached patch the flag uses the
next available bit, but maybe by value rather than bit would be better,
as this would support more options. The patch is against 4.0, but even
the latest code also needs the mod to call ether_ioctl rather than
doing the ioctl locally(i.e. needs changes similar to that reported in
bug 36592).

-- 
Cliff Wright <cliff%snipe444.org@localhost>
--- sys/dev/usb/if_cdce.c.distrib       2006-11-15 17:33:26.000000000 -0800
+++ sys/dev/usb/if_cdce.c       2009-02-03 14:39:46.000000000 -0800
@@ -121,6 +121,7 @@
   {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SL5600 }, CDCE_ZAURUS | CDCE_NO_UNION 
},
   {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_C700 }, CDCE_ZAURUS | CDCE_NO_UNION },
   {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_C750 }, CDCE_ZAURUS | CDCE_NO_UNION },
+  {{ USB_VENDOR_GENERALINSTMNTS, USB_PRODUCT_GENERALINSTMNTS_SB4100 }, 
CDCE_ALT_1},
 };
 #define cdce_lookup(v, p) ((const struct cdce_type *)usb_lookup(cdce_devs, v, 
p))
 
@@ -207,6 +208,10 @@
                USB_ATTACH_ERROR_RETURN;
        }
 
+       /* Surfboard modem uses alternate interface settings */
+       if (sc->cdce_flags & CDCE_ALT_1)
+           usbd_set_interface(sc->cdce_data_iface, 1);
+
        /* Find endpoints. */
        id = usbd_get_interface_descriptor(sc->cdce_data_iface);
        sc->cdce_bulkin_no = sc->cdce_bulkout_no = -1;
--- sys/dev/usb/if_cdcereg.h.distrib    2005-12-11 04:24:00.000000000 -0800
+++ sys/dev/usb/if_cdcereg.h    2009-02-03 14:37:18.000000000 -0800
@@ -43,6 +43,7 @@
        u_int16_t                cdce_flags;
 #define CDCE_ZAURUS    1
 #define CDCE_NO_UNION  2
+#define CDCE_ALT_1     4       /* 1st Alternate interface settings */
 };
 
 struct cdce_softc;


Home | Main Index | Thread Index | Old Index