rndis.c
Go to the documentation of this file.
1 /**
2  * @file rndis.c
3  * @brief RNDIS (Remote Network Driver Interface Specification)
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 //Switch to the appropriate trace level
20 #define TRACE_LEVEL TRACE_LEVEL_INFO
21 
22 //Dependencies
23 #include "usbd_def.h"
24 #include "usbd_rndis.h"
25 #include "os_port.h"
26 #include "core/net.h"
27 #include "usbd_desc.h"
28 #include "rndis.h"
29 #include "rndis_driver.h"
30 #include "rndis_debug.h"
31 #include "debug.h"
32 
33 //Debug macros
34 #if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG)
35  #undef TRACE_DEBUG
36  #define TRACE_DEBUG(...) fprintf(stderr, __VA_ARGS__)
37  #undef TRACE_DEBUG_ARRAY
38  #define TRACE_DEBUG_ARRAY(p, a, n) debugDisplayArray(stderr, p, a, n)
39 #endif
40 
41 //RNDIS context
43 
44 //List of supported OIDs
45 const uint32_t rndisSupportOidList[] =
46 {
47  //Mandatory general OIDs
62  //Mandatory 802.3 OIDs
70 };
71 
72 
73 /**
74  * @brief RNDIS core initialization
75  **/
76 
77 void rndisInit(void)
78 {
79  //Initialize RNDIS context
89 }
90 
91 
92 /**
93  * @brief Process incoming RNDIS message
94  * @param[in] message Pointer to the RNDIS message
95  * @param[in] length Length of the RNDIS message, in bytes
96  * @return Error code
97  **/
98 
100 {
101  error_t error;
102 
103  //Check the length of the message
104  if(length < sizeof(RndisMsg))
105  return ERROR_INVALID_LENGTH;
106 
107  //Debug message
108  TRACE_DEBUG("RNDIS message received (%" PRIuSIZE " bytes)...\r\n", length);
109  //Dump RNDIS message contents
111 
112  //Check message type
113  switch(message->messageType)
114  {
115  //RNDIS Initialize message?
118  break;
119  //RNDIS Halt message?
120  case RNDIS_HALT_MSG:
122  break;
123  //RNDIS Query message?
124  case RNDIS_QUERY_MSG:
126  break;
127  //RNDIS Set message?
128  case RNDIS_SET_MSG:
130  break;
131  //RNDIS Reset message?
132  case RNDIS_RESET_MSG:
134  break;
135  //RNDIS Keep-Alive message?
136  case RNDIS_KEEPALIVE_MSG:
138  break;
139  //Unknown message type?
140  default:
141  error = ERROR_INVALID_TYPE;
142  break;
143  }
144 
145  //Return status code
146  return error;
147 }
148 
149 
150 /**
151  * @brief Process RNDIS Initialize message
152  * @param[in] message Pointer to the RNDIS message
153  * @param[in] length Length of the RNDIS message, in bytes
154  * @return Error code
155  **/
156 
158 {
159  //Check the length of the message
160  if(length < sizeof(RndisInitializeMsg))
161  return ERROR_INVALID_LENGTH;
162 
163  //Debug message
164  TRACE_DEBUG("RNDIS Initialize message received (%" PRIuSIZE " bytes)...\r\n", length);
165 
166  //Format the response to the Initialize message
168 
169  //Send a notification to the host
171 
172  //Successful processing
173  return NO_ERROR;
174 }
175 
176 
177 /**
178  * @brief Process RNDIS Halt message
179  * @param[in] message Pointer to the RNDIS message
180  * @param[in] length Length of the RNDIS message, in bytes
181  * @return Error code
182  **/
183 
185 {
186  //Check the length of the message
187  if(length < sizeof(RndisHaltMsg))
188  return ERROR_INVALID_LENGTH;
189 
190  //Debug message
191  TRACE_DEBUG("RNDIS Halt message received (%" PRIuSIZE " bytes)...\r\n", length);
192 
193  //Switch to the RNDIS_UNINITIALIZED state
195 
196  //Successful processing
197  return NO_ERROR;
198 }
199 
200 
201 /**
202  * @brief Process RNDIS Query message
203  * @param[in] message Pointer to the RNDIS message
204  * @param[in] length Length of the RNDIS message, in bytes
205  * @return Error code
206  **/
207 
209 {
210  size_t n;
211  uint32_t status;
212  uint8_t *buffer;
213  MacAddr macAddr;
214 
215  //Check the length of the message
216  if(length < sizeof(RndisQueryMsg))
217  return ERROR_INVALID_LENGTH;
218 
219  //Debug message
220  TRACE_DEBUG("RNDIS Query message received (%" PRIuSIZE " bytes)...\r\n", length);
221 
222  //Point to the buffer where to format the response data
223  buffer = rndisContext.encapsulatedResp + sizeof(RndisQueryCmplt);
224 
225  //Clear status code
226  status = RNDIS_STATUS_SUCCESS;
227 
228  //Check the identifier of the object being queried for
229  switch(message->oid)
230  {
232  //Retrieve the length of the list
233  n = sizeof(rndisSupportOidList);
234  //Copy the list
235  memcpy(buffer, rndisSupportOidList, n);
236  break;
238  //Current hardware status of the underlying NIC
240  n = sizeof(uint32_t);
241  break;
243  //Media types that a NIC can support
244  STORE32LE(RNDIS_MEDIUM_802_3, buffer);
245  n = sizeof(uint32_t);
246  break;
248  //Complete list of the media types that the NIC currently uses
249  STORE32LE(RNDIS_MEDIUM_802_3, buffer);
250  n = sizeof(uint32_t);
251  break;
253  //Maximum network packet size, in bytes, that the NIC supports
254  STORE32LE(1500, buffer);
255  n = sizeof(uint32_t);
256  break;
257  case OID_GEN_LINK_SPEED:
258  //Maximum speed of the NIC
259  STORE32LE(10000000 / 100, buffer);
260  n = sizeof(uint32_t);
261  break;
263  //Minimum number of bytes that a single net packet occupies in
264  //the transmit buffer space of the NIC
265  STORE32LE(1518, buffer);
266  n = sizeof(uint32_t);
267  break;
269  //Amount of storage, in bytes, that a single packet occupies in
270  //the receive buffer space of the NIC
271  STORE32LE(1518, buffer);
272  n = sizeof(uint32_t);
273  break;
274  case OID_GEN_VENDOR_ID:
275  //Three-byte IEEE-registered vendor code, followed by a single byte
276  //that the vendor assigns to identify a particular NIC
277  buffer[0] = 0xFF;
278  buffer[1] = 0xFF;
279  buffer[2] = 0xFF;
280  buffer[3] = 0x00;
281  n = 4;
282  break;
284  //NULL-terminated string describing the NIC
285  strcpy((char_t *) buffer, RNDIS_VENDOR_DESCRIPTION);
286  n = strlen(RNDIS_VENDOR_DESCRIPTION) + 1;
287  break;
289  //Types of net packets for which a protocol receives indications
290  //from a miniport driver
292  n = sizeof(uint32_t);
293  break;
295  //Maximum total packet length, in bytes, the NIC supports
296  STORE32LE(1518, buffer);
297  n = sizeof(uint32_t);
298  break;
300  //Connection status of the NIC on the network
302  n = sizeof(uint32_t);
303  break;
305  //Maximum number of send packet descriptors that can be accepted
306  STORE32LE(1, buffer);
307  n = sizeof(uint32_t);
308  break;
310  //The address of the NIC encoded in the hardware
312  //The address the NIC is currently using
313  macStringToAddr(RNDIS_MAC_ADDR, &macAddr);
314  macCopyAddr(buffer, &macAddr);
315  n = sizeof(MacAddr);
316  break;
318  //Maximum number of 6-byte addresses that the multicast address list can hold
319  STORE32LE(16, buffer);
320  n = sizeof(uint32_t);
321  break;
323  //Number of frames received with alignment errors
325  //Number of frames successfully transmitted after exactly one collision
327  //Number of frames successfully transmitted after more than one collision
328  STORE32LE(0, buffer);
329  n = sizeof(uint32_t);
330  break;
331  default:
332  //Unknown OID
333  n = 0;
334  //Report an error
335  status = RNDIS_STATUS_FAILURE;
336  break;
337  }
338 
339  //Format the response to the Query message
340  rndisFormatQueryCmplt(message->requestId, status, n);
341 
342  //Send a notification to the host
344 
345  //Successful processing
346  return NO_ERROR;
347 }
348 
349 
350 /**
351  * @brief Process RNDIS Set message
352  * @param[in] message Pointer to the RNDIS message
353  * @param[in] length Length of the RNDIS message, in bytes
354  * @return Error code
355  **/
356 
358 {
359  uint32_t status;
360 
361  //Check the length of the message
362  if(length < sizeof(RndisSetMsg))
363  return ERROR_INVALID_LENGTH;
364 
365  //Debug message
366  TRACE_DEBUG("RNDIS Set message received (%" PRIuSIZE " bytes)...\r\n", length);
367 
368  //Clear status code
369  status = RNDIS_STATUS_SUCCESS;
370 
371  //Check the identifier of the object being queried for
372  switch(message->oid)
373  {
375  //Types of net packets for which a protocol receives indications
376  //from a miniport driver
377  rndisContext.packetFilter = LOAD32LE(message->oidInputBuffer);
378  break;
380  //List of multicast addresses on a miniport adapter
381  break;
382  default:
383  //Report an error
384  status = RNDIS_STATUS_FAILURE;
385  break;
386  }
387 
388  //Format the response to the Set message
389  rndisFormatSetCmplt(message->requestId, status);
390 
391  //Send a notification to the host
393 
394  //Successful processing
395  return NO_ERROR;
396 }
397 
398 
399 /**
400  * @brief Process RNDIS Reset message
401  * @param[in] message Pointer to the RNDIS message
402  * @param[in] length Length of the RNDIS message, in bytes
403  * @return Error code
404  **/
405 
407 {
408  //Check the length of the message
409  if(length < sizeof(RndisResetMsg))
410  return ERROR_INVALID_LENGTH;
411 
412  //Debug message
413  TRACE_DEBUG("RNDIS Reset message received (%" PRIuSIZE " bytes)...\r\n", length);
414 
415  //Switch to the RNDIS_UNINITIALIZED state
417 
418  //Format the response to the Reset message
420 
421  //Send a notification to the host
423 
424  //Successful processing
425  return NO_ERROR;
426 }
427 
428 
429 /**
430  * @brief Process RNDIS Keep-Alive message
431  * @param[in] message Pointer to the RNDIS message
432  * @param[in] length Length of the RNDIS message, in bytes
433  * @return Error code
434  **/
435 
437 {
438  //Check the length of the message
439  if(length < sizeof(RndisKeepAliveMsg))
440  return ERROR_INVALID_LENGTH;
441 
442  //Debug message
443  TRACE_DEBUG("RNDIS Keep-Alive message received (%" PRIuSIZE " bytes)...\r\n", length);
444 
445  //Format the response to the Keep-Alive message
447 
448  //Send a notification to the host
450 
451  //Successful processing
452  return NO_ERROR;
453 }
454 
455 
456 /**
457  * @brief Format RNDIS Halt message
458  * @return Error code
459  **/
460 
462 {
464 
465  //Point to the buffer where to format the message
467 
468  //Format the RNDIS Halt message
469  message->messageType = RNDIS_HALT_MSG;
470  message->messageLength = sizeof(RndisHaltMsg);
471  message->requestId = 0;
472 
473  //Set the length of the response
474  rndisContext.encapsulatedRespLen = message->messageLength;
475 
476  //Successful processing
477  return NO_ERROR;
478 }
479 
480 
481 /**
482  * @brief Format RNDIS Indicate Status message
483  * @param[in] status RNDIS status code
484  * @return Error code
485  **/
486 
488 {
490 
491  //Point to the buffer where to format the message
493 
494  //Format the RNDIS Indicate Status message
495  message->messageType = RNDIS_INDICATE_STATUS_MSG;
496  message->messageLength = sizeof(RndisIndicateStatusMsg);
497  message->status = status;
498  message->statusBufferLength = 0;
499  message->statusBufferOffset = 0;
500 
501  //Set the length of the response
502  rndisContext.encapsulatedRespLen = message->messageLength;
503 
504  //Successful processing
505  return NO_ERROR;
506 }
507 
508 
509 /**
510  * @brief Format RNDIS Initialize Cmplt message
511  * @param[in] requestId Request identifier
512  * @return Error code
513  **/
514 
516 {
518 
519  //Point to the buffer where to format the response
521 
522  //Format the RNDIS Initialize Cmplt message
523  message->messageType = RNDIS_INITIALIZE_CMPLT;
524  message->messageLength = sizeof(RndisInitializeCmplt);
525  message->requestId = requestId;
526  message->status = RNDIS_STATUS_SUCCESS;
527  message->majorVersion = RNDIS_MAJOR_VERSION;
528  message->minorVersion = RNDIS_MINOR_VERSION;
529  message->deviceFlags = RNDIS_DF_CONNECTIONLESS;
530  message->medium = RNDIS_MEDIUM_802_3;
531  message->maxPacketsPerTransfer = 1;
532  message->maxTransferSize = RNDIS_MAX_TRANSFER_SIZE;
533  message->packetAlignmentFactor = 0;
534  message->afListOffset = 0;
535  message->afListSize = 0;
536 
537  //Set the length of the response
538  rndisContext.encapsulatedRespLen = message->messageLength;
539 
540  //Switch to the RNDIS_INITIALIZED state
542 
543  //Successful processing
544  return NO_ERROR;
545 }
546 
547 
548 /**
549  * @brief Format RNDIS Query Cmplt message
550  * @param[in] requestId Request identifier
551  * @param[in] status RNDIS status code
552  * @param[in] length Length of the response data, in bytes
553  * @return Error code
554  **/
555 
556 error_t rndisFormatQueryCmplt(uint32_t requestId, uint32_t status, uint32_t length)
557 {
559 
560  //Point to the buffer where to format the response
562 
563  //Format the Query Cmplt message
564  message->messageType = RNDIS_QUERY_CMPLT;
565  message->messageLength = sizeof(RndisQueryCmplt) + length;
566  message->requestId = requestId;
567  message->status = status;
568  message->infoBufferLength = length;
569  message->infoBufferOffset = sizeof(RndisQueryCmplt) - 8;
570 
571  //Save the length of the response
572  rndisContext.encapsulatedRespLen = message->messageLength;
573 
574  //Successful processing
575  return NO_ERROR;
576 }
577 
578 
579 /**
580  * @brief Format RNDIS Set Cmplt message
581  * @param[in] requestId Request identifier
582  * @param[in] status RNDIS status code
583  * @return Error code
584  **/
585 
586 error_t rndisFormatSetCmplt(uint32_t requestId, uint32_t status)
587 {
589 
590  //Point to the buffer where to format the response
592 
593  //Format the RNDIS Set Cmplt message
594  message->messageType = RNDIS_SET_CMPLT;
595  message->messageLength = sizeof(RndisSetCmplt);
596  message->requestId = requestId;
597  message->status = status;
598 
599  //Set the length of the response
600  rndisContext.encapsulatedRespLen = message->messageLength;
601 
602  //Switch to the RNDIS_DATA_INITIALIZED state
604 
605  //Successful processing
606  return NO_ERROR;
607 }
608 
609 
610 /**
611  * @brief Format RNDIS Reset Cmplt message
612  * @return Error code
613  **/
614 
616 {
618 
619  //Point to the buffer where to format the response
621 
622  //Format the RNDIS Reset Cmplt message
623  message->messageType = RNDIS_RESET_CMPLT;
624  message->messageLength = sizeof(RndisResetCmplt);
625  message->status = RNDIS_STATUS_SUCCESS;
626  message->addressingReset = 1;
627 
628  //Set the length of the response
629  rndisContext.encapsulatedRespLen = message->messageLength;
630 
631  //Switch to the RNDIS_INITIALIZED state
633 
634  //Successful processing
635  return NO_ERROR;
636 }
637 
638 
639 /**
640  * @brief Format RNDIS Keep-Alive Cmplt message
641  * @param[in] requestId Request identifier
642  * @return Error code
643  **/
644 
646 {
648 
649  //Point to the buffer where to format the response
651 
652  //Format the RNDIS Keep-Alive Cmplt message
653  message->messageType = RNDIS_KEEPALIVE_CMPLT;
654  message->messageLength = sizeof(RndisKeepAliveCmplt);
655  message->requestId = requestId;
656  message->status = RNDIS_STATUS_SUCCESS;
657 
658  //Set the length of the response
659  rndisContext.encapsulatedRespLen = message->messageLength;
660 
661  //Successful processing
662  return NO_ERROR;
663 }
664 
665 
666 /**
667  * @brief Send RNDIS notification message
668  * @param[in] notification Device notification
669  * @return Error code
670  **/
671 
672 error_t rndisSendNotification(uint32_t notification)
673 {
675 
676  //Prepare a notification message
678  message.reserved = 0;
679 
680  //Debug message
681  TRACE_DEBUG("Sending RNDIS notification...\r\n");
682  TRACE_DEBUG(" Notification = 0x%08" PRIX32 "\r\n", message.notification);
683  TRACE_DEBUG(" Reserved = 0x%08" PRIX32 "\r\n", message.reserved);
684 
685  //Send the notification to the USB host
686  USBD_LL_Transmit(&USBD_Device, RNDIS_NOTIFICATION_EP,
687  (uint8_t *) &message, sizeof(RndisNotificationMsg));
688 
689  //Successful processing
690  return NO_ERROR;
691 }
692 
693 
694 /**
695  * @brief Update RNDIS state
696  * @param[in] newState New RNDIS state to switch to
697  **/
698 
700 {
701  //Check transition event
703  newState == RNDIS_STATE_DATA_INITIALIZED)
704  {
705  //The link is up
708 
709  //Sanity check
710  if(rndisDriverInterface != NULL)
711  {
712  //Notify the user that the link state has changed
713  rndisDriverInterface->nicEvent = TRUE;
715  }
716  }
718  newState == RNDIS_STATE_UNINITIALIZED)
719  {
720  //The link is down
723 
724  //Sanity check
725  if(rndisDriverInterface != NULL)
726  {
727  //Notify the user that the link state has changed
728  rndisDriverInterface->nicEvent = TRUE;
730  }
731  }
732 
733  //Switch to the new state
734  rndisContext.state = newState;
735 }
#define OID_GEN_HARDWARE_STATUS
Definition: rndis.h:78
RNDIS (Remote Network Driver Interface Specification)
#define TRACE_DEBUG(...)
Definition: rndis.c:36
RNDIS Query message.
Definition: rndis.h:234
RNDIS Indicate Status message.
Definition: rndis.h:280
char char_t
Definition: compiler_port.h:41
#define RNDIS_INDICATE_STATUS_MSG
Definition: rndis.h:54
error_t rndisProcessMsg(const RndisMsg *message, size_t length)
Process incoming RNDIS message.
Definition: rndis.c:99
Generic RNDIS message.
Definition: rndis.h:196
Response to a RNDIS Initialize message.
Definition: rndis.h:318
bool_t rxState
Definition: rndis.h:459
error_t rndisSendNotification(uint32_t notification)
Send RNDIS notification message.
Definition: rndis.c:672
TCP/IP stack core.
#define OID_802_3_PERMANENT_ADDRESS
Definition: rndis.h:134
#define OID_GEN_TRANSMIT_BLOCK_SIZE
Definition: rndis.h:86
uint32_t packetFilter
Definition: rndis.h:460
#define OID_GEN_MAXIMUM_FRAME_SIZE
Definition: rndis.h:82
Debugging facilities.
RndisState state
Definition: rndis.h:455
#define RNDIS_MEDIA_STATE_CONNECTED
Definition: rndis.h:161
error_t macStringToAddr(const char_t *str, MacAddr *macAddr)
Convert a string representation of a MAC address to a binary MAC address.
Definition: ethernet.c:1151
uint8_t message[]
Definition: chap.h:150
#define RNDIS_MAC_ADDR
Definition: rndis.h:28
Response to a RNDIS Query message.
Definition: rndis.h:340
bool_t linkEvent
Definition: rndis.h:456
#define RNDIS_KEEPALIVE_MSG
Definition: rndis.h:55
#define OID_GEN_RECEIVE_BLOCK_SIZE
Definition: rndis.h:87
RNDIS Keep-Alive message.
Definition: rndis.h:306
#define RNDIS_QUERY_CMPLT
Definition: rndis.h:49
void rndisChangeState(RndisState newState)
Update RNDIS state.
Definition: rndis.c:699
error_t rndisFormatHaltMsg(void)
Format RNDIS Halt message.
Definition: rndis.c:461
#define RNDIS_MINOR_VERSION
Definition: rndis.h:38
USBD_HandleTypeDef USBD_Device
error_t rndisProcessResetMsg(const RndisResetMsg *message, size_t length)
Process RNDIS Reset message.
Definition: rndis.c:406
USB RNDIS class.
#define OID_GEN_MEDIA_SUPPORTED
Definition: rndis.h:79
#define OID_GEN_VENDOR_ID
Definition: rndis.h:88
#define RNDIS_NOTIFICATION_RESP_AVAILABLE
Definition: rndis.h:59
RNDIS Initialize message.
Definition: rndis.h:207
error_t rndisProcessInitializeMsg(const RndisInitializeMsg *message, size_t length)
Process RNDIS Initialize message.
Definition: rndis.c:157
NetInterface * rndisDriverInterface
Definition: rndis_driver.c:32
#define OID_802_3_MULTICAST_LIST
Definition: rndis.h:136
const uint32_t rndisSupportOidList[]
Definition: rndis.c:45
uint8_t CmdOpCode
Definition: rndis.h:467
#define RNDIS_MAJOR_VERSION
Definition: rndis.h:37
#define TRUE
Definition: os_port.h:48
#define RNDIS_STATUS_SUCCESS
Definition: rndis.h:62
error_t rndisFormatSetCmplt(uint32_t requestId, uint32_t status)
Format RNDIS Set Cmplt message.
Definition: rndis.c:586
error_t rndisProcessSetMsg(const RndisSetMsg *message, size_t length)
Process RNDIS Set message.
Definition: rndis.c:357
#define RNDIS_RESET_MSG
Definition: rndis.h:52
#define OID_GEN_VENDOR_DESCRIPTION
Definition: rndis.h:89
error_t rndisProcessHaltMsg(const RndisHaltMsg *message, size_t length)
Process RNDIS Halt message.
Definition: rndis.c:184
#define RNDIS_STATUS_FAILURE
Definition: rndis.h:63
#define RNDIS_RESET_CMPLT
Definition: rndis.h:53
#define STORE32LE(a, p)
Definition: cpu_endian.h:261
#define OID_802_3_XMIT_MORE_COLLISIONS
Definition: rndis.h:141
#define RNDIS_SET_CMPLT
Definition: rndis.h:51
#define RNDIS_HARDWARE_STATUS_READY
Definition: rndis.h:151
#define RNDIS_INITIALIZE_MSG
Definition: rndis.h:45
uint8_t encapsulatedResp[RNDIS_MAX_TRANSFER_SIZE]
Definition: rndis.h:463
#define OID_802_3_MAXIMUM_LIST_SIZE
Definition: rndis.h:137
RNDIS Reset message.
Definition: rndis.h:268
RTOS abstraction layer.
error_t rndisFormatIndicateStatusMsg(uint32_t status)
Format RNDIS Indicate Status message.
Definition: rndis.c:487
RNDIS driver.
#define RNDIS_QUERY_MSG
Definition: rndis.h:48
#define OID_802_3_XMIT_ONE_COLLISION
Definition: rndis.h:140
RNDIS Set message.
Definition: rndis.h:251
Response to a RNDIS Keep-Alive message.
Definition: rndis.h:382
#define OID_GEN_MEDIA_CONNECT_STATUS
Definition: rndis.h:96
Device notification message.
Definition: rndis.h:442
#define RNDIS_KEEPALIVE_CMPLT
Definition: rndis.h:56
bool_t osSetEventFromIsr(OsEvent *event)
Set an event object to the signaled state from an interrupt service routine.
#define OID_802_3_RCV_ERROR_ALIGNMENT
Definition: rndis.h:139
bool_t linkState
Definition: rndis.h:457
#define OID_GEN_MAXIMUM_SEND_PACKETS
Definition: rndis.h:97
error_t rndisFormatResetCmplt(void)
Format RNDIS Reset Cmplt message.
Definition: rndis.c:615
RNDIS (Remote Network Driver Interface Specification)
#define OID_GEN_MEDIA_IN_USE
Definition: rndis.h:80
#define RNDIS_VENDOR_DESCRIPTION
Definition: rndis.h:33
#define RNDIS_MAX_TRANSFER_SIZE
Definition: rndis.h:41
Success.
Definition: error.h:42
size_t rxBufferLen
Definition: rndis.h:462
OsEvent netEvent
Definition: net.c:72
error_t
Error codes.
Definition: error.h:40
#define RNDIS_SET_MSG
Definition: rndis.h:50
RndisState
RNDIS states.
Definition: rndis.h:183
RNDIS context.
Definition: rndis.h:453
__start_packed struct @112 MacAddr
MAC address.
error_t rndisFormatQueryCmplt(uint32_t requestId, uint32_t status, uint32_t length)
Format RNDIS Query Cmplt message.
Definition: rndis.c:556
#define OID_GEN_SUPPORTED_LIST
Definition: rndis.h:77
#define PRIuSIZE
Definition: compiler_port.h:72
#define RNDIS_INITIALIZE_CMPLT
Definition: rndis.h:46
#define OID_GEN_CURRENT_PACKET_FILTER
Definition: rndis.h:90
#define OID_802_3_CURRENT_ADDRESS
Definition: rndis.h:135
#define OID_GEN_LINK_SPEED
Definition: rndis.h:83
error_t rndisDumpMsg(const RndisMsg *message, size_t length)
Dump RNDIS message for debugging purpose.
Definition: rndis_debug.c:112
Response to a RNDIS Reset message.
Definition: rndis.h:369
uint8_t CmdLength
Definition: rndis.h:468
Response to a RNDIS Set message.
Definition: rndis.h:356
error_t rndisProcessQueryMsg(const RndisQueryMsg *message, size_t length)
Process RNDIS Query message.
Definition: rndis.c:208
RNDIS Halt message.
Definition: rndis.h:222
#define RNDIS_MEDIUM_802_3
Definition: rndis.h:158
error_t rndisFormatInitializeCmplt(uint32_t requestId)
Format RNDIS Initialize Cmplt message.
Definition: rndis.c:515
#define RNDIS_NOTIFICATION_EP
Definition: usbd_rndis.h:26
size_t encapsulatedRespLen
Definition: rndis.h:464
void rndisInit(void)
RNDIS core initialization.
Definition: rndis.c:77
#define macCopyAddr(destMacAddr, srcMacAddr)
Definition: ethernet.h:92
RndisContext rndisContext
Definition: rndis.c:42
error_t rndisProcessKeepAliveMsg(const RndisKeepAliveMsg *message, size_t length)
Process RNDIS Keep-Alive message.
Definition: rndis.c:436
#define OID_GEN_MAXIMUM_TOTAL_SIZE
Definition: rndis.h:93
#define LOAD32LE(p)
Definition: cpu_endian.h:185
uint8_t length
Definition: dtls_misc.h:140
uint8_t n
bool_t txState
Definition: rndis.h:458
#define FALSE
Definition: os_port.h:44
error_t rndisFormatKeepAliveCmplt(uint32_t requestId)
Format RNDIS Keep-Alive Cmplt message.
Definition: rndis.c:645
USB descriptors.
#define RNDIS_DF_CONNECTIONLESS
Definition: rndis.h:70
#define RNDIS_HALT_MSG
Definition: rndis.h:47