X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/2440ca268ac444c1aed2441cefe9e25a767d961a..d1e52660368d34d693131f6aff3c8fd8584162e5:/Demos/Device/RNDISEthernet/Lib/TCP.c?ds=inline diff --git a/Demos/Device/RNDISEthernet/Lib/TCP.c b/Demos/Device/RNDISEthernet/Lib/TCP.c index f259aad02..1ebd15435 100644 --- a/Demos/Device/RNDISEthernet/Lib/TCP.c +++ b/Demos/Device/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. */ -TASK(TCP_Task) +void TCP_TCPTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo) { /* Task to hand off TCP packets to and from the listening applications. */ @@ -76,7 +76,7 @@ TASK(TCP_Task) } /* Bail out early if there is already a frame waiting to be sent in the Ethernet OUT buffer */ - if (FrameOUT.FrameInBuffer) + if (RNDISInterfaceInfo->FrameOUT.FrameInBuffer) return; /* Send response packets from each application as the TCP packet buffers are filled by the applications */ @@ -86,13 +86,13 @@ TASK(TCP_Task) if ((ConnectionStateTable[CSTableEntry].Info.Buffer.Direction == TCP_PACKETDIR_OUT) && (ConnectionStateTable[CSTableEntry].Info.Buffer.Ready)) { - Ethernet_Frame_Header_t* FrameOUTHeader = (Ethernet_Frame_Header_t*)&FrameOUT.FrameData; - IP_Header_t* IPHeaderOUT = (IP_Header_t*)&FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t)]; - TCP_Header_t* TCPHeaderOUT = (TCP_Header_t*)&FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) + - sizeof(IP_Header_t)]; - void* TCPDataOUT = &FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) + - sizeof(IP_Header_t) + - sizeof(TCP_Header_t)]; + 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) + + sizeof(IP_Header_t)]; + void* TCPDataOUT = &RNDISInterfaceInfo->FrameOUT.FrameData[sizeof(Ethernet_Frame_Header_t) + + sizeof(IP_Header_t) + + sizeof(TCP_Header_t)]; uint16_t PacketSize = ConnectionStateTable[CSTableEntry].Info.Buffer.Length; @@ -145,8 +145,8 @@ TASK(TCP_Task) PacketSize += sizeof(Ethernet_Frame_Header_t); /* Set the response length in the buffer and indicate that a response is ready to be sent */ - FrameOUT.FrameLength = PacketSize; - FrameOUT.FrameInBuffer = true; + RNDISInterfaceInfo->FrameOUT.FrameLength = PacketSize; + RNDISInterfaceInfo->FrameOUT.FrameInBuffer = true; ConnectionStateTable[CSTableEntry].Info.Buffer.Ready = false;