Browse Source

qcacld-3.0: Free cached channel list with restore channels

When driver receives the command to disable the channels
it maintains a list of the channels which are disabled.
During SAP stop, driver restores the disabled channels
but it is not freeing the cache list. Now when again the
command is issued to disable the channels, driver is not
processing this command as it still has the channels in its
cached list which were disabled during previous command.
This results into failure of current command and all the
subsequent commands to disable the channels until the
cache list is not cleared with set_disable_channel_list
command with empty channel list.

To address above issue, clear the cache channel list
as soon as driver restores the channels on stop bss.

Change-Id: I6b8c7ba250ef38b892ab83621add45fbfc09a2cd
CRs-fixed: 2496642
Ashish Kumar Dhanotiya 5 years ago
parent
commit
6176bef9d3
2 changed files with 11 additions and 8 deletions
  1. 6 1
      core/hdd/src/wlan_hdd_hostapd.c
  2. 5 7
      core/hdd/src/wlan_hdd_ioctl.c

+ 6 - 1
core/hdd/src/wlan_hdd_hostapd.c

@@ -4714,8 +4714,13 @@ int wlan_hdd_restore_channels(struct hdd_context *hdd_ctx,
 	status = sme_update_channel_list(hdd_ctx->mac_handle);
 	if (status)
 		hdd_err("Can't Restore channel list");
+	else
+		/*
+		 * Free the cache channels when the
+		 * disabled channels are restored
+		 */
+		wlan_hdd_free_cache_channels(hdd_ctx);
 	hdd_exit();
-
 	return 0;
 }
 

+ 5 - 7
core/hdd/src/wlan_hdd_ioctl.c

@@ -7205,13 +7205,11 @@ static int hdd_parse_disable_chan_cmd(struct hdd_adapter *adapter, uint8_t *ptr)
 	hdd_debug("Number of channel to disable are: %d", temp_int);
 
 	if (!temp_int) {
-		if (!wlan_hdd_restore_channels(hdd_ctx, false)) {
-			/*
-			 * Free the cache channels only when the command is
-			 * received with num channels as 0
-			 */
-			wlan_hdd_free_cache_channels(hdd_ctx);
-		}
+		/*
+		 * Restore and Free the cache channels when the command is
+		 * received with num channels as 0
+		 */
+		wlan_hdd_restore_channels(hdd_ctx, false);
 		return 0;
 	}