Update UC3 platform driver support to use the bitmasks defined in the header files...
[pub/USBasp.git] / Demos / Device / LowLevel / RNDISEthernet / Lib / TCP.c
index 1a86e93..c8a12da 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2010.
+     Copyright (C) Dean Camera, 2011.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -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.FrameInBuffer)
+       if (FrameOUT.FrameLength)
          return;
 
        /* Send response packets from each application as the TCP packet buffers are filled by the applications */
          return;
 
        /* Send response packets from each application as the TCP packet buffers are filled by the applications */
@@ -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 */
                        FrameOUT.FrameLength            = PacketSize;
 
                        /* Set the response length in the buffer and indicate that a response is ready to be sent */
                        FrameOUT.FrameLength            = PacketSize;
-                       FrameOUT.FrameInBuffer          = true;
 
                        ConnectionStateTable[CSTableEntry].Info.Buffer.Ready = false;
 
 
                        ConnectionStateTable[CSTableEntry].Info.Buffer.Ready = false;
 
@@ -153,7 +152,7 @@ void TCP_Task(void)
        }
 }
 
        }
 }
 
-/** Initialises the TCP protocol handler, clearing the port and connection state tables. This must be called before TCP packets are
+/** Initializes the TCP protocol handler, clearing the port and connection state tables. This must be called before TCP packets are
  *  processed.
  */
 void TCP_Init(void)
  *  processed.
  */
 void TCP_Init(void)
@@ -170,7 +169,7 @@ void TCP_Init(void)
 /** Sets the state and callback handler of the given port, specified in big endian to the given state.
  *
  *  \param[in] Port     Port whose state and callback function to set, specified in big endian
 /** Sets the state and callback handler of the given port, specified in big endian to the given state.
  *
  *  \param[in] Port     Port whose state and callback function to set, specified in big endian
- *  \param[in] State    New state of the port, a value from the TCP_PortStates_t enum
+ *  \param[in] State    New state of the port, a value from the \ref TCP_PortStates_t enum
  *  \param[in] Handler  Application callback handler for the port
  *
  *  \return Boolean true if the port state was set, false otherwise (no more space in the port state table)
  *  \param[in] Handler  Application callback handler for the port
  *
  *  \return Boolean true if the port state was set, false otherwise (no more space in the port state table)
@@ -222,7 +221,7 @@ bool TCP_SetPortState(const uint16_t Port,
  *
  *  \param[in] Port  TCP port whose state is to be retrieved, given in big-endian
  *
  *
  *  \param[in] Port  TCP port whose state is to be retrieved, given in big-endian
  *
- *  \return A value from the TCP_PortStates_t enum
+ *  \return A value from the \ref TCP_PortStates_t enum
  */
 uint8_t TCP_GetPortState(const uint16_t Port)
 {
  */
 uint8_t TCP_GetPortState(const uint16_t Port)
 {
@@ -245,7 +244,7 @@ uint8_t TCP_GetPortState(const uint16_t Port)
  *  \param[in] Port           TCP port of the connection on the device, specified in big endian
  *  \param[in] RemoteAddress  Remote protocol IP address of the connected device
  *  \param[in] RemotePort     TCP port of the remote device in the connection, specified in big endian
  *  \param[in] Port           TCP port of the connection on the device, specified in big endian
  *  \param[in] RemoteAddress  Remote protocol IP address of the connected device
  *  \param[in] RemotePort     TCP port of the remote device in the connection, specified in big endian
- *  \param[in] State          TCP connection state, a value from the TCP_ConnectionStates_t enum
+ *  \param[in] State          TCP connection state, a value from the \ref TCP_ConnectionStates_t enum
  *
  *  \return Boolean true if the connection was updated or created, false otherwise (no more space in the connection state table)
  */
  *
  *  \return Boolean true if the connection was updated or created, false otherwise (no more space in the connection state table)
  */
@@ -290,7 +289,7 @@ bool TCP_SetConnectionState(const uint16_t Port,
  *  \param[in] RemoteAddress  Remote protocol IP address of the connected host
  *  \param[in] RemotePort     Remote TCP port of the connected host, specified in big endian
  *
  *  \param[in] RemoteAddress  Remote protocol IP address of the connected host
  *  \param[in] RemotePort     Remote TCP port of the connected host, specified in big endian
  *
- *  \return A value from the TCP_ConnectionStates_t enum
+ *  \return A value from the \ref TCP_ConnectionStates_t enum
  */
 uint8_t TCP_GetConnectionState(const uint16_t Port,
                                const IP_Address_t RemoteAddress,
  */
 uint8_t TCP_GetConnectionState(const uint16_t Port,
                                const IP_Address_t RemoteAddress,