none
NdisMGetBusData function returns zero. RRS feed

  • Question

  • Hi,

    I'm trying to develop NDIS6.0 based mini-port driver 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.

    Somebody please help me to debug this...

    Thanks.

    Regards,

    GNK

    Thursday, December 10, 2015 11:56 AM

Answers

  • Hi,

    I got some idea on this now.

    The problem was because of WEC7's default CEDDK.dll.

    In i.MX6 BSP, it has a cloned version of this dll (with different dll name) and most of the libraries it needed.

    In default ddk_bus.lib, there is no support for ARM for PCI bus.

    They have added #if x86.

    But in i.MX6 cloned version, there is support for PCI for ARM.

    This modified library is being used for cloned PCIBus.dll.

    So, from here PCI config read/write is working.

    But NDIS-PCI is using default CEDDK.dll, where there is no support for PCI for ARM.

    Now I have cloned this driver and modified the SOURCELIBS to link i.MX6 BSP's cloned version of DDK_BUS.lib in order to include support for PCI for ARM.

    Now i'm able to read PCI config from miniport properly.

    Thanks.

    • Marked as answer by Keshava GN Tuesday, January 12, 2016 3:29 AM
    Tuesday, January 12, 2016 3:29 AM

All replies

  • The function 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.

    Friday, December 11, 2015 7:18 AM
  • Any ideas on this?

    Thanks

    Monday, January 11, 2016 6:41 AM
  • Hi,

      did you try to enable additional debug zones for NDIS to investigate your issue?
    Looks like it has got "BusInfo" zone, you could try it.

    Best regards, Igor

    Monday, January 11, 2016 7:39 AM
  • Thanks for the reply, Igor.

    Yes. I have enabled NDIS debug zones. I'm getting following prints:

    PID:00400002 TID:00A40006 ==>NdisMGetBusData: Miniport D3118BD8
    PID:00400002 TID:00A40006 ==>NdisReadPciSlotInformation: Miniport D3118BD8
    PID:00400002 TID:00A40006 <==NdisReadPciSlotInformation: Miniport D3118BD8
    PID:00400002 TID:00A40006 <==NdisMGetBusData: Miniport D3118BD8, BytesRead 0x0


    AFAIK, I should get prints from OALPCICfgRead, which is the OAL function for reading PCI Config space. (I have added RETAILMSGs in this funtion)

    But I'm not getting these prints.

    Thanks again

    --Keshava

    Monday, January 11, 2016 9:33 AM
  • Hi,

    I got some idea on this now.

    The problem was because of WEC7's default CEDDK.dll.

    In i.MX6 BSP, it has a cloned version of this dll (with different dll name) and most of the libraries it needed.

    In default ddk_bus.lib, there is no support for ARM for PCI bus.

    They have added #if x86.

    But in i.MX6 cloned version, there is support for PCI for ARM.

    This modified library is being used for cloned PCIBus.dll.

    So, from here PCI config read/write is working.

    But NDIS-PCI is using default CEDDK.dll, where there is no support for PCI for ARM.

    Now I have cloned this driver and modified the SOURCELIBS to link i.MX6 BSP's cloned version of DDK_BUS.lib in order to include support for PCI for ARM.

    Now i'm able to read PCI config from miniport properly.

    Thanks.

    • Marked as answer by Keshava GN Tuesday, January 12, 2016 3:29 AM
    Tuesday, January 12, 2016 3:29 AM