usbd_rndis.h
Go to the documentation of this file.
1 /**
2  * @file usbd_rndis.h
3  * @brief USB RNDIS class
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Pro.
10  *
11  * This software is provided under a commercial license. You may
12  * use this software under the conditions stated in the license
13  * terms. This source code cannot be redistributed.
14  *
15  * @author Oryx Embedded SARL (www.oryx-embedded.com)
16  * @version 1.9.0
17  **/
18 
19 #ifndef _USB_RNDIS_H
20 #define _USB_RNDIS_H
21 
22 //Dependencies
23 #include "usbd_ioreq.h"
24 
25 //USB endpoints
26 #define RNDIS_NOTIFICATION_EP 0x81
27 #define RNDIS_DATA_IN_EP 0x82
28 #define RNDIS_DATA_OUT_EP 0x03
29 
30 //Endpoint maximum packet size
31 #define RNDIS_NOTIFICATION_EP_MPS 64
32 #define RNDIS_DATA_IN_EP_MPS_FS 64
33 #define RNDIS_DATA_OUT_EP_MPS_FS 64
34 #define RNDIS_DATA_IN_EP_MPS_HS 512
35 #define RNDIS_DATA_OUT_EP_MPS_HS 512
36 
37 //RNDIS Class specific requests
38 #define RNDIS_SEND_ENCAPSULATED_COMMAND 0x00
39 #define RNDIS_GET_ENCAPSULATED_RESPONSE 0x01
40 
41 //Global variables
42 extern USBD_HandleTypeDef USBD_Device;
43 extern USBD_ClassTypeDef usbdRndisClass;
44 #define USBD_RNDIS_CLASS &usbdRndisClass
45 
46 //RNDIS related functions
47 uint8_t usbdRndisInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx);
48 uint8_t usbdRndisDeInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx);
49 uint8_t usbdRndisSetup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req);
50 uint8_t usbdRndisEp0RxReady(USBD_HandleTypeDef *pdev);
51 uint8_t usbdRndisDataIn(USBD_HandleTypeDef *pdev, uint8_t epnum);
52 uint8_t usbdRndisDataOut(USBD_HandleTypeDef *pdev, uint8_t epnum);
53 uint8_t *usbdRndisGetHighSpeedConfigDesc(uint16_t *length);
54 uint8_t *usbdRndisGetFullSpeedConfigDesc(uint16_t *length);
55 uint8_t *usbdRndisGetOtherSpeedConfigDesc(uint16_t *length);
56 uint8_t *usbdRndisGetDeviceQualifierDesc(uint16_t *length);
57 
58 #endif
uint8_t * usbdRndisGetFullSpeedConfigDesc(uint16_t *length)
Retrieve configuration descriptor (full speed)
Definition: usbd_rndis.c:430
uint8_t * usbdRndisGetHighSpeedConfigDesc(uint16_t *length)
Retrieve configuration descriptor (high speed)
Definition: usbd_rndis.c:416
USBD_HandleTypeDef USBD_Device
uint8_t usbdRndisDataOut(USBD_HandleTypeDef *pdev, uint8_t epnum)
DATA OUT callback.
Definition: usbd_rndis.c:325
uint8_t usbdRndisSetup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req)
Process incoming setup request.
Definition: usbd_rndis.c:157
uint8_t usbdRndisInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
RNDIS class initialization.
Definition: usbd_rndis.c:71
uint8_t usbdRndisDataIn(USBD_HandleTypeDef *pdev, uint8_t epnum)
DATA IN callback.
Definition: usbd_rndis.c:280
uint8_t * usbdRndisGetDeviceQualifierDesc(uint16_t *length)
Retrieve device qualifier descriptor.
Definition: usbd_rndis.c:458
uint8_t usbdRndisEp0RxReady(USBD_HandleTypeDef *pdev)
Handle data stage (control endpoint)
Definition: usbd_rndis.c:254
USBD_ClassTypeDef usbdRndisClass
RNDIS class callbacks.
Definition: usbd_rndis.c:45
uint8_t usbdRndisDeInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
RNDIS class de-initialization.
Definition: usbd_rndis.c:130
uint8_t length
Definition: dtls_misc.h:140
uint8_t * usbdRndisGetOtherSpeedConfigDesc(uint16_t *length)
Retrieve configuration descriptor (other speed)
Definition: usbd_rndis.c:444