usbd_rndis.c File Reference

USB RNDIS class. More...

#include "usbd_ctlreq.h"
#include "usbd_desc.h"
#include "usbd_rndis.h"
#include "core/net.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

uint8_t usbdRndisInit (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
 RNDIS class initialization. More...
 
uint8_t usbdRndisDeInit (USBD_HandleTypeDef *pdev, uint8_t cfgidx)
 RNDIS class de-initialization. More...
 
uint8_t usbdRndisSetup (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
 Process incoming setup request. More...
 
uint8_t usbdRndisEp0RxReady (USBD_HandleTypeDef *pdev)
 Handle data stage (control endpoint) More...
 
uint8_t usbdRndisDataIn (USBD_HandleTypeDef *pdev, uint8_t epnum)
 DATA IN callback. More...
 
uint8_t usbdRndisDataOut (USBD_HandleTypeDef *pdev, uint8_t epnum)
 DATA OUT callback. More...
 
uint8_t * usbdRndisGetHighSpeedConfigDesc (uint16_t *length)
 Retrieve configuration descriptor (high speed) More...
 
uint8_t * usbdRndisGetFullSpeedConfigDesc (uint16_t *length)
 Retrieve configuration descriptor (full speed) More...
 
uint8_t * usbdRndisGetOtherSpeedConfigDesc (uint16_t *length)
 Retrieve configuration descriptor (other speed) More...
 
uint8_t * usbdRndisGetDeviceQualifierDesc (uint16_t *length)
 Retrieve device qualifier descriptor. More...
 

Variables

USBD_ClassTypeDef usbdRndisClass
 RNDIS class callbacks. More...
 

Detailed Description

USB RNDIS class.

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 usbd_rndis.c.

Macro Definition Documentation

◆ TRACE_DEBUG

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

Definition at line 47 of file usbd_rndis.c.

◆ TRACE_DEBUG_ARRAY

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

Definition at line 49 of file usbd_rndis.c.

◆ TRACE_LEVEL

#define TRACE_LEVEL   TRACE_LEVEL_INFO

Definition at line 32 of file usbd_rndis.c.

Function Documentation

◆ usbdRndisDataIn()

uint8_t usbdRndisDataIn ( USBD_HandleTypeDef *  pdev,
uint8_t  epnum 
)

DATA IN callback.

Parameters
[in]pdevPointer to a USBD_HandleTypeDef structure
[in]epnumEndpoint number
Returns
Status code

Definition at line 292 of file usbd_rndis.c.

◆ usbdRndisDataOut()

uint8_t usbdRndisDataOut ( USBD_HandleTypeDef *  pdev,
uint8_t  epnum 
)

DATA OUT callback.

Parameters
[in]pdevPointer to a USBD_HandleTypeDef structure
[in]epnumEndpoint number
Returns
Status code

Definition at line 337 of file usbd_rndis.c.

◆ usbdRndisDeInit()

uint8_t usbdRndisDeInit ( USBD_HandleTypeDef *  pdev,
uint8_t  cfgidx 
)

RNDIS class de-initialization.

Parameters
[in]pdevPointer to a USBD_HandleTypeDef structure
[in]cfgidxConfiguration index
Returns
Status code

Definition at line 142 of file usbd_rndis.c.

◆ usbdRndisEp0RxReady()

uint8_t usbdRndisEp0RxReady ( USBD_HandleTypeDef *  pdev)

Handle data stage (control endpoint)

Parameters
[in]pdevPointer to a USBD_HandleTypeDef structure
Returns
Status code

Definition at line 266 of file usbd_rndis.c.

◆ usbdRndisGetDeviceQualifierDesc()

uint8_t* usbdRndisGetDeviceQualifierDesc ( uint16_t *  length)

Retrieve device qualifier descriptor.

Parameters
[out]lengthLength of the descriptor, in bytes
Returns
Pointer to the descriptor

Definition at line 470 of file usbd_rndis.c.

◆ usbdRndisGetFullSpeedConfigDesc()

uint8_t* usbdRndisGetFullSpeedConfigDesc ( uint16_t *  length)

Retrieve configuration descriptor (full speed)

Parameters
[out]lengthLength of the descriptor, in bytes
Returns
Pointer to the descriptor

Definition at line 442 of file usbd_rndis.c.

◆ usbdRndisGetHighSpeedConfigDesc()

uint8_t* usbdRndisGetHighSpeedConfigDesc ( uint16_t *  length)

Retrieve configuration descriptor (high speed)

Parameters
[out]lengthLength of the descriptor, in bytes
Returns
Pointer to the descriptor

Definition at line 428 of file usbd_rndis.c.

◆ usbdRndisGetOtherSpeedConfigDesc()

uint8_t* usbdRndisGetOtherSpeedConfigDesc ( uint16_t *  length)

Retrieve configuration descriptor (other speed)

Parameters
[out]lengthLength of the descriptor, in bytes
Returns
Pointer to the descriptor

Definition at line 456 of file usbd_rndis.c.

◆ usbdRndisInit()

uint8_t usbdRndisInit ( USBD_HandleTypeDef *  pdev,
uint8_t  cfgidx 
)

RNDIS class initialization.

Parameters
[in]pdevPointer to a USBD_HandleTypeDef structure
[in]cfgidxConfiguration index
Returns
Status code

Definition at line 83 of file usbd_rndis.c.

◆ usbdRndisSetup()

uint8_t usbdRndisSetup ( USBD_HandleTypeDef *  pdev,
USBD_SetupReqTypedef *  req 
)

Process incoming setup request.

Parameters
[in]pdevPointer to a USBD_HandleTypeDef structure
[in]reqPointer to the setup request
Returns
Status code

Definition at line 169 of file usbd_rndis.c.

Variable Documentation

◆ usbdRndisClass

uint8_t * usbdRndisGetHighSpeedConfigDesc(uint16_t *length)
Retrieve configuration descriptor (high speed)
Definition: usbd_rndis.c:428
uint8_t * usbdRndisGetDeviceQualifierDesc(uint16_t *length)
Retrieve device qualifier descriptor.
Definition: usbd_rndis.c:470
uint8_t usbdRndisDataIn(USBD_HandleTypeDef *pdev, uint8_t epnum)
DATA IN callback.
Definition: usbd_rndis.c:292
uint8_t * usbdRndisGetFullSpeedConfigDesc(uint16_t *length)
Retrieve configuration descriptor (full speed)
Definition: usbd_rndis.c:442
uint8_t usbdRndisInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
RNDIS class initialization.
Definition: usbd_rndis.c:83
uint8_t usbdRndisSetup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
Process incoming setup request.
Definition: usbd_rndis.c:169
uint8_t usbdRndisDeInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
RNDIS class de-initialization.
Definition: usbd_rndis.c:142
uint8_t usbdRndisDataOut(USBD_HandleTypeDef *pdev, uint8_t epnum)
DATA OUT callback.
Definition: usbd_rndis.c:337
uint8_t * usbdRndisGetOtherSpeedConfigDesc(uint16_t *length)
Retrieve configuration descriptor (other speed)
Definition: usbd_rndis.c:456
uint8_t usbdRndisEp0RxReady(USBD_HandleTypeDef *pdev)
Handle data stage (control endpoint)
Definition: usbd_rndis.c:266