Browse Source

qcacld-3.0: Reset roam configs to default while STA mode init

Reset roam configurations to default while station mode init.

Thus user gets default roam configuration with which STA mode is
initialized.

example: When STA connect to AP, user queries for default roam
scan home away time using following command of wpa_cli.
$wpa_cli
>driver GETSCANHOMEAWAYTIME
<OUTPUT is default value of gRoamScanHomeAwayTime INI>

Change-Id: If525e4a92fee6f4823996c1e1e34b9943fed0432
CRs-Fixed: 2607557
Abhishek Ambure 5 years ago
parent
commit
7b4b2ff625

+ 1 - 1
core/hdd/src/wlan_hdd_ioctl.c

@@ -4583,7 +4583,7 @@ static int drv_cmd_get_scan_home_away_time(struct hdd_adapter *adapter,
 {
 	int ret = 0;
 	uint16_t val;
-	char extra[32];
+	char extra[32] = {0};
 	uint8_t len = 0;
 	QDF_STATUS status;
 

+ 1 - 0
core/hdd/src/wlan_hdd_main.c

@@ -4838,6 +4838,7 @@ QDF_STATUS hdd_init_station_mode(struct hdd_adapter *adapter)
 	hdd_register_wext(adapter->dev);
 
 	hdd_conn_set_connection_state(adapter, eConnectionState_NotConnected);
+	sme_roam_reset_configs(mac_handle, adapter->vdev_id);
 
 	/* set fast roaming capability in sme session */
 	status = sme_config_fast_roaming(mac_handle, adapter->vdev_id,

+ 10 - 0
core/sme/inc/sme_api.h

@@ -1014,6 +1014,16 @@ sme_modify_roam_cand_sel_criteria(mac_handle_t mac_handle,
  */
 QDF_STATUS sme_roam_control_restore_default_config(mac_handle_t mac_handle,
 						   uint8_t vdev_id);
+
+/**
+ * sme_roam_reset_configs() - API to reset roam config
+ * @mac_handle: Opaque handle to the global MAC context
+ * @vdev_id: vdev Identifier
+ *
+ * Return: void
+ */
+void sme_roam_reset_configs(mac_handle_t mac_handle, uint8_t vdev_id);
+
 QDF_STATUS sme_set_neighbor_scan_min_chan_time(mac_handle_t mac_handle,
 		const uint16_t nNeighborScanMinChanTime,
 		uint8_t sessionId);

+ 9 - 0
core/sme/src/common/sme_api.c

@@ -6834,6 +6834,15 @@ sme_restore_default_roaming_params(struct mac_context *mac,
 			mac->mlme_cfg->lfr.roam_scan_period_after_inactivity;
 }
 
+void sme_roam_reset_configs(mac_handle_t mac_handle, uint8_t vdev_id)
+{
+	struct mac_context *mac = MAC_CONTEXT(mac_handle);
+	tCsrNeighborRoamControlInfo *neighbor_roam_info;
+
+	neighbor_roam_info = &mac->roam.neighborRoamInfo[vdev_id];
+	sme_restore_default_roaming_params(mac, neighbor_roam_info);
+}
+
 QDF_STATUS sme_roam_control_restore_default_config(mac_handle_t mac_handle,
 						   uint8_t vdev_id)
 {