From: Alex on
Hi,
Im new to this group.So please forgive me if you people find my querry
irrelevant to this group.

Im developing Virtual storport driver.While Installing the installation
Wizard returnrd the error code 10.The Setupapilog shows that
CM_PROB_FAILED_START.

Following is the sequence of events happened in my driver.

1. DriverEntry I filled VIRTUAL_HW_INITIALIZATION_DATA structure.


//the code snippet is as follows

stFCoEInitData.HwInitializationDataSize =
sizeof(VIRTUAL_HW_INITIALIZATION_DATA);
stFCoEInitData.AdapterInterfaceType = Internal;
stFCoEInitData.HwInitialize = FCoEHBAHwInitialize;
stFCoEInitData.HwStartIo = FCoEHBAHwStartIo;
stFCoEInitData.HwFindAdapter = FCoEHBAHwFindAdapter;
stFCoEInitData.HwResetBus = FCoEHBAHwResetBus;
stFCoEInitData.HwAdapterState = NULL;
stFCoEInitData.DeviceExtensionSize = sizeof(DEV_EXTN);
stFCoEInitData.SpecificLuExtensionSize = 0;
stFCoEInitData.SrbExtensionSize = sizeof(SRB_EXTN);
stFCoEInitData.NumberOfAccessRanges = 0;
stFCoEInitData.MapBuffers = TRUE;
stFCoEInitData.NeedPhysicalAddresses = FALSE;
stFCoEInitData.TaggedQueuing = TRUE;
stFCoEInitData.AutoRequestSense = TRUE;
stFCoEInitData.MultipleRequestPerLu = TRUE;
stFCoEInitData.ReceiveEvent = TRUE;
stFCoEInitData.HwAdapterControl = FCoEHBAHwAdapterControl;
stFCoEInitData.HwFreeAdapterResources = FCoEHBAHwFreeAdapterResources;
stFCoEInitData.HwProcessServiceRequest = FCoEHBAHwProcessServiceRequest;
stFCoEInitData.HwCompleteServiceIrp = FCoEHBAHwCompleteServiceIrp;
stFCoEInitData.VendorIdLength = 4;
stFCoEInitData.DeviceIdLength = 4;
stFCoEInitData.VendorId = ucVendorId;
stFCoEInitData.DeviceId = ucDeviceId;

ulStatus = StorPortInitialize(
DriverObject,
Context,
(PHW_INITIALIZATION_DATA)&stFCoEInitData,
NULL
);


The Initialization was successful.

2.Got a Call to HwFindAdapter routine.Where I filled
PORT_CONFIGURATION_INFORMATION structure as follows


ConfigInfo->VirtualDevice = TRUE;
ConfigInfo->Length = sizeof(PORT_CONFIGURATION_INFORMATION);
ConfigInfo->MaximumTransferLength = MAX_TRANSFER_SIZE;
ConfigInfo->MaximumNumberOfTargets = MAX_NO_TARGETS;
ConfigInfo->MaximumNumberOfLogicalUnits= 1;
ConfigInfo->NumberOfPhysicalBreaks = 0;
ConfigInfo->NumberOfBuses = 1;
ConfigInfo->ScatterGather = FALSE;
ConfigInfo->CachesData = FALSE;
ConfigInfo->Master = FALSE;
ConfigInfo->NeedPhysicalAddresses = FALSE;
ConfigInfo->TaggedQueuing = TRUE;
ConfigInfo->AutoRequestSense = TRUE;
ConfigInfo->MultipleRequestPerLu = TRUE;
ConfigInfo->BufferAccessScsiPortControlled = FALSE;
ConfigInfo->DeviceExtensionSize = sizeof(DEV_EXTN);
ConfigInfo->SpecificLuExtensionSize = 0;
ConfigInfo->SrbExtensionSize = sizeof(DEV_EXTN);
ConfigInfo->WmiDataProvider = TRUE;
ConfigInfo->MapBuffers = STOR_MAP_NON_READ_WRITE_BUFFERS;
ConfigInfo->SynchronizationModel = StorSynchronizeHalfDuplex;

3. I got a call to HwStartIo instead of HwInitialize with SRB function code
as SRB_FUNCTION_PNP.the PnPAction member was set to StorRemoveDevice.

I suspect the problem could be with my PortConfiguration structure.Kindly
through some light on what was wrong with the above structures.

Thank you.
Alex.
From: Don Burn on
Take a look at the definition of PORT_CONFIGURATION_INFORMATION in the
includes, there are some fields such as "Virtual" that are not in the doc's.


--
Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply





