diff mbox

mwifiex: send fewer channels to scan while connected

Message ID 1489661171-29796-1-git-send-email-akarwar@marvell.com (mailing list archive)
State Accepted
Commit 0a5cc49750b89717ad02abf132aa119743c0e5d4
Delegated to: Kalle Valo
Headers show

Commit Message

Amitkumar Karwar March 16, 2017, 10:46 a.m. UTC
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>
---
 drivers/net/wireless/marvell/mwifiex/scan.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Kalle Valo March 20, 2017, 5:09 p.m. UTC | #1
Amitkumar Karwar <akarwar@marvell.com> wrote:
> 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>

Patch applied to wireless-drivers-next.git, thanks.

0a5cc49750b8 mwifiex: send fewer channels to scan while connected
diff mbox

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
index 1816916..8295a05 100644
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -989,10 +989,15 @@  enum cipher_suite {
 	 *  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;