none
Error Loading Driver for RTL8111GS RRS feed

  • Question

  • Hello,

    When WEC7 is loading the driver for the RTL8111GS I am seeing that after NdisMMapIoSpace is called, immediately I see NdisMUnmapIoSpace is called following by the unloading of the driver. I have attached the debug output underneath here. It seems as if the driver is unable to map the physical memory to a virtual memory address (that is me guessing). Has anyone else encountered this when trying to load a PCI-e NIC driver? I'm not sure how to turn on debug messages from inside the PCI enumeration code to see any of the NIC's information, I just set the following in the config.bib file to see the following output.

    kernel.dll:initialKernelLogZones FFFFFFFF 00002108       FIXUPVAR

    The debug output is below:

    PID:00400002 TID:00900006 DoVMAlloc - returns ac8d6000
    PID:00400002 TID:00900006 ==>ndisReadOffloadRegistry: Miniport AC8D5308
    PID:00400002 TID:00900006 <==ndisReadOffloadRegistry: Miniport AC8D5308, Status c0000001, Registry 20000
    PID:00400002 TID:00900006 ==>NdisMSetAttributesEx: Miniport AC8D5308
    PID:00400002 TID:00900006 ==>ndisSetMiniportHandlers: Miniport AC8D5308
    PID:00400002 TID:00900006 ==>ndisSetupLwfMiniportHandlers : Miniport AC8D5308
    PID:00400002 TID:00900006 ==>ndisSetupNoFilterHandlers : Miniport AC8D5308
    PID:00400002 TID:00900006 <==ndisSetupNoFilterHandlers : Miniport AC8D5308
    PID:00400002 TID:00900006 <==ndisSetupLwfMiniportHandlers: Miniport AC8D5308
    PID:00400002 TID:00900006 <==ndisSetMiniportHandlers: Miniport AC8D5308
    PID:00400002 TID:00900006 ==>ndisSetMiniportHandlers: Miniport AC8D5308
    PID:00400002 TID:00900006 ==>ndisSetupLwfMiniportHandlers : Miniport AC8D5308
    PID:00400002 TID:00900006 ==>ndisSetupNoFilterHandlers : Miniport AC8D5308
    PID:00400002 TID:00900006 <==ndisSetupNoFilterHandlers : Miniport AC8D5308
    PID:00400002 TID:00900006 <==ndisSetupLwfMiniportHandlers: Miniport AC8D5308
    PID:00400002 TID:00900006 <==ndisSetMiniportHandlers: Miniport AC8D5308
    PID:00400002 TID:00900006 <==NdisMSetAttributesEx: Miniport AC8D5308
    PID:00400002 TID:00900006 ==>NdisMQueryAdapterResources: Miniport AC8D5308
    PID:00400002 TID:00900006 <==NdisMQueryAdapterResources: Miniport AC8D5308, Status 0
    PID:00400002 TID:00900006 ==>NdisMRegisterIoPortRange: Miniport AC8D5308
    PID:00400002 TID:00900006 <==NdisMRegisterIoPortRange: Miniport AC8D5308, Status 0
    PID:00400002 TID:00900006 ==>NdisMMapIoSpace: Miniport AC8D5308, PhysicalAddress 0:d0b00000, Length 100
    PID:00400002 TID:00900006 DoVMAlloc - proc-id: 00400002, dwAddr = 00000000, cPages = 0x1, fAllocType = 00002000, dwPageType = 00001000
    PID:00400002 TID:00900006 DoVMReserve - process-id: 00400002, dwAddr = 00000000, cPages = 0x1, base = 00000000, fAllocType = 00002000
    PID:00400002 TID:00900006 DoVMReserve - searching from va = ac930000
    PID:00400002 TID:00900006 SearchFreePages: Search free pages from 0xac930000 for 0x1 pages, limit = 0xf0000000
    PID:00400002 TID:00900006 SearchFreePages: returns 0xac930000
    PID:00400002 TID:00900006 DoVMReserve - use Addr ac930000
    PID:00400002 TID:00900006 last page table at 9119c000
    PID:00400002 TID:00900006 DoVMReserve - returns ac930000
    PID:00400002 TID:00900006 DoVMAlloc - returns ac930000
    PID:00400002 TID:00900006 VMCopyPhysical - process id: 00400002, dwAddr ac930000, dwPfn = d0b00000 cPages = 0x1
    PID:00400002 TID:00900006 Enumerate2ndPT: idxdir = 000002b2, idx2nd = 00000130, ppdir->pte[idxdir] = 1119c043
    PID:00400002 TID:00900006 Enumerate2ndPT: &pptbl->pte[idx2nd] = 9119c4c0, pptbl->pte[idx2nd] = d0b00013
    PID:00400002 TID:00900006 VMCopyPhysical returns 0x1
    PID:00400002 TID:00900006 <==NdisMMapIoSpace: Miniport AC8D5308, Status 0
    PID:00400002 TID:00900006 ==>NdisMUnmapIoSpace: Miniport AC8D5308
    PID:00400002 TID:00900006 VMRelease: release VM from dwAddr = ac930000 of 00000001 pages
    PID:00400002 TID:00900006 Enumerate2ndPT: idxdir = 000002b2, idx2nd = 00000130, ppdir->pte[idxdir] = 1119c043
    PID:00400002 TID:00900006 Enumerate2ndPT: &pptbl->pte[idx2nd] = 9119c4c0, pptbl->pte[idx2nd] = 00000000
    PID:00400002 TID:00900006 <==NdisMUnmapIoSpace: Miniport AC8D5308
    PID:00400002 TID:00900006 ==>NdisMDeregisterIoPortRange: Miniport AC8D5308
    PID:00400002 TID:00900006 <==NdisMDeregisterIoPortRange: Miniport AC8D5308
    PID:00400002 TID:00900006 ==>NdisMDeregisterAdapterShutdownHandler: Miniport AC8D5308
    PID:00400002 TID:00900006 <==NdisMDeregisterAdapterShutdownHandler: Miniport AC8D5308
    PID:00400002 TID:00900006 ndisMInitializeAdapter: Miniport AC8D5308 INIT FAILURE: Dereferencing mini driver block
    PID:00400002 TID:00900006 ndisDereferenceMiniport:Miniport AC8D5308, Ref = 0
    PID:00400002 TID:00900006 ==>ndisMUnload: DriverObject A4472810
    PID:00400002 TID:00900006 ndisMUnload: MiniBlock AC8D50C0
    PID:00400002 TID:00900006 <==ndisMUnload: DriverObject A4472810, MiniBlock 00000000
    PID:00400002 TID:00900006 VMDecommit - Decommitting from ef570000, for 0xd pages

    Thanks

    Tuesday, April 26, 2016 9:32 PM

