From owner-freebsd-usb@FreeBSD.ORG Tue May 13 15:54:30 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 1EA2D1065674 for ; Tue, 13 May 2008 15:54:30 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.swip.net [212.247.154.97]) by mx1.freebsd.org (Postfix) with ESMTP id A850C8FC18 for ; Tue, 13 May 2008 15:54:29 +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=Zu8uBkpam1UpjitomegA:9 a=FcaVMgPJIOxMMPx4crwA:7 a=8cipVYOkJJ5UXdo3yuqwc8xab20A:4 a=SV7veod9ZcQA:10 a=LY0hPdMaydYA:10 Received: from [62.73.248.18] (account mc467741@c2i.net [62.73.248.18] verified) by mailfe04.swip.net (CommuniGate Pro SMTP 5.1.13) with ESMTPA id 933022767; Tue, 13 May 2008 17:54:27 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Tue, 13 May 2008 17:55:53 +0200 User-Agent: KMail/1.9.7 References: <4828AA64.7060306@netwolves.com> In-Reply-To: <4828AA64.7060306@netwolves.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805131755.54080.hselasky@c2i.net> Cc: 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: Tue, 13 May 2008 15:54:30 -0000 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