I'm developing a USB mass storage device. I got the device basically working (it's too slow, but that's another conversation). What isn't working as well as I'd like is handling device removal - not from the USB end, but the USB device presenting the correct responses to the host when the USB device is forced offline by (forcible) media removal.
I've tried responding to read/write requests with the NOT_READY sense key with MEDIUM_NOT_PRESENT additional information, but the hosts don't seem to react to that in the same way they do to disconnection of the USB cable.
What is the expected behavior for USB devices with removable media when the media is yanked out during operation?