Help using generic packet commands from cdrom.h
Does anyone know how to use the generic packet commands defined in cdrom.h? I am using some of the simple commands like CDROM_DRIVE_STATUS through ioctl, but I have been unable to find a concise example of how to use the generic packet commands, e.g. GPCMD_REQUEST_SENSE.
It would be great if somebody could provide example C code of the command format, how it is sent (using ioctl?) and how to interpret the response. I'm basically trying to do this, to determine when a DVD drive fails.