Alan Stern <[EMAIL PROTECTED]> writes:

> On Wed, 31 Jan 2007, Joe Wells wrote:
>
>> Thanks very much for your advice, Alan!

Thanks again!  Your information is very helpful.

>> Alan Stern <[EMAIL PROTECTED]> writes:
>>
>> > On Wed, 31 Jan 2007, Joe Wells wrote:
>> >
>> >> I want to simulate the effect of unplugging a USB device and
>> >> plugging it back in without having to physically unplug it.  Is
>> >> it possible to "unplug" a USB device by software actions alone?
>> >> If so, could someone please tell me how?
>> >
>> > It depends on exactly what you want to simulate.
>>
>> I have a piece of hardware that works reliably when I unplug it
>> from the USB port and remove associated kernel modules between
>> every two openings of the device file.  It works unreliably when I
>> don't follow this procedure.  (Yes, obviously something is buggy,
>> but which piece of hardware or software has the bug is unclear and
>> I have a procedure that works.)
>
> Okay... but finding and fixing the bug might let you use a much
> simpler procedure.

Agreed.  But I think it would take many days to track down, given my
level of kernel hacking expertise (none).  Unfortunately I can't
justify that given that I have a working workaround.

>> > For example, unplugging a USB device will interrupt the +5 V
>> > power it receives from the bus.  With most PC systems, the USB
>> > hardware does not permit you to do this in software.
>>
>> How would I find out if I can turn off the power to the USB port in
>> software?  If it could be done on a particular computer, which
>> software actions would do it?
>
> I was speaking conservatively.  As far as I know, _no_ personal
> computer systems allow you to turn off the power to the USB bus,
> without shutting down the entire computer.  Some brands of USB hub
> do allow it; see the description on this web page:
>
>       http://www.gniibe.org/ac-power-by-usb/ac-power-control.html

Very helpful pointer.  Okay, so I have now figured out that my USB
controller is the "Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6
Family)", and it is documented that this does not implement port power
control.  The "lsusb --verbose" output also indicates the lack of port
power control.

>> > Other aspects of replugging (in particular, the device reset it
>> > causes) can indeed be carried out in software.
>> >
>> >> In case it matters, I am only using one USB device, so resetting
>> >> the entire USB subsystem would not be a problem for me.
>> >
>> > In that case it would be enough to unload the USB controller
>> > driver and then load it back.  For instance, "rmmod ohci-hcd ;
>> > modprobe ohci-hcd".  The actual driver to use will depend on your
>> > system and on the USB device in question; check the system log to
>> > find out.

When I "modprobe uhci_hcd", will this detect the USB device plugged in
and do all the necessary hotplug events?

>> If I run "lsmod | egrep 'hci|usb'", I get this output:
>>
>>   [ bunch of stuff deleted ]
>>
>> Which of these modules should go?  I'm guessing that ohci1394 is my
>> USB controller driver (see my lspci output quoted from previous
>> message below), but it is not clear to me.
>
> No, ohci1394 is a Firewire driver.  "Firewire" is Apple's name for
> the technology which is more generally available in the IEEE-1394
> specification.

Right, I should have known that.

>> Would I need also to remove usbcore?  (If I need to remove usbcore,
>> then I would need to understand what all of the hsf* modules are
>> doing, because they would need to be unloaded first.)  What about
>> ehci_hcd and uhci_hcd?
>
> You don't need to remove usbcore.  You do need to remove either or
> both of ehci-hcd and uhci-hcd, depending on what bus speed your USB
> device runs at.

I've determined that it is uhci_hcd that I need to remove.  Do I need
to make sure that any kernel modules related specifically to the USB
device are unloaded first?  (I suppose I will do this anyway, but I am
curious.)  The lsmod output does not list any other modules as
depending on uhci_hcd.

> Alan Stern

Thanks for any additional help anyone can give!

-- 
Joe Wells

-------------------------------------------------------------------------
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-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to