In on control endpoint

Steve Clark sclark at netwolves.com
Wed May 14 17:16:29 UTC 2008


Hans Petter Selasky wrote:
> Hi Steve,
> 
> Can you send me a diff between the original file and the new one so that I can 
> see where you inserted that code ? I suppose you inserted it at the wrong 
> location.
> 
> --HPS
> 
<....snip....>
>>
>>I have decided to try your new usb stack. I am running on FreeBSD 6.1. The
>>device I am trying to get working is a sierra wireless usb 597 EVDO modem.
>>It is also has a slot for a micro-sd memory card, plus when it is first
>>powered up it doesn't look like a modem it looks like a different device
>>that has both the umass device plus a cdrom device that has windows
>>software drivers on it. In this mode it has a VID of 0x1199 and a PID of
>>0xfff, after a message on the control pipe it changes its identity to VID =
>>0x1199, PID=0x0023.
>>
>>What I had done previously with the original 6.1 usba.c was in the match
>>code look for the 1199:fff and then in the attach code send a message on
>>the control pipe to set it in modem mode like the code below: {
>>        ubsa_cfg_request( sc, 0x0b, 1);
>>        ucom->sc_dying = 1;
>>                goto error;
>>   }
>>
>>I tried to do something similar in the usba.c that is part of your new code
>>as follows: {
>>        ubsa_cfg_request( sc, 0x0b, 1);
>>                goto detach;
>>   }
>>
>>but I immediately get a panic:
>>Fatal trap 12 page fault in kernel mode
>>...
>>Stopped at usbd_config_td_is_gone
>>bt gives:
>>ucom_cfg_is_gone
>>ubsa_cfg_request
>>ubsa_attach
>>...
>>
>>Which looks like it doesn't like the device disappearing when it switched
>>modes. Any ideas how this should be handled? Or where I should be trying to
>>switch the device into modem mode?
>>
>>Thanks,
>>Steve
> 
> 
> 
> 
Hi Hans,

Below is the diff you asked for - thanks for repsonding.


--- ubsa.c.orig Wed May 14 13:10:19 2008
+++ ubsa.c      Wed May 14 11:13:26 2008
@@ -295,6 +295,9 @@
        {USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE},
        /* Qualcomm, Inc. ZTE CDMA */
        {USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM},
+       /* Sierra Wireless */
+        { USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_COMPASS_597 },
+        { USB_VENDOR_SIERRA, 0xfff },
        {0, 0}
 };

@@ -322,7 +325,7 @@
 {
        struct usb_attach_arg *uaa = device_get_ivars(dev);
        const struct ubsa_product *up = ubsa_products;
-
+       printf("ubsa:vendor=%x,product=%x\n",uaa->vendor,uaa->product);
        if (uaa->usb_mode != USB_MODE_HOST) {
                return (UMATCH_NONE);
        }
@@ -332,10 +335,14 @@
        while (up->vendor) {
                if ((up->vendor == uaa->vendor) &&
                    (up->product == uaa->product)) {
+       printf("ubsa:MATCH\n");
+
                        return (UMATCH_VENDOR_PRODUCT);
                }
                up++;
        }
+        printf("ubsa:NO_MATCH\n");
+
        return (UMATCH_NONE);
 }

@@ -356,6 +363,12 @@
        usbd_set_device_desc(dev);

        sc->sc_udev = uaa->device;
+
+        if ( uaa->vendor == USB_VENDOR_SIERRA && uaa->product == 0xfff )
+        {
+                ubsa_cfg_request( sc, 0x0b, 1 );
+              goto detach;
+        }

        /* configure the device */



More information about the freebsd-usb mailing list