/* Scheduler Task List */\r
TASK_LIST\r
{\r
- { Task: USB_USBTask , TaskStatus: TASK_STOP },\r
- { Task: Ethernet_Task , TaskStatus: TASK_STOP },\r
- { Task: TCP_Task , TaskStatus: TASK_STOP },\r
- { Task: RNDIS_Task , TaskStatus: TASK_STOP },\r
+ { .Task = USB_USBTask , .TaskStatus = TASK_STOP },\r
+ { .Task = Ethernet_Task , .TaskStatus = TASK_STOP },\r
+ { .Task = TCP_Task , .TaskStatus = TASK_STOP },\r
+ { .Task = RNDIS_Task , .TaskStatus = TASK_STOP },\r
};\r
\r
/** Main program entry point. This routine configures the hardware required by the application, then\r
uint16_t wLength = Endpoint_Read_Word_LE();\r
\r
/* Process RNDIS class commands */\r
- switch (bRequest)\r
+ switch (USB_ControlRequest.bRequest)\r
{\r
case REQ_SendEncapsulatedCommand:\r
- if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
+ if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
/* Clear the SETUP packet, ready for data transfer */\r
- Endpoint_ClearControlSETUP();\r
+ Endpoint_ClearSETUP();\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_ClearControlIN();\r
+ Endpoint_ClearIN();\r
\r
/* Process the RNDIS message */\r
ProcessRNDISControlMessage();\r
\r
break;\r
case REQ_GetEncapsulatedResponse:\r
- if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
+ if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
+ /* Clear the SETUP packet, ready for data transfer */\r
+ Endpoint_ClearSETUP();\r
+ \r
/* Check if a response to the last message is ready */\r
if (!(MessageHeader->MessageLength))\r
{\r
MessageHeader->MessageLength = 1;\r
}\r
\r
- /* Check if less than the requested number of bytes to transfer */\r
- if (MessageHeader->MessageLength < wLength)\r
- wLength = MessageHeader->MessageLength;\r
-\r
- /* Clear the SETUP packet, ready for data transfer */\r
- Endpoint_ClearControlSETUP();\r
- \r
/* Write the message response data to the endpoint */\r
- Endpoint_Write_Control_Stream_LE(RNDISMessageBuffer, wLength);\r
+ Endpoint_Write_Control_Stream_LE(RNDISMessageBuffer, MessageHeader->MessageLength);\r
\r
/* Finalize the stream transfer to send the last packet or clear the host abort */\r
- Endpoint_ClearControlOUT();\r
+ Endpoint_ClearOUT();\r
\r
/* Reset the message header once again after transmission */\r
MessageHeader->MessageLength = 0;\r
{\r
USB_Notification_t Notification = (USB_Notification_t)\r
{\r
- bmRequestType: (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),\r
- bNotification: NOTIF_RESPONSE_AVAILABLE,\r
- wValue: 0,\r
- wIndex: 0,\r
- wLength: 0,\r
+ .bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),\r
+ .bNotification = NOTIF_RESPONSE_AVAILABLE,\r
+ .wValue = 0,\r
+ .wIndex = 0,\r
+ .wLength = 0,\r
};\r
\r
/* Indicate that a message response is ready for the host */\r