From owner-freebsd-usb@FreeBSD.ORG Wed May 14 15:38:25 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 73C061065671 for ; Wed, 14 May 2008 15:38:24 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe10.swip.net [212.247.155.33]) by mx1.freebsd.org (Postfix) with ESMTP id CDD458FC13 for ; Wed, 14 May 2008 15:38:23 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=8dRco+jkA7T8F7ca9kIWOg==:17 a=6I5d2MoRAAAA:8 a=4rvDYiOYwetIWVFos50A:9 a=gUa60wpn3jr8toZYrhgA:7 a=AL3XWHFun27athkBXDeDoQcSfrEA:4 a=SV7veod9ZcQA:10 a=50e4U0PicR4A:10 Received: from [62.73.248.18] (account mc467741@c2i.net [62.73.248.18] verified) by mailfe10.swip.net (CommuniGate Pro SMTP 5.1.13) with ESMTPA id 765374283; Wed, 14 May 2008 17:38:21 +0200 From: Hans Petter Selasky To: Steve Clark Date: Wed, 14 May 2008 17:39:47 +0200 User-Agent: KMail/1.9.7 References: <4828AA64.7060306@netwolves.com> <200805131755.54080.hselasky@c2i.net> <482B0036.5060106@netwolves.com> In-Reply-To: <482B0036.5060106@netwolves.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805141739.48185.hselasky@c2i.net> 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 15:38:25 -0000 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 On Wednesday 14 May 2008, Steve Clark wrote: > Hans Petter Selasky wrote: > > On Monday 12 May 2008, Steve Clark wrote: > >>Hello List, > >> > >>I have spent the afternoon going thru the usb code trying to figure out > >> how to do a read on the control port (endpoint 80 ? ) instead of a write > >> ( endpoint 0 ). I am still trying to emulate what the linux sierra.c usb > >> serial driver does. > >> > >>Any pointers would be greatly appreciated. > >> > >>Thanks, > >>Steve > >>_______________________________________________ > >>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, > > > > All transactions on the control endpoint (0) consist of three parts: > > > > SETUP > > DATA, if any > > STATUS > > > > The two most common variants are: > > > > 1) SETUP > > DATA OUT > > STATUS IN > > > > 2) SETUP > > DATA IN > > STATUS OUT > > > > Rules: > > > > The MSB of the first byte in the SETUP decides wheter the data is OUT > > (0x00) or IN (0x80). IN and OUT is relative to the USB Host. > > > > See: usbd_do_request and /sys/dev/usb/usb.h > > > > typedef struct { > > uByte bmRequestType; > > uByte bRequest; > > uWord wValue; > > uWord wIndex; > > uWord wLength; > > uByte bData[0]; > > } __packed usb_device_request_t; > > > > #define UT_WRITE 0x00 > > #define UT_READ 0x80 > > #define UT_STANDARD 0x00 > > #define UT_CLASS 0x20 > > #define UT_VENDOR 0x40 > > #define UT_DEVICE 0x00 > > #define UT_INTERFACE 0x01 > > #define UT_ENDPOINT 0x02 > > #define UT_OTHER 0x03 > > > > --HPS > > Hi Hans, > > 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