Hi all,

I've experimented a bit with the hub-power switching program from NIIBE Yutaka and I've got a couple of questions to my observations.

On Sat, 14 Jan 2006, NIIBE Yutaka wrote:

Vlado Handziski wrote:
http://thread.gmane.org/gmane.linux.usb.devel/36739


at the end I have posted a python wrapper over libusb for controlling the
hub port power. The issue with the "self-healing" in the kernel is still
there. We are currently patching the kernel to disable the automatic
re-powering.

First short question - what is this about? I haven't seen any such attempts under 2.6.16/17-rc3? Have they been in the meantime fixed?

Thanks for the pointer.  Great.

I have two questions.

Do you have any information about USB hubs which support port power
control feature?  I tested eleven products (in Japan) and only three
are good for port power control.

Now, I've tested the program with 2 hubs, and both worked, in a way that power was indeed switched off. But, what I saw in both cases, is that the kernel doesn't get a hub status-change event. I've checked with a USB-analyser and with usbmon, indeed, in the case of a normal unplug there comes a URB from the interrupt endpoint of the hub. With power-down it doesn't. You only get some control URBs which I haven't tried yet to interpret exactly, and first on power on you get an URB on the interrupt endpoint which is then interpreted by the software as plug-out and immediate re-plug event. Since without power the software doesn't notice any changes on the port (logical), you can even unplug your device while hub has no power on the port, re-plug it into another port and the kernel will happily report 2 identical devices in the hub:-) Does this mean that my 2 hubs were "not good" for port-power switching, or is it normal, or can / should something be done to produce device-removal event on port power off?

At the bottom I enclose the usbmon output for port-power off / on test case and, for comparison, for normal un- re-plug.

It seems that libusb is somewhat portable, it supports Linux, *BSD,
and MacOS X.  Do you have experience of port power control in other
OS?

Would be interesting to try it on other OSes...

Thanks
Guennadi
---------------------------------
Guennadi Liakhovetski, Ph.D.
DSA Daten- und Systemtechnik GmbH
Pascalstr. 28
D-52076 Aachen
Germany

Test case 1: hub port power off

cbd22ec0 1921919734 S Ci:002:00 s a0 06 2900 0000 0400 1024 <
cbd22ec0 1921920077 C Ci:002:00 0 9 = 092904a9 00326400 ff
cbd22ec0 1921922955 S Co:002:00 s 23 01 0008 0001 0000 0
cbd22ec0 1921923069 C Co:002:00 0 0

hub port power on

cbd22d40 1926104364 S Ci:002:00 s a0 06 2900 0000 0400 1024 <
cbd22d40 1926105056 C Ci:002:00 0 9 = 092904a9 00326400 ff
cbd22d40 1926108713 S Co:002:00 s 23 03 0008 0001 0000 0
cbd22d40 1926108927 C Co:002:00 0 0
cf47d960 1926236046 C Ii:002:01 0 1 = 02
cf47d960 1926236061 S Ii:002:01 -115 1 <
cbd22d40 1926236090 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22d40 1926237039 C Ci:002:00 0 4 = 01010100
cbd22d40 1926237059 S Co:002:00 s 23 01 0010 0001 0000 0
cbd22d40 1926237162 C Co:002:00 0 0
cbd22d40 1926237176 S Co:002:00 s 23 03 0016 0001 0000 0
cbd22d40 1926237288 C Co:002:00 0 0
cf83b440 1926238129 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cf83b440 1926238292 C Ci:002:00 0 4 = 01010000
cbd22ce0 1926269674 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22ce0 1926270049 C Ci:002:00 0 4 = 01010000
cbd22ce0 1926301669 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22ce0 1926302044 C Ci:002:00 0 4 = 01010000
cbd22ce0 1926333675 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22ce0 1926334044 C Ci:002:00 0 4 = 01010000
cbd22ce0 1926365673 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22ce0 1926366042 C Ci:002:00 0 4 = 01010000
cbd22ce0 1926366075 S Co:002:00 s 23 03 0004 0001 0000 0
cbd22ce0 1926366165 C Co:002:00 0 0
cf83b440 1926381672 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cf83b440 1926382043 C Ci:002:00 0 4 = 11010000
cf83b440 1926397676 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cf83b440 1926398046 C Ci:002:00 0 4 = 03011000
cf83b440 1926453682 S Co:002:00 s 23 01 0014 0001 0000 0
cf83b440 1926454045 C Co:002:00 0 0
cf83b440 1926454088 S Ci:000:00 s 80 06 0100 0000 0040 64 <
cf83b440 1926514168 C Ci:000:00 0 18 = 12011001 e0010140 ee033864 73030000 0001
cf83b440 1926514204 S Co:002:00 s 23 03 0004 0001 0000 0
cf83b440 1926514287 C Co:002:00 0 0
cf83b440 1926529684 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cf83b440 1926530044 C Ci:002:00 0 4 = 11010000
cf83b440 1926545683 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cf83b440 1926546041 C Ci:002:00 0 4 = 03011000
cf83b440 1926601714 S Co:002:00 s 23 01 0014 0001 0000 0
cf83b440 1926602045 C Co:002:00 0 0
cf83b440 1926602072 S Co:000:00 s 00 05 0009 0000 0000 0
cf83b440 1926602664 C Co:000:00 0 0
cf83b440 1926621689 S Ci:009:00 s 80 06 0100 0000 0012 18 <
cf83b440 1926681914 C Ci:009:00 0 18 = 12011001 e0010140 ee033864 73030000 0001
cf83b440 1926681947 S Ci:009:00 s 80 06 0200 0000 0009 9 <
cf83b440 1926822296 C Ci:009:00 0 9 = 0902c100 030100c0 64
cf83b440 1926822333 S Ci:009:00 s 80 06 0200 0000 00c1 193 <
cf83b440 1926962793 C Ci:009:00 0 193 = 0902c100 030100c0 64090400 0003e001 
01000705 81031000 01070502 02400001
cbd22d40 1926963089 S Ci:009:00 s 80 00 0000 0000 0002 2 <
cbd22d40 1926963788 C Ci:009:00 0 2 = 0000
cbd22d40 1926963828 S Co:009:00 s 00 09 0001 0000 0000 0
cbd22d40 1926964539 C Co:009:00 0 0

