Added beginnings of a new AVRISP-MKII clone project.
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Common / RNDIS.h
index abc1733..88ee04f 100644 (file)
@@ -37,6 +37,7 @@
 \r
        /* Includes: */\r
                #include "../../USB.h"\r
+               #include "CDC.h"\r
                \r
                #include <string.h>\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
                typedef struct\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 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 a RNDIS packet message, used to encapsulate Ethernet packets sent to and from the adapter */\r
                typedef struct\r
                {\r
                        uint32_t PerPacketInfoLength;\r
                        uint32_t VcHandle;\r
                        uint32_t Reserved;\r
-               } RNDIS_PACKET_MSG_t;\r
+               } RNDIS_Packet_Message_t;\r
 \r
                /** Type define for a RNDIS Initialize command message */\r
                typedef struct\r
                        uint32_t MajorVersion;\r
                        uint32_t MinorVersion;\r
                        uint32_t MaxTransferSize;\r
-               } RNDIS_INITIALIZE_MSG_t;\r
+               } RNDIS_Initialize_Message_t;\r
                \r
                /** Type define for a RNDIS Initialize complete response message */\r
                typedef struct\r
                        uint32_t PacketAlignmentFactor;\r
                        uint32_t AFListOffset;\r
                        uint32_t AFListSize;\r
-               } RNDIS_INITIALIZE_CMPLT_t;\r
+               } RNDIS_Initialize_Complete_t;\r
                \r
                /** Type define for a RNDIS Keepalive command message */\r
                typedef struct\r
                        uint32_t MessageType;\r
                        uint32_t MessageLength;\r
                        uint32_t RequestId;\r
-               } RNDIS_KEEPALIVE_MSG_t;\r
+               } RNDIS_KeepAlive_Message_t;\r
 \r
                /** Type define for a RNDIS Keepalive complete message */\r
                typedef struct\r
                        uint32_t MessageLength;\r
                        uint32_t RequestId;\r
                        uint32_t Status;\r
-               } RNDIS_KEEPALIVE_CMPLT_t;\r
+               } RNDIS_KeepAlive_Complete_t;\r
 \r
                /** Type define for a RNDIS Reset complete message */\r
                typedef struct\r
                        uint32_t Status;\r
 \r
                        uint32_t AddressingReset;\r
-               } RNDIS_RESET_CMPLT_t;\r
+               } RNDIS_Reset_Complete_t;\r
                \r
                /** Type define for a RNDIS Set command message */\r
                typedef struct\r
                        uint32_t InformationBufferLength;\r
                        uint32_t InformationBufferOffset;\r
                        uint32_t DeviceVcHandle;\r
-               } RNDIS_SET_MSG_t;\r
+               } RNDIS_Set_Message_t;\r
 \r
                /** Type define for a RNDIS Set complete response message */\r
                typedef struct\r
                        uint32_t MessageLength;\r
                        uint32_t RequestId;\r
                        uint32_t Status;\r
-               } RNDIS_SET_CMPLT_t;\r
+               } RNDIS_Set_Complete_t;\r
                \r
                /** Type define for a RNDIS Query command message */\r
                typedef struct\r
                        uint32_t InformationBufferLength;\r
                        uint32_t InformationBufferOffset;\r
                        uint32_t DeviceVcHandle;\r
-               } RNDIS_QUERY_MSG_t;\r
+               } RNDIS_Query_Message_t;\r
                \r
                /** Type define for a RNDIS Query complete response message */\r
                typedef struct\r
                        \r
                        uint32_t InformationBufferLength;\r
                        uint32_t InformationBufferOffset;\r
-               } RNDIS_QUERY_CMPLT_t;\r
-\r
-               /** Class state structure. An instance of this structure should be made for each RNDIS interface\r
-                *  within the user application, and passed to each of the RNDIS class driver functions as the\r
-                *  RNDISInterfaceInfo parameter. The contents of this structure should be set to their correct\r
-                *  values when used, or ommitted to force the library to use default values.\r
-                */\r
-               typedef struct\r
-               {\r
-                       uint8_t  ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device */\r
-\r
-                       uint8_t  DataINEndpointNumber; /**< Endpoint number of the CDC interface's IN data endpoint */\r
-                       uint16_t DataINEndpointSize; /**< Size in bytes of the CDC interface's IN data endpoint */\r
-\r
-                       uint8_t  DataOUTEndpointNumber; /**< Endpoint number of the CDC interface's OUT data endpoint */\r
-                       uint16_t DataOUTEndpointSize;  /**< Size in bytes of the CDC interface's OUT data endpoint */\r
-\r
-                       uint8_t  NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used */\r
-                       uint16_t NotificationEndpointSize;  /**< Size in bytes of the CDC interface's IN notification endpoint, if used */\r
-                       \r
-                       char*         AdapterVendorDescription; /**< String description of the adapter vendor */\r
-                       MAC_Address_t AdapterMACAddress; /**< MAC address of the adapter */\r
-\r
-                       uint8_t  RNDISMessageBuffer[RNDIS_MESSAGE_BUFFER_SIZE]; /**< Buffer to hold RNDIS messages to and from the host,\r
-                                                                                *   managed by the class driver\r
-                                                                                */\r
-                       bool     ResponseReady; /**< Internal flag indicating if a RNDIS message is waiting to be returned to the host */\r
-                       uint8_t  CurrRNDISState; /**< Current RNDIS state of the adapter, a value from the RNDIS_States_t enum */\r
-                       uint32_t CurrPacketFilter; /**< Current packet filter mode, used internally by the class driver */\r
-                       Ethernet_Frame_Info_t FrameIN; /**< Structure holding the last received Ethernet frame from the host, for user\r
-                                                       *   processing\r
-                                                       */\r
-                       Ethernet_Frame_Info_t FrameOUT; /**< Structure holding the next Ethernet frame to send to the host, populated by the\r
-                                                        *   user application\r
-                                                        */\r
-               } USB_ClassInfo_RNDIS_t;\r
+               } RNDIS_Query_Complete_t;\r
                                \r
        /* Disable C linkage for C++ Compilers: */\r
                #if defined(__cplusplus)\r