mwifiex: send fewer channels to scan while connected
authorAmitkumar Karwar <akarwar@marvell.com>
Thu, 16 Mar 2017 10:46:11 +0000 (16:16 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 20 Mar 2017 17:08:47 +0000 (19:08 +0200)
Application triggers periodic background scans when device is connected.
We will scan less number of channels per scan command so that data
traffic won't get affected.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/scan.c

index 8cd12347ee3baa31434ad905739c6284e5186db6..ce6936d0c5c02ee4a64e5bcb5a13e11188adf07f 100644 (file)
@@ -994,10 +994,15 @@ mwifiex_config_scan(struct mwifiex_private *priv,
         *  If a specific BSSID or SSID is used, the number of channels in the
         *  scan command will be increased to the absolute maximum.
         */
-       if (*filtered_scan)
+       if (*filtered_scan) {
                *max_chan_per_scan = MWIFIEX_MAX_CHANNELS_PER_SPECIFIC_SCAN;
-       else
-               *max_chan_per_scan = MWIFIEX_DEF_CHANNELS_PER_SCAN_CMD;
+       } else {
+               if (!priv->media_connected)
+                       *max_chan_per_scan = MWIFIEX_DEF_CHANNELS_PER_SCAN_CMD;
+               else
+                       *max_chan_per_scan =
+                                       MWIFIEX_DEF_CHANNELS_PER_SCAN_CMD / 2;
+       }
 
        if (adapter->ext_scan) {
                bss_mode = (struct mwifiex_ie_types_bss_mode *)tlv_pos;