Test case 2: device un-plug

cf47d960 1513566114 C Ii:002:01 0 1 = 02
cf47d960 1513566147 S Ii:002:01 -115 1 <
cbd22c80 1513566177 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22c80 1513567103 C Ci:002:00 0 4 = 00010100
cbd22c80 1513567124 S Co:002:00 s 23 01 0010 0001 0000 0
cbd22c80 1513567226 C Co:002:00 0 0
cbd22c80 1513567239 S Co:002:00 s 23 03 0016 0001 0000 0
cbd22c80 1513567348 C Co:002:00 0 0
cbd22e60 1513568195 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22e60 1513568352 C Ci:002:00 0 4 = 00010000
cf83b860 1513599901 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cf83b860 1513600103 C Ci:002:00 0 4 = 00010000
cf83b860 1513631925 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cf83b860 1513632110 C Ci:002:00 0 4 = 00010000
cf83b860 1513663904 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cf83b860 1513664106 C Ci:002:00 0 4 = 00010000
cf83b860 1513695927 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cf83b860 1513696108 C Ci:002:00 0 4 = 00010000

device re-plug

cf47d960 1537118007 C Ii:002:01 0 1 = 02
cf47d960 1537118041 S Ii:002:01 -115 1 <
cbd22f20 1537118071 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22f20 1537118999 C Ci:002:00 0 4 = 01010100
cbd22f20 1537119019 S Co:002:00 s 23 01 0010 0001 0000 0
cbd22f20 1537119123 C Co:002:00 0 0
cbd22f20 1537119137 S Co:002:00 s 23 03 0016 0001 0000 0
cbd22f20 1537119247 C Co:002:00 0 0
cbd22f20 1537119261 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22f20 1537119373 C Ci:002:00 0 4 = 01010000
cbd22e60 1537149391 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22e60 1537150008 C Ci:002:00 0 4 = 01010000
cbd22e60 1537181365 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22e60 1537182005 C Ci:002:00 0 4 = 01010000
cbd22e60 1537213371 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22e60 1537214009 C Ci:002:00 0 4 = 01010000
cbd22e60 1537245370 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22e60 1537246004 C Ci:002:00 0 4 = 01010000
cbd22e60 1537246041 S Co:002:00 s 23 03 0004 0001 0000 0
cbd22e60 1537246120 C Co:002:00 0 0
cbd22e60 1537261366 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22e60 1537262003 C Ci:002:00 0 4 = 11010000
cbd22e60 1537277371 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22e60 1537278010 C Ci:002:00 0 4 = 03011000
cbd22e60 1537333366 S Co:002:00 s 23 01 0014 0001 0000 0
cbd22e60 1537334003 C Co:002:00 0 0
cbd22e60 1537334051 S Ci:000:00 s 80 06 0100 0000 0040 64 <
cbd22e60 1537394133 C Ci:000:00 0 18 = 12011001 e0010140 ee033864 73030000 0001
cbd22e60 1537394173 S Co:002:00 s 23 03 0004 0001 0000 0
cbd22e60 1537394244 C Co:002:00 0 0
cbd22e60 1537409372 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22e60 1537410003 C Ci:002:00 0 4 = 11010000
cbd22e60 1537425365 S Ci:002:00 s a3 00 0000 0001 0004 4 <
cbd22e60 1537425996 C Ci:002:00 0 4 = 03011000
cbd22e60 1537481393 S Co:002:00 s 23 01 0014 0001 0000 0
cbd22e60 1537482007 C Co:002:00 0 0
cbd22e60 1537482035 S Co:000:00 s 00 05 0004 0000 0000 0
cbd22e60 1537482621 C Co:000:00 0 0
cbd22e60 1537501383 S Ci:004:00 s 80 06 0100 0000 0012 18 <
cbd22e60 1537561887 C Ci:004:00 0 18 = 12011001 e0010140 ee033864 73030000 0001
cbd22e60 1537561929 S Ci:004:00 s 80 06 0200 0000 0009 9 <
cbd22e60 1537702249 C Ci:004:00 0 9 = 0902c100 030100c0 64
cbd22e60 1537702283 S Ci:004:00 s 80 06 0200 0000 00c1 193 <
cbd22e60 1537842747 C Ci:004:00 0 193 = 0902c100 030100c0 64090400 0003e001 
01000705 81031000 01070502 02400001
cbd22c20 1537843062 S Ci:004:00 s 80 00 0000 0000 0002 2 <
cbd22c20 1537843871 C Ci:004:00 0 2 = 0000
cbd22c20 1537843911 S Co:004:00 s 00 09 0001 0000 0000 0
cbd22c20 1537844621 C Co:004:00 0 0


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to