diff mbox series

[v4,5/8] ath11k: set psc channel flag when sending channel list to firmware.

Message ID 20200531185600.20789-6-pradeepc@codeaurora.org (mailing list archive)
State Superseded
Delegated to: Kalle Valo
Headers show
Series add 6GHz radio support in ath11k driver | expand

Commit Message

Pradeep Kumar Chitrapu May 31, 2020, 6:55 p.m. UTC
If 6 ghz channel is a Preferred Scanning Channel(PSC), mark
the channel flag accordingly when updating channel list to firmware.
This will be used when making scanning decision in 6GHz channels.

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
---
v4:
 - use cfg80211_channel_is_psc.
v3:
 - use helper function ieee80211_is_channel_psc() instead of
   channel flag for identifying 6GHz PSC channels.

 drivers/net/wireless/ath/ath11k/reg.c | 4 ++++
 drivers/net/wireless/ath/ath11k/wmi.h | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

kernel test robot June 1, 2020, 1:10 a.m. UTC | #1
Hi Pradeep,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on ath6kl/ath-next]
[also build test ERROR on next-20200529]
[cannot apply to v5.7-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Pradeep-Kumar-Chitrapu/add-6GHz-radio-support-in-ath11k-driver/20200601-045939
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 2388a096e7865c043e83ece4e26654bd3d1a20d5)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/net/wireless/ath/ath11k/reg.c:165:8: error: implicit declaration of function 'cfg80211_channel_is_psc' [-Werror,-Wimplicit-function-declaration]
cfg80211_channel_is_psc(channel))
^
drivers/net/wireless/ath/ath11k/reg.c:165:8: note: did you mean 'cfg80211_chandef_is_edmg'?
include/net/cfg80211.h:732:1: note: 'cfg80211_chandef_is_edmg' declared here
cfg80211_chandef_is_edmg(const struct cfg80211_chan_def *chandef)
^
1 error generated.

vim +/cfg80211_channel_is_psc +165 drivers/net/wireless/ath/ath11k/reg.c

    89	
    90	int ath11k_reg_update_chan_list(struct ath11k *ar)
    91	{
    92		struct ieee80211_supported_band **bands;
    93		struct scan_chan_list_params *params;
    94		struct ieee80211_channel *channel;
    95		struct ieee80211_hw *hw = ar->hw;
    96		struct channel_param *ch;
    97		enum nl80211_band band;
    98		int num_channels = 0;
    99		int params_len;
   100		int i, ret;
   101	
   102		bands = hw->wiphy->bands;
   103		for (band = 0; band < NUM_NL80211_BANDS; band++) {
   104			if (!bands[band])
   105				continue;
   106	
   107			for (i = 0; i < bands[band]->n_channels; i++) {
   108				if (bands[band]->channels[i].flags &
   109				    IEEE80211_CHAN_DISABLED)
   110					continue;
   111	
   112				num_channels++;
   113			}
   114		}
   115	
   116		if (WARN_ON(!num_channels))
   117			return -EINVAL;
   118	
   119		params_len = sizeof(struct scan_chan_list_params) +
   120				num_channels * sizeof(struct channel_param);
   121		params = kzalloc(params_len, GFP_KERNEL);
   122	
   123		if (!params)
   124			return -ENOMEM;
   125	
   126		params->pdev_id = ar->pdev->pdev_id;
   127		params->nallchans = num_channels;
   128	
   129		ch = params->ch_param;
   130	
   131		for (band = 0; band < NUM_NL80211_BANDS; band++) {
   132			if (!bands[band])
   133				continue;
   134	
   135			for (i = 0; i < bands[band]->n_channels; i++) {
   136				channel = &bands[band]->channels[i];
   137	
   138				if (channel->flags & IEEE80211_CHAN_DISABLED)
   139					continue;
   140	
   141				/* TODO: Set to true/false based on some condition? */
   142				ch->allow_ht = true;
   143				ch->allow_vht = true;
   144				ch->allow_he = true;
   145	
   146				ch->dfs_set =
   147					!!(channel->flags & IEEE80211_CHAN_RADAR);
   148				ch->is_chan_passive = !!(channel->flags &
   149							IEEE80211_CHAN_NO_IR);
   150				ch->is_chan_passive |= ch->dfs_set;
   151				ch->mhz = channel->center_freq;
   152				ch->cfreq1 = channel->center_freq;
   153				ch->minpower = 0;
   154				ch->maxpower = channel->max_power * 2;
   155				ch->maxregpower = channel->max_reg_power * 2;
   156				ch->antennamax = channel->max_antenna_gain * 2;
   157	
   158				/* TODO: Use appropriate phymodes */
   159				if (channel->band == NL80211_BAND_2GHZ)
   160					ch->phy_mode = MODE_11G;
   161				else
   162					ch->phy_mode = MODE_11A;
   163	
   164				if (channel->band == NL80211_BAND_6GHZ &&
 > 165				    cfg80211_channel_is_psc(channel))
   166					ch->psc_channel = true;
   167	
   168				ath11k_dbg(ar->ab, ATH11K_DBG_WMI,
   169					   "mac channel [%d/%d] freq %d maxpower %d regpower %d antenna %d mode %d\n",
   170					   i, params->nallchans,
   171					   ch->mhz, ch->maxpower, ch->maxregpower,
   172					   ch->antennamax, ch->phy_mode);
   173	
   174				ch++;
   175				/* TODO: use quarrter/half rate, cfreq12, dfs_cfreq2
   176				 * set_agile, reg_class_idx
   177				 */
   178			}
   179		}
   180	
   181		ret = ath11k_wmi_send_scan_chan_list_cmd(ar, params);
   182		kfree(params);
   183	
   184		return ret;
   185	}
   186	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot June 1, 2020, 5:34 a.m. UTC | #2
