RT73 USB endpoint desc problem

Live forum: http://rt2x00.serialmonkey.com/viewtopic.php?t=5145


30-12-2008 11:48:47

Can any one tell me some thing about the IN-OUT endpoint desc?
I analyzed with CATALYST, it shows rt73's IN-bulk endpoint is 0001[/color1vmgd21d], and OUT bulk endpoint is also 0001[/color1vmgd21d].I catch the desc data with windows host.
According to usb spec, only control endpoint can perform IN and OUT's dual role. How can this work on rt73?
If 0001 endpoint perform both IN and OUT role, will the buffer in the DONGLE conflict with each other?



30-12-2008 13:17:25

Check the macros usb_rcvbulkpipe and usb_sndbulkpipe in /usr/src/linux/include/usb.h
#define usb_sndbulkpipe(dev,endpoint) \
((PIPE_BULK << 30) | __create_pipe(dev, endpoint))
#define usb_rcvbulkpipe(dev,endpoint) \
((PIPE_BULK << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN)

As you can see the return value from __create_pip() will be increased with the value of USB_DIR_IN. This define is set to 0x80.

When you call 'lsusb -v" you will see the definition for the 2 endpoints of your hardware in particular the 2 bEndpointAddress values. This will most likely be

bEndpointAddress 0x81 EP 1 IN
bEndpointAddress 0x01 EP 1 OUT

As you can see there are 2 endpoints, and both have index 1 (since we must substract USB_DIR_IN from the IN endpoint).