Hello,
A few days ago I commented my problem with SRB commands in my miniport. I don’t exactly know the cause yet, that is why I would like to ask some more questions.
According what I read on http://www.osronline.com/DDKx/storage/k302_9vsi.htm, for a Plug and Play miniport driver, the port driver calls HwScsiFindAdapter when the Plug and Play Manager has detected an adapter for that miniport, right?
Well, by debugging and using LOGs I found that HwScsiFindAdapter is also never called as the same as HwStartIo. Perhaps HwStartIo won’t be able to be called without before calling HwScsiFindAdapter. I don’t know. But in that case, why does Plug and Play Manager never call HwScsiFindAdapter ?
After installing the miniport through the PNP Manager, the miniport seems to be installed correctly and Windows doesn’t report any error.
HwInitialize and HwResetBus are also never called.
This is the initialization of the structure HW_INITIALIZATION_DATA:
RtlZeroMemory(&HwInitializationData, sizeof(HW_INITIALIZATION_DATA));
HwInitializationData.HwInitializationDataSize = sizeof(HW_INITIALIZATION_DATA);
HwInitializationData.HwInitialize = CDDAInitialize;
HwInitializationData.HwResetBus = CDDAResetBus;
HwInitializationData.HwStartIo = CDDAStartIo;
HwInitializationData.HwFindAdapter = CDDAFindAdapter;
HwInitializationData.HwAdapterControl = CDDAAdapterControl;
HwInitializationData.AdapterInterfaceType = PCIBus;
HwInitializationData.DeviceExtensionSize = sizeof( DEVICE_EXTENSION );
HwInitializationData.MapBuffers = TRUE;
HwInitializationData.ReceiveEvent = TRUE;
HwInitializationData.AutoRequestSense = TRUE;
HwInitializationData.VendorIdLength = 8;
HwInitializationData.VendorId = “Valhalla”;
HwInitializationData.DeviceIdLength = 8;
HwInitializationData.DeviceId = “CDDASCSI”;
status = ScsiPortInitialize( DriverObject, RegistryPath, &HwInitializationData, &HwContext );
if (!NT_SUCCESS(status))
{
return status;
DbgPrint(“It was impossible to initialize SCSI port”);
CDDALogS(“SCSI Miniport Initilizated WRONG”);
}
CDDALogS(“SCSI Miniport Initilizated OK”);
In the member AdapterInterfaceType I have tried with both, PCIBus and Internal, but the sames happens. ScsiPortInitialize always returns SUCCESS, however, HwScsiXXXX funcitons are never called.
Do I need to add something special different code in the PNP dispatcher for SCSI minports? In such dispatcher I’m checking for the following Minor Functions:
IRP_MN_START_DEVICE
IRP_MN_QUERY_STOP_DEVICE
IRP_MN_CANCEL_STOP_DEVICE
IRP_MN_STOP_DEVICE
IRP_MN_QUERY_REMOVE_DEVICE
IRP_MN_CANCEL_REMOVE_DEVICE
IRP_MN_SURPRISE_REMOVAL
IRP_MN_REMOVE_DEVICE
and only IRP_MN_START_DEVICE is called (successfully). The other ones are not called.
Does anyone have some idea?
Thanks in advance.
Christian D’Orazio