# HG changeset patch # User Florian Pose # Date 1316175023 -7200 # Node ID afb40fd6018e1038998693f116f4d15a79bd26d2 # Parent 1448a40b5af50e121a7fdc698658309489574c78 Removed allow_config flag and obsolete request to OP. diff -r 1448a40b5af5 -r afb40fd6018e master/fsm_master.c --- a/master/fsm_master.c Fri Sep 16 12:44:54 2011 +0200 +++ b/master/fsm_master.c Fri Sep 16 14:10:23 2011 +0200 @@ -586,28 +586,24 @@ // Start slave configuration, if it is allowed. ec_mutex_lock(&master->config_mutex); - if (!master->allow_config) { - ec_mutex_unlock(&master->config_mutex); - } else { - master->config_busy = 1; - ec_mutex_unlock(&master->config_mutex); - - if (master->debug_level) { - char old_state[EC_STATE_STRING_SIZE], - new_state[EC_STATE_STRING_SIZE]; - ec_state_string(slave->current_state, old_state, 0); - ec_state_string(slave->requested_state, new_state, 0); - EC_SLAVE_DBG(slave, 1, "Changing state from %s to %s%s.\n", - old_state, new_state, - slave->force_config ? " (forced)" : ""); - } - - fsm->idle = 0; - fsm->state = ec_fsm_master_state_configure_slave; - ec_fsm_slave_config_start(&fsm->fsm_slave_config, slave); - fsm->state(fsm); // execute immediately - return; + master->config_busy = 1; + ec_mutex_unlock(&master->config_mutex); + + if (master->debug_level) { + char old_state[EC_STATE_STRING_SIZE], + new_state[EC_STATE_STRING_SIZE]; + ec_state_string(slave->current_state, old_state, 0); + ec_state_string(slave->requested_state, new_state, 0); + EC_SLAVE_DBG(slave, 1, "Changing state from %s to %s%s.\n", + old_state, new_state, + slave->force_config ? " (forced)" : ""); } + + fsm->idle = 0; + fsm->state = ec_fsm_master_state_configure_slave; + ec_fsm_slave_config_start(&fsm->fsm_slave_config, slave); + fsm->state(fsm); // execute immediately + return; } // slave has error flag set; process next one @@ -895,6 +891,7 @@ } } + // scanning and setting system times complete ec_master_request_op(master); ec_fsm_master_restart(fsm); } diff -r 1448a40b5af5 -r afb40fd6018e master/master.c --- a/master/master.c Fri Sep 16 12:44:54 2011 +0200 +++ b/master/master.c Fri Sep 16 14:10:23 2011 +0200 @@ -161,12 +161,10 @@ master->has_app_time = 0; master->scan_busy = 0; - master->allow_scan = 1; ec_mutex_init(&master->scan_mutex); init_waitqueue_head(&master->scan_queue); master->config_busy = 0; - master->allow_config = 1; ec_mutex_init(&master->config_mutex); init_waitqueue_head(&master->config_queue); @@ -583,7 +581,6 @@ EC_MASTER_DBG(master, 1, "IDLE -> OPERATION.\n"); ec_mutex_lock(&master->config_mutex); - master->allow_config = 0; // temporarily disable slave configuration if (master->config_busy) { ec_mutex_unlock(&master->config_mutex); @@ -644,7 +641,6 @@ out_allow: master->allow_scan = 1; - master->allow_config = 1; return ret; } @@ -2034,7 +2030,6 @@ return ret; } - master->allow_config = 1; // request the current configuration master->allow_scan = 1; // allow re-scanning on topology change master->active = 1; @@ -2107,7 +2102,6 @@ EC_MASTER_WARN(master, "Failed to restart master thread!\n"); master->allow_scan = 1; - master->allow_config = 1; master->active = 0; } diff -r 1448a40b5af5 -r afb40fd6018e master/master.h --- a/master/master.h Fri Sep 16 12:44:54 2011 +0200 +++ b/master/master.h Fri Sep 16 14:10:23 2011 +0200 @@ -232,8 +232,6 @@ slave scanning. */ unsigned int config_busy; /**< State of slave configuration. */ - unsigned int allow_config; /**< \a True, if slave configuration is - allowed. */ struct ec_mutex_t config_mutex; /**< Mutex protecting the \a config_busy variable and the allow_config flag. */ wait_queue_head_t config_queue; /**< Queue for processes that wait for