Re: Software based unplug of USB device?

From: Duncan Sands
Date: Tue May 04 2004 - 01:34:54 EST


On Monday 03 May 2004 12:21, Joerg Pommnitz wrote:
> Hello listees,
> we are struggling with a 3rd party USB device. It comes with its own
> firmware and its own Linux USB serial drivers. Unfortunately the
> communication between the device and the user application seems to break
> down from time to time. This situation can easily be resolved by
> unplugging and then re-plugging the device. Unfortunately this requires
> manual intervention.
> While resolving the real issue would be the preferred way to deal with
> this problem, we would settle for a way to do a software unplug/re-plug.
> Can this be done at all? If so, is there a tool to do this?
>
> A detailed description of our environment:
> * Linux 2.4.21 with USB OHCI driver
> * Natsemi Geode integrated CPU/Chipset

This can be done in a number of ways:
(1) unload and reload the module driving the usb device. This should disconnect
it from the device and reconnect it when reloaded.
(2) restart the hotplug system (this will disconnect and reconnect all devices).
(3) use usbfs: there is an ioctl to disconnect a kernel driver from a device,
and another to reconnect it.

I hope this helps,

Duncan.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/