rndis.c File Reference

RNDIS (Remote Network Driver Interface Specification) More...

#include "usbd_def.h"
#include "usbd_rndis.h"
#include "os_port.h"
#include "core/net.h"
#include "usbd_desc.h"
#include "rndis.h"
#include "rndis_driver.h"
#include "rndis_debug.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   TRACE_LEVEL_INFO
 
#define TRACE_DEBUG(...)   fprintf(stderr, __VA_ARGS__)
 
#define TRACE_DEBUG_ARRAY(p, a, n)   debugDisplayArray(stderr, p, a, n)
 

Functions

void rndisInit (void)
 RNDIS core initialization. More...
 
error_t rndisProcessMsg (const RndisMsg *message, size_t length)
 Process incoming RNDIS message. More...
 
error_t rndisProcessInitializeMsg (const RndisInitializeMsg *message, size_t length)
 Process RNDIS Initialize message. More...
 
error_t rndisProcessHaltMsg (const RndisHaltMsg *message, size_t length)
 Process RNDIS Halt message. More...
 
error_t rndisProcessQueryMsg (const RndisQueryMsg *message, size_t length)
 Process RNDIS Query message. More...
 
error_t rndisProcessSetMsg (const RndisSetMsg *message, size_t length)
 Process RNDIS Set message. More...
 
error_t rndisProcessResetMsg (const RndisResetMsg *message, size_t length)
 Process RNDIS Reset message. More...
 
error_t rndisProcessKeepAliveMsg (const RndisKeepAliveMsg *message, size_t length)
 Process RNDIS Keep-Alive message. More...
 
error_t rndisFormatHaltMsg (void)
 Format RNDIS Halt message. More...
 
error_t rndisFormatIndicateStatusMsg (uint32_t status)
 Format RNDIS Indicate Status message. More...
 
error_t rndisFormatInitializeCmplt (uint32_t requestId)
 Format RNDIS Initialize Cmplt message. More...
 
error_t rndisFormatQueryCmplt (uint32_t requestId, uint32_t status, uint32_t length)
 Format RNDIS Query Cmplt message. More...
 
error_t rndisFormatSetCmplt (uint32_t requestId, uint32_t status)
 Format RNDIS Set Cmplt message. More...
 
error_t rndisFormatResetCmplt (void)
 Format RNDIS Reset Cmplt message. More...
 
error_t rndisFormatKeepAliveCmplt (uint32_t requestId)
 Format RNDIS Keep-Alive Cmplt message. More...
 
error_t rndisSendNotification (uint32_t notification)
 Send RNDIS notification message. More...
 
void rndisChangeState (RndisState newState)
 Update RNDIS state. More...
 

Variables

RndisContext rndisContext
 
const uint32_t rndisSupportOidList []
 

Detailed Description

RNDIS (Remote Network Driver Interface Specification)

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Pro.

This software is provided under a commercial license. You may use this software under the conditions stated in the license terms. This source code cannot be redistributed.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file rndis.c.

Macro Definition Documentation

◆ TRACE_DEBUG

#define TRACE_DEBUG (   ...)    fprintf(stderr, __VA_ARGS__)

Definition at line 36 of file rndis.c.

◆ TRACE_DEBUG_ARRAY

#define TRACE_DEBUG_ARRAY (   p,
  a,
  n 
)    debugDisplayArray(stderr, p, a, n)

Definition at line 38 of file rndis.c.

◆ TRACE_LEVEL

#define TRACE_LEVEL   TRACE_LEVEL_INFO

Definition at line 20 of file rndis.c.

Function Documentation

◆ rndisChangeState()

void rndisChangeState ( RndisState  newState)

Update RNDIS state.

Parameters
[in]newStateNew RNDIS state to switch to

Definition at line 699 of file rndis.c.

◆ rndisFormatHaltMsg()

error_t rndisFormatHaltMsg ( void  )

Format RNDIS Halt message.

Returns
Error code

Definition at line 461 of file rndis.c.

◆ rndisFormatIndicateStatusMsg()

error_t rndisFormatIndicateStatusMsg ( uint32_t  status)

Format RNDIS Indicate Status message.

Parameters
[in]statusRNDIS status code
Returns
Error code

Definition at line 487 of file rndis.c.

◆ rndisFormatInitializeCmplt()

error_t rndisFormatInitializeCmplt ( uint32_t  requestId)

Format RNDIS Initialize Cmplt message.

Parameters
[in]requestIdRequest identifier
Returns
Error code

Definition at line 515 of file rndis.c.

◆ rndisFormatKeepAliveCmplt()

error_t rndisFormatKeepAliveCmplt ( uint32_t  requestId)

Format RNDIS Keep-Alive Cmplt message.

Parameters
[in]requestIdRequest identifier
Returns
Error code

Definition at line 645 of file rndis.c.

◆ rndisFormatQueryCmplt()

error_t rndisFormatQueryCmplt ( uint32_t  requestId,
uint32_t  status,
uint32_t  length 
)

Format RNDIS Query Cmplt message.

Parameters
[in]requestIdRequest identifier
[in]statusRNDIS status code
[in]lengthLength of the response data, in bytes
Returns
Error code

Definition at line 556 of file rndis.c.

◆ rndisFormatResetCmplt()

error_t rndisFormatResetCmplt ( void  )

Format RNDIS Reset Cmplt message.

