qcacld-3.0: Remove enable_snr_monitoring from hdd_config struct

Currently, enable_snr_monitoring doesn't be initialized properly, in
some acs scenario, hostapd will dump survey(NL80211_CMD_GET_SURVEY),
driver return error due to uninitialized enable_snr_monitoring, this
will result in acs won't be started and sap fail to start.

Fix is to remove enable_snr_monitoring from hdd_config struct,
calling ucfg_scan_is_snr_monitor_enabled() everywhere that
enable_snr_monitoring is being used.

Change-Id: I8784867683b21d9441e980a1215b2db712db381a
CRs-Fixed: 2585661
This commit is contained in:
hqu
2019-12-18 14:26:17 +08:00
committed by nshrivas
parent fb6757f24d
commit d109f767f6
4 changed files with 8 additions and 6 deletions

View File

@@ -110,7 +110,6 @@ struct hdd_config {
#ifdef ENABLE_MTRACE_LOG
bool enable_mtrace;
#endif
bool enable_snr_monitoring;
bool advertise_concurrent_operation;
#ifdef DHCP_SERVER_OFFLOAD
struct dhcp_server dhcp_server_ip;

View File

@@ -23697,7 +23697,7 @@ void wlan_hdd_init_chan_info(struct hdd_context *hdd_ctx)
mac_handle_t mac_handle;
hdd_ctx->chan_info = NULL;
if (!hdd_ctx->config->enable_snr_monitoring) {
if (!ucfg_scan_is_snr_monitor_enabled(hdd_ctx->psoc)) {
hdd_debug("SNR monitoring is disabled");
return;
}

View File

@@ -5021,7 +5021,7 @@ static int __wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy,
sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
if (!hdd_ctx->config->enable_snr_monitoring)
if (!ucfg_scan_is_snr_monitor_enabled(hdd_ctx->psoc))
return -ENONET;
if (sta_ctx->hdd_reassoc_scenario) {

View File

@@ -7313,6 +7313,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
{
int8_t s7snr = 0;
int status = 0;
bool enable_snr_monitoring;
struct hdd_context *hdd_ctx;
struct hdd_station_ctx *sta_ctx;
@@ -7322,12 +7323,14 @@ static int __iw_get_char_setnone(struct net_device *dev,
return status;
sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
if (!hdd_ctx->config->enable_snr_monitoring ||
enable_snr_monitoring =
ucfg_scan_is_snr_monitor_enabled(hdd_ctx->psoc);
if (!enable_snr_monitoring ||
eConnectionState_Associated !=
sta_ctx->conn_info.conn_state) {
hdd_err("getSNR failed: Enable SNR Monitoring-%d, ConnectionState-%d",
hdd_ctx->config->enable_snr_monitoring,
sta_ctx->conn_info.conn_state);
enable_snr_monitoring,
sta_ctx->conn_info.conn_state);
return -ENONET;
}
wlan_hdd_get_snr(adapter, &s7snr);