From 85e85befc41a9a66a49db0afd08e04c88ba38556 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 11 Jul 2011 09:50:54 +0000 Subject: More endianness porting of the LUFA device mode class drivers. Add endianness information to the class driver and core structure definitions. Move out the unused Ethernet_Frame_Info_t structure definition to the RNDIS device demos where it is needed. --- Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h | 7 +++++++ Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.c | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'Demos/Device/LowLevel/RNDISEthernet/Lib') diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h index 7749e7990..3ce62128c 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h @@ -81,6 +81,13 @@ #define NO_PROCESS -1 /* Type Defines: */ + /** 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. */ + } Ethernet_Frame_Info_t; + /** Type define for an Ethernet frame header. */ typedef struct { diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.c index cadd33563..827dc1ac3 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.c @@ -84,10 +84,7 @@ void DecodeEthernetFrameHeader(void* InDataStart) FrameHeader->Destination.Octets[4], FrameHeader->Destination.Octets[5]); - if (SwapEndian_16(FrameIN.FrameLength) > ETHERNET_VER2_MINSIZE) - printf_P(PSTR(" + Protocol: 0x%04x\r\n"), SwapEndian_16(FrameHeader->EtherType)); - else - printf_P(PSTR(" + Protocol: UNKNOWN E1\r\n")); + printf_P(PSTR(" + Protocol: 0x%04x\r\n"), SwapEndian_16(FrameHeader->EtherType)); #endif } -- cgit v1.2.3