Search code examples
windows-cedevice-driverpci-endisminiport

NdisMGetBusData function returns zero


I'm trying to develop NDIS6.0 based mini-port driver on WEC7 (Windows Embedded Compact 7) for a PCIe network card.

In MPInitialize function when I try to read PCI config space using function NdisMGetBusData, It is returning zero.

From documentation, it should read number of bytes read. There is no any more info available in documentation.

I'm not getting any debug message from NDIS wrapper layer.

I have added print in my OALPCICfgRead in my OAL layer. I'm not getting this print also.

The function that I'm calling is :

ulResult = NdisMGetBusData(
                       Adapter->AdapterHandle,
                       PCI_WHICHSPACE_CONFIG,
                       FIELD_OFFSET(PCI_COMMON_CONFIG, VendorID),
                       buffer,
                       PCI_COMMON_HDR_LENGTH );

Here ulResult is zero.

Not getting any additional debug prints from NDIS.

Prints in PCI controller lower level functions also not appearing.

It'll be helpful if somebody help me on debugging this issue.


Solution

  • The problem is in WEC7's CEDDK.dll. There was no support for PCI bus HalGetBusDataByOffset and HalSetBusDataByOffset functions for ARM in DDK_BUS.lib (they have built in support for x86 ).

    When I cloned this driver from public code and added this support, the functionality is working fine now.

    This seems to be undocumented in MSDN.