none
NDIS_STATUS_BAD_CHARACTERISTICS for wifi development for using ndis6.0 support?? RRS feed

  • Question

  • Dear Developers,

    Greetings!!

    As, I am developing the wifi miniport driver for AM335x on WinCE7 platform with ndis 6.1 support. I have created the DriverEntry function in the miniport driver and it is being called properly. I can see the debug logs that I have given in the DriverEntry function. 

    In DriverEntry function I am filling the ndis_miniport_driver_characteristics structure with the minimal value to check the DriverEntry is returning success or not.

    Below are the structure entries: -

            PHYTEC_STATUS status =	PHYTEC_STATUS_SUCCESS;
    	PHYTEC_HANDLE hMiniportDriverContext = NULL;
    	PHYTEC_HANDLE hNdisMiniportDriverHandle = NULL;
    
    	NDIS_MINIPORT_DRIVER_CHARACTERISTICS PHYMiniChar;
    
    PHYMiniChar.Header.Type				= NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS;
    	PHYMiniChar.Header.Revision			= NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2;
    	PHYMiniChar.Header.Size				= NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2;
    	PHYMiniChar.MajorNdisVersion		= PHY_NDIS_MAJOR_VERSION_6;
    	PHYMiniChar.MinorNdisVersion		= PHY_NDIS_MINOR_VERSION_1;
    	PHYMiniChar.MajorDriverVersion		= PHY_DRIVER_MAJOR_VERSION_1;
    	PHYMiniChar.MinorDriverVersion		= PHY_DRIVER_MINOR_VERSION_0;
    	PHYMiniChar.Flags					= NDIS_WDM_DRIVER;
    	PHYMiniChar.InitializeHandlerEx 	= phytec_initialize;

    and immediately after that I am using NdisMRegisterMiniportDriver function so that my driver is register with ndis library. but the NdisMRegisterMiniportDriver is  not returning success. I's return type is NDIS_STATUS_BAD_CHARACTERISTICS

    After putting some efforts, I come to know that the source of the error may be the MajorNdisVersion. But I have checked, I am getting as -

    PHY_RTLMSG(TRUE,(TEXT("The major version is %d \r\n"),PHY_NDIS_MAJOR_VERSION_6));
    	PHY_RTLMSG(TRUE,(TEXT("The minor version is %d \r\n"),PHY_NDIS_MINOR_VERSION_1));

    Here are the logs - 

       8176 PID:400002 TID:9e0006 +NDIS Driver Entry Point......
       8176 PID:400002 TID:9e0006 +NDIS DriverEntry: Driver Object & RegistryPath is (0x9E432C50, 0x1)
       8177 PID:400002 TID:9e0006 +phytec_miniport_characteristics.
       8177 PID:400002 TID:9e0006 The major version is 6 
       8178 PID:400002 TID:9e0006 The minor version is 1 
       8179 PID:400002 TID:9e0006 ==>NdisMRegisterMiniportDriver: DriverObject 9E432C50
       8180 PID:400002 TID:9e0006 <==NdisMRegisterMiniportDriver: MiniBlock 00000000
       8181 PID:400002 TID:9e0006 STATUS: Bad Characteristics
       8181 PID:400002 TID:9e0006 -phytec_miniport_characteristics.
       8182 PID:400002 TID:9e0006 -NDIS Driver Exit Point...... 

    One more doubt that the registry I can see is seems strange to me.


    Wednesday, October 14, 2015 1:08 PM

Answers

  • Dear Developers,

    Greetings!!!!

    I have solved the NDIS_STATUS_BAD_CHARACTERISTICS error after studying all correct document on MSDN instead of Wiki information.

    Prior I was thinking that Wince7 and 2013 supports NDIS6.1 but I got this info from Wiki and i compiled it for the same version and I was having the mentioned error and after that I focused on MSDN info only and I come to know that it supports NDIS6.0 only and for the DriverEntry funciton we have to initialize the characteristics structure but we must add all the minimal entry points that is required for characteristics function. I did that and now I am able to solve the error of bad characteristics...

    Thanks for all support.

    Friday, October 23, 2015 4:50 AM