All replies

  • 1. Whether this miniport driver is being developed by you? Do you have source code for the driver?

    2. Are you using WEC7 default PCIBus driver? Or customized one?

    3. Are you using WEC7 default CEDDK? Or customized one?

    4. Your registry settings (for both PCIBus and miniport driver)?. Are you providing proper I/O Address there?

    5. On which processor you are testing this?

    • Edited by Keshava GN Wednesday, April 27, 2016 1:14 PM
    Wednesday, April 27, 2016 1:13 PM
  • Hello,

    1. There is no source code for the driver, it was not developed by me. The same driver has been used to run another board with a RTL8168 NIC, I believe it is the same driver for the RTL8111 (this is what I was told, could be wrong)

    2. Using the default PCIBus driver that comes with WEC7

    3. Using the default CEDDK

    4. 

    PCI Bus Registry:

    ;-- PCI Bus --------------------------------------------------------------------
    ; @CESYSGEN IF CE_MODULES_PCI
    IF BSP_NOPCIBUS !

    ; @XIPREGION IF PACKAGE_OEMXIPKERNEL
    ; HIVE BOOT SECTION
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI]
        "NoConfig"=dword:1
        "MemBase"=dword:80000000
        "MemLen" =dword:7f000000
        "IoBase"=dword:8000
        "IoLen" =dword:8000
    #include "$(DRIVERS_DIR)\pcibus\pcibus.reg"

    IF BSP_NOCFGPCIPCIBRIDGE
    ; Because the BIOS configure the PCI-PCI bridge and it is different from
    ; how we configured we cannot touch the window. Set NoConfig to all
    ; PCI to PCI Bridge to indicate PCiBus do not configure PCI-PCI bridge window.
    ;
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Template\PCI-PCI-BRIDGE]
        "Class"=dword:06
        "SubClass"=dword:04
        "NoConfig"=dword:1
    ENDIF BSP_NOCFGPCIPCIBRIDGE

    ; END HIVE BOOT SECTION
    ; @XIPREGION ENDIF PACKAGE_OEMXIPKERNEL

    ENDIF BSP_NOPCIBUS !
    ; @CESYSGEN ENDIF CE_MODULES_PCI
    ;-------------------------------------------------------------------------------

    Miniport Registry:

    IF BSP_REALTEK_RT
    ; Generic adapter configuration/description
    [HKEY_LOCAL_MACHINE\Comm\RTCENIC]
       "DisplayName"="Realtek Gigabit/Fast Ethernet Controller"
       "Group"="NDIS"
       "ImagePath"="rtcenic.dll"

    ;Create registry information for template (will be copied to ALL instances of
    ;adapters using the Intel Miniport Driver

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Template\RTCENIC]
    ;PCI Bus Enumeration Information
       "Class"=dword:02
       "SubClass"=dword:00
       "ProgIF"=dword:0
       "VendorID"=multi_sz:"10EC","10EC","10EC","10EC","10EC"
       "DeviceID"=multi_sz:"8169","8168","8167","8136","8111"
       "Dll"="NDIS.dll"
       "Entry"="NdisPCIBusDeviceInit"
    ;Installable ISR Handler Information
       "IsrDll"="giisr.dll"
       "IsrHandler"="ISRHandler"
       "PortIsIO"=dword:0
       "PortOffset"=dword:3e
       "PortSize"=dword:2
       "PortMask"=dword:FFFF
    ENDIF

    ------------------------------------------------

    from common\oak\drivers:

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI]
        "Dll"="PCIbus.dll"
        "Order"=dword:20
        "Flags"=dword:8
        "BusIoctl"=dword:2a0048
        "IClass"=multi_sz:"{CD149194-286F-4095-9694-D70E6AB867C3}=%b","{6F40791D-300E-44E4-BC38-E0E63CA8375C}=%b"

    ; Registry enumerator used for loading each PCI device driver instance   
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Instance]
        "InterfaceType"=dword:5
        "BusName"="PCI"

    5. Testing on the Intel Baytrail E3825 with the RTL8111GS NIC with no luck. Successfully tested on another board that has Intel Baytrail E3845 with RTL8168.

    With regard to #4, I do not know if I am providing proper I/O adressing their, and that is why I wanted to know how to produce debug output from the PCIbus driver so that the NIC would appear and display some information. From the BIOS I am using I know that the NIC resides on Bus number 3 while everything else resides on Bus number 0. 

    Thanks

    Wednesday, April 27, 2016 3:07 PM
  • Did you try enabling debug zones for PCIBus?

    ([HKEY_LOCAL_MACHINE\DebugZones])

    • Edited by Keshava GN Thursday, April 28, 2016 3:33 AM
    Thursday, April 28, 2016 3:31 AM
  • Hello,

    Yes, the information for the NIC shows as follows:

    -------------------------------------------------------------------------------
    PID:00400003 TID:00850006 Bus/Device/Function = 3/0/0, Ethernet Network Controller
    PID:00400003 TID:00850006   VendorID = 0x10EC, DeviceID = 0x8168, Command = 0x0007, Status = 0x0010
    PID:00400003 TID:00850006   RevisionID = 0x0C, ProgIf = 0x00, SubClass = 0x00, BaseClass = 0x02
    PID:00400003 TID:00850006   CacheLineSize = 0x10, LatencyTimer = 0x00, HeaderType = 0x00, BIST = 0x00
    PID:00400003 TID:00850006   BaseAddresses:
    PID:00400003 TID:00850006     0x00005001  0x00000000  0xD0B00004 0x00000000  0xC820000C  0x00000000
    PID:00400003 TID:00850006   CIS = 0x00000000, SubVendorID = 0x10EC, SubSystemID = 0x0123
    PID:00400003 TID:00850006   ROMBaseAddress = 0x00000000
    PID:00400003 TID:00850006   InterruptLine = 0x0A, InterruptPin = 0x01, MinGrant = 0x00, MaxLatency = 0x00
    PID:00400003 TID:00850006
    -------------------------------------------------------------------------------

    The base addresses look odd to me, I thought they had to end in either a 1 for I/O or a 0, but it is showing three base addresses and they are spaced out (not sure how normal that is):

    BaseAddresses:
    0x00005001  0x00000000  0xD0B00004 0x00000000  0xC820000C  0x00000000

    From here the driver calls a bunch of NDIS calls, but the failure happens at NdisMMapIoSpace as can be seen below. It is using the physical address of d0b00000, which is 4 less than one of the base addresses identified above. 

    PID:00400003 TID:00850006 ==>NdisMMapIoSpace: Miniport AC8D5308,
    PhysicalAddress 0:d0b00000, Length 100
    PID:00400003 TID:00850006 <==NdisMMapIoSpace: Miniport AC8D5308, Status 0
    PID:00400003 TID:00850006 ==>NdisMUnmapIoSpace: Miniport AC8D5308
    PID:00400003 TID:00850006 <==NdisMUnmapIoSpace: Miniport AC8D5308
    PID:00400003 TID:00850006 ==>NdisMDeregisterIoPortRange: Miniport AC8D5308
    PID:00400003 TID:00850006 <==NdisMDeregisterIoPortRange: Miniport AC8D5308
    PID:00400003 TID:00850006 ==>NdisMDeregisterAdapterShutdownHandler:
    Miniport AC8D5308
    PID:00400003 TID:00850006 <==NdisMDeregisterAdapterShutdownHandler:
    Miniport AC8D5308
    PID:00400003 TID:00850006 ndisMInitializeAdapter: Miniport AC8D5308
    INIT FAILURE: Dereferencing mini driver block
    PID:00400003 TID:00850006 ndisDereferenceMiniport:Miniport AC8D5308, Ref = 0
    PID:00400003 TID:00850006 ==>ndisMUnload: DriverObject A4472810
    PID:00400003 TID:00850006 ndisMUnload: MiniBlock AC8D50C0
    PID:00400003 TID:00850006 <==ndisMUnload: DriverObject A4472810,
    MiniBlock 00000000
    PID:00400003 TID:00850006
    DeviceFolder::LoadDevice(Drivers\BuiltIn\PCI\Instance\RTCENIC1) last
    1013 TicksPID:00400003 TID:00850006 DeviceFolder::LoadDevice!Loading
    driver from device key Drivers\BuiltIn\PCI\Instance\PCI-PCI-BRIDGE1

    Is it possible that the NdisMQueryAdapterResources is returning the wrong resources for the PCI card as was the case for this other person:

    http://www.tech-archive.net/Archive/WindowsCE/microsoft.public.windowsce.platbuilder/2007-02/msg00422.html

    This would lead to NdisMUnmapIoSpace failing because it has the wrong address. I'm not experienced in this, so I am just guessing at this point. Any other ideas?

    Thursday, April 28, 2016 9:53 PM
  • The addresses in the BIOS were as follows:

    I/O Range: 5000 - 50FF

    Memory I/O Range: D0B00000 - D0B00FFF

    Memory I/O Range: C8200000 - C8203FFFF

    PCIbus.dll reported the base addresses as:

    0x00005001  0x00000000  0xD0B00004 0x00000000  0xC820000C  0x00000000

    The values are close but not the same, so it seems that it may have the correct values. Not sure if this is enough information to know what is going on (why NdisMmapIoSpace immediately leads to NdisMUnmapIoSpace and the rest of the unloading function calls).

    Thursday, April 28, 2016 11:30 PM