aboutsummaryrefslogtreecommitdiffstats
path: root/Demos
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-08-05 11:39:28 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-08-05 11:39:28 +0000
commit4421782b7fb49e160b1c18f2295e6cd1f0b00c04 (patch)
treed6b5007b2644ee9bf5c8bf588375158f0bab5f07 /Demos
parenta9d5e129b76449c73a853af450d7d353512cd3a0 (diff)
downloadlufa-4421782b7fb49e160b1c18f2295e6cd1f0b00c04.tar.gz
lufa-4421782b7fb49e160b1c18f2295e6cd1f0b00c04.tar.bz2
lufa-4421782b7fb49e160b1c18f2295e6cd1f0b00c04.zip
Make Control Endpoint stream transfers more reliable by adding in early aborts for unexpected new SETUP tokens, or unexpected status stage during control stream writes.
Fix corruption in Device RNDIS demos TCP stack when too many connections attempted simultaneously, freezing the device when a page was re-fetched before the first connection was closed. Fix incorrect model compatibility information in the Host LowLevel demo overview text files.
Diffstat (limited to 'Demos')
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c27
-rw-r--r--Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h2
-rw-r--r--Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c27
-rw-r--r--Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h2
-rw-r--r--Demos/Host/LowLevel/CDCHost/CDCHost.txt2
-rw-r--r--Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.txt2
-rw-r--r--Demos/Host/LowLevel/KeyboardHost/KeyboardHost.txt2
-rw-r--r--Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.txt2
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/MassStorageHost.txt2
-rw-r--r--Demos/Host/LowLevel/MouseHost/MouseHost.txt2
-rw-r--r--Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.txt2
-rw-r--r--Demos/Host/LowLevel/PrinterHost/PrinterHost.txt2
-rw-r--r--Demos/Host/LowLevel/StillImageHost/StillImageHost.txt2
13 files changed, 43 insertions, 33 deletions
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c
index 674643381..c94495dc3 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c
+++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c
@@ -381,19 +381,24 @@ int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void
case TCP_Connection_Listen:
if (TCPHeaderIN->Flags == TCP_FLAG_SYN)
{
- /* SYN connection when closed starts a connection with a peer */
+ /* SYN connection starts a connection with a peer */
+ if (TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort, TCP_Connection_SYNReceived))
+ {
+ TCPHeaderOUT->Flags = (TCP_FLAG_SYN | TCP_FLAG_ACK);
- TCPHeaderOUT->Flags = (TCP_FLAG_SYN | TCP_FLAG_ACK);
- PacketResponse = true;
-
- TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress, TCPHeaderIN->SourcePort,
- TCP_Connection_SYNReceived);
-
- ConnectionInfo = TCP_GetConnectionInfo(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress, TCPHeaderIN->SourcePort);
+ ConnectionInfo = TCP_GetConnectionInfo(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress, TCPHeaderIN->SourcePort);
- ConnectionInfo->SequenceNumberIn = (SwapEndian_32(TCPHeaderIN->SequenceNumber) + 1);
- ConnectionInfo->SequenceNumberOut = 0;
- ConnectionInfo->Buffer.InUse = false;
+ ConnectionInfo->SequenceNumberIn = (SwapEndian_32(TCPHeaderIN->SequenceNumber) + 1);
+ ConnectionInfo->SequenceNumberOut = 0;
+ ConnectionInfo->Buffer.InUse = false;
+ }
+ else
+ {
+ TCPHeaderOUT->Flags = TCP_FLAG_RST;
+ }
+
+ PacketResponse = true;
}
break;
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h
index b61de7e18..4e1e0d7a6 100644
--- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h
+++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h
@@ -49,7 +49,7 @@
#define MAX_OPEN_TCP_PORTS 1
/** Maximum number of TCP connections which can be sustained at the one time */
- #define MAX_TCP_CONNECTIONS 1
+ #define MAX_TCP_CONNECTIONS 3
/** TCP window size, giving the maximum number of bytes which can be buffered at the one time */
#define TCP_WINDOW_SIZE 512
diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c
index b4fc12c93..57b3f3a8c 100644
--- a/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c
+++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c
@@ -381,19 +381,24 @@ int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void
case TCP_Connection_Listen:
if (TCPHeaderIN->Flags == TCP_FLAG_SYN)
{
- /* SYN connection when closed starts a connection with a peer */
+ /* SYN connection starts a connection with a peer */
+ if (TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress,
+ TCPHeaderIN->SourcePort, TCP_Connection_SYNReceived))
+ {
+ TCPHeaderOUT->Flags = (TCP_FLAG_SYN | TCP_FLAG_ACK);
- TCPHeaderOUT->Flags = (TCP_FLAG_SYN | TCP_FLAG_ACK);
- PacketResponse = true;
-
- TCP_SetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress, TCPHeaderIN->SourcePort,
- TCP_Connection_SYNReceived);
-
- ConnectionInfo = TCP_GetConnectionInfo(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress, TCPHeaderIN->SourcePort);
+ ConnectionInfo = TCP_GetConnectionInfo(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress, TCPHeaderIN->SourcePort);
- ConnectionInfo->SequenceNumberIn = (SwapEndian_32(TCPHeaderIN->SequenceNumber) + 1);
- ConnectionInfo->SequenceNumberOut = 0;
- ConnectionInfo->Buffer.InUse = false;
+ ConnectionInfo->SequenceNumberIn = (SwapEndian_32(TCPHeaderIN->SequenceNumber) + 1);
+ ConnectionInfo->SequenceNumberOut = 0;
+ ConnectionInfo->Buffer.InUse = false;
+ }
+ else
+ {
+ TCPHeaderOUT->Flags = TCP_FLAG_RST;
+ }
+
+ PacketResponse = true;
}
break;
diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h
index eac682547..460e3f819 100644
--- a/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h
+++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h
@@ -49,7 +49,7 @@
#define MAX_OPEN_TCP_PORTS 1
/** Maximum number of TCP connections which can be sustained at the one time */
- #define MAX_TCP_CONNECTIONS 1
+ #define MAX_TCP_CONNECTIONS 3
/** TCP window size, giving the maximum number of bytes which can be buffered at the one time */
#define TCP_WINDOW_SIZE 512
diff --git a/Demos/Host/LowLevel/CDCHost/CDCHost.txt b/Demos/Host/LowLevel/CDCHost/CDCHost.txt
index 30a88ba0c..58469ab45 100644
--- a/Demos/Host/LowLevel/CDCHost/CDCHost.txt
+++ b/Demos/Host/LowLevel/CDCHost/CDCHost.txt
@@ -11,7 +11,7 @@
* The following table indicates what microcontrollers are compatible with this demo.
*
* - AT90USB1287
- * - AT90USB1286
+ * - AT90USB647
*
* \section SSec_Info USB Information:
*
diff --git a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.txt b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.txt
index 0a82aaa0d..51d91cc6e 100644
--- a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.txt
+++ b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.txt
@@ -11,7 +11,7 @@
* The following table indicates what microcontrollers are compatible with this demo.
*
* - AT90USB1287
- * - AT90USB1286
+ * - AT90USB647
*
* \section SSec_Info USB Information:
*
diff --git a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.txt b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.txt
index 6eba0ae2e..42009a3ca 100644
--- a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.txt
+++ b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.txt
@@ -11,7 +11,7 @@
* The following table indicates what microcontrollers are compatible with this demo.
*
* - AT90USB1287
- * - AT90USB1286
+ * - AT90USB647
*
* \section SSec_Info USB Information:
*
diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.txt b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.txt
index cc883ea2d..b9ad58b92 100644
--- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.txt
+++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.txt
@@ -11,7 +11,7 @@
* The following table indicates what microcontrollers are compatible with this demo.
*
* - AT90USB1287
- * - AT90USB1286
+ * - AT90USB647
*
* \section SSec_Info USB Information:
*
diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.txt b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.txt
index 165245c2f..5872d1947 100644
--- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.txt
+++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.txt
@@ -11,7 +11,7 @@
* The following table indicates what microcontrollers are compatible with this demo.
*
* - AT90USB1287
- * - AT90USB1286
+ * - AT90USB647
*
* \section SSec_Info USB Information:
*
diff --git a/Demos/Host/LowLevel/MouseHost/MouseHost.txt b/Demos/Host/LowLevel/MouseHost/MouseHost.txt
index d3106256d..8a3c1674c 100644
--- a/Demos/Host/LowLevel/MouseHost/MouseHost.txt
+++ b/Demos/Host/LowLevel/MouseHost/MouseHost.txt
@@ -11,7 +11,7 @@
* The following table indicates what microcontrollers are compatible with this demo.
*
* - AT90USB1287
- * - AT90USB1286
+ * - AT90USB647
*
* \section SSec_Info USB Information:
*
diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.txt b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.txt
index 77bd16f33..c0ff4bfbb 100644
--- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.txt
+++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.txt
@@ -11,7 +11,7 @@
* The following table indicates what microcontrollers are compatible with this demo.
*
* - AT90USB1287
- * - AT90USB1286
+ * - AT90USB647
*
* \section SSec_Info USB Information:
*
diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.txt b/Demos/Host/LowLevel/PrinterHost/PrinterHost.txt
index 6326469e0..79310310f 100644
--- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.txt
+++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.txt
@@ -11,7 +11,7 @@
* The following table indicates what microcontrollers are compatible with this demo.
*
* - AT90USB1287
- * - AT90USB1286
+ * - AT90USB647
*
* \section SSec_Info USB Information:
*
diff --git a/Demos/Host/LowLevel/StillImageHost/StillImageHost.txt b/Demos/Host/LowLevel/StillImageHost/StillImageHost.txt
index b2a8a84cf..776e1a49c 100644
--- a/Demos/Host/LowLevel/StillImageHost/StillImageHost.txt
+++ b/Demos/Host/LowLevel/StillImageHost/StillImageHost.txt
@@ -11,7 +11,7 @@
* The following table indicates what microcontrollers are compatible with this demo.
*
* - AT90USB1287
- * - AT90USB1286
+ * - AT90USB647
*
* \section SSec_Info USB Information:
*