I believe on USB the hub driver does this, although I am not sure. I believe
it is the purpose of a 1 time/second interrupt, to probe for new hardware.
I see something like this (although I am whipping up an idea here off the
top of my head, so it will probably have major flaws):
1. Device gets added/removed
2. hardware driver gets notified, now knows to give file errors on
read/write.
3. userspace daemon is notified, removes file link.
on (re)insertion is more difficult:
1. hardware driver gets notified, processes any device info and tries to see
if there is a unique serial number.
2. device is temporarily mapped as a new device
2. driver notifies userspace daemon
3. userspace daemon processes configuration, decides if the device should be
considered the same as a previous device
4. device is either re-added (read/write work again), or left as a new
device.
5. userspace daemon adds file link
-David Waite
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/