On Thu, 18 Dec 2003 17:58:35 -0800 Steve Calfee <[EMAIL PROTECTED]> wrote:
| At 03:19 PM 12/18/2003 -0800, Alex Sanks wrote: | >All, | > | >I have an unusual request and maybe a linux-usb guru can help me out | >here. I have a device that's been exhibiting weird behavior when it is | >assigned a particular USB address. This shows up when running the | >USB-CV 150 enumeration test. Now, the address isn't *terribly* high, so | >plugging in a bunch of devices to bump the addresses up is doable, but I | >wonder: is there a better way? | > | >For starters, I suppose I should ask and make sure there's no user-mode | >way to do this. I didn't see anything relevant, but I know next to | >nothing about the Linux USB host side (I've only dealt with Gadget) | > | >So, in short, what I'd like to do is somehow force my device to an | >address that I choose. I've been exploring this and tried just adding a | >special case into usb_choose_address(), only to find that the host | >hasn't pulled the device descriptor information yet (which I'd need to | >compare the VID/PID to my failing device - interesting, since Windows | >gets the device descriptor before doing anything). The obvious solution | >to that was to try pulling out the device descriptor first but that | >appears to fail with ENODEV if you're trying to talk to address zero. | > | >The only other way that comes to mind is to wait until after we've gone | >thru usb_set_address and then pulled the device descriptor, and *then* | >go thru and give myself the address I want (set device->devnum, clear | >the old devnum bit in dev->bus->devmap.devicemap, and set the new bit). | > | >Does anyone have a suggestion of a better way to go about this (even | >though under no circumstances do I ever expect any of these hacks to | >leave the confines of my cube :) | > | >Thanks for the help, | > | >Alex | > | | The easiest way is to boot your system fresh with no devices plugged in. | | Then plug your device in and wait 10 seconds it will now be address 2. | | If the device is ok (try lsusb? or some other test that the device is ok) | unplug it and wait 5 seconds. | | Repeat, each time you should get the next higher USB bus address ie | 3,4,5...n... | The address will go to 127 and then wrap back to 2. What kernel version? (almost always important info) For 2.4.x, you can #undef DEVNUM_ROUND_ROBIN in drivers/usb/usb.c and it will re-use recent device numbers instead of assigning new numbers up thru 127 and then beginning at <low numbers> again. In 2.6.x this #define (DEVNUM_ROUND_ROBIN) is gone, but you can port that same code to 2.6 if you need it. HTH. -- ~Randy ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel