Oops - revert changes to the Device mode Class Driver VirtualSerial demo makefile.
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Host / RNDIS.h
index 1695d67..0cb5f46 100644 (file)
                        
                /* Enums: */
                        /** Enum for the possible error codes returned by the \ref RNDIS_Host_ConfigurePipes() function. */
-                       enum RNDISHost_EnumerationFailure_ErrorCodes_t
+                       enum RNDIS_Host_EnumerationFailure_ErrorCodes_t
                        {
                                RNDIS_ENUMERROR_NoError                    = 0, /**< Configuration Descriptor was processed successfully. */
                                RNDIS_ENUMERROR_InvalidConfigDescriptor    = 1, /**< The device returned an invalid Configuration Descriptor. */
-                               RNDIS_ENUMERROR_NoRNDISInterfaceFound      = 2, /**< A compatible RNDIS interface was not found in the device's Configuration Descriptor. */
-                               RNDIS_ENUMERROR_EndpointsNotFound          = 3, /**< Compatible RNDIS endpoints were not found in the device's RNDIS interface. */
+                               RNDIS_ENUMERROR_NoCompatibleInterfaceFound = 2, /**< A compatible RNDIS interface was not found in the device's Configuration Descriptor. */
                        };
 
                /* Macros: */
                        /** Additional error code for RNDIS functions when a device returns a logical command failure. */
-                       #define RNDIS_COMMAND_FAILED                  0xC0      
+                       #define RNDIS_COMMAND_FAILED                  0xC0
 
                /* Function Prototypes: */
                        /** Host interface configuration routine, to configure a given RNDIS host interface instance using the Configuration
                         *  This should be called once after the stack has enumerated the attached device, while the host state machine is in
                         *  the Addressed state.
                         *
+                        *  \note The pipe index numbers as given in the interface's configuration structure must not overlap with any other
+                        *        interface, or pipe bank corruption will occur. Gaps in the allocated pipe numbers or non-sequential indexes
+                        *        within a single interface is allowed, but no two interfaces of any type have have interleaved pipe indexes.
+                        *
                         *  \param[in,out] RNDISInterfaceInfo      Pointer to a structure containing an RNDIS Class host configuration and state.
                         *  \param[in]     ConfigDescriptorSize    Length of the attached device's Configuration Descriptor.
                         *  \param[in]     DeviceConfigDescriptor  Pointer to a buffer containing the attached device's Configuration Descriptor.
                         *
-                        *  \return A value from the \ref RNDISHost_EnumerationFailure_ErrorCodes_t enum.
+                        *  \return A value from the \ref RNDIS_Host_EnumerationFailure_ErrorCodes_t enum.
                         */
-                       uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, uint16_t ConfigDescriptorSize,
-                                                       void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
+                       uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
+                                                         uint16_t ConfigDescriptorSize,
+                                                         void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
 
                        /** Sends a RNDIS KEEPALIVE command to the device, to ensure that it does not enter standby mode after periods
                         *  of long inactivity.
                         */
                        uint8_t RNDIS_Host_SendKeepAlive(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
 
-                       /** Initializes the attached RNDIS device's RNDIS interface. This should be called after the device's pipes have been
+                       /** Initialises the attached RNDIS device's RNDIS interface. This should be called after the device's pipes have been
                         *  configured via the call to \ref RNDIS_Host_ConfigurePipes().
                         *
                         *  \param[in,out] RNDISInterfaceInfo  Pointer to a structure containing an RNDIS Class host configuration and state.
                         *  \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
                         *          logical command failure.
                         */
-                       uint8_t RNDIS_Host_SetRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, const uint32_t Oid, void* Buffer,
-                                                           const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)  ATTR_NON_NULL_PTR_ARG(3);
+                       uint8_t RNDIS_Host_SetRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
+                                                           const uint32_t Oid,
+                                                           void* Buffer,
+                                                           const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
 
                        /** Gets a given RNDIS property of an attached RNDIS device.
                         *
                         *  \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
                         *          logical command failure.
                         */
-                       uint8_t RNDIS_Host_QueryRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, const uint32_t Oid, void* Buffer,
+                       uint8_t RNDIS_Host_QueryRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
+                                                             const uint32_t Oid,
+                                                             void* Buffer,
                                                              const uint16_t MaxLength) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
 
                        /** Determines if a packet is currently waiting for the host to read in and process.
                         *
                         *  \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
                         */
-                       uint8_t RNDIS_Host_ReadPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, void* Buffer, uint16_t* const PacketLength)
-                                                     ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3);
+                       uint8_t RNDIS_Host_ReadPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
+                                                     void* Buffer,
+                                                     uint16_t* const PacketLength) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2)
+                                                     ATTR_NON_NULL_PTR_ARG(3);
 
                        /** Sends the given packet to the attached RNDIS device, after adding a RNDIS packet message header.
                         *
                         *
                         *  \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
                         */
-                       uint8_t RNDIS_Host_SendPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, void* Buffer, const uint16_t PacketLength)
-                                                     ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
+                       uint8_t RNDIS_Host_SendPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
+                                                     void* Buffer,
+                                                     const uint16_t PacketLength) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
 
                /* Inline Functions: */
                        /** General management task for a given RNDIS host class interface, required for the correct operation of the interface. This should
                        #define RNDIS_DATA_CLASS                  0x0A
                        #define RNDIS_DATA_SUBCLASS               0x00
                        #define RNDIS_DATA_PROTOCOL               0x00
-                       
-                       #define RNDIS_FOUND_DATAPIPE_IN           (1 << 0)
-                       #define RNDIS_FOUND_DATAPIPE_OUT          (1 << 1)
-                       #define RNDIS_FOUND_NOTIFICATION_IN       (1 << 2)
 
                /* Function Prototypes: */
                        #if defined(__INCLUDE_FROM_RNDIS_CLASS_HOST_C)
                                static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, 
-                                                                            void* Buffer, const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
+                                                                            void* Buffer,
+                                                                            const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
                                                                             ATTR_NON_NULL_PTR_ARG(2);
                                static uint8_t RNDIS_GetEncapsulatedResponse(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
-                                                                            void* Buffer, const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
+                                                                            void* Buffer,
+                                                                            const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1)
                                                                             ATTR_NON_NULL_PTR_ARG(2);
 
                                static uint8_t DCOMP_RNDIS_Host_NextRNDISControlInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
                                static uint8_t DCOMP_RNDIS_Host_NextRNDISDataInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
                                static uint8_t DCOMP_RNDIS_Host_NextRNDISInterfaceEndpoint(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
-                       #endif  
+                       #endif
        #endif
-                               
+
        /* Disable C linkage for C++ Compilers: */
                #if defined(__cplusplus)
                        }