From 32925f718398558a082a70cff668a13f08d4a36d Mon Sep 17 00:00:00 2001 From: Sai Pavan Akhil Remella Date: Mon, 31 Jan 2022 15:28:28 +0530 Subject: [PATCH] qcacld-3.0: Send channel list to fw in case of PNO In case of PNO scan, If firmware supports WMI_SERVICE_PNO_SCAN_CONFIG_PER_CHANNEL, it uses the upper-12 bits(bit-20 to bit 32) of channel_list for flags and lower 20-bits(bit-0 to bit-19) for frequency. If firmware doesn't support it, then channel_list holds the frequency value only. Fix is to fill the flags and frequency accordingly. Change-Id: I8473072069da4532406ce720a0070a665e29b1af CRs-Fixed: 3103939 --- core/hdd/src/wlan_hdd_wext.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 314e96e69cad..a273c996d0a0 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -8617,7 +8618,7 @@ static int __iw_set_pno(struct net_device *dev, params = sscanf(ptr, " %u %u %hhu %n", &(req.networks_list[i].authentication), &(req.networks_list[i].encryption), - &(req.networks_list[i].channel_cnt), + &(req.networks_list[i].pno_chan_list.num_chan), &offset); if (3 != params) { @@ -8632,20 +8633,20 @@ static int __iw_set_pno(struct net_device *dev, req.networks_list[i].ssid.ssid, req.networks_list[i].authentication, req.networks_list[i].encryption, - req.networks_list[i].channel_cnt, offset); + req.networks_list[i].pno_chan_list.num_chan, offset); /* Advance to channel list */ ptr += offset; if (SCAN_PNO_MAX_NETW_CHANNELS_EX < - req.networks_list[i].channel_cnt) { + req.networks_list[i].pno_chan_list.num_chan) { hdd_err("Incorrect number of channels"); ret = -EINVAL; goto exit; } - if (0 != req.networks_list[i].channel_cnt) { - for (j = 0; j < req.networks_list[i].channel_cnt; + if (0 != req.networks_list[i].pno_chan_list.num_chan) { + for (j = 0; j < req.networks_list[i].pno_chan_list.num_chan; j++) { if (1 != sscanf(ptr, " %hhu %n", &value, &offset)) { @@ -8659,7 +8660,7 @@ static int __iw_set_pno(struct net_device *dev, ret = -EINVAL; goto exit; } - req.networks_list[i].channels[j] = + req.networks_list[i].pno_chan_list.chan[j].freq = cds_chan_to_freq(value); /* Advance to next channel number */ ptr += offset;