Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lufa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Erik Strand
lufa
Commits
397c2f91
Commit
397c2f91
authored
May 27, 2011
by
Dean Camera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge over trunk changes to the 110528 BETA to form the 110528 release.
parent
2b09c428
Changes
42
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
390 additions
and
204 deletions
+390
-204
Bootloaders/CDC/BootloaderCDC.c
Bootloaders/CDC/BootloaderCDC.c
+17
-0
Bootloaders/CDC/BootloaderCDC.h
Bootloaders/CDC/BootloaderCDC.h
+1
-0
Bootloaders/DFU/BootloaderDFU.c
Bootloaders/DFU/BootloaderDFU.c
+21
-4
Bootloaders/DFU/BootloaderDFU.h
Bootloaders/DFU/BootloaderDFU.h
+1
-0
Bootloaders/HID/BootloaderHID.c
Bootloaders/HID/BootloaderHID.c
+8
-0
Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.c
Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.c
+1
-1
Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c
Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c
+1
-2
Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c
Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c
+3
-6
Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h
Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h
+2
-1
Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
+17
-3
Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.c
Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.c
+1
-1
Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.c
Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.c
+1
-2
Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c
Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c
+1
-2
Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c
Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c
+4
-7
LUFA/CodeTemplates/makefile_template.uc3
LUFA/CodeTemplates/makefile_template.uc3
+1
-3
LUFA/Common/Common.h
LUFA/Common/Common.h
+4
-1
LUFA/Common/Endianness.h
LUFA/Common/Endianness.h
+3
-3
LUFA/Drivers/USB/Class/Common/CDC.h
LUFA/Drivers/USB/Class/Common/CDC.h
+2
-2
LUFA/Drivers/USB/Class/Common/RNDIS.h
LUFA/Drivers/USB/Class/Common/RNDIS.h
+13
-10
LUFA/Drivers/USB/Class/Device/RNDIS.c
LUFA/Drivers/USB/Class/Device/RNDIS.c
+80
-46
LUFA/Drivers/USB/Class/Device/RNDIS.h
LUFA/Drivers/USB/Class/Device/RNDIS.h
+42
-6
LUFA/Drivers/USB/Class/Host/RNDIS.c
LUFA/Drivers/USB/Class/Host/RNDIS.c
+5
-4
LUFA/Drivers/USB/Class/Host/RNDIS.h
LUFA/Drivers/USB/Class/Host/RNDIS.h
+7
-11
LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h
LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h
+15
-7
LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h
LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h
+3
-2
LUFA/Drivers/USB/Core/ConfigDescriptor.c
LUFA/Drivers/USB/Core/ConfigDescriptor.c
+7
-3
LUFA/Drivers/USB/Core/ConfigDescriptor.h
LUFA/Drivers/USB/Core/ConfigDescriptor.h
+9
-4
LUFA/Drivers/USB/Core/Device.h
LUFA/Drivers/USB/Core/Device.h
+7
-0
LUFA/Drivers/USB/Core/DeviceStandardReq.c
LUFA/Drivers/USB/Core/DeviceStandardReq.c
+1
-1
LUFA/Drivers/USB/Core/StdDescriptors.h
LUFA/Drivers/USB/Core/StdDescriptors.h
+15
-11
LUFA/Drivers/USB/Core/UC3/Device_UC3.h
LUFA/Drivers/USB/Core/UC3/Device_UC3.h
+16
-7
LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c
LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c
+1
-1
LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c
LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c
+1
-1
LUFA/Drivers/USB/Core/UC3/USBController_UC3.c
LUFA/Drivers/USB/Core/UC3/USBController_UC3.c
+2
-0
LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c
LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c
+4
-4
LUFA/ManPages/ChangeLog.txt
LUFA/ManPages/ChangeLog.txt
+4
-1
LUFA/ManPages/DeviceSupport.txt
LUFA/ManPages/DeviceSupport.txt
+42
-39
LUFA/ManPages/FutureChanges.txt
LUFA/ManPages/FutureChanges.txt
+4
-0
LUFA/ManPages/LUFAPoweredProjects.txt
LUFA/ManPages/LUFAPoweredProjects.txt
+9
-2
LUFA/ManPages/LibraryResources.txt
LUFA/ManPages/LibraryResources.txt
+1
-2
LUFA/ManPages/MigrationInformation.txt
LUFA/ManPages/MigrationInformation.txt
+3
-0
LUFA/makefile
LUFA/makefile
+10
-4
No files found.
Bootloaders/CDC/BootloaderCDC.c
View file @
397c2f91
...
@@ -66,6 +66,9 @@ int main(void)
...
@@ -66,6 +66,9 @@ int main(void)
/* Setup hardware required for the bootloader */
/* Setup hardware required for the bootloader */
SetupHardware
();
SetupHardware
();
/* Turn on first LED on the board to indicate that the bootloader has started */
LEDs_SetAllLEDs
(
LEDS_LED1
);
/* Enable global interrupts so that the USB stack can function */
/* Enable global interrupts so that the USB stack can function */
sei
();
sei
();
...
@@ -100,6 +103,17 @@ void SetupHardware(void)
...
@@ -100,6 +103,17 @@ void SetupHardware(void)
/* Initialize USB Subsystem */
/* Initialize USB Subsystem */
USB_Init
();
USB_Init
();
LEDs_Init
();
/* Bootloader active LED toggle timer initialization */
TIMSK1
=
(
1
<<
TOIE1
);
TCCR1B
=
((
1
<<
CS11
)
|
(
1
<<
CS10
));
}
/** ISR to periodically toggle the LEDs on the board to indicate that the bootloader is active. */
ISR
(
TIMER1_OVF_vect
,
ISR_BLOCK
)
{
LEDs_ToggleLEDs
(
LEDS_LED1
|
LEDS_LED2
);
}
}
/** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready
/** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready
...
@@ -134,6 +148,9 @@ void EVENT_USB_Device_ControlRequest(void)
...
@@ -134,6 +148,9 @@ void EVENT_USB_Device_ControlRequest(void)
return
;
return
;
}
}
/* Activity - toggle indicator LEDs */
LEDs_ToggleLEDs
(
LEDS_LED1
|
LEDS_LED2
);
/* Process CDC specific control requests */
/* Process CDC specific control requests */
switch
(
USB_ControlRequest
.
bRequest
)
switch
(
USB_ControlRequest
.
bRequest
)
{
{
...
...
Bootloaders/CDC/BootloaderCDC.h
View file @
397c2f91
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
#include "Descriptors.h"
#include "Descriptors.h"
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
/* Macros: */
/* Macros: */
/** Version major of the CDC bootloader. */
/** Version major of the CDC bootloader. */
...
...
Bootloaders/DFU/BootloaderDFU.c
View file @
397c2f91
...
@@ -119,6 +119,9 @@ int main(void)
...
@@ -119,6 +119,9 @@ int main(void)
MCUCR
&=
~
(
1
<<
JTD
);
MCUCR
&=
~
(
1
<<
JTD
);
#endif
#endif
/* Turn on first LED on the board to indicate that the bootloader has started */
LEDs_SetAllLEDs
(
LEDS_LED1
);
/* Enable global interrupts so that the USB stack can function */
/* Enable global interrupts so that the USB stack can function */
sei
();
sei
();
...
@@ -149,6 +152,11 @@ void SetupHardware(void)
...
@@ -149,6 +152,11 @@ void SetupHardware(void)
/* Initialize the USB subsystem */
/* Initialize the USB subsystem */
USB_Init
();
USB_Init
();
LEDs_Init
();
/* Bootloader active LED toggle timer initialization */
TIMSK1
=
(
1
<<
TOIE1
);
TCCR1B
=
((
1
<<
CS11
)
|
(
1
<<
CS10
));
}
}
/** Resets all configured hardware required for the bootloader back to their original states. */
/** Resets all configured hardware required for the bootloader back to their original states. */
...
@@ -162,15 +170,18 @@ void ResetHardware(void)
...
@@ -162,15 +170,18 @@ void ResetHardware(void)
MCUCR
=
0
;
MCUCR
=
0
;
}
}
/** ISR to periodically toggle the LEDs on the board to indicate that the bootloader is active. */
ISR
(
TIMER1_OVF_vect
,
ISR_BLOCK
)
{
LEDs_ToggleLEDs
(
LEDS_LED1
|
LEDS_LED2
);
}
/** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to
/** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to
* the device from the USB host before passing along unhandled control requests to the library for processing
* the device from the USB host before passing along unhandled control requests to the library for processing
* internally.
* internally.
*/
*/
void
EVENT_USB_Device_ControlRequest
(
void
)
void
EVENT_USB_Device_ControlRequest
(
void
)
{
{
/* Get the size of the command and data from the wLength value */
SentCommand
.
DataSize
=
USB_ControlRequest
.
wLength
;
/* Ignore any requests that aren't directed to the DFU interface */
/* Ignore any requests that aren't directed to the DFU interface */
if
((
USB_ControlRequest
.
bmRequestType
&
(
CONTROL_REQTYPE_TYPE
|
CONTROL_REQTYPE_RECIPIENT
))
!=
if
((
USB_ControlRequest
.
bmRequestType
&
(
CONTROL_REQTYPE_TYPE
|
CONTROL_REQTYPE_RECIPIENT
))
!=
(
REQTYPE_CLASS
|
REQREC_INTERFACE
))
(
REQTYPE_CLASS
|
REQREC_INTERFACE
))
...
@@ -178,6 +189,12 @@ void EVENT_USB_Device_ControlRequest(void)
...
@@ -178,6 +189,12 @@ void EVENT_USB_Device_ControlRequest(void)
return
;
return
;
}
}
/* Activity - toggle indicator LEDs */
LEDs_ToggleLEDs
(
LEDS_LED1
|
LEDS_LED2
);
/* Get the size of the command and data from the wLength value */
SentCommand
.
DataSize
=
USB_ControlRequest
.
wLength
;
switch
(
USB_ControlRequest
.
bRequest
)
switch
(
USB_ControlRequest
.
bRequest
)
{
{
case
DFU_REQ_DNLOAD
:
case
DFU_REQ_DNLOAD
:
...
...
Bootloaders/DFU/BootloaderDFU.h
View file @
397c2f91
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
#include "Descriptors.h"
#include "Descriptors.h"
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
/* Macros: */
/* Macros: */
/** Configuration define. Define this token to true to case the bootloader to reject all memory commands
/** Configuration define. Define this token to true to case the bootloader to reject all memory commands
...
...
Bootloaders/HID/BootloaderHID.c
View file @
397c2f91
...
@@ -113,10 +113,18 @@ void EVENT_USB_Device_ControlRequest(void)
...
@@ -113,10 +113,18 @@ void EVENT_USB_Device_ControlRequest(void)
while
(
!
(
Endpoint_IsOUTReceived
()));
while
(
!
(
Endpoint_IsOUTReceived
()));
/* Read in the write destination address */
/* Read in the write destination address */
#if (FLASHEND > 0xFFFF)
uint32_t
PageAddress
=
((
uint32_t
)
Endpoint_Read_16_LE
()
<<
8
);
#else
uint16_t
PageAddress
=
Endpoint_Read_16_LE
();
uint16_t
PageAddress
=
Endpoint_Read_16_LE
();
#endif
/* Check if the command is a program page command, or a start application command */
/* Check if the command is a program page command, or a start application command */
#if (FLASHEND > 0xFFFF)
if
((
uint16_t
)(
PageAddress
>>
8
)
==
COMMAND_STARTAPPLICATION
)
#else
if
(
PageAddress
==
COMMAND_STARTAPPLICATION
)
if
(
PageAddress
==
COMMAND_STARTAPPLICATION
)
#endif
{
{
RunBootloader
=
false
;
RunBootloader
=
false
;
}
}
...
...
Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.c
View file @
397c2f91
...
@@ -59,7 +59,7 @@ int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart,
...
@@ -59,7 +59,7 @@ int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart,
DecodeDHCPHeader
(
DHCPHeaderInStart
);
DecodeDHCPHeader
(
DHCPHeaderInStart
);
/* Zero out the response DHCP packet, as much of it legacy and left at 0 */
/* Zero out the response DHCP packet, as much of it
is
legacy and left at 0 */
memset
(
DHCPHeaderOUT
,
0
,
sizeof
(
DHCP_Header_t
));
memset
(
DHCPHeaderOUT
,
0
,
sizeof
(
DHCP_Header_t
));
/* Fill out the response DHCP packet */
/* Fill out the response DHCP packet */
...
...
Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c
View file @
397c2f91
...
@@ -96,7 +96,6 @@ void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* const FrameIN,
...
@@ -96,7 +96,6 @@ void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* const FrameIN,
/* Set the response length in the buffer and indicate that a response is ready to be sent */
/* Set the response length in the buffer and indicate that a response is ready to be sent */
FrameOUT
->
FrameLength
=
(
sizeof
(
Ethernet_Frame_Header_t
)
+
RetSize
);
FrameOUT
->
FrameLength
=
(
sizeof
(
Ethernet_Frame_Header_t
)
+
RetSize
);
FrameOUT
->
FrameInBuffer
=
true
;
}
}
}
}
...
@@ -104,7 +103,7 @@ void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* const FrameIN,
...
@@ -104,7 +103,7 @@ void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* const FrameIN,
if
(
RetSize
!=
NO_PROCESS
)
if
(
RetSize
!=
NO_PROCESS
)
{
{
/* Clear the frame buffer */
/* Clear the frame buffer */
FrameIN
->
Frame
InBuffer
=
false
;
FrameIN
->
Frame
Length
=
0
;
}
}
}
}
...
...
Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c
View file @
397c2f91
...
@@ -55,7 +55,8 @@ TCP_ConnectionState_t ConnectionStateTable[MAX_TCP_CONNECTIONS];
...
@@ -55,7 +55,8 @@ TCP_ConnectionState_t ConnectionStateTable[MAX_TCP_CONNECTIONS];
* level. If an application produces a response, this task constructs the appropriate Ethernet frame and places it into the Ethernet OUT
* level. If an application produces a response, this task constructs the appropriate Ethernet frame and places it into the Ethernet OUT
* buffer for later transmission.
* buffer for later transmission.
*/
*/
void
TCP_TCPTask
(
USB_ClassInfo_RNDIS_Device_t
*
const
RNDISInterfaceInfo
)
void
TCP_TCPTask
(
USB_ClassInfo_RNDIS_Device_t
*
const
RNDISInterfaceInfo
,
Ethernet_Frame_Info_t
*
const
FrameOUT
)
{
{
/* Run each application in sequence, to process incoming and generate outgoing packets */
/* Run each application in sequence, to process incoming and generate outgoing packets */
for
(
uint8_t
CSTableEntry
=
0
;
CSTableEntry
<
MAX_TCP_CONNECTIONS
;
CSTableEntry
++
)
for
(
uint8_t
CSTableEntry
=
0
;
CSTableEntry
<
MAX_TCP_CONNECTIONS
;
CSTableEntry
++
)
...
@@ -73,11 +74,8 @@ void TCP_TCPTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)
...
@@ -73,11 +74,8 @@ void TCP_TCPTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)
}
}
}
}
/* Get pointer to the output frame info struct for convenience */
Ethernet_Frame_Info_t
*
FrameOUT
=
&
RNDISInterfaceInfo
->
State
.
FrameOUT
;
/* Bail out early if there is already a frame waiting to be sent in the Ethernet OUT buffer */
/* Bail out early if there is already a frame waiting to be sent in the Ethernet OUT buffer */
if
(
FrameOUT
->
Frame
InBuffer
)
if
(
FrameOUT
->
Frame
Length
)
return
;
return
;
/* Send response packets from each application as the TCP packet buffers are filled by the applications */
/* Send response packets from each application as the TCP packet buffers are filled by the applications */
...
@@ -147,7 +145,6 @@ void TCP_TCPTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)
...
@@ -147,7 +145,6 @@ void TCP_TCPTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)
/* Set the response length in the buffer and indicate that a response is ready to be sent */
/* Set the response length in the buffer and indicate that a response is ready to be sent */
FrameOUT
->
FrameLength
=
PacketSize
;
FrameOUT
->
FrameLength
=
PacketSize
;
FrameOUT
->
FrameInBuffer
=
true
;
ConnectionStateTable
[
CSTableEntry
].
Info
.
Buffer
.
Ready
=
false
;
ConnectionStateTable
[
CSTableEntry
].
Info
.
Buffer
.
Ready
=
false
;
...
...
Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h
View file @
397c2f91
...
@@ -228,7 +228,8 @@
...
@@ -228,7 +228,8 @@
}
TCP_Header_t
;
}
TCP_Header_t
;
/* Function Prototypes: */
/* Function Prototypes: */
void
TCP_TCPTask
(
USB_ClassInfo_RNDIS_Device_t
*
const
RNDISInterfaceInfo
);
void
TCP_TCPTask
(
USB_ClassInfo_RNDIS_Device_t
*
const
RNDISInterfaceInfo
,
Ethernet_Frame_Info_t
*
const
FrameOUT
);
void
TCP_Init
(
void
);
void
TCP_Init
(
void
);
bool
TCP_SetPortState
(
const
uint16_t
Port
,
bool
TCP_SetPortState
(
const
uint16_t
Port
,
const
uint8_t
State
,
const
uint8_t
State
,
...
...
Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c
View file @
397c2f91
...
@@ -63,6 +63,11 @@ USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface =
...
@@ -63,6 +63,11 @@ USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface =
},
},
};
};
/** Global to store the incoming frame from the host before it is processed by the device. */
static
Ethernet_Frame_Info_t
FrameIN
;
/** Global to store the outgoing frame created in the device before it is sent to the host. */
static
Ethernet_Frame_Info_t
FrameOUT
;
/** Main program entry point. This routine contains the overall program flow, including initial
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
* setup of all components and the main program loop.
...
@@ -79,14 +84,23 @@ int main(void)
...
@@ -79,14 +84,23 @@ int main(void)
for
(;;)
for
(;;)
{
{
if
(
Ethernet_RNDIS_Interface
.
State
.
FrameIN
.
FrameInBuffer
)
if
(
RNDIS_Device_IsPacketReceived
(
&
Ethernet_RNDIS_Interface
)
)
{
{
LEDs_SetAllLEDs
(
LEDMASK_USB_BUSY
);
LEDs_SetAllLEDs
(
LEDMASK_USB_BUSY
);
Ethernet_ProcessPacket
(
&
Ethernet_RNDIS_Interface
.
State
.
FrameIN
,
&
Ethernet_RNDIS_Interface
.
State
.
FrameOUT
);
RNDIS_Device_ReadPacket
(
&
Ethernet_RNDIS_Interface
,
&
FrameIN
.
FrameData
,
&
FrameIN
.
FrameLength
);
Ethernet_ProcessPacket
(
&
FrameIN
,
&
FrameOUT
);
if
(
FrameOUT
.
FrameLength
)
{
RNDIS_Device_SendPacket
(
&
Ethernet_RNDIS_Interface
,
&
FrameOUT
.
FrameData
,
FrameOUT
.
FrameLength
);
FrameOUT
.
FrameLength
=
0
;
}
LEDs_SetAllLEDs
(
LEDMASK_USB_READY
);
LEDs_SetAllLEDs
(
LEDMASK_USB_READY
);
}
}
TCP_TCPTask
(
&
Ethernet_RNDIS_Interface
);
TCP_TCPTask
(
&
Ethernet_RNDIS_Interface
,
&
FrameOUT
);
RNDIS_Device_USBTask
(
&
Ethernet_RNDIS_Interface
);
RNDIS_Device_USBTask
(
&
Ethernet_RNDIS_Interface
);
USB_USBTask
();
USB_USBTask
();
...
...
Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.c
View file @
397c2f91
...
@@ -59,7 +59,7 @@ int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart,
...
@@ -59,7 +59,7 @@ int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart,
DecodeDHCPHeader
(
DHCPHeaderInStart
);
DecodeDHCPHeader
(
DHCPHeaderInStart
);
/* Zero out the response DHCP packet, as much of it legacy and left at 0 */
/* Zero out the response DHCP packet, as much of it
is
legacy and left at 0 */
memset
(
DHCPHeaderOUT
,
0
,
sizeof
(
DHCP_Header_t
));
memset
(
DHCPHeaderOUT
,
0
,
sizeof
(
DHCP_Header_t
));
/* Fill out the response DHCP packet */
/* Fill out the response DHCP packet */
...
...
Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.c
View file @
397c2f91
...
@@ -100,7 +100,6 @@ void Ethernet_ProcessPacket(void)
...
@@ -100,7 +100,6 @@ void Ethernet_ProcessPacket(void)
/* Set the response length in the buffer and indicate that a response is ready to be sent */
/* Set the response length in the buffer and indicate that a response is ready to be sent */
FrameOUT
.
FrameLength
=
(
sizeof
(
Ethernet_Frame_Header_t
)
+
RetSize
);
FrameOUT
.
FrameLength
=
(
sizeof
(
Ethernet_Frame_Header_t
)
+
RetSize
);
FrameOUT
.
FrameInBuffer
=
true
;
}
}
}
}
...
@@ -108,7 +107,7 @@ void Ethernet_ProcessPacket(void)
...
@@ -108,7 +107,7 @@ void Ethernet_ProcessPacket(void)
if
(
RetSize
!=
NO_PROCESS
)
if
(
RetSize
!=
NO_PROCESS
)
{
{
/* Clear the frame buffer */
/* Clear the frame buffer */
FrameIN
.
Frame
InBuffer
=
false
;
FrameIN
.
Frame
Length
=
0
;
}
}
}
}
...
...
Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c
View file @
397c2f91
...
@@ -74,7 +74,7 @@ void TCP_Task(void)
...
@@ -74,7 +74,7 @@ void TCP_Task(void)
}
}
/* Bail out early if there is already a frame waiting to be sent in the Ethernet OUT buffer */
/* Bail out early if there is already a frame waiting to be sent in the Ethernet OUT buffer */
if
(
FrameOUT
.
Frame
InBuffer
)
if
(
FrameOUT
.
Frame
Length
)
return
;
return
;
/* Send response packets from each application as the TCP packet buffers are filled by the applications */
/* Send response packets from each application as the TCP packet buffers are filled by the applications */
...
@@ -144,7 +144,6 @@ void TCP_Task(void)
...
@@ -144,7 +144,6 @@ void TCP_Task(void)
/* Set the response length in the buffer and indicate that a response is ready to be sent */
/* Set the response length in the buffer and indicate that a response is ready to be sent */
FrameOUT
.
FrameLength
=
PacketSize
;
FrameOUT
.
FrameLength
=
PacketSize
;
FrameOUT
.
FrameInBuffer
=
true
;
ConnectionStateTable
[
CSTableEntry
].
Info
.
Buffer
.
Ready
=
false
;
ConnectionStateTable
[
CSTableEntry
].
Info
.
Buffer
.
Ready
=
false
;
...
...
Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c
View file @
397c2f91
...
@@ -204,7 +204,7 @@ void RNDIS_Task(void)
...
@@ -204,7 +204,7 @@ void RNDIS_Task(void)
Endpoint_SelectEndpoint
(
CDC_RX_EPNUM
);
Endpoint_SelectEndpoint
(
CDC_RX_EPNUM
);
/* Check if the data OUT endpoint contains data, and that the IN buffer is empty */
/* Check if the data OUT endpoint contains data, and that the IN buffer is empty */
if
(
Endpoint_IsOUTReceived
()
&&
!
(
FrameIN
.
Frame
InBuffer
))
if
(
Endpoint_IsOUTReceived
()
&&
!
(
FrameIN
.
Frame
Length
))
{
{
/* Read in the packet message header */
/* Read in the packet message header */
Endpoint_Read_Stream_LE
(
&
RNDISPacketHeader
,
sizeof
(
RNDIS_Packet_Message_t
),
NULL
);
Endpoint_Read_Stream_LE
(
&
RNDISPacketHeader
,
sizeof
(
RNDIS_Packet_Message_t
),
NULL
);
...
@@ -224,16 +224,13 @@ void RNDIS_Task(void)
...
@@ -224,16 +224,13 @@ void RNDIS_Task(void)
/* Store the size of the Ethernet frame */
/* Store the size of the Ethernet frame */
FrameIN
.
FrameLength
=
RNDISPacketHeader
.
DataLength
;
FrameIN
.
FrameLength
=
RNDISPacketHeader
.
DataLength
;
/* Indicate Ethernet IN buffer full */
FrameIN
.
FrameInBuffer
=
true
;
}
}
/* Select the data IN endpoint */
/* Select the data IN endpoint */
Endpoint_SelectEndpoint
(
CDC_TX_EPNUM
);
Endpoint_SelectEndpoint
(
CDC_TX_EPNUM
);
/* Check if the data IN endpoint is ready for more data, and that the IN buffer is full */
/* Check if the data IN endpoint is ready for more data, and that the IN buffer is full */
if
(
Endpoint_IsINReady
()
&&
FrameOUT
.
Frame
InBuffer
)
if
(
Endpoint_IsINReady
()
&&
FrameOUT
.
Frame
Length
)
{
{
/* Clear the packet header with all 0s so that the relevant fields can be filled */
/* Clear the packet header with all 0s so that the relevant fields can be filled */
memset
(
&
RNDISPacketHeader
,
0
,
sizeof
(
RNDIS_Packet_Message_t
));
memset
(
&
RNDISPacketHeader
,
0
,
sizeof
(
RNDIS_Packet_Message_t
));
...
@@ -254,7 +251,7 @@ void RNDIS_Task(void)
...
@@ -254,7 +251,7 @@ void RNDIS_Task(void)
Endpoint_ClearIN
();
Endpoint_ClearIN
();
/* Indicate Ethernet OUT buffer no longer full */
/* Indicate Ethernet OUT buffer no longer full */
FrameOUT
.
Frame
InBuffer
=
false
;
FrameOUT
.
Frame
Length
=
0
;
}
}
}
}
}
}
...
@@ -273,7 +270,7 @@ void Ethernet_Task(void)
...
@@ -273,7 +270,7 @@ void Ethernet_Task(void)
return
;
return
;
/* Check if a frame has been written to the IN frame buffer */
/* Check if a frame has been written to the IN frame buffer */
if
(
FrameIN
.
Frame
InBuffer
)
if
(
FrameIN
.
Frame
Length
)
{
{
/* Indicate packet processing started */
/* Indicate packet processing started */
LEDs_SetAllLEDs
(
LEDMASK_USB_BUSY
);
LEDs_SetAllLEDs
(
LEDMASK_USB_BUSY
);
...
...
LUFA/CodeTemplates/makefile_template.uc3
View file @
397c2f91
...
@@ -236,9 +236,7 @@ ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-l
...
@@ -236,9 +236,7 @@ ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-l
# -Map: create map file
# -Map: create map file
# --cref: add cross reference to map file
# --cref: add cross reference to map file
LDFLAGS
=
-Wl
,-Map
=
$(TARGET)
.map,--cref
LDFLAGS
=
-Wl
,-Map
=
$(TARGET)
.map,--cref
LDFLAGS
+=
-Wl
,--relax
LDFLAGS
+=
-Wl
,--gc-sections
--rodata-writable
LDFLAGS
+=
-Wl
,--gc-sections
LDFLAGS
+=
-Wl
,--rodata-writable
LDFLAGS
+=
-Wl
,--direct-data
LDFLAGS
+=
-Wl
,--direct-data
#LDFLAGS += -T linker_script.x
#LDFLAGS += -T linker_script.x
...
...
LUFA/Common/Common.h
View file @
397c2f91
...
@@ -73,7 +73,10 @@
...
@@ -73,7 +73,10 @@
/* Architecture specific utility includes: */
/* Architecture specific utility includes: */
#if defined(__DOXYGEN__)
#if defined(__DOXYGEN__)
/** Type define for an unsigned integer the same width as the selected architecture's machine register. */
/** Type define for an unsigned integer the same width as the selected architecture's machine register.
* This is distinct from the non-specific standard int data type, whose width is machine dependant but
* which may not reflect the actual machine register width on some targets (e.g. AVR8).
*/
typedef
MACHINE_REG_t
uint_reg_t
;
typedef
MACHINE_REG_t
uint_reg_t
;
#elif (ARCH == ARCH_AVR8)
#elif (ARCH == ARCH_AVR8)
#include <avr/io.h>
#include <avr/io.h>
...
...
LUFA/Common/Endianness.h
View file @
397c2f91
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
*
*
* \return Input value with the byte ordering reversed.
* \return Input value with the byte ordering reversed.
*/
*/
#define SWAPENDIAN_16(x) ((((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8))
#define SWAPENDIAN_16(x)
(uint16_t)
((((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8))
/** Swaps the byte ordering of a 32-bit value at compile-time. Do not use this macro for swapping byte orderings
/** Swaps the byte ordering of a 32-bit value at compile-time. Do not use this macro for swapping byte orderings
* of dynamic values computed at runtime- use \ref SwapEndian_32() instead. The result of this macro can be used
* of dynamic values computed at runtime- use \ref SwapEndian_32() instead. The result of this macro can be used
...
@@ -91,8 +91,8 @@
...
@@ -91,8 +91,8 @@
*
*
* \return Input value with the byte ordering reversed.
* \return Input value with the byte ordering reversed.
*/
*/
#define SWAPENDIAN_32(x) ((((x) & 0xFF000000UL) >> 24UL) | (((x) & 0x00FF0000UL) >> 8UL) | \
#define SWAPENDIAN_32(x)
(uint32_t)
((((x) & 0xFF000000UL) >> 24UL) | (((x) & 0x00FF0000UL) >> 8UL) | \
(((
x
)
&
0x0000FF00UL
)
<<
8UL
)
|
(((
x
)
&
0x000000FFUL
)
<<
24UL
))
(((
x
)
&
0x0000FF00UL
)
<<
8UL
)
|
(((
x
)
&
0x000000FFUL
)
<<
24UL
))
#if defined(ARCH_BIG_ENDIAN) && !defined(le16_to_cpu)
#if defined(ARCH_BIG_ENDIAN) && !defined(le16_to_cpu)
#define le16_to_cpu(x) SwapEndian_16(x)
#define le16_to_cpu(x) SwapEndian_16(x)
...
...
LUFA/Drivers/USB/Class/Common/CDC.h
View file @
397c2f91
...
@@ -145,10 +145,10 @@
...
@@ -145,10 +145,10 @@
CDC_CSCP_ATCommandProtocol
=
0x01
,
/**< Descriptor Protocol value indicating that the device or interface
CDC_CSCP_ATCommandProtocol
=
0x01
,
/**< Descriptor Protocol value indicating that the device or interface
* belongs to the AT Command protocol of the CDC class.
* belongs to the AT Command protocol of the CDC class.
*/
*/
CDC_CSCP_NoSpecificProtocol
=
0x00
,
/**< Descriptor
Class
value indicating that the device or interface
CDC_CSCP_NoSpecificProtocol
=
0x00
,
/**< Descriptor
Protocol
value indicating that the device or interface
* belongs to no specific protocol of the CDC class.
* belongs to no specific protocol of the CDC class.
*/
*/
CDC_CSCP_VendorSpecificProtocol
=
0xFF
,
/**< Descriptor
Class
value indicating that the device or interface
CDC_CSCP_VendorSpecificProtocol
=
0xFF
,
/**< Descriptor
Protocol
value indicating that the device or interface
* belongs to a vendor-specific protocol of the CDC class.
* belongs to a vendor-specific protocol of the CDC class.
*/
*/
CDC_CSCP_CDCDataClass
=
0x0A
,
/**< Descriptor Class value indicating that the device or interface
CDC_CSCP_CDCDataClass
=
0x0A
,
/**< Descriptor Class value indicating that the device or interface
...
...
LUFA/Drivers/USB/Class/Common/RNDIS.h
View file @
397c2f91
...
@@ -68,6 +68,9 @@
...
@@ -68,6 +68,9 @@
#endif
#endif
/* Macros: */
/* 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. */
/** Implemented RNDIS Version Major. */
#define REMOTE_NDIS_VERSION_MAJOR 0x01
#define REMOTE_NDIS_VERSION_MAJOR 0x01
...
@@ -205,25 +208,25 @@
...
@@ -205,25 +208,25 @@
};
};
/* Type Defines: */
/* Type Defines: */
/** \brief
MAC Address
Structure.
/** \brief
Ethernet Frame Packet Information
Structure.
*
*
* Type define for a physical MAC address of a device on a network.
* Type define for an Ethernet frame buffer data and information structure. This can be used to conveniently
* store both the size and data in an Ethernet frame.
*/
*/
typedef
struct
typedef
struct
{
{
uint8_t
Octets
[
6
];
/**< Individual bytes of a MAC address */
uint8_t
FrameData
[
ETHERNET_FRAME_SIZE_MAX
];
/**< Ethernet frame contents. */
}
ATTR_PACKED
MAC_Address_t
;
uint16_t
FrameLength
;
/**< Length in bytes of the Ethernet frame stored in the buffer. */
}
Ethernet_Frame_Info_t
;
/** \brief
RNDIS Ethernet Frame Packet Information
Structure.
/** \brief
MAC Address
Structure.
*
*
* Type define for a
n Ethernet frame buffer data and information structure
.