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

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

Macro Definition Documentation

◆ TRACE_DEBUG

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

Definition at line 35 of file usbd_rndis.c.

◆ TRACE_DEBUG_ARRAY

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

Definition at line 37 of file usbd_rndis.c.

◆ TRACE_LEVEL

#define TRACE_LEVEL   TRACE_LEVEL_INFO

Definition at line 20 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 280 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 325 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 130 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 254 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 458 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 430 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 416 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 444 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 71 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 157 of file usbd_rndis.c.

Variable Documentation

◆ usbdRndisClass

USBD_ClassTypeDef usbdRndisClass
Initial value:
=
{
NULL,
NULL,
NULL,
NULL,
}
uint8_t usbdRndisDataOut(USBD_HandleTypeDef *pdev, uint8_t epnum)
DATA OUT callback.
Definition: usbd_rndis.c:325
uint8_t * usbdRndisGetFullSpeedConfigDesc(uint16_t *length)
Retrieve configuration descriptor (full speed)
Definition: usbd_rndis.c:430
uint8_t * usbdRndisGetOtherSpeedConfigDesc(uint16_t *length)
Retrieve configuration descriptor (other speed)
Definition: usbd_rndis.c:444
uint8_t usbdRndisInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
RNDIS class initialization.
Definition: usbd_rndis.c:71
uint8_t usbdRndisEp0RxReady(USBD_HandleTypeDef *pdev)
Handle data stage (control endpoint)
Definition: usbd_rndis.c:254
uint8_t * usbdRndisGetDeviceQualifierDesc(uint16_t *length)
Retrieve device qualifier descriptor.
Definition: usbd_rndis.c:458
uint8_t * usbdRndisGetHighSpeedConfigDesc(uint16_t *length)
Retrieve configuration descriptor (high speed)
Definition: usbd_rndis.c:416
uint8_t usbdRndisDataIn(USBD_HandleTypeDef *pdev, uint8_t epnum)
DATA IN callback.
Definition: usbd_rndis.c:280
uint8_t usbdRndisDeInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
RNDIS class de-initialization.
Definition: usbd_rndis.c:130
uint8_t usbdRndisSetup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
Process incoming setup request.
Definition: usbd_rndis.c:157

RNDIS class callbacks.

Definition at line 45 of file usbd_rndis.c.