Dear Experts,
The proc/bus/usb API has an ioctl that can arrange for the application
to receive a signal when the device is disconnected. Is there anything
similar for the SCSI generic (or other SCSI) APIs?
Assuming that there isn't, I think I need to either poll the device to
see if it's still there, or listen on a netlink socket for a removal
uevent, or I need to find the USB device corresponding to the sg device
that I'm using and use its signal-on-removal ioctl. In the latter
case, is there a way to traverse from an sg device's /sys directory to
the corresponding usb device's /sys directory? /sys seems to be full
of symlinks but I can't find the one that I need in this case.
Basically I have a fairly simple user-space driver for a USB SCSI
device that uses the SCSI-generic API, and I want it to terminate
tidily when the device is detached.
Many thanks for any advice.
Phil.
(Please Cc: me in any replies.)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html