Commit 692af7f3 authored by Alessandro Rubini's avatar Alessandro Rubini

kill portState: nobody is using it

the portState field is probably a relic of ptpd, then the state
machine was a single switch() statement.  Many places were still
setting it, but nobody was ever reading the field.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 4a7a4164
......@@ -252,7 +252,7 @@ typedef struct DSPort { /* page 72 */
/* Static */
PortIdentity portIdentity;
/* Dynamic */
Enumeration8 portState;
/* Enumeration8 portState; -- not used */
Integer8 logMinDelayReqInterval; /* note: never changed */
/* TimeInternal peerMeanPathDelay; -- not used */
/* Configurable */
......
......@@ -12,7 +12,6 @@ int wr_locked(struct pp_instance *ppi, unsigned char *pkt, int plen)
MsgSignaling wrsig_msg;
if (ppi->is_new_state) {
DSPOR(ppi)->portState = PPS_UNCALIBRATED;
WR_DSPOR(ppi)->wrPortState = WRS_LOCKED;
pp_timeout_set(ppi, PP_TO_EXT_0,
WR_DSPOR(ppi)->wrStateTimeout);
......
......@@ -12,7 +12,6 @@ int wr_m_lock(struct pp_instance *ppi, unsigned char *pkt, int plen)
MsgSignaling wrsig_msg;
if (ppi->is_new_state) {
DSPOR(ppi)->portState = PPS_MASTER;
WR_DSPOR(ppi)->wrPortState = WRS_M_LOCK;
WR_DSPOR(ppi)->wrMode = WR_MASTER;
e = msg_issue_wrsig(ppi, LOCK);
......
......@@ -14,7 +14,6 @@ int wr_present(struct pp_instance *ppi, unsigned char *pkt, int plen)
MsgSignaling wrsig_msg;
if (ppi->is_new_state) {
DSPOR(ppi)->portState = PPS_UNCALIBRATED;
WR_DSPOR(ppi)->wrPortState = WRS_PRESENT;
WR_DSPOR(ppi)->wrMode = WR_SLAVE;
pp_timeout_set(ppi, PP_TO_EXT_0,
......
......@@ -10,7 +10,6 @@ int wr_s_lock(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
int e = 0;
if (ppi->is_new_state) {
DSPOR(ppi)->portState = PPS_UNCALIBRATED;
WR_DSPOR(ppi)->wrPortState = WRS_S_LOCK;
wr_locking_enable(ppi);
pp_timeout_set(ppi, PP_TO_EXT_0, WR_S_LOCK_TIMEOUT_MS);
......
......@@ -8,7 +8,6 @@
int pp_disabled(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
/* nothing to do */
DSPOR(ppi)->portState = PPS_DISABLED;
ppi->next_delay = PP_DEFAULT_NEXT_DELAY_MS;
return 0;
}
......@@ -12,7 +12,6 @@
int pp_faulty(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
DSPOR(ppi)->portState = PPS_FAULTY;
PP_PRINTF("Faulty state detected\n");
ppi->next_state = PPS_INITIALIZING;
return 0;
......
......@@ -20,8 +20,6 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
if (ppi->n_ops->init(ppi) < 0) /* it must handle being called twice */
goto failure;
port->portState = PPS_INITIALIZING;
/*
* Initialize default data set
*/
......
......@@ -15,10 +15,8 @@ int pp_listening(struct pp_instance *ppi, unsigned char *pkt, int plen)
if (e)
goto out;
if (ppi->is_new_state) {
DSPOR(ppi)->portState = PPS_LISTENING;
if (ppi->is_new_state)
pp_timeout_restart_annrec(ppi);
}
if (st_com_check_record_update(ppi))
goto state_updated;
......
......@@ -16,7 +16,6 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
time = &ppi->last_rcv_time;
if (ppi->is_new_state) {
DSPOR(ppi)->portState = PPS_MASTER;
pp_timeout_rand(ppi, PP_TO_SYNC, DSPOR(ppi)->logSyncInterval);
pp_timeout_rand(ppi, PP_TO_ANN_INTERVAL,
DSPOR(ppi)->logAnnounceInterval);
......
......@@ -10,11 +10,8 @@ int pp_passive(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
int e = 0; /* error var, to check errors in msg handling */
if (ppi->is_new_state) {
DSPOR(ppi)->portState = PPS_PASSIVE;
if (ppi->is_new_state)
pp_timeout_restart_annrec(ppi);
}
if (st_com_check_record_update(ppi))
goto state_updated;
......
......@@ -11,6 +11,5 @@ int pp_pre_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
* No need of PRE_MASTER state because of only ordinary clock
* implementation.
*/
DSPOR(ppi)->portState = PPS_PRE_MASTER;
return 0;
}
......@@ -15,8 +15,6 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
int d1, d2;
if (ppi->is_new_state) {
DSPOR(ppi)->portState = PPS_SLAVE;
pp_init_clock(ppi);
if (pp_hooks.new_slave)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment