Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 May 2008 12:50:54 -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:  <4829C6EE.8040404@netwolves.com>
In-Reply-To: <200805131755.54080.hselasky@c2i.net>
References:  <4828AA64.7060306@netwolves.com> <200805131755.54080.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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,

Thanks so much - I have just been reviewing the usb spec and had about determined as much. So I need to
have UT_READ or'ed in with my bmRequestType as I understand it.

Regards,
Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4829C6EE.8040404>