Hi Pradeep,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on ath6kl/ath-next]
[also build test ERROR on next-20200529]
[cannot apply to v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Pradeep-Kumar-Chitrapu/add-6GHz-radio-support-in-ath11k-driver/20200601-045939
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

drivers/net/wireless/ath/ath11k/reg.c: In function 'ath11k_reg_update_chan_list':
>> drivers/net/wireless/ath/ath11k/reg.c:165:8: error: implicit declaration of function 'cfg80211_channel_is_psc'; did you mean 'cfg80211_chandef_is_edmg'? [-Werror=implicit-function-declaration]
165 |        cfg80211_channel_is_psc(channel))
|        ^~~~~~~~~~~~~~~~~~~~~~~
|        cfg80211_chandef_is_edmg
cc1: some warnings being treated as errors

vim +165 drivers/net/wireless/ath/ath11k/reg.c

    89	
    90	int ath11k_reg_update_chan_list(struct ath11k *ar)
    91	{
    92		struct ieee80211_supported_band **bands;
    93		struct scan_chan_list_params *params;
    94		struct ieee80211_channel *channel;
    95		struct ieee80211_hw *hw = ar->hw;
    96		struct channel_param *ch;
    97		enum nl80211_band band;
    98		int num_channels = 0;
    99		int params_len;
   100		int i, ret;
   101	
   102		bands = hw->wiphy->bands;
   103		for (band = 0; band < NUM_NL80211_BANDS; band++) {
   104			if (!bands[band])
   105				continue;
   106	
   107			for (i = 0; i < bands[band]->n_channels; i++) {
   108				if (bands[band]->channels[i].flags &
   109				    IEEE80211_CHAN_DISABLED)
   110					continue;
   111	
   112				num_channels++;
   113			}
   114		}
   115	
   116		if (WARN_ON(!num_channels))
   117			return -EINVAL;
   118	
   119		params_len = sizeof(struct scan_chan_list_params) +
   120				num_channels * sizeof(struct channel_param);
   121		params = kzalloc(params_len, GFP_KERNEL);
   122	
   123		if (!params)
   124			return -ENOMEM;
   125	
   126		params->pdev_id = ar->pdev->pdev_id;
   127		params->nallchans = num_channels;
   128	
   129		ch = params->ch_param;
   130	
   131		for (band = 0; band < NUM_NL80211_BANDS; band++) {
   132			if (!bands[band])
   133				continue;
   134	
   135			for (i = 0; i < bands[band]->n_channels; i++) {
   136				channel = &bands[band]->channels[i];
   137	
   138				if (channel->flags & IEEE80211_CHAN_DISABLED)
   139					continue;
   140	
   141				/* TODO: Set to true/false based on some condition? */
   142				ch->allow_ht = true;
   143				ch->allow_vht = true;
   144				ch->allow_he = true;
   145	
   146				ch->dfs_set =
   147					!!(channel->flags & IEEE80211_CHAN_RADAR);
   148				ch->is_chan_passive = !!(channel->flags &
   149							IEEE80211_CHAN_NO_IR);
   150				ch->is_chan_passive |= ch->dfs_set;
   151				ch->mhz = channel->center_freq;
   152				ch->cfreq1 = channel->center_freq;
   153				ch->minpower = 0;
   154				ch->maxpower = channel->max_power * 2;
   155				ch->maxregpower = channel->max_reg_power * 2;
   156				ch->antennamax = channel->max_antenna_gain * 2;
   157	
   158				/* TODO: Use appropriate phymodes */
   159				if (channel->band == NL80211_BAND_2GHZ)
   160					ch->phy_mode = MODE_11G;
   161				else
   162					ch->phy_mode = MODE_11A;
   163	
   164				if (channel->band == NL80211_BAND_6GHZ &&
 > 165				    cfg80211_channel_is_psc(channel))
   166					ch->psc_channel = true;
   167	
   168				ath11k_dbg(ar->ab, ATH11K_DBG_WMI,
   169					   "mac channel [%d/%d] freq %d maxpower %d regpower %d antenna %d mode %d\n",
   170					   i, params->nallchans,
   171					   ch->mhz, ch->maxpower, ch->maxregpower,
   172					   ch->antennamax, ch->phy_mode);
   173	
   174				ch++;
   175				/* TODO: use quarrter/half rate, cfreq12, dfs_cfreq2
   176				 * set_agile, reg_class_idx
   177				 */
   178			}
   179		}
   180	
   181		ret = ath11k_wmi_send_scan_chan_list_cmd(ar, params);
   182		kfree(params);
   183	
   184		return ret;
   185	}
   186	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/reg.c b/drivers/net/wireless/ath/ath11k/reg.c
index 453aa9c06969..7c9dc91cc48a 100644
--- a/drivers/net/wireless/ath/ath11k/reg.c
+++ b/drivers/net/wireless/ath/ath11k/reg.c
@@ -161,6 +161,10 @@  int ath11k_reg_update_chan_list(struct ath11k *ar)
 			else
 				ch->phy_mode = MODE_11A;
 
+			if (channel->band == NL80211_BAND_6GHZ &&
+			    cfg80211_channel_is_psc(channel))
+				ch->psc_channel = true;
+
 			ath11k_dbg(ar->ab, ATH11K_DBG_WMI,
 				   "mac channel [%d/%d] freq %d maxpower %d regpower %d antenna %d mode %d\n",
 				   i, params->nallchans,
diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h
index fd82cff7537b..76c2da2c5db7 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.h
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
@@ -2520,7 +2520,8 @@  struct channel_param {
 	    allow_ht:1,
 	    allow_vht:1,
 	    allow_he:1,
-	    set_agile:1;
+	    set_agile:1,
+	    psc_channel:1;
 	u32 phy_mode;
 	u32 cfreq1;
 	u32 cfreq2;