aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-07-22 13:32:39 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-07-22 13:32:39 +0000
commitbadbca579115d3305e1c95141e65689f90798019 (patch)
tree0867aa0f9cc8919844d430cb0ec5e4ca44d9c899
parent8e1328dc6aa3c2e832aba65f5b4cbc3faae6f77b (diff)
downloadlufa-badbca579115d3305e1c95141e65689f90798019.tar.gz
lufa-badbca579115d3305e1c95141e65689f90798019.tar.bz2
lufa-badbca579115d3305e1c95141e65689f90798019.zip
Fixed endianess issues in the RNDIS host class driver for UC3 devices (thanks to Andrew Chu). Fix broken build for UC3 devices when ORDERED_EP_CONFIG compile time option is set.
-rw-r--r--LUFA/DoxygenPages/ChangeLog.txt1
-rw-r--r--LUFA/Drivers/USB/Class/Host/RNDISClassHost.c4
-rw-r--r--LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt
index 999af82e1..91005999f 100644
--- a/LUFA/DoxygenPages/ChangeLog.txt
+++ b/LUFA/DoxygenPages/ChangeLog.txt
@@ -69,6 +69,7 @@
* - Fixed swapped Little Endian/Big Endian endpoint and pipe write code for the UC3 devices (thanks to Andrew Chu)
* - Fixed the JTAG_DISABLE() macro clearing all other bits in MCUSR when called
* - Fixed incorrect Micropendous board LED driver LEDs_SetAllLEDs() and LEDs_ChangeLEDs() function implementations (thanks to MitchJS)
+ * - Fixed endianess issues in the RNDIS host class driver for UC3 devices (thanks to Andrew Chu)
* - Library Applications:
* - Fixed error in the AVRISP-MKII programmer when ISP mode is used at 64KHz (thanks to Ben R. Porter)
* - Fixed AVRISP-MKII programmer project failing to compile for the U4 chips when VTARGET_ADC_CHANNEL is defined to an invalid channel and NO_VTARGET_DETECT is
diff --git a/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c b/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c
index e457b5dff..c5687511d 100644
--- a/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c
+++ b/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c
@@ -315,7 +315,7 @@ uint8_t RNDIS_Host_SetRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInter
memcpy(&SetMessageData.ContiguousBuffer, Buffer, Length);
if ((ErrorCode = RNDIS_SendEncapsulatedCommand(RNDISInterfaceInfo, &SetMessageData,
- SetMessageData.SetMessage.MessageLength)) != HOST_SENDCONTROL_Successful)
+ (sizeof(RNDIS_Set_Message_t) + Length))) != HOST_SENDCONTROL_Successful)
{
return ErrorCode;
}
@@ -424,7 +424,7 @@ uint8_t RNDIS_Host_ReadPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceIn
*PacketLength = (uint16_t)le32_to_cpu(DeviceMessage.DataLength);
- Pipe_Discard_Stream(DeviceMessage.DataOffset -
+ Pipe_Discard_Stream(le32_to_cpu(DeviceMessage.DataOffset) -
(sizeof(RNDIS_Packet_Message_t) - sizeof(RNDIS_Message_Header_t)),
NULL);
diff --git a/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c b/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c
index 23c004db3..5b17455ab 100644
--- a/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c
+++ b/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c
@@ -87,7 +87,7 @@ bool Pipe_ConfigurePipe(const uint8_t Address,
((uint32_t)Token << AVR32_USBB_PTOKEN_OFFSET) |
((Banks > 1) ? AVR32_USBB_PBK_MASK : 0) |
Pipe_BytesToEPSizeMask(Size) |
- ((EndpointNumber & PIPE_EPNUM_MASK) << AVR32_USBB_PEPNUM_OFFSET));
+ ((uint32_t)Number << AVR32_USBB_PEPNUM_OFFSET));
Pipe_SetInfiniteINRequests();