All replies

  • I don't know about NDIS6 registration. But did you check with

    PHYMiniChar.MinorNdisVersion		= 0;

    ?

    Because, the documentation here says that

    MajorNdisVersion

    The major version of the NDIS library the driver is using. The current value is 0x06.

    MinorNdisVersion

    The minor NDIS version. The current value is 0x00.


    Keshava G N, Software Engineer, iWave Systems, Bangalore ( http://iwavesystems.com ). mail - keshavagnATiwavesystemsDOTcom , blog - http://wec7.blogspot.com ,

    Thursday, October 15, 2015 3:59 AM
  • Hi GNKeshava,

    Greetings!!

    Yes, according to document, the major and the minor number should be the same what you have share from the part of the document. 

    I have already tried with the above mentioned MajorNdisVersion and MinorNdisVersion

    But, I have read some where on msdn that for MinorndisVersion

    Value          Meaning
    0              NDIS6
    20             NDIS6.20
    30             NDIS6.30

    But what about for NDIS6.10 that is compatible with Compact7 and WinCE 2013

    Have a look on the below link..

    https://msdn.microsoft.com/fr-fr/library/ff565958(v=vs.85).aspx

    Thursday, October 15, 2015 5:53 AM
  • The link that you are specifying is for Windows.

    I'm not sure about ndis6.1 support in WEC7.

    You can test with minor version 0, and check whether you are getting BAD_CHARACTERISTICS error or not, so that you can understand whether the problem is with version, or something else.


    Keshava G N, Software Engineer, iWave Systems, Bangalore ( http://iwavesystems.com ). mail - keshavagnATiwavesystemsDOTcom , blog - http://wec7.blogspot.com ,

    Thursday, October 15, 2015 6:10 AM
  • Hi GNKeshava,

    I have already mentioned that I tried with both MinorNdisVersion 1 and 0.

    and still the logs are same...

    Thursday, October 15, 2015 6:21 AM
  • Dear Developers,

    Greetings!!

    I have made the following changes but I have got no success: -

    1. Fill the structure with all the minimal entries as shown below - 

    PHYMiniChar.Header.Type						= NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS;
    	PHYMiniChar.Header.Revision					= NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1;
    	PHYMiniChar.Header.Size						= sizeof(NDIS_MINIPORT_DRIVER_CHARACTERISTICS);
    	PHYMiniChar.MajorNdisVersion				= PHY_NDIS_MAJOR_VERSION_6;
    	PHYMiniChar.MinorNdisVersion				= PHY_NDIS_MINOR_VERSION_1;
    	PHYMiniChar.MajorDriverVersion				= PHY_DRIVER_MAJOR_VERSION_1;
    	PHYMiniChar.MinorDriverVersion				= PHY_DRIVER_MINOR_VERSION_0;
    	PHYMiniChar.Flags							= 0;
    	PHYMiniChar.CheckForHangHandlerEx			= phytec_CheckForHang;
    	PHYMiniChar.DevicePnPEventNotifyHandler		= phytec_DevicepPnP;
    	PHYMiniChar.UnloadHandler					= phytec_Unload;
    	PHYMiniChar.HaltHandlerEx					= phytec_Halt;
    	PHYMiniChar.InitializeHandlerEx 			= phytec_Initialize;
    	PHYMiniChar.OidRequestHandler				= phytec_OidRequest;
    	PHYMiniChar.PauseHandler					= phytec_Pause;
    	PHYMiniChar.ResetHandlerEx					= phytec_Reset;
    	PHYMiniChar.RestartHandler					= phytec_Restart;
    	PHYMiniChar.SetOptionsHandler				= phytec_SetOptions;
    	PHYMiniChar.ShutdownHandlerEx				= phytec_ShutDown;
    	PHYMiniChar.CancelOidRequestHandler			= phytec_CancelOidRequest;

    And sources file for NDIS6.0 support is as: -

    CDEFINES=$(CDEFINES) -DNDIS_LEGACY_MINIPORT=1
    CDEFINES=$(CDEFINES) -DNDIS60_MINIPORT=1 -DNDIS_MINIPORT_DRIVER=1 -DWIN_CE
    CDEFINES=$(CDEFINES) -DNDIS_LEGACY_MINIPORT=1


    My my NdisMRegisterMiniportDriver is as: -

    //NdisMRegisterMiniport
    	status = NdisMRegisterMiniportDriver(DriverObject,
    									RegistryPath,
    									(PHYTEC_HANDLE)ghMiniportDriverContext,
    									&PHYMiniChar,
    									&ghNdisMiniportDriverHandle);

    But still, the logs are same...

    The return type of NdisMRegisterMiniportDriver is Bad Characteristics


    Friday, October 16, 2015 12:34 PM
  • For the case of something else... I had some strange issues with NDIS functions (DeviceIoControl, IOCTL_NDIS_REBIND_ADAPTER). The problem was, that in CE6, some registry keys (IP,Gateway,Subnet) were REG_SZ, in Compact 2013 they are MULTI_REG_SZ. Also, the DeviceIoControl for NDIS needed a input buffer with a double \0 termination and an input size including this \0s, in CE6 a normal termination was sufficient. Perhaps this is also in WEC7?

    Kind regards, Pascal

    Wednesday, October 21, 2015 5:46 AM
  • Dear Developers,

    Greetings!!!

    It's still a startup and I m in the first function and I am not using the mentioned keys so far.

    Wednesday, October 21, 2015 9:28 AM
  • Dear Developers,

    Greetings!!!!

    I have solved the NDIS_STATUS_BAD_CHARACTERISTICS error after studying all correct document on MSDN instead of Wiki information.

    Prior I was thinking that Wince7 and 2013 supports NDIS6.1 but I got this info from Wiki and i compiled it for the same version and I was having the mentioned error and after that I focused on MSDN info only and I come to know that it supports NDIS6.0 only and for the DriverEntry funciton we have to initialize the characteristics structure but we must add all the minimal entry points that is required for characteristics function. I did that and now I am able to solve the error of bad characteristics...

    Thanks for all support.

    Friday, October 23, 2015 4:50 AM
  • Can you post your working ndis_miniport_driver_characteristics  structure?
    Saturday, October 24, 2015 4:17 AM
  • Dear Developers,

    Greetings!!!!

    Hi GNKeshava!!!

    Below are the entries for the structure

    PHYMiniChar.Header.Type						= NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS;
    	PHYMiniChar.Header.Revision					= NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1;
    	PHYMiniChar.Header.Size						= NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1;
    	PHYMiniChar.MajorNdisVersion				= PHY_NDIS_MAJOR_VERSION_6;
    	PHYMiniChar.MinorNdisVersion				= PHY_NDIS_MINOR_VERSION_0;
    	PHYMiniChar.MajorDriverVersion				= PHY_DRIVER_MAJOR_VERSION_1;
    	PHYMiniChar.MinorDriverVersion				= PHY_DRIVER_MINOR_VERSION_0;
    	PHYMiniChar.Flags							= NDIS_WDM_DRIVER;
    	PHYMiniChar.CheckForHangHandlerEx			= phytec_CheckForHang;
    	PHYMiniChar.DevicePnPEventNotifyHandler		= phytec_DevicepPnP;
    	PHYMiniChar.UnloadHandler					= phytec_Unload;
    	PHYMiniChar.HaltHandlerEx					= phytec_Halt;
    	PHYMiniChar.InitializeHandlerEx 			= phytec_Initialize;
    	PHYMiniChar.OidRequestHandler				= phytec_OidRequest;
    	PHYMiniChar.SendNetBufferListsHandler		= phytec_SendNetBufferLists;
    	PHYMiniChar.ReturnNetBufferListsHandler     = phytec_ReturnNetBufferLists;
    	PHYMiniChar.CancelSendHandler				= phytec_CancelSend;
    	PHYMiniChar.PauseHandler					= phytec_Pause;
    	PHYMiniChar.ResetHandlerEx					= phytec_Reset;
    	PHYMiniChar.RestartHandler					= phytec_Restart;
    	PHYMiniChar.SetOptionsHandler				= phytec_SetOptions;
    	PHYMiniChar.ShutdownHandlerEx				= phytec_ShutDown;
    	PHYMiniChar.CancelOidRequestHandler			= phytec_CancelOidRequest;

    Monday, October 26, 2015 3:51 AM