LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
RNDISClassCommon.h
Go to the documentation of this file.
1 /*
2  * @brief Common definitions and declarations for the library USB RNDIS Class driver
3  *
4  * @note
5  * Copyright(C) NXP Semiconductors, 2012
6  * Copyright(C) Dean Camera, 2011, 2012
7  * All rights reserved.
8  *
9  * @par
10  * Software that is described herein is for illustrative purposes only
11  * which provides customers with programming information regarding the
12  * LPC products. This software is supplied "AS IS" without any warranties of
13  * any kind, and NXP Semiconductors and its licensor disclaim any and
14  * all warranties, express or implied, including all implied warranties of
15  * merchantability, fitness for a particular purpose and non-infringement of
16  * intellectual property rights. NXP Semiconductors assumes no responsibility
17  * or liability for the use of the software, conveys no license or rights under any
18  * patent, copyright, mask work right, or any other intellectual property rights in
19  * or to any products. NXP Semiconductors reserves the right to make changes
20  * in the software without notification. NXP Semiconductors also makes no
21  * representation or warranty that such application will be suitable for the
22  * specified use without further testing or modification.
23  *
24  * @par
25  * Permission to use, copy, modify, and distribute this software and its
26  * documentation is hereby granted, under NXP Semiconductors' and its
27  * licensor's relevant copyrights in the software, without fee, provided that it
28  * is used in conjunction with NXP Semiconductors microcontrollers. This
29  * copyright, permission, and disclaimer notice must appear in all copies of
30  * this code.
31  */
32 
43 #ifndef _RNDIS_CLASS_COMMON_H_
44 #define _RNDIS_CLASS_COMMON_H_
45 
46  /* Macros: */
47  #define __INCLUDE_FROM_CDC_DRIVER
48 
49  /* Includes: */
50  #include "../../Core/StdDescriptors.h"
51  #include "CDCClassCommon.h"
52 
53  /* Enable C linkage for C++ Compilers: */
54  #if defined(__cplusplus)
55  extern "C" {
56  #endif
57 
58  /* Preprocessor Checks: */
59  #if !defined(__INCLUDE_FROM_RNDIS_DRIVER)
60  #error Do not include this file directly. Include LPCUSBlib/Drivers/USB.h instead.
61  #endif
62 
63  /* Macros: */
65  #define RNDIS_ERROR_LOGICAL_CMD_FAILED 0x80
66 
68  #define REMOTE_NDIS_VERSION_MAJOR 0x01
69 
71  #define REMOTE_NDIS_VERSION_MINOR 0x00
72 
75  #define REMOTE_NDIS_PACKET_MSG 0x00000001UL
76  #define REMOTE_NDIS_INITIALIZE_MSG 0x00000002UL
77  #define REMOTE_NDIS_HALT_MSG 0x00000003UL
78  #define REMOTE_NDIS_QUERY_MSG 0x00000004UL
79  #define REMOTE_NDIS_SET_MSG 0x00000005UL
80  #define REMOTE_NDIS_RESET_MSG 0x00000006UL
81  #define REMOTE_NDIS_INDICATE_STATUS_MSG 0x00000007UL
82  #define REMOTE_NDIS_KEEPALIVE_MSG 0x00000008UL
83 
84 
87  #define REMOTE_NDIS_INITIALIZE_CMPLT 0x80000002UL
88  #define REMOTE_NDIS_QUERY_CMPLT 0x80000004UL
89  #define REMOTE_NDIS_SET_CMPLT 0x80000005UL
90  #define REMOTE_NDIS_RESET_CMPLT 0x80000006UL
91  #define REMOTE_NDIS_KEEPALIVE_CMPLT 0x80000008UL
92 
93 
96  #define REMOTE_NDIS_STATUS_SUCCESS 0x00000000UL
97  #define REMOTE_NDIS_STATUS_FAILURE 0xC0000001UL
98  #define REMOTE_NDIS_STATUS_INVALID_DATA 0xC0010015UL
99  #define REMOTE_NDIS_STATUS_NOT_SUPPORTED 0xC00000BBUL
100  #define REMOTE_NDIS_STATUS_MEDIA_CONNECT 0x4001000BUL
101  #define REMOTE_NDIS_STATUS_MEDIA_DISCONNECT 0x4001000CUL
102 
103 
106  #define REMOTE_NDIS_MEDIA_STATE_CONNECTED 0x00000000UL
107  #define REMOTE_NDIS_MEDIA_STATE_DISCONNECTED 0x00000001UL
108 
109 
110  #define REMOTE_NDIS_MEDIUM_802_3 0x00000000UL
111 
114  #define REMOTE_NDIS_DF_CONNECTIONLESS 0x00000001UL
115  #define REMOTE_NDIS_DF_CONNECTION_ORIENTED 0x00000002UL
116 
117 
120  #define REMOTE_NDIS_PACKET_DIRECTED 0x00000001UL
121  #define REMOTE_NDIS_PACKET_MULTICAST 0x00000002UL
122  #define REMOTE_NDIS_PACKET_ALL_MULTICAST 0x00000004UL
123  #define REMOTE_NDIS_PACKET_BROADCAST 0x00000008UL
124  #define REMOTE_NDIS_PACKET_SOURCE_ROUTING 0x00000010UL
125  #define REMOTE_NDIS_PACKET_PROMISCUOUS 0x00000020UL
126  #define REMOTE_NDIS_PACKET_SMT 0x00000040UL
127  #define REMOTE_NDIS_PACKET_ALL_LOCAL 0x00000080UL
128  #define REMOTE_NDIS_PACKET_GROUP 0x00001000UL
129  #define REMOTE_NDIS_PACKET_ALL_FUNCTIONAL 0x00002000UL
130  #define REMOTE_NDIS_PACKET_FUNCTIONAL 0x00004000UL
131  #define REMOTE_NDIS_PACKET_MAC_FRAME 0x00008000UL
132 
133 
136  #define OID_GEN_SUPPORTED_LIST 0x00010101UL
137  #define OID_GEN_HARDWARE_STATUS 0x00010102UL
138  #define OID_GEN_MEDIA_SUPPORTED 0x00010103UL
139  #define OID_GEN_MEDIA_IN_USE 0x00010104UL
140  #define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106UL
141  #define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111UL
142  #define OID_GEN_LINK_SPEED 0x00010107UL
143  #define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010AUL
144  #define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010BUL
145  #define OID_GEN_VENDOR_ID 0x0001010CUL
146  #define OID_GEN_VENDOR_DESCRIPTION 0x0001010DUL
147  #define OID_GEN_CURRENT_PACKET_FILTER 0x0001010EUL
148  #define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111UL
149  #define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114UL
150  #define OID_GEN_PHYSICAL_MEDIUM 0x00010202UL
151  #define OID_GEN_XMIT_OK 0x00020101UL
152  #define OID_GEN_RCV_OK 0x00020102UL
153  #define OID_GEN_XMIT_ERROR 0x00020103UL
154  #define OID_GEN_RCV_ERROR 0x00020104UL
155  #define OID_GEN_RCV_NO_BUFFER 0x00020105UL
156  #define OID_802_3_PERMANENT_ADDRESS 0x01010101UL
157  #define OID_802_3_CURRENT_ADDRESS 0x01010102UL
158  #define OID_802_3_MULTICAST_LIST 0x01010103UL
159  #define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104UL
160  #define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101UL
161  #define OID_802_3_XMIT_ONE_COLLISION 0x01020102UL
162  #define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103UL
163 
164 
166  #define RNDIS_MESSAGE_BUFFER_SIZE 128
167 
169  #define ETHERNET_FRAME_SIZE_MAX 1500
170 
171  /* Enums: */
174  {
177  };
178 
181  {
185  };
186 
189  {
191  };
192 
195  {
201  };
202 
203  /* Type Defines: */
208  typedef ATTR_IAR_PACKED struct
209  {
210  uint8_t Octets[6];
212 
219  typedef ATTR_IAR_PACKED struct
220  {
224 
231  typedef ATTR_IAR_PACKED struct
232  {
245 
252  typedef ATTR_IAR_PACKED struct
253  {
257 
262 
269  typedef ATTR_IAR_PACKED struct
270  {
275 
286 
293  typedef ATTR_IAR_PACKED struct
294  {
299 
306  typedef ATTR_IAR_PACKED struct
307  {
313 
320  typedef ATTR_IAR_PACKED struct
321  {
325 
328 
335  typedef ATTR_IAR_PACKED struct
336  {
340 
346 
353  typedef ATTR_IAR_PACKED struct
354  {
360 
367  typedef ATTR_IAR_PACKED struct
368  {
372 
373  uint32_t Oid;
378 
385  typedef ATTR_IAR_PACKED struct
386  {
391 
395 
396  /* Disable C linkage for C++ Compilers: */
397  #if defined(__cplusplus)
398  }
399  #endif
400 
401 #endif
402