From owner-freebsd-usb@FreeBSD.ORG Wed May 14 19:53:07 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4375F106564A for ; Wed, 14 May 2008 19:53:07 +0000 (UTC) (envelope-from sclark@netwolves.com) Received: from elasmtp-masked.atl.sa.earthlink.net (elasmtp-masked.atl.sa.earthlink.net [209.86.89.68]) by mx1.freebsd.org (Postfix) with ESMTP id 010C68FC19 for ; Wed, 14 May 2008 19:53:06 +0000 (UTC) (envelope-from sclark@netwolves.com) Received: from [205.201.149.100] (helo=[10.0.129.1]) by elasmtp-masked.atl.sa.earthlink.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JwN29-0003U7-4O; Wed, 14 May 2008 15:53:05 -0400 Message-ID: <482B431F.5050901@netwolves.com> Date: Wed, 14 May 2008 15:53:03 -0400 From: Steve Clark User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20080425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Steve Clark References: <4828AA64.7060306@netwolves.com> <200805131755.54080.hselasky@c2i.net> <482B0036.5060106@netwolves.com> <200805141739.48185.hselasky@c2i.net> <482B1E6B.3070309@netwolves.com> In-Reply-To: <482B1E6B.3070309@netwolves.com> Content-Type: multipart/mixed; boundary="------------090505070209010307090106" X-ELNK-Trace: a437fbc6971e80f61aa676d7e74259b7b3291a7d08dfec796a7a4f6873947fba9a6b8d77107a4d47350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 205.201.149.100 Cc: freebsd-usb@freebsd.org Subject: Re: In on control endpoint X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2008 19:53:07 -0000 This is a multi-part message in MIME format. --------------090505070209010307090106 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Steve Clark wrote: > 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 */ > > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > > Hi Hans, I tried moving the ubsa_cfg_reguest() to various places in the ubsa_attach routine. When I moved it after the call: error = usbd_transfer_setup(uaa->device, &(sc->sc_iface_index), sc->sc_xfer, ubsa_config, UBSA_N_TRANSFER, sc, &Giant); if (error) { DPRINTF(0, "could not allocate all pipes\n"); goto detach; } The error message "could not allocate all pipes" is printed and the ubsa_attach function exits. if I put before the if (error) it panics . Attached is a lsusb -vvv I got from a linux system before the device is put in the modem mode. sierra_tru.txt. I had previously posted an lsusb -vvv from the device after it had been placed in modem mode. when it is in modem mode it looks like a composite device? It has the modem which has 3 serial ports, and a UMASS device. Thanks again for taking an interest. Steve --------------090505070209010307090106 Content-Type: text/plain; name="sierra_tru.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sierra_tru.txt" Bus 002 Device 002: ID 1199:0fff Sierra Wireless, Inc. Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x1199 Sierra Wireless, Inc. idProduct 0x0fff bcdDevice 0.00 iManufacturer 1 Sierra Wireless iProduct 2 USB MMC Storage iSerial 3 SWOC22905731 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xc0 Self Powered MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 8 Mass Storage bInterfaceSubClass 6 SCSI bInterfaceProtocol 80 Bulk (Zip) iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x86 EP 6 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x07 EP 7 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 --------------090505070209010307090106--