From 1ed90878fda4c5052fd076b226d42b3d2e251a7b Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Tue, 4 Aug 2020 14:33:44 +0000 Subject: [PATCH 01/24] agent: Move front radio configuration to AgentDB Move front radio configuration from "sPlatformSettings" struct to the AgentDB. Replace the use of front radio settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 4 +++- .../slave/platform_manager/platform_manager_thread.cpp | 10 +++++----- agent/src/beerocks/slave/son_slave_thread.cpp | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 30893c248d..a9f5430882 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -81,7 +81,9 @@ class AgentDB { /* Agent Configuration */ struct sDeviceConf { struct sFrontRadio { - + char ssid[beerocks::message::WIFI_SSID_MAX_LENGTH]; + char pass[beerocks::message::WIFI_PASS_MAX_LENGTH]; + char security_type[beerocks::message::WIFI_SECURITY_TYPE_MAX_LENGTH]; } front_radio; struct sBackRadio { diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index a0dd39f840..88e7087042 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -66,16 +66,16 @@ static bool fill_platform_settings( { auto db = AgentDB::get(); - if (bpl::cfg_get_beerocks_credentials(BPL_RADIO_FRONT, msg->platform_settings().front_ssid, - msg->platform_settings().front_pass, - msg->platform_settings().front_security_type) < 0) { + if (bpl::cfg_get_beerocks_credentials(BPL_RADIO_FRONT, db->device_conf.front_radio.ssid, + db->device_conf.front_radio.pass, + db->device_conf.front_radio.security_type) < 0) { LOG(ERROR) << "Failed reading front Wi-Fi credentials!"; return false; } LOG(DEBUG) << "Front Credentials:" - << " ssid=" << msg->platform_settings().front_ssid - << " sec=" << msg->platform_settings().front_security_type << " pass=***"; + << " ssid=" << db->device_conf.front_radio.ssid + << " sec=" << db->device_conf.front_radio.security_type << " pass=***"; if (bpl::cfg_get_beerocks_credentials(BPL_RADIO_BACK, msg->platform_settings().back_ssid, msg->platform_settings().back_pass, diff --git a/agent/src/beerocks/slave/son_slave_thread.cpp b/agent/src/beerocks/slave/son_slave_thread.cpp index f5b0d50ae4..1bdf887938 100644 --- a/agent/src/beerocks/slave/son_slave_thread.cpp +++ b/agent/src/beerocks/slave/son_slave_thread.cpp @@ -794,7 +794,7 @@ bool slave_thread::handle_cmdu_control_message(Socket *sd, if (request_in->params().use_optional_ssid && std::string((char *)request_in->params().ssid).empty()) { //LOG(DEBUG) << "ssid field is empty! using slave ssid -> " << config.ssid; - string_utils::copy_string(request_in->params().ssid, platform_settings.front_ssid, + string_utils::copy_string(request_in->params().ssid, db->device_conf.front_radio.ssid, message::WIFI_SSID_MAX_LENGTH); } From 198dd29ba3b108024c30fee195f3ac40ded40dbf Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Tue, 4 Aug 2020 16:24:49 +0000 Subject: [PATCH 02/24] agent: Move back radio configuration to AgentDB Move back radio configuration from "sPlatformSettings" struct to the AgentDB. Replace the use of back radio settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 4 +++- .../slave/platform_manager/platform_manager_thread.cpp | 10 +++++----- agent/src/beerocks/slave/son_slave_thread.cpp | 8 +++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index a9f5430882..dd2d535930 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -87,7 +87,9 @@ class AgentDB { } front_radio; struct sBackRadio { - + char ssid[beerocks::message::WIFI_SSID_MAX_LENGTH]; + char pass[beerocks::message::WIFI_PASS_MAX_LENGTH]; + char security_type[beerocks::message::WIFI_SECURITY_TYPE_MAX_LENGTH]; } back_radio; bool local_gw; diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 88e7087042..0fee9243d3 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -77,9 +77,9 @@ static bool fill_platform_settings( << " ssid=" << db->device_conf.front_radio.ssid << " sec=" << db->device_conf.front_radio.security_type << " pass=***"; - if (bpl::cfg_get_beerocks_credentials(BPL_RADIO_BACK, msg->platform_settings().back_ssid, - msg->platform_settings().back_pass, - msg->platform_settings().back_security_type) < 0) { + if (bpl::cfg_get_beerocks_credentials(BPL_RADIO_BACK, db->device_conf.back_radio.ssid, + db->device_conf.back_radio.pass, + db->device_conf.back_radio.security_type) < 0) { LOG(ERROR) << "Failed reading Wi-Fi back credentials!"; return false; } @@ -93,8 +93,8 @@ static bool fill_platform_settings( msg->platform_settings().mem_only_psk = mem_only_psk; LOG(DEBUG) << "Back Credentials:" - << " ssid=" << msg->platform_settings().back_ssid - << " sec=" << msg->platform_settings().back_security_type + << " ssid=" << db->device_conf.back_radio.ssid + << " sec=" << db->device_conf.back_radio.security_type << " mem_only_psk=" << int(msg->platform_settings().mem_only_psk) << " pass=***"; bpl::BPL_WLAN_PARAMS params; diff --git a/agent/src/beerocks/slave/son_slave_thread.cpp b/agent/src/beerocks/slave/son_slave_thread.cpp index 1bdf887938..81a251234c 100644 --- a/agent/src/beerocks/slave/son_slave_thread.cpp +++ b/agent/src/beerocks/slave/son_slave_thread.cpp @@ -3105,11 +3105,13 @@ bool slave_thread::slave_fsm(bool &call_slave_select) // to the backhaul manager will no longer be necessary, and therefore should be be // removed completely from beerocks including the BPL. string_utils::copy_string(bh_enable->ssid(message::WIFI_SSID_MAX_LENGTH), - platform_settings.back_ssid, message::WIFI_SSID_MAX_LENGTH); + db->device_conf.back_radio.ssid, + message::WIFI_SSID_MAX_LENGTH); string_utils::copy_string(bh_enable->pass(message::WIFI_PASS_MAX_LENGTH), - platform_settings.back_pass, message::WIFI_PASS_MAX_LENGTH); + db->device_conf.back_radio.pass, + message::WIFI_PASS_MAX_LENGTH); bh_enable->security_type() = static_cast( - platform_to_bwl_security(platform_settings.back_security_type)); + platform_to_bwl_security(db->device_conf.back_radio.security_type)); bh_enable->mem_only_psk() = platform_settings.mem_only_psk; bh_enable->backhaul_preferred_radio_band() = platform_settings.backhaul_preferred_radio_band; From b940541e5f0985bf95975d61591f9f99c37f5822 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Wed, 5 Aug 2020 12:33:56 +0000 Subject: [PATCH 03/24] agent: Move mem_only_psk configuration to AgentDB Move "mem_only_psk" configuration of back radio from "sPlatformSettings" struct to the AgentDB. Replace the use of "mem_only_psk" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../slave/platform_manager/platform_manager_thread.cpp | 4 ++-- agent/src/beerocks/slave/son_slave_thread.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index dd2d535930..0c9fc58f81 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -90,6 +90,7 @@ class AgentDB { char ssid[beerocks::message::WIFI_SSID_MAX_LENGTH]; char pass[beerocks::message::WIFI_PASS_MAX_LENGTH]; char security_type[beerocks::message::WIFI_SECURITY_TYPE_MAX_LENGTH]; + uint8_t mem_only_psk; } back_radio; bool local_gw; diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 0fee9243d3..4467a1c588 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -90,12 +90,12 @@ static bool fill_platform_settings( return false; } - msg->platform_settings().mem_only_psk = mem_only_psk; + db->device_conf.back_radio.mem_only_psk = mem_only_psk; LOG(DEBUG) << "Back Credentials:" << " ssid=" << db->device_conf.back_radio.ssid << " sec=" << db->device_conf.back_radio.security_type - << " mem_only_psk=" << int(msg->platform_settings().mem_only_psk) << " pass=***"; + << " mem_only_psk=" << int(db->device_conf.back_radio.mem_only_psk) << " pass=***"; bpl::BPL_WLAN_PARAMS params; if (bpl::cfg_get_wifi_params(iface_name.c_str(), ¶ms) < 0) { diff --git a/agent/src/beerocks/slave/son_slave_thread.cpp b/agent/src/beerocks/slave/son_slave_thread.cpp index 81a251234c..c276ef1bb9 100644 --- a/agent/src/beerocks/slave/son_slave_thread.cpp +++ b/agent/src/beerocks/slave/son_slave_thread.cpp @@ -3112,7 +3112,7 @@ bool slave_thread::slave_fsm(bool &call_slave_select) message::WIFI_PASS_MAX_LENGTH); bh_enable->security_type() = static_cast( platform_to_bwl_security(db->device_conf.back_radio.security_type)); - bh_enable->mem_only_psk() = platform_settings.mem_only_psk; + bh_enable->mem_only_psk() = db->device_conf.back_radio.mem_only_psk; bh_enable->backhaul_preferred_radio_band() = platform_settings.backhaul_preferred_radio_band; From fa19acb4c47a378bd76cf1eedbf2a3168105b2f4 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 08:36:38 +0000 Subject: [PATCH 04/24] agent: Move backhaul_max_vaps configuration to AgentDB Move "backhaul_max_vaps" configuration of back radio from "sPlatformSettings" struct to the AgentDB. Replace the use of "backhaul_max_vaps" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../beerocks/slave/platform_manager/platform_manager_thread.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 0c9fc58f81..11b9c22fca 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -91,6 +91,7 @@ class AgentDB { char pass[beerocks::message::WIFI_PASS_MAX_LENGTH]; char security_type[beerocks::message::WIFI_SECURITY_TYPE_MAX_LENGTH]; uint8_t mem_only_psk; + uint8_t backhaul_max_vaps; } back_radio; bool local_gw; diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 4467a1c588..f19e86a165 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -208,7 +208,7 @@ static bool fill_platform_settings( msg->platform_settings().certification_mode = uint8_t(platform_common_conf.certification_mode); msg->platform_settings().stop_on_failure_attempts = uint8_t(platform_common_conf.stop_on_failure_attempts); - msg->platform_settings().backhaul_max_vaps = uint8_t(platform_common_conf.backhaul_max_vaps); + db->device_conf.back_radio.backhaul_max_vaps = uint8_t(platform_common_conf.backhaul_max_vaps); msg->platform_settings().backhaul_network_enabled = uint8_t(platform_common_conf.backhaul_network_enabled); msg->platform_settings().backhaul_preferred_radio_band = From bd04912b2592b60153464126581a7afd219777e2 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 08:43:30 +0000 Subject: [PATCH 05/24] agent: Move backhaul_network_enabled configuration to AgentDB Move "backhaul_network_enabled" configuration of back radio from "sPlatformSettings" struct to the AgentDB. Replace the use of "backhaul_network_enabled" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../beerocks/slave/platform_manager/platform_manager_thread.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 11b9c22fca..4e29449acc 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -92,6 +92,7 @@ class AgentDB { char security_type[beerocks::message::WIFI_SECURITY_TYPE_MAX_LENGTH]; uint8_t mem_only_psk; uint8_t backhaul_max_vaps; + uint8_t backhaul_network_enabled; } back_radio; bool local_gw; diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index f19e86a165..ac811fcad9 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -209,7 +209,7 @@ static bool fill_platform_settings( msg->platform_settings().stop_on_failure_attempts = uint8_t(platform_common_conf.stop_on_failure_attempts); db->device_conf.back_radio.backhaul_max_vaps = uint8_t(platform_common_conf.backhaul_max_vaps); - msg->platform_settings().backhaul_network_enabled = + db->device_conf.back_radio.backhaul_network_enabled = uint8_t(platform_common_conf.backhaul_network_enabled); msg->platform_settings().backhaul_preferred_radio_band = uint8_t(bpl_band_to_freq_type(platform_common_conf.backhaul_preferred_radio_band)); From 6d15f7e6d53c875e2ff6d34afd8b1b28f654eb9d Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 08:51:46 +0000 Subject: [PATCH 06/24] agent: Move backhaul_preferred_radio_band configuration to AgentDB Move "backhaul_preferred_radio_band" configuration of back radio from "sPlatformSettings" struct to the AgentDB. Replace the use of "backhaul_preferred_radio_band" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../slave/platform_manager/platform_manager_thread.cpp | 4 ++-- agent/src/beerocks/slave/son_slave_thread.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 4e29449acc..fc486117a8 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -93,6 +93,7 @@ class AgentDB { uint8_t mem_only_psk; uint8_t backhaul_max_vaps; uint8_t backhaul_network_enabled; + uint8_t backhaul_preferred_radio_band; } back_radio; bool local_gw; diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index ac811fcad9..083f7c32c9 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -211,7 +211,7 @@ static bool fill_platform_settings( db->device_conf.back_radio.backhaul_max_vaps = uint8_t(platform_common_conf.backhaul_max_vaps); db->device_conf.back_radio.backhaul_network_enabled = uint8_t(platform_common_conf.backhaul_network_enabled); - msg->platform_settings().backhaul_preferred_radio_band = + db->device_conf.back_radio.backhaul_preferred_radio_band = uint8_t(bpl_band_to_freq_type(platform_common_conf.backhaul_preferred_radio_band)); msg->platform_settings().load_balancing_enabled = 0; // for v1.3 TODO read from CAL DB @@ -231,7 +231,7 @@ static bool fill_platform_settings( LOG(DEBUG) << "local_controller: " << db->device_conf.local_controller; LOG(DEBUG) << "dfs_reentry_enabled: " << (unsigned)msg->platform_settings().dfs_reentry_enabled; LOG(DEBUG) << "backhaul_preferred_radio_band: " - << (unsigned)msg->platform_settings().backhaul_preferred_radio_band; + << (unsigned)db->device_conf.back_radio.backhaul_preferred_radio_band; LOG(DEBUG) << "rdkb_extensions: " << (unsigned)msg->platform_settings().rdkb_extensions_enabled; return true; diff --git a/agent/src/beerocks/slave/son_slave_thread.cpp b/agent/src/beerocks/slave/son_slave_thread.cpp index c276ef1bb9..01e74b3fb6 100644 --- a/agent/src/beerocks/slave/son_slave_thread.cpp +++ b/agent/src/beerocks/slave/son_slave_thread.cpp @@ -3114,7 +3114,7 @@ bool slave_thread::slave_fsm(bool &call_slave_select) platform_to_bwl_security(db->device_conf.back_radio.security_type)); bh_enable->mem_only_psk() = db->device_conf.back_radio.mem_only_psk; bh_enable->backhaul_preferred_radio_band() = - platform_settings.backhaul_preferred_radio_band; + db->device_conf.back_radio.backhaul_preferred_radio_band; string_utils::copy_string(bh_enable->wire_iface(message::IFACE_NAME_LENGTH), db->ethernet.iface_name.c_str(), message::IFACE_NAME_LENGTH); From 6af1e0bb7edf7dc2c642a1259631f61e67fff533 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 11:17:24 +0000 Subject: [PATCH 07/24] agent: Move operating_mode configuration to AgentDB Move "operating_mode" configuration of from "sPlatformSettings" struct to the AgentDB. Replace the use of "operating_mode" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../beerocks/slave/platform_manager/platform_manager_thread.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index fc486117a8..042f9fb168 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -98,6 +98,7 @@ class AgentDB { bool local_gw; bool local_controller; + uint8_t operating_mode; } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 083f7c32c9..033390ad08 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -203,7 +203,7 @@ static bool fill_platform_settings( 0; // TODO add platform DB flag msg->platform_settings().client_11k_roaming_enabled = uint8_t(platform_common_conf.client_roaming || platform_common_conf.band_steering); - msg->platform_settings().operating_mode = uint8_t(platform_common_conf.operating_mode); + db->device_conf.operating_mode = uint8_t(platform_common_conf.operating_mode); msg->platform_settings().management_mode = uint8_t(platform_common_conf.management_mode); msg->platform_settings().certification_mode = uint8_t(platform_common_conf.certification_mode); msg->platform_settings().stop_on_failure_attempts = From e59af3a5bc35bc0ce599f332c719f7f134c4ec50 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 11:48:02 +0000 Subject: [PATCH 08/24] agent: Move management_mode configuration to AgentDB Move "management_mode" configuration of from "sPlatformSettings" struct to the AgentDB. Replace the use of "management_mode" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../slave/platform_manager/platform_manager_thread.cpp | 2 +- agent/src/beerocks/slave/son_slave_thread.cpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 042f9fb168..5216d10555 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -99,6 +99,7 @@ class AgentDB { bool local_gw; bool local_controller; uint8_t operating_mode; + uint8_t management_mode; } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 033390ad08..04ddda5a3e 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -204,7 +204,7 @@ static bool fill_platform_settings( msg->platform_settings().client_11k_roaming_enabled = uint8_t(platform_common_conf.client_roaming || platform_common_conf.band_steering); db->device_conf.operating_mode = uint8_t(platform_common_conf.operating_mode); - msg->platform_settings().management_mode = uint8_t(platform_common_conf.management_mode); + db->device_conf.management_mode = uint8_t(platform_common_conf.management_mode); msg->platform_settings().certification_mode = uint8_t(platform_common_conf.certification_mode); msg->platform_settings().stop_on_failure_attempts = uint8_t(platform_common_conf.stop_on_failure_attempts); diff --git a/agent/src/beerocks/slave/son_slave_thread.cpp b/agent/src/beerocks/slave/son_slave_thread.cpp index 01e74b3fb6..e602a4b2c0 100644 --- a/agent/src/beerocks/slave/son_slave_thread.cpp +++ b/agent/src/beerocks/slave/son_slave_thread.cpp @@ -3950,7 +3950,7 @@ bool slave_thread::handle_autoconfiguration_wsc(Socket *sd, ieee1905_1::CmduMess // All EasyMesh VAPs will be stored in the platform DB. // All other VAPs are manual, AKA should not be modified by prplMesh //////////////////////////////////////////////////////////////////// - if (platform_settings.management_mode != BPL_MGMT_MODE_NOT_MULTIAP) { + if (db->device_conf.management_mode != BPL_MGMT_MODE_NOT_MULTIAP) { message_com::send_cmdu(ap_manager_socket, cmdu_tx); } else { LOG(WARNING) << "non-EasyMesh mode - skip updating VAP credentials"; @@ -4713,7 +4713,7 @@ bool slave_thread::handle_channel_selection_request(Socket *sd, ieee1905_1::Cmdu // and in this case don't switch channel // //////////////////////////////////////////////////////////////////// - if (platform_settings.management_mode != BPL_MGMT_MODE_NOT_MULTIAP) { + if (db->device_conf.management_mode != BPL_MGMT_MODE_NOT_MULTIAP) { message_com::send_cmdu(ap_manager_socket, cmdu_tx); } else { LOG(WARNING) << "non-EasyMesh mode - skip channel switch"; From 84178c694cbf08e9f2dbd41f7538cf9db0180c9a Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 11:54:54 +0000 Subject: [PATCH 09/24] agent: Move certification_mode configuration to AgentDB Move "certification_mode" configuration of from "sPlatformSettings" struct to the AgentDB. Replace the use of "certification_mode" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../slave/platform_manager/platform_manager_thread.cpp | 6 +++--- agent/src/beerocks/slave/son_slave_thread.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 5216d10555..d38380cbef 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -100,6 +100,7 @@ class AgentDB { bool local_controller; uint8_t operating_mode; uint8_t management_mode; + uint8_t certification_mode; } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 04ddda5a3e..64edad82bb 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -203,9 +203,9 @@ static bool fill_platform_settings( 0; // TODO add platform DB flag msg->platform_settings().client_11k_roaming_enabled = uint8_t(platform_common_conf.client_roaming || platform_common_conf.band_steering); - db->device_conf.operating_mode = uint8_t(platform_common_conf.operating_mode); - db->device_conf.management_mode = uint8_t(platform_common_conf.management_mode); - msg->platform_settings().certification_mode = uint8_t(platform_common_conf.certification_mode); + db->device_conf.operating_mode = uint8_t(platform_common_conf.operating_mode); + db->device_conf.management_mode = uint8_t(platform_common_conf.management_mode); + db->device_conf.certification_mode = uint8_t(platform_common_conf.certification_mode); msg->platform_settings().stop_on_failure_attempts = uint8_t(platform_common_conf.stop_on_failure_attempts); db->device_conf.back_radio.backhaul_max_vaps = uint8_t(platform_common_conf.backhaul_max_vaps); diff --git a/agent/src/beerocks/slave/son_slave_thread.cpp b/agent/src/beerocks/slave/son_slave_thread.cpp index e602a4b2c0..4fd8c8cba7 100644 --- a/agent/src/beerocks/slave/son_slave_thread.cpp +++ b/agent/src/beerocks/slave/son_slave_thread.cpp @@ -2979,7 +2979,7 @@ bool slave_thread::slave_fsm(bool &call_slave_select) request->sta_iface_filter_low() = config.backhaul_wireless_iface_filter_low; request->onboarding() = platform_settings.onboarding; - request->certification_mode() = platform_settings.certification_mode; + request->certification_mode() = db->device_conf.certification_mode; LOG(INFO) << "ACTION_BACKHAUL_REGISTER_REQUEST " << " hostap_iface=" << request->hostap_iface(message::IFACE_NAME_LENGTH) From 8d7e39498009421d01c66bab3d01e5366ad56b0f Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 12:02:31 +0000 Subject: [PATCH 10/24] agent: Move stop_on_failure_attempts configuration to AgentDB Move "stop_on_failure_attempts" configuration from "sPlatformSettings" struct to the AgentDB. Replace the use of "stop_on_failure_attempts" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../slave/platform_manager/platform_manager_thread.cpp | 2 +- agent/src/beerocks/slave/son_slave_thread.cpp | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index d38380cbef..38169e0f9e 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -101,6 +101,7 @@ class AgentDB { uint8_t operating_mode; uint8_t management_mode; uint8_t certification_mode; + uint8_t stop_on_failure_attempts; } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 64edad82bb..fa53fdc8b9 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -206,7 +206,7 @@ static bool fill_platform_settings( db->device_conf.operating_mode = uint8_t(platform_common_conf.operating_mode); db->device_conf.management_mode = uint8_t(platform_common_conf.management_mode); db->device_conf.certification_mode = uint8_t(platform_common_conf.certification_mode); - msg->platform_settings().stop_on_failure_attempts = + db->device_conf.stop_on_failure_attempts = uint8_t(platform_common_conf.stop_on_failure_attempts); db->device_conf.back_radio.backhaul_max_vaps = uint8_t(platform_common_conf.backhaul_max_vaps); db->device_conf.back_radio.backhaul_network_enabled = diff --git a/agent/src/beerocks/slave/son_slave_thread.cpp b/agent/src/beerocks/slave/son_slave_thread.cpp index 4fd8c8cba7..e9f7d0a512 100644 --- a/agent/src/beerocks/slave/son_slave_thread.cpp +++ b/agent/src/beerocks/slave/son_slave_thread.cpp @@ -1336,9 +1336,8 @@ bool slave_thread::handle_cmdu_platform_manager_message( db->ethernet.mac = network_utils::ZERO_MAC; } - configuration_stop_on_failure_attempts = - response->platform_settings().stop_on_failure_attempts; - stop_on_failure_attempts = configuration_stop_on_failure_attempts; + configuration_stop_on_failure_attempts = db->device_conf.stop_on_failure_attempts; + stop_on_failure_attempts = configuration_stop_on_failure_attempts; LOG(TRACE) << "goto STATE_CONNECT_TO_BACKHAUL_MANAGER"; slave_state = STATE_CONNECT_TO_BACKHAUL_MANAGER; From b13191f95aba8b817bdd5a4b07a573938fbe645b Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 12:36:27 +0000 Subject: [PATCH 11/24] agent: Move client_band_steering_enabled configuration to AgentDB Move "client_band_steering_enabled" configuration from "sPlatformSettings" struct to the AgentDB. Replace the use of "client_band_steering_enabled" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 2 ++ .../slave/platform_manager/platform_manager_thread.cpp | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 38169e0f9e..e5e87be0fa 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -102,6 +102,8 @@ class AgentDB { uint8_t management_mode; uint8_t certification_mode; uint8_t stop_on_failure_attempts; + + uint8_t client_band_steering_enabled; } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index fa53fdc8b9..8e63f6e336 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -195,8 +195,7 @@ static bool fill_platform_settings( msg->platform_settings().dfs_reentry_enabled = uint8_t(platform_common_conf.dfs_reentry); msg->platform_settings().rdkb_extensions_enabled = uint8_t(platform_common_conf.rdkb_extensions); - msg->platform_settings().client_band_steering_enabled = - uint8_t(platform_common_conf.band_steering); + db->device_conf.client_band_steering_enabled = uint8_t(platform_common_conf.band_steering); msg->platform_settings().client_optimal_path_roaming_enabled = uint8_t(platform_common_conf.client_roaming); msg->platform_settings().client_optimal_path_roaming_prefer_signal_strength_enabled = @@ -220,7 +219,7 @@ static bool fill_platform_settings( LOG(DEBUG) << "iface " << iface_name << " settings:"; LOG(DEBUG) << "onboarding: " << (unsigned)msg->platform_settings().onboarding; LOG(DEBUG) << "client_band_steering_enabled: " - << (unsigned)msg->platform_settings().client_band_steering_enabled; + << (unsigned)db->device_conf.client_band_steering_enabled; LOG(DEBUG) << "client_optimal_path_roaming_enabled: " << (unsigned)msg->platform_settings().client_optimal_path_roaming_enabled; LOG(DEBUG) << "client_optimal_path_roaming_prefer_signal_strength_enabled: " From d6d17b43a23e1e38c3be3562d8aa36e02b083c41 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 14:12:55 +0000 Subject: [PATCH 12/24] agent: Move client_optimal_path_roaming_enabled configuration to AgentDB Move "client_optimal_path_roaming_enabled" configuration from "sPlatformSettings" struct to the AgentDB. Replace the use of "client_optimal_path_roaming_enabled" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../slave/platform_manager/platform_manager_thread.cpp | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index e5e87be0fa..0b8467d710 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -104,6 +104,7 @@ class AgentDB { uint8_t stop_on_failure_attempts; uint8_t client_band_steering_enabled; + uint8_t client_optimal_path_roaming_enabled; } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 8e63f6e336..7227d77e47 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -196,8 +196,7 @@ static bool fill_platform_settings( msg->platform_settings().rdkb_extensions_enabled = uint8_t(platform_common_conf.rdkb_extensions); db->device_conf.client_band_steering_enabled = uint8_t(platform_common_conf.band_steering); - msg->platform_settings().client_optimal_path_roaming_enabled = - uint8_t(platform_common_conf.client_roaming); + db->device_conf.client_optimal_path_roaming_enabled = uint8_t(platform_common_conf.client_roaming); msg->platform_settings().client_optimal_path_roaming_prefer_signal_strength_enabled = 0; // TODO add platform DB flag msg->platform_settings().client_11k_roaming_enabled = @@ -221,7 +220,7 @@ static bool fill_platform_settings( LOG(DEBUG) << "client_band_steering_enabled: " << (unsigned)db->device_conf.client_band_steering_enabled; LOG(DEBUG) << "client_optimal_path_roaming_enabled: " - << (unsigned)msg->platform_settings().client_optimal_path_roaming_enabled; + << (unsigned)db->device_conf.client_optimal_path_roaming_enabled; LOG(DEBUG) << "client_optimal_path_roaming_prefer_signal_strength_enabled: " << (unsigned)msg->platform_settings() .client_optimal_path_roaming_prefer_signal_strength_enabled; From f166c0a5017b3a8d8f6d7c1379fde9d98aa2ba08 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 14:23:45 +0000 Subject: [PATCH 13/24] agent: Move dfs_reentry_enabled configuration to AgentDB Move "dfs_reentry_enabled" configuration from "sPlatformSettings" struct to the AgentDB. Replace the use of "dfs_reentry_enabled" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../slave/platform_manager/platform_manager_thread.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 0b8467d710..70c651372a 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -105,6 +105,7 @@ class AgentDB { uint8_t client_band_steering_enabled; uint8_t client_optimal_path_roaming_enabled; + uint8_t dfs_reentry_enabled; } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 7227d77e47..76f33b1831 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -192,7 +192,7 @@ static bool fill_platform_settings( platform_common_conf.operating_mode == BPL_OPER_MODE_GATEWAY_WISP); msg->platform_settings().onboarding = uint8_t(platform_common_conf.onboarding); - msg->platform_settings().dfs_reentry_enabled = uint8_t(platform_common_conf.dfs_reentry); + db->device_conf.dfs_reentry_enabled = uint8_t(platform_common_conf.dfs_reentry); msg->platform_settings().rdkb_extensions_enabled = uint8_t(platform_common_conf.rdkb_extensions); db->device_conf.client_band_steering_enabled = uint8_t(platform_common_conf.band_steering); @@ -227,7 +227,7 @@ static bool fill_platform_settings( LOG(DEBUG) << "band_enabled: " << (unsigned)msg->wlan_settings().band_enabled; LOG(DEBUG) << "local_gw: " << db->device_conf.local_gw; LOG(DEBUG) << "local_controller: " << db->device_conf.local_controller; - LOG(DEBUG) << "dfs_reentry_enabled: " << (unsigned)msg->platform_settings().dfs_reentry_enabled; + LOG(DEBUG) << "dfs_reentry_enabled: " << (unsigned)db->device_conf.dfs_reentry_enabled; LOG(DEBUG) << "backhaul_preferred_radio_band: " << (unsigned)db->device_conf.back_radio.backhaul_preferred_radio_band; LOG(DEBUG) << "rdkb_extensions: " << (unsigned)msg->platform_settings().rdkb_extensions_enabled; From ced7c3de3633a2c2fe938d8dbed4fa980fc50606 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 14:29:01 +0000 Subject: [PATCH 14/24] agent: Move client_optimal_path_prefer_signal_strength to AgentDB Move "client_optimal_path_roaming_prefer_signal_strength_enabled" configuration from "sPlatformSettings" struct to the AgentDB. Replace the use of "client_optimal_path_roaming_prefer_signal_strength_enabled" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../platform_manager/platform_manager_thread.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 70c651372a..223669b1e4 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -106,6 +106,7 @@ class AgentDB { uint8_t client_band_steering_enabled; uint8_t client_optimal_path_roaming_enabled; uint8_t dfs_reentry_enabled; + uint8_t client_optimal_path_roaming_prefer_signal_strength_enabled; } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 76f33b1831..c15a21a2e0 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -191,13 +191,14 @@ static bool fill_platform_settings( db->device_conf.local_gw = (platform_common_conf.operating_mode == BPL_OPER_MODE_GATEWAY || platform_common_conf.operating_mode == BPL_OPER_MODE_GATEWAY_WISP); - msg->platform_settings().onboarding = uint8_t(platform_common_conf.onboarding); + msg->platform_settings().onboarding = uint8_t(platform_common_conf.onboarding); db->device_conf.dfs_reentry_enabled = uint8_t(platform_common_conf.dfs_reentry); msg->platform_settings().rdkb_extensions_enabled = uint8_t(platform_common_conf.rdkb_extensions); db->device_conf.client_band_steering_enabled = uint8_t(platform_common_conf.band_steering); - db->device_conf.client_optimal_path_roaming_enabled = uint8_t(platform_common_conf.client_roaming); - msg->platform_settings().client_optimal_path_roaming_prefer_signal_strength_enabled = + db->device_conf.client_optimal_path_roaming_enabled = + uint8_t(platform_common_conf.client_roaming); + db->device_conf.client_optimal_path_roaming_prefer_signal_strength_enabled = 0; // TODO add platform DB flag msg->platform_settings().client_11k_roaming_enabled = uint8_t(platform_common_conf.client_roaming || platform_common_conf.band_steering); @@ -222,8 +223,8 @@ static bool fill_platform_settings( LOG(DEBUG) << "client_optimal_path_roaming_enabled: " << (unsigned)db->device_conf.client_optimal_path_roaming_enabled; LOG(DEBUG) << "client_optimal_path_roaming_prefer_signal_strength_enabled: " - << (unsigned)msg->platform_settings() - .client_optimal_path_roaming_prefer_signal_strength_enabled; + << (unsigned) + db->device_conf.client_optimal_path_roaming_prefer_signal_strength_enabled; LOG(DEBUG) << "band_enabled: " << (unsigned)msg->wlan_settings().band_enabled; LOG(DEBUG) << "local_gw: " << db->device_conf.local_gw; LOG(DEBUG) << "local_controller: " << db->device_conf.local_controller; From 1c890a37e81bc6c60c670668f3574e971af6de76 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 15:05:59 +0000 Subject: [PATCH 15/24] agent: Move client_11k_roaming_enabled configuration to AgentDB Move "client_11k_roaming_enabled" configuration from "sPlatformSettings" struct to the AgentDB. Replace the use of "client_11k_roaming_enabled" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../beerocks/slave/platform_manager/platform_manager_thread.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 223669b1e4..8d374f6ab4 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -107,6 +107,7 @@ class AgentDB { uint8_t client_optimal_path_roaming_enabled; uint8_t dfs_reentry_enabled; uint8_t client_optimal_path_roaming_prefer_signal_strength_enabled; + uint8_t client_11k_roaming_enabled; } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index c15a21a2e0..2248701c69 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -200,7 +200,7 @@ static bool fill_platform_settings( uint8_t(platform_common_conf.client_roaming); db->device_conf.client_optimal_path_roaming_prefer_signal_strength_enabled = 0; // TODO add platform DB flag - msg->platform_settings().client_11k_roaming_enabled = + db->device_conf.client_11k_roaming_enabled = uint8_t(platform_common_conf.client_roaming || platform_common_conf.band_steering); db->device_conf.operating_mode = uint8_t(platform_common_conf.operating_mode); db->device_conf.management_mode = uint8_t(platform_common_conf.management_mode); From d672a81a52208c2a2c3fa3754d951fbd57e56594 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 15:10:25 +0000 Subject: [PATCH 16/24] agent: Move load_balancing_enabled configuration to AgentDB Move "load_balancing_enabled" configuration from "sPlatformSettings" struct to the AgentDB. Replace the use of "load_balancing_enabled" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../beerocks/slave/platform_manager/platform_manager_thread.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 8d374f6ab4..1ee95a9332 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -108,6 +108,7 @@ class AgentDB { uint8_t dfs_reentry_enabled; uint8_t client_optimal_path_roaming_prefer_signal_strength_enabled; uint8_t client_11k_roaming_enabled; + uint8_t load_balancing_enabled; } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 2248701c69..775ec2169a 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -213,7 +213,7 @@ static bool fill_platform_settings( db->device_conf.back_radio.backhaul_preferred_radio_band = uint8_t(bpl_band_to_freq_type(platform_common_conf.backhaul_preferred_radio_band)); - msg->platform_settings().load_balancing_enabled = 0; // for v1.3 TODO read from CAL DB + db->device_conf.load_balancing_enabled = 0; // for v1.3 TODO read from CAL DB msg->platform_settings().service_fairness_enabled = 0; // for v1.3 TODO read from CAL DB LOG(DEBUG) << "iface " << iface_name << " settings:"; From 9565fce787c7ebfe88a8b4e94db88182fe4533b6 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 15:19:25 +0000 Subject: [PATCH 17/24] agent: Move service_fairness_enabled configuration to AgentDB Move "service_fairness_enabled" configuration from "sPlatformSettings" struct to the AgentDB. Replace the use of "service_fairness_enabled" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 1 + .../slave/platform_manager/platform_manager_thread.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 1ee95a9332..74ad006856 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -109,6 +109,7 @@ class AgentDB { uint8_t client_optimal_path_roaming_prefer_signal_strength_enabled; uint8_t client_11k_roaming_enabled; uint8_t load_balancing_enabled; + uint8_t service_fairness_enabled; } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 775ec2169a..4e0d13f4bd 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -213,8 +213,8 @@ static bool fill_platform_settings( db->device_conf.back_radio.backhaul_preferred_radio_band = uint8_t(bpl_band_to_freq_type(platform_common_conf.backhaul_preferred_radio_band)); - db->device_conf.load_balancing_enabled = 0; // for v1.3 TODO read from CAL DB - msg->platform_settings().service_fairness_enabled = 0; // for v1.3 TODO read from CAL DB + db->device_conf.load_balancing_enabled = 0; // for v1.3 TODO read from CAL DB + db->device_conf.service_fairness_enabled = 0; // for v1.3 TODO read from CAL DB LOG(DEBUG) << "iface " << iface_name << " settings:"; LOG(DEBUG) << "onboarding: " << (unsigned)msg->platform_settings().onboarding; From b9541a9fab08e20f0071ac355cce605caec1998f Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Thu, 6 Aug 2020 15:29:08 +0000 Subject: [PATCH 18/24] agent: Move rdkb_extensions_enabled configuration to AgentDB Move "rdkb_extensions_enabled" configuration of back radio from "sPlatformSettings" struct to the AgentDB. Replace the use of "rdkb_extensions_enabled" settings on the Agent thread to the one on the AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 2 +- .../slave/platform_manager/platform_manager_thread.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 74ad006856..82a4206ac6 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -102,7 +102,6 @@ class AgentDB { uint8_t management_mode; uint8_t certification_mode; uint8_t stop_on_failure_attempts; - uint8_t client_band_steering_enabled; uint8_t client_optimal_path_roaming_enabled; uint8_t dfs_reentry_enabled; @@ -110,6 +109,7 @@ class AgentDB { uint8_t client_11k_roaming_enabled; uint8_t load_balancing_enabled; uint8_t service_fairness_enabled; + uint8_t rdkb_extensions_enabled; } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 4e0d13f4bd..125b520697 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -191,10 +191,9 @@ static bool fill_platform_settings( db->device_conf.local_gw = (platform_common_conf.operating_mode == BPL_OPER_MODE_GATEWAY || platform_common_conf.operating_mode == BPL_OPER_MODE_GATEWAY_WISP); - msg->platform_settings().onboarding = uint8_t(platform_common_conf.onboarding); - db->device_conf.dfs_reentry_enabled = uint8_t(platform_common_conf.dfs_reentry); - msg->platform_settings().rdkb_extensions_enabled = - uint8_t(platform_common_conf.rdkb_extensions); + msg->platform_settings().onboarding = uint8_t(platform_common_conf.onboarding); + db->device_conf.dfs_reentry_enabled = uint8_t(platform_common_conf.dfs_reentry); + db->device_conf.rdkb_extensions_enabled = uint8_t(platform_common_conf.rdkb_extensions); db->device_conf.client_band_steering_enabled = uint8_t(platform_common_conf.band_steering); db->device_conf.client_optimal_path_roaming_enabled = uint8_t(platform_common_conf.client_roaming); @@ -231,7 +230,7 @@ static bool fill_platform_settings( LOG(DEBUG) << "dfs_reentry_enabled: " << (unsigned)db->device_conf.dfs_reentry_enabled; LOG(DEBUG) << "backhaul_preferred_radio_band: " << (unsigned)db->device_conf.back_radio.backhaul_preferred_radio_band; - LOG(DEBUG) << "rdkb_extensions: " << (unsigned)msg->platform_settings().rdkb_extensions_enabled; + LOG(DEBUG) << "rdkb_extensions: " << (unsigned)db->device_conf.rdkb_extensions_enabled; return true; } From 5477bb5a1a97a46d82f8d6778e11888881445463 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Mon, 10 Aug 2020 14:32:46 +0000 Subject: [PATCH 19/24] agent: remove unused onboarding configuration Remove unused "onboarding" configuration from "sPlatformSettings" struct. Replace the use of "onboarding" with false value. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- .../slave/platform_manager/platform_manager_thread.cpp | 3 +-- agent/src/beerocks/slave/son_slave_thread.cpp | 10 +++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 125b520697..2cd9bd04f7 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -191,7 +191,6 @@ static bool fill_platform_settings( db->device_conf.local_gw = (platform_common_conf.operating_mode == BPL_OPER_MODE_GATEWAY || platform_common_conf.operating_mode == BPL_OPER_MODE_GATEWAY_WISP); - msg->platform_settings().onboarding = uint8_t(platform_common_conf.onboarding); db->device_conf.dfs_reentry_enabled = uint8_t(platform_common_conf.dfs_reentry); db->device_conf.rdkb_extensions_enabled = uint8_t(platform_common_conf.rdkb_extensions); db->device_conf.client_band_steering_enabled = uint8_t(platform_common_conf.band_steering); @@ -216,7 +215,7 @@ static bool fill_platform_settings( db->device_conf.service_fairness_enabled = 0; // for v1.3 TODO read from CAL DB LOG(DEBUG) << "iface " << iface_name << " settings:"; - LOG(DEBUG) << "onboarding: " << (unsigned)msg->platform_settings().onboarding; + LOG(DEBUG) << "onboarding: " << (unsigned)0; LOG(DEBUG) << "client_band_steering_enabled: " << (unsigned)db->device_conf.client_band_steering_enabled; LOG(DEBUG) << "client_optimal_path_roaming_enabled: " diff --git a/agent/src/beerocks/slave/son_slave_thread.cpp b/agent/src/beerocks/slave/son_slave_thread.cpp index e9f7d0a512..da4438ad06 100644 --- a/agent/src/beerocks/slave/son_slave_thread.cpp +++ b/agent/src/beerocks/slave/son_slave_thread.cpp @@ -2977,7 +2977,7 @@ bool slave_thread::slave_fsm(bool &call_slave_select) config.hostap_iface.c_str(), message::IFACE_NAME_LENGTH); request->sta_iface_filter_low() = config.backhaul_wireless_iface_filter_low; - request->onboarding() = platform_settings.onboarding; + request->onboarding() = 0; request->certification_mode() = db->device_conf.certification_mode; LOG(INFO) << "ACTION_BACKHAUL_REGISTER_REQUEST " @@ -3006,12 +3006,8 @@ bool slave_thread::slave_fsm(bool &call_slave_select) case STATE_JOIN_INIT: { auto db = AgentDB::get(); - LOG(DEBUG) << "onboarding: " << int(platform_settings.onboarding); - if (platform_settings.onboarding) { - LOG(TRACE) << "goto STATE_ONBOARDING"; - slave_state = STATE_ONBOARDING; - break; - } else if (!wlan_settings.band_enabled) { + LOG(DEBUG) << "onboarding: " << int(0); + if (!wlan_settings.band_enabled) { LOG(DEBUG) << "wlan_settings.band_enabled=false"; LOG(TRACE) << "goto STATE_BACKHAUL_ENABLE"; slave_state = STATE_BACKHAUL_ENABLE; From e3efdfb9ac6b28f3e49e9acc2d0e8caacdcb04cd Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Sun, 9 Aug 2020 15:31:36 +0000 Subject: [PATCH 20/24] tlvf: beerocks_message::sPlatformSettings remove unused settings Remove of unused fields from sPlatformSettings struct. Those fields have been moved to the Agent_DB and there for no longer needed as part of a beerocks massage. PPM-338 Signed-off-by: Oren Vormaser --- .../beerocks/tlvf/beerocks_message_common.h | 16 ---------- .../tlvf/beerocks_message_common.yaml | 30 ------------------- 2 files changed, 46 deletions(-) diff --git a/common/beerocks/tlvf/AutoGenerated/include/beerocks/tlvf/beerocks_message_common.h b/common/beerocks/tlvf/AutoGenerated/include/beerocks/tlvf/beerocks_message_common.h index 2160ef81af..381180bbb6 100644 --- a/common/beerocks/tlvf/AutoGenerated/include/beerocks/tlvf/beerocks_message_common.h +++ b/common/beerocks/tlvf/AutoGenerated/include/beerocks/tlvf/beerocks_message_common.h @@ -72,20 +72,7 @@ typedef struct sSonConfig { } __attribute__((packed)) sSonConfig; typedef struct sPlatformSettings { - char front_ssid[beerocks::message::WIFI_SSID_MAX_LENGTH]; - char front_pass[beerocks::message::WIFI_PASS_MAX_LENGTH]; - char front_security_type[beerocks::message::WIFI_SECURITY_TYPE_MAX_LENGTH]; - char back_ssid[beerocks::message::WIFI_SSID_MAX_LENGTH]; - char back_pass[beerocks::message::WIFI_PASS_MAX_LENGTH]; - char back_security_type[beerocks::message::WIFI_SECURITY_TYPE_MAX_LENGTH]; - uint8_t onboarding; uint8_t local_master; - uint8_t local_gw; - uint8_t operating_mode; - uint8_t management_mode; - uint8_t mem_only_psk; - uint8_t certification_mode; - uint8_t stop_on_failure_attempts; uint8_t client_band_steering_enabled; uint8_t client_optimal_path_roaming_enabled; uint8_t dfs_reentry_enabled; @@ -94,9 +81,6 @@ typedef struct sPlatformSettings { uint8_t load_balancing_enabled; uint8_t service_fairness_enabled; uint8_t rdkb_extensions_enabled; - uint8_t backhaul_max_vaps; - uint8_t backhaul_network_enabled; - uint8_t backhaul_preferred_radio_band; void struct_swap(){ } void struct_init(){ diff --git a/common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_common.yaml b/common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_common.yaml index 271d506d3b..82bf79e862 100755 --- a/common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_common.yaml +++ b/common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_common.yaml @@ -50,33 +50,7 @@ sSonConfig: sPlatformSettings: _type: struct - front_ssid: - _type: char - _length: ["beerocks::message::WIFI_SSID_MAX_LENGTH"] - front_pass: - _type: char - _length: ["beerocks::message::WIFI_PASS_MAX_LENGTH"] - front_security_type: - _type: char - _length: ["beerocks::message::WIFI_SECURITY_TYPE_MAX_LENGTH"] - back_ssid: - _type: char - _length: ["beerocks::message::WIFI_SSID_MAX_LENGTH"] - back_pass: - _type: char - _length: ["beerocks::message::WIFI_PASS_MAX_LENGTH"] - back_security_type: - _type: char - _length: ["beerocks::message::WIFI_SECURITY_TYPE_MAX_LENGTH"] - onboarding: uint8_t local_master: uint8_t - local_gw: uint8_t - operating_mode: uint8_t - management_mode: uint8_t - mem_only_psk: uint8_t - - certification_mode: uint8_t - stop_on_failure_attempts: uint8_t client_band_steering_enabled: uint8_t client_optimal_path_roaming_enabled: uint8_t @@ -89,10 +63,6 @@ sPlatformSettings: rdkb_extensions_enabled: uint8_t - backhaul_max_vaps: uint8_t - backhaul_network_enabled: uint8_t - backhaul_preferred_radio_band: uint8_t - sWlanSettings: _type: struct band_enabled: From c666a1167ffe6e247202a32dde580f839f298936 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Tue, 11 Aug 2020 11:51:38 +0000 Subject: [PATCH 21/24] agent: Remove "platform_settings" local variable from son_slave_thread Remove "platform_settings" local variable from son_slave_thread. Replace the use of "platform_settings" to the settings in AgentDB. Removing of the config from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/son_slave_thread.cpp | 22 ++++++++++++++++--- agent/src/beerocks/slave/son_slave_thread.h | 3 +-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/agent/src/beerocks/slave/son_slave_thread.cpp b/agent/src/beerocks/slave/son_slave_thread.cpp index da4438ad06..64d5ee977f 100644 --- a/agent/src/beerocks/slave/son_slave_thread.cpp +++ b/agent/src/beerocks/slave/son_slave_thread.cpp @@ -1320,8 +1320,7 @@ bool slave_thread::handle_cmdu_platform_manager_message( return true; } - platform_settings = response->platform_settings(); - wlan_settings = response->wlan_settings(); + wlan_settings = response->wlan_settings(); auto db = AgentDB::get(); @@ -3364,7 +3363,24 @@ bool slave_thread::slave_fsm(bool &call_slave_select) } //Platform Settings - notification->platform_settings() = platform_settings; + notification->platform_settings().client_band_steering_enabled = + db->device_conf.client_band_steering_enabled; + notification->platform_settings().client_optimal_path_roaming_enabled = + db->device_conf.client_optimal_path_roaming_enabled; + notification->platform_settings().dfs_reentry_enabled = + db->device_conf.dfs_reentry_enabled; + notification->platform_settings() + .client_optimal_path_roaming_prefer_signal_strength_enabled = + db->device_conf.client_optimal_path_roaming_prefer_signal_strength_enabled; + notification->platform_settings().client_11k_roaming_enabled = + db->device_conf.client_11k_roaming_enabled; + notification->platform_settings().load_balancing_enabled = + db->device_conf.load_balancing_enabled; + notification->platform_settings().service_fairness_enabled = + db->device_conf.service_fairness_enabled; + notification->platform_settings().rdkb_extensions_enabled = + db->device_conf.rdkb_extensions_enabled; + notification->platform_settings().local_master = db->device_conf.local_controller; //Wlan Settings diff --git a/agent/src/beerocks/slave/son_slave_thread.h b/agent/src/beerocks/slave/son_slave_thread.h index 8ac74efda6..0679a3b0cc 100644 --- a/agent/src/beerocks/slave/son_slave_thread.h +++ b/agent/src/beerocks/slave/son_slave_thread.h @@ -160,8 +160,7 @@ class slave_thread : public beerocks::socket_thread { std::string backhaul_manager_uds; std::string platform_manager_uds; sSlaveConfig config; - beerocks_message::sPlatformSettings platform_settings; // from platform manager // - beerocks_message::sWlanSettings wlan_settings; // from platform manager // + beerocks_message::sWlanSettings wlan_settings; // from platform manager // beerocks_message::sSonConfig son_config; beerocks::logging &logger; std::string master_version; From 2831a7de0ee2ef6c223d9fc7261d4edc90c680c8 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Tue, 11 Aug 2020 15:23:47 +0000 Subject: [PATCH 22/24] agent: Move wlan_settings configuration to AgentDB Move "wlan_settings" configuration from son_slave_thread local variable to the AgentDB. Currently son_slave receive "wlan_settings" from platform_manager using "PLATFORM_SON_SLAVE_REGISTER_REQUEST/RESPONSE" messages, and save the settings in a local variable. This transfer will be replaced by the use of agent_db to pass and store "wlan_settings". Removing of "sWlanSettings" from the tlvf will take place on future commit. PPM-338 Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/agent_db.h | 6 ++++++ .../platform_manager_thread.cpp | 17 ++++++++--------- agent/src/beerocks/slave/son_slave_thread.cpp | 18 +++++++++++------- agent/src/beerocks/slave/son_slave_thread.h | 1 - 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/agent/src/beerocks/slave/agent_db.h b/agent/src/beerocks/slave/agent_db.h index 82a4206ac6..897fbe7533 100644 --- a/agent/src/beerocks/slave/agent_db.h +++ b/agent/src/beerocks/slave/agent_db.h @@ -110,6 +110,12 @@ class AgentDB { uint8_t load_balancing_enabled; uint8_t service_fairness_enabled; uint8_t rdkb_extensions_enabled; + + struct sWlanSettings { + uint8_t band_enabled; + uint8_t channel; + } wlan_settings; + } device_conf; /** diff --git a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp index 2cd9bd04f7..fe8f003791 100644 --- a/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp +++ b/agent/src/beerocks/slave/platform_manager/platform_manager_thread.cpp @@ -57,9 +57,7 @@ static beerocks::eFreqType bpl_band_to_freq_type(int bpl_band) } static bool fill_platform_settings( - std::string iface_name, - std::shared_ptr msg, - main_thread::platform_common_conf_t &platform_common_conf, + std::string iface_name, main_thread::platform_common_conf_t &platform_common_conf, std::unordered_map> &iface_wlan_params_map, Socket *sd) @@ -103,12 +101,13 @@ static bool fill_platform_settings( return false; } /* update message */ - msg->wlan_settings().band_enabled = params.enabled; - msg->wlan_settings().channel = params.channel; + db->device_conf.wlan_settings.band_enabled = params.enabled; + db->device_conf.wlan_settings.channel = params.channel; LOG(DEBUG) << "wlan settings:" - << " band_enabled=" << string_utils::bool_str(msg->wlan_settings().band_enabled) - << " channel=" << int(msg->wlan_settings().channel); + << " band_enabled=" + << string_utils::bool_str(db->device_conf.wlan_settings.band_enabled) + << " channel=" << int(db->device_conf.wlan_settings.channel); // initialize wlan params cache //erase interface cache from map if exists @@ -223,7 +222,7 @@ static bool fill_platform_settings( LOG(DEBUG) << "client_optimal_path_roaming_prefer_signal_strength_enabled: " << (unsigned) db->device_conf.client_optimal_path_roaming_prefer_signal_strength_enabled; - LOG(DEBUG) << "band_enabled: " << (unsigned)msg->wlan_settings().band_enabled; + LOG(DEBUG) << "band_enabled: " << (unsigned)db->device_conf.wlan_settings.band_enabled; LOG(DEBUG) << "local_gw: " << db->device_conf.local_gw; LOG(DEBUG) << "local_controller: " << db->device_conf.local_controller; LOG(DEBUG) << "dfs_reentry_enabled: " << (unsigned)db->device_conf.dfs_reentry_enabled; @@ -649,7 +648,7 @@ bool main_thread::handle_cmdu(Socket *sd, ieee1905_1::CmduMessageRx &cmdu_rx) do { LOG(TRACE) << "Trying to read settings of iface:" << strIfaceName << ", attempt=" << int(retry_cnt); - if (fill_platform_settings(strIfaceName, register_response, platform_common_conf, + if (fill_platform_settings(strIfaceName, platform_common_conf, bpl_iface_wlan_params_map, sd)) { register_response->valid() = 1; } else { diff --git a/agent/src/beerocks/slave/son_slave_thread.cpp b/agent/src/beerocks/slave/son_slave_thread.cpp index 64d5ee977f..1da43c0325 100644 --- a/agent/src/beerocks/slave/son_slave_thread.cpp +++ b/agent/src/beerocks/slave/son_slave_thread.cpp @@ -1320,8 +1320,6 @@ bool slave_thread::handle_cmdu_platform_manager_message( return true; } - wlan_settings = response->wlan_settings(); - auto db = AgentDB::get(); /** @@ -1380,7 +1378,9 @@ bool slave_thread::handle_cmdu_platform_manager_message( } // slave only reacts to band_enabled change - if (wlan_settings.band_enabled != notification->wlan_settings().band_enabled) { + auto db = AgentDB::get(); + if (db->device_conf.wlan_settings.band_enabled != + notification->wlan_settings().band_enabled) { LOG(DEBUG) << "band_enabled changed - performing slave_reset()"; slave_reset(); } @@ -1502,7 +1502,8 @@ bool slave_thread::handle_cmdu_ap_manager_message(Socket *sd, return false; } - config_msg->channel() = wlan_settings.channel; + auto db = AgentDB::get(); + config_msg->channel() = db->device_conf.wlan_settings.channel; message_com::send_cmdu(ap_manager_socket, cmdu_tx); @@ -3006,7 +3007,7 @@ bool slave_thread::slave_fsm(bool &call_slave_select) auto db = AgentDB::get(); LOG(DEBUG) << "onboarding: " << int(0); - if (!wlan_settings.band_enabled) { + if (!db->device_conf.wlan_settings.band_enabled) { LOG(DEBUG) << "wlan_settings.band_enabled=false"; LOG(TRACE) << "goto STATE_BACKHAUL_ENABLE"; slave_state = STATE_BACKHAUL_ENABLE; @@ -3177,7 +3178,7 @@ bool slave_thread::slave_fsm(bool &call_slave_select) master_socket->setPeerMac(backhaul_params.controller_bridge_mac); auto db = AgentDB::get(); - if (!wlan_settings.band_enabled) { + if (!db->device_conf.wlan_settings.band_enabled) { LOG(TRACE) << "goto STATE_OPERATIONAL"; slave_state = STATE_OPERATIONAL; break; @@ -3384,7 +3385,10 @@ bool slave_thread::slave_fsm(bool &call_slave_select) notification->platform_settings().local_master = db->device_conf.local_controller; //Wlan Settings - notification->wlan_settings() = wlan_settings; + notification->wlan_settings().band_enabled = + db->device_conf.wlan_settings.band_enabled; + notification->wlan_settings().channel = db->device_conf.wlan_settings.channel; + ; // Hostap Params notification->hostap() = hostap_params; notification->hostap().ant_gain = config.hostap_ant_gain; diff --git a/agent/src/beerocks/slave/son_slave_thread.h b/agent/src/beerocks/slave/son_slave_thread.h index 0679a3b0cc..9c158a3d4e 100644 --- a/agent/src/beerocks/slave/son_slave_thread.h +++ b/agent/src/beerocks/slave/son_slave_thread.h @@ -160,7 +160,6 @@ class slave_thread : public beerocks::socket_thread { std::string backhaul_manager_uds; std::string platform_manager_uds; sSlaveConfig config; - beerocks_message::sWlanSettings wlan_settings; // from platform manager // beerocks_message::sSonConfig son_config; beerocks::logging &logger; std::string master_version; From cb51ce998a43e55cf9604527ac4bb096555befc4 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Wed, 12 Aug 2020 09:20:06 +0000 Subject: [PATCH 23/24] fixup! agent: Move wlan_settings configuration to AgentDB Signed-off-by: Oren Vormaser --- agent/src/beerocks/slave/son_slave_thread.cpp | 20 ++++++++----------- agent/src/beerocks/slave/son_slave_thread.h | 1 + 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/agent/src/beerocks/slave/son_slave_thread.cpp b/agent/src/beerocks/slave/son_slave_thread.cpp index 1da43c0325..136c9ec638 100644 --- a/agent/src/beerocks/slave/son_slave_thread.cpp +++ b/agent/src/beerocks/slave/son_slave_thread.cpp @@ -1320,7 +1320,9 @@ bool slave_thread::handle_cmdu_platform_manager_message( return true; } - auto db = AgentDB::get(); + auto db = AgentDB::get(); + wlan_settings.band_enabled = db->device_conf.wlan_settings.band_enabled; + wlan_settings.channel = db->device_conf.wlan_settings.channel; /** * On GW platform the ethernet interface which is used for backhaul connection must be @@ -1378,9 +1380,7 @@ bool slave_thread::handle_cmdu_platform_manager_message( } // slave only reacts to band_enabled change - auto db = AgentDB::get(); - if (db->device_conf.wlan_settings.band_enabled != - notification->wlan_settings().band_enabled) { + if (wlan_settings.band_enabled != notification->wlan_settings().band_enabled) { LOG(DEBUG) << "band_enabled changed - performing slave_reset()"; slave_reset(); } @@ -1502,8 +1502,7 @@ bool slave_thread::handle_cmdu_ap_manager_message(Socket *sd, return false; } - auto db = AgentDB::get(); - config_msg->channel() = db->device_conf.wlan_settings.channel; + config_msg->channel() = wlan_settings.channel; message_com::send_cmdu(ap_manager_socket, cmdu_tx); @@ -3007,7 +3006,7 @@ bool slave_thread::slave_fsm(bool &call_slave_select) auto db = AgentDB::get(); LOG(DEBUG) << "onboarding: " << int(0); - if (!db->device_conf.wlan_settings.band_enabled) { + if (!wlan_settings.band_enabled) { LOG(DEBUG) << "wlan_settings.band_enabled=false"; LOG(TRACE) << "goto STATE_BACKHAUL_ENABLE"; slave_state = STATE_BACKHAUL_ENABLE; @@ -3178,7 +3177,7 @@ bool slave_thread::slave_fsm(bool &call_slave_select) master_socket->setPeerMac(backhaul_params.controller_bridge_mac); auto db = AgentDB::get(); - if (!db->device_conf.wlan_settings.band_enabled) { + if (!wlan_settings.band_enabled) { LOG(TRACE) << "goto STATE_OPERATIONAL"; slave_state = STATE_OPERATIONAL; break; @@ -3385,10 +3384,7 @@ bool slave_thread::slave_fsm(bool &call_slave_select) notification->platform_settings().local_master = db->device_conf.local_controller; //Wlan Settings - notification->wlan_settings().band_enabled = - db->device_conf.wlan_settings.band_enabled; - notification->wlan_settings().channel = db->device_conf.wlan_settings.channel; - ; + notification->wlan_settings() = wlan_settings; // Hostap Params notification->hostap() = hostap_params; notification->hostap().ant_gain = config.hostap_ant_gain; diff --git a/agent/src/beerocks/slave/son_slave_thread.h b/agent/src/beerocks/slave/son_slave_thread.h index 9c158a3d4e..0679a3b0cc 100644 --- a/agent/src/beerocks/slave/son_slave_thread.h +++ b/agent/src/beerocks/slave/son_slave_thread.h @@ -160,6 +160,7 @@ class slave_thread : public beerocks::socket_thread { std::string backhaul_manager_uds; std::string platform_manager_uds; sSlaveConfig config; + beerocks_message::sWlanSettings wlan_settings; // from platform manager // beerocks_message::sSonConfig son_config; beerocks::logging &logger; std::string master_version; From 9c450e9967a5164a30b7200a4555215d6b86d109 Mon Sep 17 00:00:00 2001 From: Oren Vormaser Date: Wed, 12 Aug 2020 13:03:11 +0000 Subject: [PATCH 24/24] tlvf: PLATFORM_SON_SLAVE_REGISTER_RESPONSE remove unused fields Remove of unused fields: sPlatformSettings and wlan_settings from PLATFORM_SON_SLAVE_REGISTER_RESPONSE message. Those fields have been moved to the Agent_DB and there for no longer needed as part of this beerocks massage. PPM-338 Signed-off-by: Oren Vormaser --- .../beerocks/tlvf/beerocks_message_platform.h | 4 ---- .../tlvf/beerocks_message_platform.cpp | 24 ------------------- .../tlvf/beerocks_message_platform.yaml | 4 +--- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/common/beerocks/tlvf/AutoGenerated/include/beerocks/tlvf/beerocks_message_platform.h b/common/beerocks/tlvf/AutoGenerated/include/beerocks/tlvf/beerocks_message_platform.h index 7af51a48f4..6481737155 100644 --- a/common/beerocks/tlvf/AutoGenerated/include/beerocks/tlvf/beerocks_message_platform.h +++ b/common/beerocks/tlvf/AutoGenerated/include/beerocks/tlvf/beerocks_message_platform.h @@ -83,8 +83,6 @@ class cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE : public BaseClass static eActionOp_PLATFORM get_action_op(){ return (eActionOp_PLATFORM)(ACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE); } - sPlatformSettings& platform_settings(); - sWlanSettings& wlan_settings(); uint32_t& valid(); void class_swap() override; bool finalize() override; @@ -93,8 +91,6 @@ class cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE : public BaseClass private: bool init(); eActionOp_PLATFORM* m_action_op = nullptr; - sPlatformSettings* m_platform_settings = nullptr; - sWlanSettings* m_wlan_settings = nullptr; uint32_t* m_valid = nullptr; }; diff --git a/common/beerocks/tlvf/AutoGenerated/src/beerocks/tlvf/beerocks_message_platform.cpp b/common/beerocks/tlvf/AutoGenerated/src/beerocks/tlvf/beerocks_message_platform.cpp index ab4a1dcc10..1d037921d3 100644 --- a/common/beerocks/tlvf/AutoGenerated/src/beerocks/tlvf/beerocks_message_platform.cpp +++ b/common/beerocks/tlvf/AutoGenerated/src/beerocks/tlvf/beerocks_message_platform.cpp @@ -185,14 +185,6 @@ BaseClass(base->getBuffPtr(), base->getBuffRemainingBytes(), parse){ } cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE::~cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE() { } -sPlatformSettings& cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE::platform_settings() { - return (sPlatformSettings&)(*m_platform_settings); -} - -sWlanSettings& cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE::wlan_settings() { - return (sWlanSettings&)(*m_wlan_settings); -} - uint32_t& cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE::valid() { return (uint32_t&)(*m_valid); } @@ -200,8 +192,6 @@ uint32_t& cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE::valid() { void cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE::class_swap() { tlvf_swap(8*sizeof(eActionOp_PLATFORM), reinterpret_cast(m_action_op)); - m_platform_settings->struct_swap(); - m_wlan_settings->struct_swap(); tlvf_swap(32, reinterpret_cast(m_valid)); } @@ -235,8 +225,6 @@ bool cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE::finalize() size_t cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE::get_initial_size() { size_t class_size = 0; - class_size += sizeof(sPlatformSettings); // platform_settings - class_size += sizeof(sWlanSettings); // wlan_settings class_size += sizeof(uint32_t); // valid return class_size; } @@ -247,18 +235,6 @@ bool cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE::init() TLVF_LOG(ERROR) << "Not enough available space on buffer. Class init failed"; return false; } - m_platform_settings = reinterpret_cast(m_buff_ptr__); - if (!buffPtrIncrementSafe(sizeof(sPlatformSettings))) { - LOG(ERROR) << "buffPtrIncrementSafe(" << std::dec << sizeof(sPlatformSettings) << ") Failed!"; - return false; - } - if (!m_parse__) { m_platform_settings->struct_init(); } - m_wlan_settings = reinterpret_cast(m_buff_ptr__); - if (!buffPtrIncrementSafe(sizeof(sWlanSettings))) { - LOG(ERROR) << "buffPtrIncrementSafe(" << std::dec << sizeof(sWlanSettings) << ") Failed!"; - return false; - } - if (!m_parse__) { m_wlan_settings->struct_init(); } m_valid = reinterpret_cast(m_buff_ptr__); if (!buffPtrIncrementSafe(sizeof(uint32_t))) { LOG(ERROR) << "buffPtrIncrementSafe(" << std::dec << sizeof(uint32_t) << ") Failed!"; diff --git a/common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_platform.yaml b/common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_platform.yaml index 5764402e77..24cbe2b4f0 100755 --- a/common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_platform.yaml +++ b/common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_platform.yaml @@ -24,11 +24,9 @@ cACTION_PLATFORM_SON_SLAVE_REGISTER_REQUEST: cACTION_PLATFORM_SON_SLAVE_REGISTER_RESPONSE: _type: class - platform_settings: sPlatformSettings - wlan_settings: sWlanSettings valid: _type: uint32_t - _comment: #Marks whether the settings are valid + _comment: # Marks whether the settings received into agent_db cACTION_PLATFORM_ARP_MONITOR_NOTIFICATION: _type: class