From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============1346251630173203119==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH 01/16] mac80211: add more HT/VHT/HE state logging Date: Tue, 30 Nov 2021 17:05:40 +0800 Message-ID: <202111301700.jAkdP74U-lkp@intel.com> In-Reply-To: List-Id: --===============1346251630173203119== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Luca, I love your patch! Yet something to improve: [auto build test ERROR on jberg-mac80211-next/master] [also build test ERROR on jberg-mac80211/master linus/master v5.16-rc3 next= -20211129] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Luca-Coelho/cfg80211-mac80= 211-patches-from-our-internal-tree-2021-11-29/20211129-213704 base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next= .git master config: arm-allmodconfig (https://download.01.org/0day-ci/archive/20211130/= 202111301700.jAkdP74U-lkp(a)intel.com/config) compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/8275a35cfbfc5c94966b49077= 447b828f24c14d5 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Luca-Coelho/cfg80211-mac80211-patc= hes-from-our-internal-tree-2021-11-29/20211129-213704 git checkout 8275a35cfbfc5c94966b49077447b828f24c14d5 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Darm SHELL=3D/bin/bash arch/arm/common/ drivers/pinctr= l/qcom/ net/mac80211/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): net/mac80211/mlme.c: In function 'ieee80211_prep_channel': >> net/mac80211/mlme.c:5085:29: error: 'vht_cap' undeclared (first use in t= his function); did you mean 'ht_cap'? 5085 | if (vht_cap) | ^~~~~~~ | ht_cap net/mac80211/mlme.c:5085:29: note: each undeclared identifier is reporte= d only once for each function it appears in vim +5085 net/mac80211/mlme.c 5005 = 5006 static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdat= a, 5007 struct cfg80211_bss *cbss) 5008 { 5009 struct ieee80211_local *local =3D sdata->local; 5010 struct ieee80211_if_managed *ifmgd =3D &sdata->u.mgd; 5011 const struct ieee80211_ht_cap *ht_cap =3D NULL; 5012 const struct ieee80211_ht_operation *ht_oper =3D NULL; 5013 const struct ieee80211_vht_operation *vht_oper =3D NULL; 5014 const struct ieee80211_he_operation *he_oper =3D NULL; 5015 const struct ieee80211_s1g_oper_ie *s1g_oper =3D NULL; 5016 struct ieee80211_supported_band *sband; 5017 struct cfg80211_chan_def chandef; 5018 bool is_6ghz =3D cbss->channel->band =3D=3D NL80211_BAND_6GHZ; 5019 bool is_5ghz =3D cbss->channel->band =3D=3D NL80211_BAND_5GHZ; 5020 struct ieee80211_bss *bss =3D (void *)cbss->priv; 5021 struct ieee802_11_elems *elems; 5022 const struct cfg80211_bss_ies *ies; 5023 int ret; 5024 u32 i; 5025 bool have_80mhz; 5026 = 5027 rcu_read_lock(); 5028 = 5029 ies =3D rcu_dereference(cbss->ies); 5030 elems =3D ieee802_11_parse_elems(ies->data, ies->len, false, 5031 NULL, NULL); 5032 if (!elems) { 5033 rcu_read_unlock(); 5034 return -ENOMEM; 5035 } 5036 = 5037 sband =3D local->hw.wiphy->bands[cbss->channel->band]; 5038 = 5039 ifmgd->flags &=3D ~(IEEE80211_STA_DISABLE_40MHZ | 5040 IEEE80211_STA_DISABLE_80P80MHZ | 5041 IEEE80211_STA_DISABLE_160MHZ); 5042 = 5043 /* disable HT/VHT/HE if we don't support them */ 5044 if (!sband->ht_cap.ht_supported && !is_6ghz) { 5045 mlme_dbg(sdata, "HT not supported, disabling HT/VHT/HE\n"); 5046 ifmgd->flags |=3D IEEE80211_STA_DISABLE_HT; 5047 ifmgd->flags |=3D IEEE80211_STA_DISABLE_VHT; 5048 ifmgd->flags |=3D IEEE80211_STA_DISABLE_HE; 5049 } 5050 = 5051 if (!sband->vht_cap.vht_supported && is_5ghz) { 5052 mlme_dbg(sdata, "VHT not supported, disabling VHT/HE\n"); 5053 ifmgd->flags |=3D IEEE80211_STA_DISABLE_VHT; 5054 ifmgd->flags |=3D IEEE80211_STA_DISABLE_HE; 5055 } 5056 = 5057 if (!ieee80211_get_he_iftype_cap(sband, 5058 ieee80211_vif_type_p2p(&sdata->vif))) { 5059 mlme_dbg(sdata, "HE not supported, disabling it\n"); 5060 ifmgd->flags |=3D IEEE80211_STA_DISABLE_HE; 5061 } 5062 = 5063 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT) && !is_6ghz) { 5064 ht_oper =3D elems->ht_operation; 5065 ht_cap =3D elems->ht_cap_elem; 5066 = 5067 if (!ht_cap) { 5068 ifmgd->flags |=3D IEEE80211_STA_DISABLE_HT; 5069 ht_oper =3D NULL; 5070 } 5071 } 5072 = 5073 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT) && !is_6ghz) { 5074 vht_oper =3D elems->vht_operation; 5075 if (vht_oper && !ht_oper) { 5076 vht_oper =3D NULL; 5077 sdata_info(sdata, 5078 "AP advertised VHT without HT, disabling HT/VHT/HE\n"); 5079 ifmgd->flags |=3D IEEE80211_STA_DISABLE_HT; 5080 ifmgd->flags |=3D IEEE80211_STA_DISABLE_VHT; 5081 ifmgd->flags |=3D IEEE80211_STA_DISABLE_HE; 5082 } 5083 = 5084 if (!elems->vht_cap_elem) { > 5085 if (vht_cap) 5086 sdata_info(sdata, 5087 "bad VHT capabilities, disabling VHT\n"); 5088 ifmgd->flags |=3D IEEE80211_STA_DISABLE_VHT; 5089 vht_oper =3D NULL; 5090 } 5091 } 5092 = 5093 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE)) { 5094 he_oper =3D elems->he_operation; 5095 = 5096 if (is_6ghz) { 5097 struct ieee80211_bss_conf *bss_conf; 5098 u8 i, j =3D 0; 5099 = 5100 bss_conf =3D &sdata->vif.bss_conf; 5101 = 5102 if (elems->pwr_constr_elem) 5103 bss_conf->pwr_reduction =3D *elems->pwr_constr_elem; 5104 = 5105 BUILD_BUG_ON(ARRAY_SIZE(bss_conf->tx_pwr_env) !=3D 5106 ARRAY_SIZE(elems->tx_pwr_env)); 5107 = 5108 for (i =3D 0; i < elems->tx_pwr_env_num; i++) { 5109 if (elems->tx_pwr_env_len[i] > 5110 sizeof(bss_conf->tx_pwr_env[j])) 5111 continue; 5112 = 5113 bss_conf->tx_pwr_env_num++; 5114 memcpy(&bss_conf->tx_pwr_env[j], elems->tx_pwr_env[i], 5115 elems->tx_pwr_env_len[i]); 5116 j++; 5117 } 5118 } 5119 = 5120 if (!ieee80211_verify_sta_he_mcs_support(sdata, sband, he_oper)) 5121 ifmgd->flags |=3D IEEE80211_STA_DISABLE_HE; 5122 } 5123 = 5124 /* Allow VHT if at least one channel on the sband supports 80 MHz */ 5125 have_80mhz =3D false; 5126 for (i =3D 0; i < sband->n_channels; i++) { 5127 if (sband->channels[i].flags & (IEEE80211_CHAN_DISABLED | 5128 IEEE80211_CHAN_NO_80MHZ)) 5129 continue; 5130 = 5131 have_80mhz =3D true; 5132 break; 5133 } 5134 = 5135 if (!have_80mhz) { 5136 sdata_info(sdata, "80 MHz not supported, disabling VHT\n"); 5137 ifmgd->flags |=3D IEEE80211_STA_DISABLE_VHT; 5138 } 5139 = 5140 if (sband->band =3D=3D NL80211_BAND_S1GHZ) { 5141 s1g_oper =3D elems->s1g_oper; 5142 if (!s1g_oper) 5143 sdata_info(sdata, 5144 "AP missing S1G operation element?\n"); 5145 } 5146 = 5147 ifmgd->flags |=3D ieee80211_determine_chantype(sdata, sband, 5148 cbss->channel, 5149 bss->vht_cap_info, 5150 ht_oper, vht_oper, he_oper, 5151 s1g_oper, 5152 &chandef, false); 5153 = 5154 sdata->needed_rx_chains =3D min(ieee80211_ht_vht_rx_chains(sdata, c= bss), 5155 local->rx_chains); 5156 = 5157 rcu_read_unlock(); 5158 /* the element data was RCU protected so no longer valid anyway */ 5159 kfree(elems); 5160 elems =3D NULL; 5161 = 5162 if (ifmgd->flags & IEEE80211_STA_DISABLE_HE && is_6ghz) { 5163 sdata_info(sdata, "Rejecting non-HE 6/7 GHz connection"); 5164 return -EINVAL; 5165 } 5166 = 5167 /* will change later if needed */ 5168 sdata->smps_mode =3D IEEE80211_SMPS_OFF; 5169 = 5170 mutex_lock(&local->mtx); 5171 /* 5172 * If this fails (possibly due to channel context sharing 5173 * on incompatible channels, e.g. 80+80 and 160 sharing the 5174 * same control channel) try to use a smaller bandwidth. 5175 */ 5176 ret =3D ieee80211_vif_use_channel(sdata, &chandef, 5177 IEEE80211_CHANCTX_SHARED); 5178 = 5179 /* don't downgrade for 5 and 10 MHz channels, though. */ 5180 if (chandef.width =3D=3D NL80211_CHAN_WIDTH_5 || 5181 chandef.width =3D=3D NL80211_CHAN_WIDTH_10) 5182 goto out; 5183 = 5184 while (ret && chandef.width !=3D NL80211_CHAN_WIDTH_20_NOHT) { 5185 ifmgd->flags |=3D ieee80211_chandef_downgrade(&chandef); 5186 ret =3D ieee80211_vif_use_channel(sdata, &chandef, 5187 IEEE80211_CHANCTX_SHARED); 5188 } 5189 out: 5190 mutex_unlock(&local->mtx); 5191 return ret; 5192 } 5193 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============1346251630173203119==--