Date: Wed, 14 May 2008 13:16:27 -0400 From: Steve Clark <sclark@netwolves.com> To: Hans Petter Selasky <hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: In on control endpoint Message-ID: <482B1E6B.3070309@netwolves.com> In-Reply-To: <200805141739.48185.hselasky@c2i.net> References: <4828AA64.7060306@netwolves.com> <200805131755.54080.hselasky@c2i.net> <482B0036.5060106@netwolves.com> <200805141739.48185.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?482B1E6B.3070309>