X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/1daa5e16f9a395fb2943906a715adb35b8106988..d881e0cbf691793ab6e5fe24f091549a007e009a:/LUFA/Drivers/USB/Class/Common/RNDIS.h diff --git a/LUFA/Drivers/USB/Class/Common/RNDIS.h b/LUFA/Drivers/USB/Class/Common/RNDIS.h index cb806ec56..05ab13b70 100644 --- a/LUFA/Drivers/USB/Class/Common/RNDIS.h +++ b/LUFA/Drivers/USB/Class/Common/RNDIS.h @@ -57,8 +57,6 @@ #include "../../Core/StdDescriptors.h" #include "CDC.h" - #include - /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) extern "C" { @@ -70,6 +68,9 @@ #endif /* Macros: */ + /** Additional error code for RNDIS functions when a device returns a logical command failure. */ + #define RNDIS_ERROR_LOGICAL_CMD_FAILED 0x80 + /** Implemented RNDIS Version Major. */ #define REMOTE_NDIS_VERSION_MAJOR 0x01 @@ -213,33 +214,26 @@ */ typedef struct { - uint8_t Octets[6]; /**< Individual bytes of a MAC address */ - } MAC_Address_t; - - /** \brief RNDIS Ethernet Frame Packet Information Structure. - * - * Type define for an Ethernet frame buffer data and information structure. - */ - typedef struct - { - uint8_t FrameData[ETHERNET_FRAME_SIZE_MAX]; /**< Ethernet frame contents. */ - uint16_t FrameLength; /**< Length in bytes of the Ethernet frame stored in the buffer. */ - bool FrameInBuffer; /**< Indicates if a frame is currently stored in the buffer. */ - } Ethernet_Frame_Info_t; + uint8_t Octets[6]; /**< Individual bytes of a MAC address */ + } ATTR_PACKED MAC_Address_t; /** \brief RNDIS Common Message Header Structure. * * Type define for a RNDIS message header, sent before RNDIS messages. + * + * \note Regardless of CPU architecture, these values should be stored as little endian. */ typedef struct { uint32_t MessageType; /**< RNDIS message type, a \c REMOTE_NDIS_*_MSG constant */ uint32_t MessageLength; /**< Total length of the RNDIS message, in bytes */ - } RNDIS_Message_Header_t; + } ATTR_PACKED RNDIS_Message_Header_t; /** \brief RNDIS Message Structure. * * Type define for a RNDIS packet message, used to encapsulate Ethernet packets sent to and from the adapter. + * + * \note Regardless of CPU architecture, these values should be stored as little endian. */ typedef struct { @@ -254,11 +248,13 @@ uint32_t PerPacketInfoLength; uint32_t VcHandle; uint32_t Reserved; - } RNDIS_Packet_Message_t; + } ATTR_PACKED RNDIS_Packet_Message_t; /** \brief RNDIS Initialization Message Structure. * * Type define for a RNDIS Initialize command message. + * + * \note Regardless of CPU architecture, these values should be stored as little endian. */ typedef struct { @@ -269,11 +265,13 @@ uint32_t MajorVersion; uint32_t MinorVersion; uint32_t MaxTransferSize; - } RNDIS_Initialize_Message_t; + } ATTR_PACKED RNDIS_Initialize_Message_t; /** \brief RNDIS Initialize Complete Message Structure. * * Type define for a RNDIS Initialize Complete response message. + * + * \note Regardless of CPU architecture, these values should be stored as little endian. */ typedef struct { @@ -291,22 +289,26 @@ uint32_t PacketAlignmentFactor; uint32_t AFListOffset; uint32_t AFListSize; - } RNDIS_Initialize_Complete_t; + } ATTR_PACKED RNDIS_Initialize_Complete_t; /** \brief RNDIS Keep Alive Message Structure. * * Type define for a RNDIS Keep Alive command message. + * + * \note Regardless of CPU architecture, these values should be stored as little endian. */ typedef struct { uint32_t MessageType; uint32_t MessageLength; uint32_t RequestId; - } RNDIS_KeepAlive_Message_t; + } ATTR_PACKED RNDIS_KeepAlive_Message_t; /** \brief RNDIS Keep Alive Complete Message Structure. * * Type define for a RNDIS Keep Alive Complete response message. + * + * \note Regardless of CPU architecture, these values should be stored as little endian. */ typedef struct { @@ -314,11 +316,13 @@ uint32_t MessageLength; uint32_t RequestId; uint32_t Status; - } RNDIS_KeepAlive_Complete_t; + } ATTR_PACKED RNDIS_KeepAlive_Complete_t; /** \brief RNDIS Reset Complete Message Structure. * * Type define for a RNDIS Reset Complete response message. + * + * \note Regardless of CPU architecture, these values should be stored as little endian. */ typedef struct { @@ -327,11 +331,13 @@ uint32_t Status; uint32_t AddressingReset; - } RNDIS_Reset_Complete_t; + } ATTR_PACKED RNDIS_Reset_Complete_t; /** \brief RNDIS OID Property Set Message Structure. * * Type define for a RNDIS OID Property Set command message. + * + * \note Regardless of CPU architecture, these values should be stored as little endian. */ typedef struct { @@ -343,11 +349,13 @@ uint32_t InformationBufferLength; uint32_t InformationBufferOffset; uint32_t DeviceVcHandle; - } RNDIS_Set_Message_t; + } ATTR_PACKED RNDIS_Set_Message_t; /** \brief RNDIS OID Property Set Complete Message Structure. * * Type define for a RNDIS OID Property Set Complete response message. + * + * \note Regardless of CPU architecture, these values should be stored as little endian. */ typedef struct { @@ -355,11 +363,13 @@ uint32_t MessageLength; uint32_t RequestId; uint32_t Status; - } RNDIS_Set_Complete_t; + } ATTR_PACKED RNDIS_Set_Complete_t; /** \brief RNDIS OID Property Query Message Structure. * * Type define for a RNDIS OID Property Query command message. + * + * \note Regardless of CPU architecture, these values should be stored as little endian. */ typedef struct { @@ -371,11 +381,13 @@ uint32_t InformationBufferLength; uint32_t InformationBufferOffset; uint32_t DeviceVcHandle; - } RNDIS_Query_Message_t; + } ATTR_PACKED RNDIS_Query_Message_t; /** \brief RNDIS OID Property Query Complete Message Structure. * * Type define for a RNDIS OID Property Query Complete response message. + * + * \note Regardless of CPU architecture, these values should be stored as little endian. */ typedef struct { @@ -386,7 +398,7 @@ uint32_t InformationBufferLength; uint32_t InformationBufferOffset; - } RNDIS_Query_Complete_t; + } ATTR_PACKED RNDIS_Query_Complete_t; /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus)