From owner-freebsd-usb@FreeBSD.ORG Wed May 14 17:16:29 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 97099106564A for ; Wed, 14 May 2008 17:16:29 +0000 (UTC) (envelope-from sclark@netwolves.com) Received: from elasmtp-mealy.atl.sa.earthlink.net (elasmtp-mealy.atl.sa.earthlink.net [209.86.89.69]) by mx1.freebsd.org (Postfix) with ESMTP id 581828FC0C for ; Wed, 14 May 2008 17:16:29 +0000 (UTC) (envelope-from sclark@netwolves.com) Received: from [205.201.149.100] (helo=[10.0.129.1]) by elasmtp-mealy.atl.sa.earthlink.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JwKaa-0003oR-Fn; Wed, 14 May 2008 13:16:28 -0400 Message-ID: <482B1E6B.3070309@netwolves.com> Date: Wed, 14 May 2008 13:16:27 -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: Hans Petter Selasky References: <4828AA64.7060306@netwolves.com> <200805131755.54080.hselasky@c2i.net> <482B0036.5060106@netwolves.com> <200805141739.48185.hselasky@c2i.net> In-Reply-To: <200805141739.48185.hselasky@c2i.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: a437fbc6971e80f61aa676d7e74259b7b3291a7d08dfec7925827fbb747dea386ad52b4890667a19350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c 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 17:16:29 -0000 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 */