How to detect USB Slave connections to an host computer ?

Nico
Hi Everyone,

I am using the Mini2440 as a USB Mass Storage peripheral by loading the
g_file_storage module of the Linux USB Gadget. It actually works pretty
well. I can modificate the files on the mini2440 like if it was a usb key.

I would like now to be able to detect the when I plug the card from the usb
slave port to my computer in order to load/unload the module according to
that. (and by the way mount/unmount the "shared" data).

Any idea on how I could do that ?

I tried with hotplug, but it only detect when I plug something (like a
mouse, or a usb key...) on the other usb port, the master one.

Thanks a lot !
See you.
Nico.