projects
/
pub
/
lufa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed GenericHIDHost demo report write routine incorrect for control type requests...
[pub/lufa.git]
/
Demos
/
Device
/
RNDISEthernet
/
RNDISEthernet.c
diff --git
a/Demos/Device/RNDISEthernet/RNDISEthernet.c
b/Demos/Device/RNDISEthernet/RNDISEthernet.c
index
d573a76
..
5e14bb7
100644
(file)
--- a/
Demos/Device/RNDISEthernet/RNDISEthernet.c
+++ b/
Demos/Device/RNDISEthernet/RNDISEthernet.c
@@
-36,12
+36,6
@@
\r
#include "RNDISEthernet.h"
\r
\r
\r
#include "RNDISEthernet.h"
\r
\r
-/* Project Tags, for reading out using the ButtLoad project */
\r
-BUTTLOADTAG(ProjName, "LUFA RNDIS App");
\r
-BUTTLOADTAG(BuildTime, __TIME__);
\r
-BUTTLOADTAG(BuildDate, __DATE__);
\r
-BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
\r
-
\r
/* Scheduler Task List */
\r
TASK_LIST
\r
{
\r
/* Scheduler Task List */
\r
TASK_LIST
\r
{
\r
@@
-162,13
+156,13
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
/* Clear the SETUP packet, ready for data transfer */
\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
\r
{
\r
/* Clear the SETUP packet, ready for data transfer */
\r
- Endpoint_Clear
SetupReceived
();
\r
+ Endpoint_Clear
ControlSETUP
();
\r
\r
/* Read in the RNDIS message into the message buffer */
\r
Endpoint_Read_Control_Stream_LE(RNDISMessageBuffer, wLength);
\r
\r
/* Finalize the stream transfer to clear the last packet from the host */
\r
\r
/* Read in the RNDIS message into the message buffer */
\r
Endpoint_Read_Control_Stream_LE(RNDISMessageBuffer, wLength);
\r
\r
/* Finalize the stream transfer to clear the last packet from the host */
\r
- Endpoint_Clear
Setup
IN();
\r
+ Endpoint_Clear
Control
IN();
\r
\r
/* Process the RNDIS message */
\r
ProcessRNDISControlMessage();
\r
\r
/* Process the RNDIS message */
\r
ProcessRNDISControlMessage();
\r
@@
-191,13
+185,13
@@
EVENT_HANDLER(USB_UnhandledControlPacket)
wLength = MessageHeader->MessageLength;
\r
\r
/* Clear the SETUP packet, ready for data transfer */
\r
wLength = MessageHeader->MessageLength;
\r
\r
/* Clear the SETUP packet, ready for data transfer */
\r
- Endpoint_Clear
SetupReceived
();
\r
+ Endpoint_Clear
ControlSETUP
();
\r
\r
/* Write the message response data to the endpoint */
\r
Endpoint_Write_Control_Stream_LE(RNDISMessageBuffer, wLength);
\r
\r
/* Finalize the stream transfer to send the last packet or clear the host abort */
\r
\r
/* Write the message response data to the endpoint */
\r
Endpoint_Write_Control_Stream_LE(RNDISMessageBuffer, wLength);
\r
\r
/* Finalize the stream transfer to send the last packet or clear the host abort */
\r
- Endpoint_Clear
Setup
OUT();
\r
+ Endpoint_Clear
Control
OUT();
\r
\r
/* Reset the message header once again after transmission */
\r
MessageHeader->MessageLength = 0;
\r
\r
/* Reset the message header once again after transmission */
\r
MessageHeader->MessageLength = 0;
\r
@@
-247,7
+241,7
@@
TASK(RNDIS_Task)
Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPNUM);
\r
\r
/* Check if a message response is ready for the host */
\r
Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPNUM);
\r
\r
/* Check if a message response is ready for the host */
\r
- if (Endpoint_
ReadWriteAllowed
() && ResponseReady)
\r
+ if (Endpoint_
IsINReady
() && ResponseReady)
\r
{
\r
USB_Notification_t Notification = (USB_Notification_t)
\r
{
\r
{
\r
USB_Notification_t Notification = (USB_Notification_t)
\r
{
\r
@@
-262,7
+256,7
@@
TASK(RNDIS_Task)
Endpoint_Write_Stream_LE(&Notification, sizeof(Notification));
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
Endpoint_Write_Stream_LE(&Notification, sizeof(Notification));
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
- Endpoint_Clear
CurrentBank
();
\r
+ Endpoint_Clear
IN
();
\r
\r
/* Indicate a response is no longer ready */
\r
ResponseReady = false;
\r
\r
/* Indicate a response is no longer ready */
\r
ResponseReady = false;
\r
@@
-278,7
+272,7
@@
TASK(RNDIS_Task)
Endpoint_SelectEndpoint(CDC_RX_EPNUM);
\r
\r
/* Check if the data OUT endpoint contains data, and that the IN buffer is empty */
\r
Endpoint_SelectEndpoint(CDC_RX_EPNUM);
\r
\r
/* Check if the data OUT endpoint contains data, and that the IN buffer is empty */
\r
- if (Endpoint_
ReadWriteAllow
ed() && !(FrameIN.FrameInBuffer))
\r
+ if (Endpoint_
IsOUTReceiv
ed() && !(FrameIN.FrameInBuffer))
\r
{
\r
/* Read in the packet message header */
\r
Endpoint_Read_Stream_LE(&RNDISPacketHeader, sizeof(RNDIS_PACKET_MSG_t));
\r
{
\r
/* Read in the packet message header */
\r
Endpoint_Read_Stream_LE(&RNDISPacketHeader, sizeof(RNDIS_PACKET_MSG_t));
\r
@@
-294,7
+288,7
@@
TASK(RNDIS_Task)
Endpoint_Read_Stream_LE(FrameIN.FrameData, RNDISPacketHeader.DataLength);
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
Endpoint_Read_Stream_LE(FrameIN.FrameData, RNDISPacketHeader.DataLength);
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
- Endpoint_Clear
CurrentBank
();
\r
+ Endpoint_Clear
OUT
();
\r
\r
/* Store the size of the Ethernet frame */
\r
FrameIN.FrameLength = RNDISPacketHeader.DataLength;
\r
\r
/* Store the size of the Ethernet frame */
\r
FrameIN.FrameLength = RNDISPacketHeader.DataLength;
\r
@@
-307,7
+301,7
@@
TASK(RNDIS_Task)
Endpoint_SelectEndpoint(CDC_TX_EPNUM);
\r
\r
/* Check if the data IN endpoint is ready for more data, and that the IN buffer is full */
\r
Endpoint_SelectEndpoint(CDC_TX_EPNUM);
\r
\r
/* Check if the data IN endpoint is ready for more data, and that the IN buffer is full */
\r
- if (Endpoint_
ReadWriteAllowed
() && FrameOUT.FrameInBuffer)
\r
+ if (Endpoint_
IsINReady
() && FrameOUT.FrameInBuffer)
\r
{
\r
/* Clear the packet header with all 0s so that the relevant fields can be filled */
\r
memset(&RNDISPacketHeader, 0, sizeof(RNDIS_PACKET_MSG_t));
\r
{
\r
/* Clear the packet header with all 0s so that the relevant fields can be filled */
\r
memset(&RNDISPacketHeader, 0, sizeof(RNDIS_PACKET_MSG_t));
\r
@@
-325,7
+319,7
@@
TASK(RNDIS_Task)
Endpoint_Write_Stream_LE(FrameOUT.FrameData, RNDISPacketHeader.DataLength);
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
Endpoint_Write_Stream_LE(FrameOUT.FrameData, RNDISPacketHeader.DataLength);
\r
\r
/* Finalize the stream transfer to send the last packet */
\r
- Endpoint_Clear
CurrentBank
();
\r
+ Endpoint_Clear
IN
();
\r
\r
/* Indicate Ethernet OUT buffer no longer full */
\r
FrameOUT.FrameInBuffer = false;
\r
\r
/* Indicate Ethernet OUT buffer no longer full */
\r
FrameOUT.FrameInBuffer = false;
\r