Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
c9e817ff
Commit
c9e817ff
authored
Oct 09, 2011
by
Dean Camera
Browse files
Fixed port state table corruption in the TCP layer of the RNDIS Ethernet device demos.
Fix additional warnings under GCC 4.6.
parent
68e777e1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c
View file @
c9e817ff
...
...
@@ -182,7 +182,7 @@ bool TCP_SetPortState(const uint16_t Port,
/* Note, Port number should be specified in BIG endian to simplify network code */
/* Check to see if the port entry is already in the port state table */
for
(
uint8_t
PTableEntry
=
0
;
PTableEntry
<
MAX_
TCP_CONNECTION
S
;
PTableEntry
++
)
for
(
uint8_t
PTableEntry
=
0
;
PTableEntry
<
MAX_
OPEN_TCP_PORT
S
;
PTableEntry
++
)
{
/* Find existing entry for the port in the table, update it if found */
if
(
PortStateTable
[
PTableEntry
].
Port
==
Port
)
...
...
@@ -196,7 +196,7 @@ bool TCP_SetPortState(const uint16_t Port,
/* Check if trying to open the port -- if so we need to find an unused (closed) entry and replace it */
if
(
State
==
TCP_Port_Open
)
{
for
(
uint8_t
PTableEntry
=
0
;
PTableEntry
<
MAX_
TCP_CONNECTION
S
;
PTableEntry
++
)
for
(
uint8_t
PTableEntry
=
0
;
PTableEntry
<
MAX_
OPEN_TCP_PORT
S
;
PTableEntry
++
)
{
/* Find a closed port entry in the table, change it to the given port and state */
if
(
PortStateTable
[
PTableEntry
].
State
==
TCP_Port_Closed
)
...
...
@@ -228,7 +228,7 @@ uint8_t TCP_GetPortState(const uint16_t Port)
{
/* Note, Port number should be specified in BIG endian to simplify network code */
for
(
uint8_t
PTableEntry
=
0
;
PTableEntry
<
MAX_
TCP_CONNECTION
S
;
PTableEntry
++
)
for
(
uint8_t
PTableEntry
=
0
;
PTableEntry
<
MAX_
OPEN_TCP_PORT
S
;
PTableEntry
++
)
{
/* Find existing entry for the port in the table, return the port status if found */
if
(
PortStateTable
[
PTableEntry
].
Port
==
Port
)
...
...
Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c
View file @
c9e817ff
...
...
@@ -181,7 +181,7 @@ bool TCP_SetPortState(const uint16_t Port,
/* Note, Port number should be specified in BIG endian to simplify network code */
/* Check to see if the port entry is already in the port state table */
for
(
uint8_t
PTableEntry
=
0
;
PTableEntry
<
MAX_
TCP_CONNECTION
S
;
PTableEntry
++
)
for
(
uint8_t
PTableEntry
=
0
;
PTableEntry
<
MAX_
OPEN_TCP_PORT
S
;
PTableEntry
++
)
{
/* Find existing entry for the port in the table, update it if found */
if
(
PortStateTable
[
PTableEntry
].
Port
==
Port
)
...
...
@@ -195,7 +195,7 @@ bool TCP_SetPortState(const uint16_t Port,
/* Check if trying to open the port -- if so we need to find an unused (closed) entry and replace it */
if
(
State
==
TCP_Port_Open
)
{
for
(
uint8_t
PTableEntry
=
0
;
PTableEntry
<
MAX_
TCP_CONNECTION
S
;
PTableEntry
++
)
for
(
uint8_t
PTableEntry
=
0
;
PTableEntry
<
MAX_
OPEN_TCP_PORT
S
;
PTableEntry
++
)
{
/* Find a closed port entry in the table, change it to the given port and state */
if
(
PortStateTable
[
PTableEntry
].
State
==
TCP_Port_Closed
)
...
...
@@ -227,7 +227,7 @@ uint8_t TCP_GetPortState(const uint16_t Port)
{
/* Note, Port number should be specified in BIG endian to simplify network code */
for
(
uint8_t
PTableEntry
=
0
;
PTableEntry
<
MAX_
TCP_CONNECTION
S
;
PTableEntry
++
)
for
(
uint8_t
PTableEntry
=
0
;
PTableEntry
<
MAX_
OPEN_TCP_PORT
S
;
PTableEntry
++
)
{
/* Find existing entry for the port in the table, return the port status if found */
if
(
PortStateTable
[
PTableEntry
].
Port
==
Port
)
...
...
Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c
View file @
c9e817ff
...
...
@@ -348,7 +348,7 @@ void MassStorageHost_Task(void)
* \param[in] CommandString ASCII string located in PROGMEM space indicating what operation failed
* \param[in] ErrorCode Error code of the function which failed to complete successfully
*/
void
ShowDiskReadError
(
char
*
CommandString
,
void
ShowDiskReadError
(
const
char
*
CommandString
,
const
uint8_t
ErrorCode
)
{
if
(
ErrorCode
==
MASS_STORE_SCSI_COMMAND_FAILED
)
...
...
Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h
View file @
c9e817ff
...
...
@@ -84,7 +84,7 @@
const
uint8_t
SubErrorCode
);
void
EVENT_USB_Host_DeviceEnumerationComplete
(
void
);
void
ShowDiskReadError
(
char
*
CommandString
,
void
ShowDiskReadError
(
const
char
*
CommandString
,
const
uint8_t
ErrorCode
);
#endif
...
...
Demos/Host/LowLevel/StillImageHost/StillImageHost.c
View file @
c9e817ff
...
...
@@ -353,7 +353,7 @@ void UnicodeToASCII(uint8_t* UnicodeString,
void
ShowCommandError
(
uint8_t
ErrorCode
,
bool
ResponseCodeError
)
{
char
*
FailureType
=
((
ResponseCodeError
)
?
PSTR
(
"Response Code != OK"
)
:
PSTR
(
"Transaction Fail"
));
const
char
*
FailureType
=
((
ResponseCodeError
)
?
PSTR
(
"Response Code != OK"
)
:
PSTR
(
"Transaction Fail"
));
printf_P
(
PSTR
(
ESC_FG_RED
"Command Error (%S).
\r\n
"
" -- Error Code %d
\r\n
"
ESC_FG_WHITE
),
FailureType
,
ErrorCode
);
...
...
LUFA/ManPages/ChangeLog.txt
View file @
c9e817ff
...
...
@@ -94,6 +94,7 @@
* - Fixed incorrect Dataflash buffer use in the DataflashManager_WriteBlocks_RAM() function of several demos/projects (thanks to Jeremy Willden)
* - Fixed incorrect logging interval (always 500ms longer than requested) in the TempDataLogger project
* - Fixed incorrect buffer size check in the USBtoSerial project (thanks to Yuri A Nikiforov)
* - Fixed port state table corruption in the TCP layer of the RNDIS Ethernet device demos
*
* \section Sec_ChangeLog110528 Version 110528
* <b>New:</b>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment