Document the Bluetooth ACL layer. Remove unneeded parameters from the signalling...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Common / RNDIS.h
index c169fa4..74e22bd 100644 (file)
@@ -1,21 +1,21 @@
 /*\r
              LUFA Library\r
 /*\r
              LUFA Library\r
-     Copyright (C) Dean Camera, 2009.\r
+     Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
-  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
-\r
-  Permission to use, copy, modify, and distribute this software\r
-  and its documentation for any purpose and without fee is hereby\r
-  granted, provided that the above copyright notice appear in all\r
-  copies and that both that the copyright notice and this\r
-  permission notice and warranty disclaimer appear in supporting\r
-  documentation, and that the name of the author not be used in\r
-  advertising or publicity pertaining to distribution of the\r
+  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+\r
+  Permission to use, copy, modify, distribute, and sell this \r
+  software and its documentation for any purpose is hereby granted\r
+  without fee, provided that the above copyright notice appear in \r
+  all copies and that both that the copyright notice and this\r
+  permission notice and warranty disclaimer appear in supporting \r
+  documentation, and that the name of the author not be used in \r
+  advertising or publicity pertaining to distribution of the \r
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
   this software.\r
 */\r
 \r
   this software.\r
 */\r
 \r
+/** \file\r
+ *  \brief Common definitions and declarations for the library USB RNDIS Class driver.\r
+ *\r
+ *  Common definitions and declarations for the library USB RNDIS Class driver.\r
+ *\r
+ *  \note This file should not be included directly. It is automatically included as needed by the class driver\r
+ *        dispatch header located in LUFA/Drivers/USB/Class/RNDIS.h.\r
+ */\r
+\r
 /** \ingroup Group_USBClassRNDIS\r
 /** \ingroup Group_USBClassRNDIS\r
+ *  @defgroup Group_USBClassRNDISCommon  Common Class Definitions\r
+ *\r
+ *  \section Module Description\r
+ *  Constants, Types and Enum definitions that are common to both Device and Host modes for the USB\r
+ *  RNDIS Class.\r
+ *\r
  *  @{\r
  */\r
 \r
 #ifndef _RNDIS_CLASS_COMMON_H_\r
 #define _RNDIS_CLASS_COMMON_H_\r
 \r
  *  @{\r
  */\r
 \r
 #ifndef _RNDIS_CLASS_COMMON_H_\r
 #define _RNDIS_CLASS_COMMON_H_\r
 \r
+       /* Macros: */\r
+               #define __INCLUDE_FROM_CDC_DRIVER\r
+\r
        /* Includes: */\r
                #include "../../USB.h"\r
        /* Includes: */\r
                #include "../../USB.h"\r
+               #include "RNDISConstants.h"\r
+               #include "CDC.h"\r
                \r
                #include <string.h>\r
        \r
                \r
                #include <string.h>\r
        \r
                        extern "C" {\r
                #endif\r
 \r
                        extern "C" {\r
                #endif\r
 \r
+       /* Preprocessor Checks: */\r
+               #if !defined(__INCLUDE_FROM_RNDIS_DRIVER)\r
+                       #error Do not include this file directly. Include LUFA/Drivers/Class/RNDIS.h instead.\r
+               #endif\r
+               \r
        /* Macros: */\r
                /** Implemented RNDIS Version Major */\r
                #define REMOTE_NDIS_VERSION_MAJOR             0x01\r
        /* Macros: */\r
                /** Implemented RNDIS Version Major */\r
                #define REMOTE_NDIS_VERSION_MAJOR             0x01\r
@@ -61,7 +86,7 @@
                /** Maximum size in bytes of a RNDIS control message which can be sent or received */\r
                #define RNDIS_MESSAGE_BUFFER_SIZE             128\r
 \r
                /** Maximum size in bytes of a RNDIS control message which can be sent or received */\r
                #define RNDIS_MESSAGE_BUFFER_SIZE             128\r
 \r
-               /** Maximum size in bytes of an Ethernet frame which can be sent or received */\r
+               /** Maximum size in bytes of an Ethernet frame according to the Ethernet standard */\r
                #define ETHERNET_FRAME_SIZE_MAX               1500\r
                \r
                /** Notification request value for a RNDIS Response Available notification */\r
                #define ETHERNET_FRAME_SIZE_MAX               1500\r
                \r
                /** Notification request value for a RNDIS Response Available notification */\r
                };\r
                \r
        /* Type Defines: */\r
                };\r
                \r
        /* Type Defines: */\r
-               /** Type define for a physical MAC address of a device on a network */\r
+               /** \brief MAC Address Structure.\r
+                *\r
+                *  Type define for a physical MAC address of a device on a network\r
+                */\r
                typedef struct\r
                {\r
                        uint8_t       Octets[6]; /**< Individual bytes of a MAC address */\r
                } MAC_Address_t;\r
 \r
                typedef struct\r
                {\r
                        uint8_t       Octets[6]; /**< Individual bytes of a MAC address */\r
                } MAC_Address_t;\r
 \r
-               /** Type define for a RNDIS message header, sent before RNDIS messages */\r
-               typedef struct\r
-               {\r
-                       uint32_t MessageType; /**< RNDIS message type, a REMOTE_NDIS_*_MSG constant */\r
-                       uint32_t MessageLength; /**< Total length of the RNDIS message, in bytes */\r
-               } RNDIS_Message_Header_t;\r
-\r
-               /** Type define for an Ethernet frame buffer. */\r
+               /** \brief RNDIS Ethernet Frame Packet Information Structure.\r
+                *\r
+                *  Type define for an Ethernet frame buffer data and information structure.\r
+                */\r
                typedef struct\r
                {\r
                        uint8_t       FrameData[ETHERNET_FRAME_SIZE_MAX]; /**< Ethernet frame contents */\r
                typedef struct\r
                {\r
                        uint8_t       FrameData[ETHERNET_FRAME_SIZE_MAX]; /**< Ethernet frame contents */\r
                        bool          FrameInBuffer; /**< Indicates if a frame is currently stored in the buffer */\r
                } Ethernet_Frame_Info_t;\r
 \r
                        bool          FrameInBuffer; /**< Indicates if a frame is currently stored in the buffer */\r
                } Ethernet_Frame_Info_t;\r
 \r
-               /** Type define for a RNDIS packet message, used to encapsulate Ethernet packets sent to and from the adapter */\r
+               /** \brief RNDIS Common Message Header Structure.\r
+                *\r
+                *  Type define for a RNDIS message header, sent before RNDIS messages.\r
+                */\r
+               typedef struct\r
+               {\r
+                       uint32_t MessageType; /**< RNDIS message type, a REMOTE_NDIS_*_MSG constant */\r
+                       uint32_t MessageLength; /**< Total length of the RNDIS message, in bytes */\r
+               } RNDIS_Message_Header_t;\r
+\r
+               /** \brief RNDIS Message Structure.\r
+                *\r
+                *  Type define for a RNDIS packet message, used to encapsulate Ethernet packets sent to and from the adapter.\r
+                */\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                        uint32_t Reserved;\r
                } RNDIS_Packet_Message_t;\r
 \r
                        uint32_t Reserved;\r
                } RNDIS_Packet_Message_t;\r
 \r
