Re: Force usb to use same port number for re/boot or re insert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 31, 2012 at 02:27:04PM +0530, $rik@nth  wrote:
> Hi Sarah,
> 
> I need some help regarding the usb devices(Android based mobiles).,
> 
> I am having some trouble in automating the task. I am testing some android
> based mobiles in linux machine. The automation script uses the device id
> under "/dev/bus/usb/001/"053" it will be always under bus 001 only.. But
> the dev id will be random like if i insert one mobile then the dev id will
> be 053, if remove and insert it again then the dev id will be 054..

That's the device address, not the device ID.

And note that if there are two host controllers (which is probably not
likely with a smart phone, but may be possible with a tablet), then the
bus numbers might change as well across reboots.  One bus may be
enumerated before the other for one boot, and get bus number 1, while on
the next boot it gets bus number 2.

> The problem is, when some tests runs on the device and if device gets
> rebooted then new dev id is showing for the rebooted one and my scripts
> failing due to new dev id..
> 
> Is there any way to force usb devices to use same dev id instead of new
> one. So that there will be no issues to my tests even after device reboots.

No, there isn't.  The USB core goes through device addresses
incrementally, and that's not something you can change.

The bigger question here is *why* you need to dig around in the sysfs
files.  Doesn't Android give you some higher level abstraction that you
should be using instead?

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux