none
RNDIS Speed change through NDIS_STATUS_LINK_STATE RRS feed

  • Question

  • I have a device running a Linux distro. I have modified an existing Linux RNDIS module in order to match the company's product specification. The RNDIS is wokring fine and have no problem with it.

    One functionality that is not clear to me how to implement is the dynamic change of speed. Once the device is hotplugged, an OID_GEN_LINK_SPEED request appears that picks up the speed. However, the speed changes during the device operation and OID_GEN_LINK_SPEED requests need to be triggered.

    It is not clear to me what payload I need to send to the windows host in order to trigger a subsequent OID_GEN_LINK_SPEED request. I have tried sending a packet with NDIS_STATUS_LINK_STATE, but this led to blue screen with error message IRQL_LESS_OR_NOT_EQUAL. I have also tried sending a packet with RNDIS_STATUS_LINK_SPEED_CHANGE payload, but this didn't have any noticeable effect.

    So can you help me with the specification of the payload that needs to be transmitted from the device to the host in order to trigger a subsequent OID_GEN_LINK_SPEED requst?

    Tuesday, January 6, 2015 11:24 AM

Answers

  • Assuming you're using the RNDIS6 INF template (your INF mentions usbrndis6.ndi)
    Indicate a status indication of NDIS_STATUS_LINK_SPEED_CHANGE (0x40010013).  Set the payload to a 4-byte little-endian unsigned integer.  The integer should be the link speed in units of 100bits/sec.  For example, for 100Mbps network, indicate up the integer value 1000000.

    This will not force RNDIS to reissue OID_GEN_LINK_SPEED; you just include the new speed with the status indication.
    Tuesday, January 6, 2015 8:39 PM

All replies

  • Assuming you're using the RNDIS6 INF template (your INF mentions usbrndis6.ndi)
    Indicate a status indication of NDIS_STATUS_LINK_SPEED_CHANGE (0x40010013).  Set the payload to a 4-byte little-endian unsigned integer.  The integer should be the link speed in units of 100bits/sec.  For example, for 100Mbps network, indicate up the integer value 1000000.

    This will not force RNDIS to reissue OID_GEN_LINK_SPEED; you just include the new speed with the status indication.
    Tuesday, January 6, 2015 8:39 PM
  • The Microsoft Corporation->Remote NDIS Compatible Device driver is used. Is this the INF used, or is it a complimentary file?

    Great. This seems like a suitable solution for me. Currently I can succesfully, connect by sending the following struct ( all fields are 4 bytes long )

    MessageType : REMOTE_NDIS_INDICATE_STATUS_MSG ( 0x00000001U )
    MessageLength : 20
    Status : RNDIS_STATUS_MEDIA_CONNECT ( 0x4001000BU )
    StatusBufferLength : 0
    StatusBufferOffset : 0


    Would the proposed solution work by sending the following struct in order to set 100MBps:

    MessageType : REMOTE_NDIS_INDICATE_STATUS_MSG ( 0x00000001U )
    MessageLength : 24
    Status : NDIS_STATUS_LINK_SPEED_CHANGE ( 0x4001000BU )
    StatusBufferLength : 0
    StatusBufferOffset : 1000000
    Wednesday, January 7, 2015 4:58 PM
  • Yes, I believe it should work if you replace 0x4001000BU with 0x40010013U, and make sure Offset is an actual offset to the integer payload.
    Wednesday, January 7, 2015 7:22 PM
  • Great. Is it possible to get any debug messages from ndis.sys?
    Thursday, January 8, 2015 10:49 AM
  • You can get debug messages from NDIS.SYS by following these instructions.  Although, NDIS tracing won't give details about RNDIS, since RNDIS is a platform in its own right.  There are no debug messages for RNDIS.
    Thursday, January 8, 2015 7:51 PM
  • This didn't work for me and let to more BSODs.

    As a way forward I am now using ndis5.x which sends periodical requests for speed when the user is in the Details window of the network adapter.
    Thursday, January 22, 2015 12:33 PM