-               /** Type define for a RNDIS Initialize command message */\r
+               /** \brief RNDIS Initialization Message Structure.\r
+                *\r
+                *  Type define for a RNDIS Initialize command message.\r
+                */\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                        uint32_t MaxTransferSize;\r
                } RNDIS_Initialize_Message_t;\r
                \r
                        uint32_t MaxTransferSize;\r
                } RNDIS_Initialize_Message_t;\r
                \r
-               /** Type define for a RNDIS Initialize complete response message */\r
+               /** \brief RNDIS Initialize Complete Message Structure.\r
+                *\r
+                *  Type define for a RNDIS Initialize Complete response message.\r
+                */\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                        uint32_t AFListSize;\r
                } RNDIS_Initialize_Complete_t;\r
                \r
                        uint32_t AFListSize;\r
                } RNDIS_Initialize_Complete_t;\r
                \r
-               /** Type define for a RNDIS Keepalive command message */\r
+               /** \brief RNDIS Keep Alive Message Structure.\r
+                *\r
+                *  Type define for a RNDIS Keep Alive command message.\r
+                */\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                        uint32_t RequestId;\r
                } RNDIS_KeepAlive_Message_t;\r
 \r
                        uint32_t RequestId;\r
                } RNDIS_KeepAlive_Message_t;\r
 \r
-               /** Type define for a RNDIS Keepalive complete message */\r
+               /** \brief RNDIS Keep Alive Complete Message Structure.\r
+                *\r
+                *  Type define for a RNDIS Keep Alive Complete response message.\r
+                */\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                        uint32_t Status;\r
                } RNDIS_KeepAlive_Complete_t;\r
 \r
                        uint32_t Status;\r
                } RNDIS_KeepAlive_Complete_t;\r
 \r
-               /** Type define for a RNDIS Reset complete message */\r
+               /** \brief RNDIS Reset Complete Message Structure.\r
+                *\r
+                *  Type define for a RNDIS Reset Complete response message.\r
+                */\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                        uint32_t AddressingReset;\r
                } RNDIS_Reset_Complete_t;\r
                \r
                        uint32_t AddressingReset;\r
                } RNDIS_Reset_Complete_t;\r
                \r
-               /** Type define for a RNDIS Set command message */\r
+               /** \brief RNDIS OID Property Set Message Structure.\r
+                *\r
+                *  Type define for a RNDIS OID Property Set command message.\r
+                */\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                        uint32_t DeviceVcHandle;\r
                } RNDIS_Set_Message_t;\r
 \r
                        uint32_t DeviceVcHandle;\r
                } RNDIS_Set_Message_t;\r
 \r
-               /** Type define for a RNDIS Set complete response message */\r
+               /** \brief RNDIS OID Property Set Complete Message Structure.\r
+                *\r
+                *  Type define for a RNDIS OID Property Set Complete response message.\r
+                */\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                        uint32_t Status;\r
                } RNDIS_Set_Complete_t;\r
                \r
                        uint32_t Status;\r
                } RNDIS_Set_Complete_t;\r
                \r
-               /** Type define for a RNDIS Query command message */\r
+               /** \brief RNDIS OID Property Query Message Structure.\r
+                *\r
+                *  Type define for a RNDIS OID Property Query command message.\r
+                */\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                        uint32_t DeviceVcHandle;\r
                } RNDIS_Query_Message_t;\r
                \r
                        uint32_t DeviceVcHandle;\r
                } RNDIS_Query_Message_t;\r
                \r
-               /** Type define for a RNDIS Query complete response message */\r
+               /** \brief RNDIS OID Property Query Complete Message Structure.\r
+                *\r
+                *  Type define for a RNDIS OID Property Query Complete response message.\r
+                */\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r
                typedef struct\r
                {\r
                        uint32_t MessageType;\r