Returns
Error code

Definition at line 615 of file rndis.c.

◆ rndisFormatSetCmplt()

error_t rndisFormatSetCmplt ( uint32_t  requestId,
uint32_t  status 
)

Format RNDIS Set Cmplt message.

Parameters
[in]requestIdRequest identifier
[in]statusRNDIS status code
Returns
Error code

Definition at line 586 of file rndis.c.

◆ rndisInit()

void rndisInit ( void  )

RNDIS core initialization.

Definition at line 77 of file rndis.c.

◆ rndisProcessHaltMsg()

error_t rndisProcessHaltMsg ( const RndisHaltMsg message,
size_t  length 
)

Process RNDIS Halt message.

Parameters
[in]messagePointer to the RNDIS message
[in]lengthLength of the RNDIS message, in bytes
Returns
Error code

Definition at line 184 of file rndis.c.

◆ rndisProcessInitializeMsg()

error_t rndisProcessInitializeMsg ( const RndisInitializeMsg message,
size_t  length 
)

Process RNDIS Initialize message.

Parameters
[in]messagePointer to the RNDIS message
[in]lengthLength of the RNDIS message, in bytes
Returns
Error code

Definition at line 157 of file rndis.c.

◆ rndisProcessKeepAliveMsg()

error_t rndisProcessKeepAliveMsg ( const RndisKeepAliveMsg message,
size_t  length 
)

Process RNDIS Keep-Alive message.

Parameters
[in]messagePointer to the RNDIS message
[in]lengthLength of the RNDIS message, in bytes
Returns
Error code

Definition at line 436 of file rndis.c.

◆ rndisProcessMsg()

error_t rndisProcessMsg ( const RndisMsg message,
size_t  length 
)

Process incoming RNDIS message.

Parameters
[in]messagePointer to the RNDIS message
[in]lengthLength of the RNDIS message, in bytes
Returns
Error code

Definition at line 99 of file rndis.c.

◆ rndisProcessQueryMsg()

error_t rndisProcessQueryMsg ( const RndisQueryMsg message,
size_t  length 
)

Process RNDIS Query message.

Parameters
[in]messagePointer to the RNDIS message
[in]lengthLength of the RNDIS message, in bytes
Returns
Error code

Definition at line 208 of file rndis.c.

◆ rndisProcessResetMsg()

error_t rndisProcessResetMsg ( const RndisResetMsg message,
size_t  length 
)

Process RNDIS Reset message.

Parameters
[in]messagePointer to the RNDIS message
[in]lengthLength of the RNDIS message, in bytes
Returns
Error code

Definition at line 406 of file rndis.c.

◆ rndisProcessSetMsg()

error_t rndisProcessSetMsg ( const RndisSetMsg message,
size_t  length 
)

Process RNDIS Set message.

Parameters
[in]messagePointer to the RNDIS message
[in]lengthLength of the RNDIS message, in bytes
Returns
Error code

Definition at line 357 of file rndis.c.

◆ rndisSendNotification()

error_t rndisSendNotification ( uint32_t  notification)

Send RNDIS notification message.

Parameters
[in]notificationDevice notification
Returns
Error code

Definition at line 672 of file rndis.c.

Variable Documentation

◆ rndisContext

RndisContext rndisContext

Definition at line 42 of file rndis.c.

◆ rndisSupportOidList

const uint32_t rndisSupportOidList[]
Initial value:
=
{
}
#define OID_GEN_HARDWARE_STATUS
Definition: rndis.h:78
#define OID_802_3_PERMANENT_ADDRESS
Definition: rndis.h:134
#define OID_GEN_TRANSMIT_BLOCK_SIZE
Definition: rndis.h:86
#define OID_GEN_MAXIMUM_FRAME_SIZE
Definition: rndis.h:82
#define OID_GEN_RECEIVE_BLOCK_SIZE
Definition: rndis.h:87
#define OID_GEN_MEDIA_SUPPORTED
Definition: rndis.h:79
#define OID_GEN_VENDOR_ID
Definition: rndis.h:88
#define OID_802_3_MULTICAST_LIST
Definition: rndis.h:136
#define OID_GEN_VENDOR_DESCRIPTION
Definition: rndis.h:89
#define OID_802_3_XMIT_MORE_COLLISIONS
Definition: rndis.h:141
#define OID_802_3_MAXIMUM_LIST_SIZE
Definition: rndis.h:137
#define OID_802_3_XMIT_ONE_COLLISION
Definition: rndis.h:140
#define OID_GEN_MEDIA_CONNECT_STATUS
Definition: rndis.h:96
#define OID_802_3_RCV_ERROR_ALIGNMENT
Definition: rndis.h:139
#define OID_GEN_MAXIMUM_SEND_PACKETS
Definition: rndis.h:97
#define OID_GEN_MEDIA_IN_USE
Definition: rndis.h:80
#define OID_GEN_SUPPORTED_LIST
Definition: rndis.h:77
#define OID_GEN_CURRENT_PACKET_FILTER
Definition: rndis.h:90
#define OID_802_3_CURRENT_ADDRESS
Definition: rndis.h:135
#define OID_GEN_LINK_SPEED
Definition: rndis.h:83
#define OID_GEN_MAXIMUM_TOTAL_SIZE
Definition: rndis.h:93

Definition at line 45 of file rndis.c.