Fixed endianess issues in the RNDIS host class driver for UC3 devices (thanks to...
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 22 Jul 2012 13:32:39 +0000 (13:32 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 22 Jul 2012 13:32:39 +0000 (13:32 +0000)
LUFA/DoxygenPages/ChangeLog.txt
LUFA/Drivers/USB/Class/Host/RNDISClassHost.c
LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c

index 999af82..9100599 100644 (file)
@@ -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
index e457b5d..c568751 100644 (file)
@@ -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);
 
index 23c004d..5b17455 100644 (file)
@@ -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();