"Alex" <Alex(a)discussions.microsoft.com> wrote in message
news:51EDFB6F-2624-4FBF-929F-791669EA01CD(a)microsoft.com...
> Hi,
> Im new to this group.So please forgive me if you people find my querry
> irrelevant to this group.
>
> Im developing Virtual storport driver.While Installing the installation
> Wizard returnrd the error code 10.The Setupapilog shows that
> CM_PROB_FAILED_START.
>
> Following is the sequence of events happened in my driver.
>
> 1. DriverEntry I filled VIRTUAL_HW_INITIALIZATION_DATA structure.
>
>
> //the code snippet is as follows
>
> stFCoEInitData.HwInitializationDataSize =
> sizeof(VIRTUAL_HW_INITIALIZATION_DATA);
> stFCoEInitData.AdapterInterfaceType = Internal;
> stFCoEInitData.HwInitialize = FCoEHBAHwInitialize;
> stFCoEInitData.HwStartIo = FCoEHBAHwStartIo;
> stFCoEInitData.HwFindAdapter = FCoEHBAHwFindAdapter;
> stFCoEInitData.HwResetBus = FCoEHBAHwResetBus;
> stFCoEInitData.HwAdapterState = NULL;
> stFCoEInitData.DeviceExtensionSize = sizeof(DEV_EXTN);
> stFCoEInitData.SpecificLuExtensionSize = 0;
> stFCoEInitData.SrbExtensionSize = sizeof(SRB_EXTN);
> stFCoEInitData.NumberOfAccessRanges = 0;
> stFCoEInitData.MapBuffers = TRUE;
> stFCoEInitData.NeedPhysicalAddresses = FALSE;
> stFCoEInitData.TaggedQueuing = TRUE;
> stFCoEInitData.AutoRequestSense = TRUE;
> stFCoEInitData.MultipleRequestPerLu = TRUE;
> stFCoEInitData.ReceiveEvent = TRUE;
> stFCoEInitData.HwAdapterControl = FCoEHBAHwAdapterControl;
> stFCoEInitData.HwFreeAdapterResources = FCoEHBAHwFreeAdapterResources;
> stFCoEInitData.HwProcessServiceRequest = FCoEHBAHwProcessServiceRequest;
> stFCoEInitData.HwCompleteServiceIrp = FCoEHBAHwCompleteServiceIrp;
> stFCoEInitData.VendorIdLength = 4;
> stFCoEInitData.DeviceIdLength = 4;
> stFCoEInitData.VendorId = ucVendorId;
> stFCoEInitData.DeviceId = ucDeviceId;
>
> ulStatus = StorPortInitialize(
> DriverObject,
> Context,
> (PHW_INITIALIZATION_DATA)&stFCoEInitData,
> NULL
> );
>
>
> The Initialization was successful.
>
> 2.Got a Call to HwFindAdapter routine.Where I filled
> PORT_CONFIGURATION_INFORMATION structure as follows
>
>
> ConfigInfo->VirtualDevice = TRUE;
> ConfigInfo->Length = sizeof(PORT_CONFIGURATION_INFORMATION);
> ConfigInfo->MaximumTransferLength = MAX_TRANSFER_SIZE;
> ConfigInfo->MaximumNumberOfTargets = MAX_NO_TARGETS;
> ConfigInfo->MaximumNumberOfLogicalUnits= 1;
> ConfigInfo->NumberOfPhysicalBreaks = 0;
> ConfigInfo->NumberOfBuses = 1;
> ConfigInfo->ScatterGather = FALSE;
> ConfigInfo->CachesData = FALSE;
> ConfigInfo->Master = FALSE;
> ConfigInfo->NeedPhysicalAddresses = FALSE;
> ConfigInfo->TaggedQueuing = TRUE;
> ConfigInfo->AutoRequestSense = TRUE;
> ConfigInfo->MultipleRequestPerLu = TRUE;
> ConfigInfo->BufferAccessScsiPortControlled = FALSE;
> ConfigInfo->DeviceExtensionSize = sizeof(DEV_EXTN);
> ConfigInfo->SpecificLuExtensionSize = 0;
> ConfigInfo->SrbExtensionSize = sizeof(DEV_EXTN);
> ConfigInfo->WmiDataProvider = TRUE;
> ConfigInfo->MapBuffers = STOR_MAP_NON_READ_WRITE_BUFFERS;
> ConfigInfo->SynchronizationModel = StorSynchronizeHalfDuplex;
>
> 3. I got a call to HwStartIo instead of HwInitialize with SRB function
> code
> as SRB_FUNCTION_PNP.the PnPAction member was set to StorRemoveDevice.
>
> I suspect the problem could be with my PortConfiguration structure.Kindly
> through some light on what was wrong with the above structures.
>
> Thank you.
> Alex.