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

SPDX-License-Identifier: GPL-2.0-or-later

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

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

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

Definition in file rndis.c.

Macro Definition Documentation

◆ TRACE_DEBUG

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

Definition at line 48 of file rndis.c.

◆ TRACE_DEBUG_ARRAY

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

Definition at line 50 of file rndis.c.

◆ TRACE_LEVEL

#define TRACE_LEVEL   TRACE_LEVEL_INFO

Definition at line 32 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 711 of file rndis.c.

◆ rndisFormatHaltMsg()

error_t rndisFormatHaltMsg ( void  )

Format RNDIS Halt message.

Returns
Error code

Definition at line 473 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 499 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 527 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 657 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 568 of file rndis.c.

◆ rndisFormatResetCmplt()

error_t rndisFormatResetCmplt ( void  )

Format RNDIS Reset Cmplt message.

Returns
Error code

Definition at line 627 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 598 of file rndis.c.

◆ rndisInit()

void rndisInit ( void  )

RNDIS core initialization.

Definition at line 89 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 196 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 169 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 448 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 111 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 220 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 418 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 369 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 684 of file rndis.c.

Variable Documentation

◆ rndisContext

RndisContext rndisContext

Definition at line 54 of file rndis.c.

◆ rndisSupportOidList

#define OID_GEN_CURRENT_PACKET_FILTER
Definition: rndis.h:102
#define OID_802_3_CURRENT_ADDRESS
Definition: rndis.h:147
#define OID_802_3_RCV_ERROR_ALIGNMENT
Definition: rndis.h:151
#define OID_GEN_MEDIA_CONNECT_STATUS
Definition: rndis.h:108
#define OID_GEN_TRANSMIT_BLOCK_SIZE
Definition: rndis.h:98
#define OID_GEN_VENDOR_DESCRIPTION
Definition: rndis.h:101
#define OID_GEN_VENDOR_ID
Definition: rndis.h:100
#define OID_GEN_MAXIMUM_FRAME_SIZE
Definition: rndis.h:94
#define OID_GEN_MAXIMUM_SEND_PACKETS
Definition: rndis.h:109
#define OID_GEN_MAXIMUM_TOTAL_SIZE
Definition: rndis.h:105
#define OID_GEN_MEDIA_IN_USE
Definition: rndis.h:92
#define OID_GEN_HARDWARE_STATUS
Definition: rndis.h:90
#define OID_GEN_SUPPORTED_LIST
Definition: rndis.h:89
#define OID_802_3_PERMANENT_ADDRESS
Definition: rndis.h:146
#define OID_802_3_MAXIMUM_LIST_SIZE
Definition: rndis.h:149
#define OID_GEN_RECEIVE_BLOCK_SIZE
Definition: rndis.h:99
#define OID_802_3_XMIT_MORE_COLLISIONS
Definition: rndis.h:153
#define OID_802_3_XMIT_ONE_COLLISION
Definition: rndis.h:152
#define OID_802_3_MULTICAST_LIST
Definition: rndis.h:148
#define OID_GEN_LINK_SPEED
Definition: rndis.h:95
#define OID_GEN_MEDIA_SUPPORTED
Definition: rndis.h:91