none
IoRegisterDeviceInterface() fails RRS feed

  • Question

  • Hello,

      IoRegisterDeviceInterface() call within HwFindAdapter() routine in my storport miniport driver fails. The stack trace for the HwFindAdapter shows that IoAttachDeviceToStack function is being called.

    Do we still need to call the IoRegisterDeviceInterface() call inside the HwFindAdapter routine ?

    Thanks,

    Please see stack trace below

    Stack trace for HwFindAdapter routine

     # ChildEBP RetAddr  Args to Child              
    00 80786648 9285ba05 8d20700c 00000000 00000000 SDCStor!SDCHwFindAdapter(void * PDevExt = 0x8d20700c, void * PHwContext = 0x00000000, void * PBusInformation = 0x00000000, char * PArgumentString = 0x8d206810 "PlaceHolder=0;", struct _PORT_CONFIGURATION_INFORMATION * PConfigInfo = 0x8d192190, unsigned char * PBAgain = 0x80786683 "") (FPO: [Non-Fpo]) (CONV: stdcall)
    WARNING: Stack unwind information not available. Following frames may be wrong.
    01 80786678 928579e7 00192188 8d206810 00000000 storport!DllInitialize+0x7674
    02 807866a0 9288a7d0 8d1920e8 8d191560 8d0e5300 storport!DllInitialize+0x3656
    03 807866c8 9288a8e8 94a9e768 8d0e5300 92868000 storport!StorPortExtendedFunction+0x2c3cd
    04 807866e4 9288aeb5 00000000 010e5300 8d0e53b8 storport!StorPortExtendedFunction+0x2c4e5
    05 80786700 89879169 8d192030 8d0e5300 80786788 storport!StorPortExtendedFunction+0x2cab2
    06 80786718 89a048c6 00000000 8d145b50 8c8631c8 nt!IofCallDriver+0x64
    07 80786734 898543dc 80786764 898571bf 8c8631c8 nt!IoClearDependency+0x535
    08 80786798 899fb727 898571bf 8c8631c8 8d1435f8 nt!IoAttachDeviceToDeviceStack+0x3c2
    09 807867f4 899fb5f0 8c8631c8 0000003e 00000000 nt!IoSetDevicePropertyData+0x1e20
    0a 80786810 89a0300e 00000000 00000000 00000000 nt!IoSetDevicePropertyData+0x1ce9
    0b 80786a0c 89856d2c 8c7a9458 00000000 80786a48 nt!RtlUnicodeStringToOemString+0x111f
    0c 80786a54 898563a4 00000000 8d1916a0 94a7aaa8 nt!IoQueueThreadIrp+0x1ae
    0d 80786a6c 89be8ebd 00000000 00000000 00000000 nt!IoGetDriverObjectExtension+0x162
    0e 80786ae4 89bfd197 8080a790 00000007 8080a790 nt!KeSetProfileIrql+0x71a5
    0f 80786b6c 89c013f0 0080a790 8c6f2dc0 8c6f2a50 nt!TmInitSystem+0x367f
    10 80786c48 899d2630 80786c90 89a4f63d 8080a790 nt!TmInitSystem+0x78d8
    11 80786c50 89a4f63d 8080a790 fba384c3 00000000 nt!PsSetLegoNotifyRoutine+0x311
    12 80786c90 898f3ab9 899d2623 8080a790 00000000 nt!RtlAnsiStringToUnicodeString+0x19d
    13 00000000 00000000 00000000 00000000 00000000 nt!KeInitializeTimerEx+0x3cf

    Tuesday, January 9, 2018 7:33 PM

Answers

  • If you are writing a driver for this device, then you should have the chip's specification with the registers defined.  There is not a single SAS interface specification, so without the chip's spec you are doomed.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Wednesday, January 10, 2018 2:23 AM
  • If you have the source of the Linux driver, you can probably resolve enough information to proceed.  Note: it is possible there are features that Linux does not use that are desirable for Windows, but the source code should allow you to determine the use of the registers that are at various offsets from the base.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Wednesday, January 10, 2018 6:57 PM

All replies

  • Where did you get the physical device object to pass to IoRegisterDeviceInterface?  What interface are you registering?  The standard system interfaces are all handled for you by the port driver.

    Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.

    Tuesday, January 9, 2018 8:50 PM
  • also, you need to fix your symbols

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, January 9, 2018 9:14 PM
  • Thanks for your response. I was trying to register the SAS device for which I am writing the driver under the class GUID_DEVCLASS_SCSIADAPTER .  I did not get the PDO. I tried to get the PDO from GetDeviceObjects() call for DeviceExtension that represented my SAS device. But this call returned all three objects as 0x0

    I have a follow up question.

    I was able to get the base address register for the SAS HBA as listed below. How can I get the HBA capabilities and other HBA specific details using the base address register?  For AHCI, we can map it to AHCI_Memory registers. For SAS HBA, what can we map the BAR to? Appreciate your help.

    I am getting the BAR as below:

    pDevExt->RegisterBase =
        (unsigned int *)StorPortGetDeviceBase(pDevExt,
                                                   PConfigInfo->AdapterInterfaceType,
                                                   PConfigInfo->SystemIoBusNumber,
                                                   AccessRange->RangeStart,
                                                   AccessRange->RangeLength,
                                                   (BOOLEAN)!AccessRange->RangeInMemory);
        pDevExt->RegisterBasePhys = AccessRange->RangeStart.LowPart;

    Tuesday, January 9, 2018 9:42 PM
  • If you are writing a driver for this device, then you should have the chip's specification with the registers defined.  There is not a single SAS interface specification, so without the chip's spec you are doomed.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Wednesday, January 10, 2018 2:23 AM
  • Appreciate your response. I don't have the chip spec. What are my options to get the chip spec?

    Thanks.

    Wednesday, January 10, 2018 6:25 PM
  • Check the board and see what chip is on it, then search the internet and see if there are specifications.   If that does not work, query the board manufacturer or the chip manufacturer for the specifications.   Unfortunately, it is likely you won't be able to get the specifications, at which point the project is doomed.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Wednesday, January 10, 2018 6:28 PM
  • Thanks. Does the Linux driver released by the vendor for the HBA provide the spec?

    Wednesday, January 10, 2018 6:37 PM
  • If you have the source of the Linux driver, you can probably resolve enough information to proceed.  Note: it is possible there are features that Linux does not use that are desirable for Windows, but the source code should allow you to determine the use of the registers that are at various offsets from the base.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Wednesday, January 10, 2018 6:57 PM
  • Thanks. I am starting to look at that option.
    Wednesday, January 10, 2018 7:00 PM