I'm working on a device driver that needs to issue a
GET_CONFIGURATION command at probe time, to determine whether or not
the device is a suitable candidate for matching.
Unfortunately, issuing SCSI commands from within the probe routine
causes a kernel panic.
I tried returning false from start, to indicate that the device is
unsuitable, but that seems to have a fairly high footprint on the
system (CreateStorageServiceNub ends up being called before I have a
chance issue the GET_CONFIGURATION command). I also noticed that
stop was never called, but if I call it when I'm going to fail start,
the system kernel panics a minute or two after it is booted.
bool com_softarch_BD_SCSIPeripheralDevice::start(IOService* provider)
{
if (super::start(provider))
{
if (this->SAI_supports_BD_Read_Profile()) // Issues a
GET_CONFIGURATION command.
{
return true;
}
// this->stop(provider); // !!! Causes a delayed kernel panic.
}
return false;
}
I'd really like to get this out of the start routine - is there a way
that I can safely issue the GET_CONFIGURATION command from my probe
routine?