aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/ClassDriver/RNDISEthernet/Lib
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-18 10:31:55 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-18 10:31:55 +0000
commitf896c00c48f04fb9273555ab8d9b1af99f865d25 (patch)
treeb76827a0467c77ddeb30e11748c02a4f53779a14 /Demos/Device/ClassDriver/RNDISEthernet/Lib
parente338cb6f329d6bf948abad88637f81436ee90daf (diff)
downloadlufa-f896c00c48f04fb9273555ab8d9b1af99f865d25.tar.gz
lufa-f896c00c48f04fb9273555ab8d9b1af99f865d25.tar.bz2
lufa-f896c00c48f04fb9273555ab8d9b1af99f865d25.zip
Break device mode class driver interfaces into seperate config and state structs which are then combined, for clarity. Move device mode class driver interfaces back into the device mode class driver headers from the common class headers to make room for host class interfaces.
Diffstat (limited to 'Demos/Device/ClassDriver/RNDISEthernet/Lib')
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c16
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c
index 44a32ea51..652714985 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c
+++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c
@@ -56,7 +56,7 @@ 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
* buffer for later transmission.
*/
-void TCP_TCPTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
+void TCP_TCPTask(USB_ClassInfo_RNDIS_Device_t* RNDISInterfaceInfo)
{
/* Task to hand off TCP packets to and from the listening applications. */
@@ -76,7 +76,7 @@ void TCP_TCPTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
}
/* Bail out early if there is already a frame waiting to be sent in the Ethernet OUT buffer */
- if (RNDISInterfaceInfo->FrameOUT.FrameInBuffer)
+ if (RNDISInterfaceInfo->State.FrameOUT.FrameInBuffer)
return;
/* Send response packets from each application as the TCP packet buffers are filled by the applications */
@@ -86,11 +86,11 @@ void TCP_TCPTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
if ((ConnectionStateTable[CSTableEntry].Info.Buffer.Direction == TCP_PACKETDIR_OUT) &&
(ConnectionStateTable[CSTableEntry].Info.Buffer.Ready))
{
- Ethernet_Frame_Header_t* FrameOUTHeader = (Ethernet_Frame_Header_t*)&RNDISInterfaceInfo->FrameOUT.FrameData;
- IP_Header_t* IPHeaderOUT = (IP_Header_t*)&RNDISInterfaceInfo->FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t)];
- TCP_Header_t* TCPHeaderOUT = (TCP_Header_t*)&RNDISInterfaceInfo->FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) +
+ Ethernet_Frame_Header_t* FrameOUTHeader = (Ethernet_Frame_Header_t*)&RNDISInterfaceInfo->State.FrameOUT.FrameData;
+ IP_Header_t* IPHeaderOUT = (IP_Header_t*)&RNDISInterfaceInfo->State.FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t)];
+ TCP_Header_t* TCPHeaderOUT = (TCP_Header_t*)&RNDISInterfaceInfo->State.FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) +
sizeof(IP_Header_t)];
- void* TCPDataOUT = &RNDISInterfaceInfo->FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) +
+ void* TCPDataOUT = &RNDISInterfaceInfo->State.FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) +
sizeof(IP_Header_t) +
sizeof(TCP_Header_t)];
@@ -145,8 +145,8 @@ void TCP_TCPTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
PacketSize += sizeof(Ethernet_Frame_Header_t);
/* Set the response length in the buffer and indicate that a response is ready to be sent */
- RNDISInterfaceInfo->FrameOUT.FrameLength = PacketSize;
- RNDISInterfaceInfo->FrameOUT.FrameInBuffer = true;
+ RNDISInterfaceInfo->State.FrameOUT.FrameLength = PacketSize;
+ RNDISInterfaceInfo->State.FrameOUT.FrameInBuffer = true;
ConnectionStateTable[CSTableEntry].Info.Buffer.Ready = false;
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h
index 3448245ed..919245a0d 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h
+++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h
@@ -232,7 +232,7 @@
TCP_PortState_t PortStateTable[MAX_OPEN_TCP_PORTS];
/* Function Prototypes: */
- void TCP_TCPTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
+ void TCP_TCPTask(USB_ClassInfo_RNDIS_Device_t* RNDISInterfaceInfo);
void TCP_Init(void);
bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*));
uint8_t TCP_GetPortState(uint16_t Port);