I am using the PSP 3.20.00.14 with my EVMOMAPL137. My USB port is configured as a file backed storage gadget using g_file_storage.ko using the sd/mmc card (dev/mmcblk0p1) as the backing file. My application continuously logs information to the SD card. When a user plugs a host device (Windows) into the usb they need to be able to view (and possibly modify) the contents of the files on the SD card. It appears that once Windows connects to the backing file, it's state is not updated as Windows does not expect anything other than itself to be making changes to the files. I have confirmed this by connecting to the gadget, appending to a file's contents with application, and observing no change in the file size on windows.
This situation requires that my application be able to detect when a host computer connects to the USB port so that I can stop modifying the files and possibly load the file backed storage module if deemed necessary. Is there a way that my application can be signaled when a host (not a device) connects and disconnects to this port?