Current-Users archive

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

Re: umodem(4) with "no pointer to data interface"



On Thu, Jan 23, 2014 at 08:09:03PM +1030, Brett Lymn wrote:
> 
> Yes, I agree that is probably not a wise thing to assume.  I think we
> should iterate over all the interfaces looking for a data interface if
> it is not a union with the control interface.  If you don't beat me to
> it I will try to get a patch done in the next day or so.
> 

OK, try the attached patches, I have added a quirk to usb_quirks.c (I
assume that you must have modified your usbdevs because I don't have
connexant in mine so I can't compile test...) and added code to
umodem_common.c so it will search for a data interface when it is not in
a union.  See how that goes.

-- 
Brett Lymn
Staple Guns: because duct tape doesn't make that KerCHUNK sound - xkcd.com
Index: usb_quirks.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usb_quirks.c,v
retrieving revision 1.79
diff -u -r1.79 usb_quirks.c
--- usb_quirks.c        28 Mar 2013 04:07:55 -0000      1.79
+++ usb_quirks.c        26 Jan 2014 09:17:57 -0000
@@ -142,6 +142,10 @@
        ANY, { UQ_ASSUME_CM_OVER_DATA }},
  { USB_VENDOR_ZOOM, USB_PRODUCT_ZOOM_3095,
        ANY, { UQ_LOST_CS_DESC }},
+ /* Connexant modems don't have a union for control and data */
+
+ { USB_VENDOR_CONEXANT, USB_PRODUCT_CONEXANT_USB56KMODEM1,
+       ANY,   { UQ_NO_UNION_NRM }},
  { 0, 0, 0, { 0 } }
 };
 
Index: umodem_common.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/umodem_common.c,v
retrieving revision 1.22
diff -u -r1.22 umodem_common.c
--- umodem_common.c     3 Nov 2010 22:34:24 -0000       1.22
+++ umodem_common.c     26 Jan 2014 08:58:29 -0000
@@ -152,6 +152,26 @@
                        }
                }
        }
+
+       /*
+        * if data interface is not a union of the control interface then
+        * hunt for it in the other interfaces.
+        */
+       if (sc->sc_data_iface == NULL) {
+               for (i = 0; i < uaa->nifaces; i++) {
+                       if (uaa->ifaces[i] != NULL) {
+                               id = usbd_get_interface_descriptor(
+                                       uaa->ifaces[i]);
+                               if (id != NULL &&
+                                   id->bInterfaceClass == UICLASS_CDC_DATA &&
+                                   id->bInterfaceSubClass == UISUBCLASS_DATA) {
+                                       sc->sc_data_iface = uaa->ifaces[i];
+                                       uaa->ifaces[i] = NULL;
+                               }
+                       }
+               }
+       }
+
        if (sc->sc_data_iface == NULL) {
                aprint_error_dev(self, "no data interface\n");
                goto bad;


Home | Main Index | Thread Index | Old Index