Changed MS/TP idle state: when no-token timeout occurs, clear the receive frame flags in case a message was received and timeout occurred, which may cause MS/TP to stop working in optimized dlmstp loops which don't check for new events when either of those flags are set. Thank you, Jason!

This commit is contained in:
skarg
2009-09-17 03:38:20 +00:00
parent bc01893af4
commit 69fad0502a
6 changed files with 24 additions and 0 deletions
+4
View File
@@ -727,6 +727,10 @@ static bool MSTP_Master_Node_FSM(
/* assume that the token has been lost */
EventCount = 0; /* Addendum 135-2004d-8 */
Master_State = MSTP_MASTER_STATE_NO_TOKEN;
/* set the receive frame flags to false in case we received
some bytes and had a timeout for some reason */
MSTP_Flag.ReceivedValidFrame = false;
MSTP_Flag.ReceivedInvalidFrame = false;
transition_now = true;
} else if (MSTP_Flag.ReceivedInvalidFrame == true) {
/* ReceivedInvalidFrame */
+4
View File
@@ -636,6 +636,10 @@ static bool MSTP_Master_Node_FSM(
/* assume that the token has been lost */
EventCount = 0; /* Addendum 135-2004d-8 */
Master_State = MSTP_MASTER_STATE_NO_TOKEN;
/* set the receive frame flags to false in case we received
some bytes and had a timeout for some reason */
MSTP_Flag.ReceivedValidFrame = false;
MSTP_Flag.ReceivedInvalidFrame = false;
transition_now = true;
} else if (MSTP_Flag.ReceivedInvalidFrame == true) {
/* ReceivedInvalidFrame */
@@ -724,6 +724,10 @@ static bool MSTP_Master_Node_FSM(
/* assume that the token has been lost */
EventCount = 0; /* Addendum 135-2004d-8 */
Master_State = MSTP_MASTER_STATE_NO_TOKEN;
/* set the receive frame flags to false in case we received
some bytes and had a timeout for some reason */
MSTP_Flag.ReceivedValidFrame = false;
MSTP_Flag.ReceivedInvalidFrame = false;
transition_now = true;
} else if (MSTP_Flag.ReceivedInvalidFrame == true) {
/* ReceivedInvalidFrame */
+4
View File
@@ -607,6 +607,10 @@ bool MSTP_Master_Node_FSM(
/* assume that the token has been lost */
mstp_port->EventCount = 0; /* Addendum 135-2004d-8 */
mstp_port->master_state = MSTP_MASTER_STATE_NO_TOKEN;
/* set the receive frame flags to false in case we received
some bytes and had a timeout for some reason */
mstp_port->ReceivedInvalidFrame = false;
mstp_port->ReceivedValidFrame = false;
transition_now = true;
}
/* ReceivedInvalidFrame */
+4
View File
@@ -742,6 +742,10 @@ bool MSTP_Master_Node_FSM(
/* assume that the token has been lost */
mstp_port->EventCount = 0; /* Addendum 135-2004d-8 */
mstp_port->master_state = MSTP_MASTER_STATE_NO_TOKEN;
/* set the receive frame flags to false in case we received
some bytes and had a timeout for some reason */
mstp_port->ReceivedInvalidFrame = false;
mstp_port->ReceivedValidFrame = false;
transition_now = true;
}
/* ReceivedInvalidFrame */
+4
View File
@@ -618,6 +618,10 @@ bool MSTP_Master_Node_FSM(
/* assume that the token has been lost */
mstp_port->EventCount = 0; /* Addendum 135-2004d-8 */
mstp_port->master_state = MSTP_MASTER_STATE_NO_TOKEN;
/* set the receive frame flags to false in case we received
some bytes and had a timeout for some reason */
mstp_port->ReceivedInvalidFrame = false;
mstp_port->ReceivedValidFrame = false;
transition_now = true;
} else if (mstp_port->ReceivedInvalidFrame == true) {
/* ReceivedInvalidFrame */