tree:
https://github.com/0day-ci/linux/commits/UPDATE-20201019-144130/Shay-Bar/...
head: 0ede483fb5b54c0e7af13f36bd07f399c84c0d1c
commit: 0ede483fb5b54c0e7af13f36bd07f399c84c0d1c [1/1] mac80211: 160MHz support per
IEEE802.11ax standard
config: powerpc64-randconfig-s032-20201019 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-dirty
#
https://github.com/0day-ci/linux/commit/0ede483fb5b54c0e7af13f36bd07f399c...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
UPDATE-20201019-144130/Shay-Bar/mac80211-160MHz-support-per-IEEE802-11ax-standard/20201012-221911
git checkout 0ede483fb5b54c0e7af13f36bd07f399c84c0d1c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
> net/mac80211/spectmgmt.c:232:42: sparse: sparse: cast to
restricted __le16
> net/mac80211/spectmgmt.c:232:42: sparse: sparse: cast to restricted __le16
> net/mac80211/spectmgmt.c:232:42: sparse: sparse: cast to restricted __le16
> net/mac80211/spectmgmt.c:232:42: sparse: sparse: cast to restricted __le16
> net/mac80211/spectmgmt.c:231:48: sparse: sparse: incorrect type in assignment
(different base types) @@ expected restricted __le16 [usertype] operation_mode @@
got int @@
> net/mac80211/spectmgmt.c:231:48: sparse: expected restricted __le16 [usertype]
operation_mode
> net/mac80211/spectmgmt.c:231:48: sparse: got int
vim +232 net/mac80211/spectmgmt.c
96
97 int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
98 struct ieee802_11_elems *elems,
99 enum nl80211_band current_band,
100 u32 vht_cap_info,
101 u32 sta_flags, u8 *bssid,
102 struct ieee80211_csa_ie *csa_ie)
103 {
104 enum nl80211_band new_band = current_band;
105 int new_freq;
106 u8 new_chan_no;
107 struct ieee80211_channel *new_chan;
108 struct cfg80211_chan_def new_vht_chandef = {};
109 const struct ieee80211_sec_chan_offs_ie *sec_chan_offs;
110 const struct ieee80211_wide_bw_chansw_ie *wide_bw_chansw_ie;
111 int secondary_channel_offset = -1;
112
113 memset(csa_ie, 0, sizeof(*csa_ie));
114
115 sec_chan_offs = elems->sec_chan_offs;
116 wide_bw_chansw_ie = elems->wide_bw_chansw_ie;
117
118 if (sta_flags & (IEEE80211_STA_DISABLE_HT |
119 IEEE80211_STA_DISABLE_40MHZ)) {
120 sec_chan_offs = NULL;
121 wide_bw_chansw_ie = NULL;
122 }
123
124 if (sta_flags & IEEE80211_STA_DISABLE_VHT)
125 wide_bw_chansw_ie = NULL;
126
127 if (elems->ext_chansw_ie) {
128 if (!ieee80211_operating_class_to_band(
129 elems->ext_chansw_ie->new_operating_class,
130 &new_band)) {
131 sdata_info(sdata,
132 "cannot understand ECSA IE operating class, %d, ignoring\n",
133 elems->ext_chansw_ie->new_operating_class);
134 }
135 new_chan_no = elems->ext_chansw_ie->new_ch_num;
136 csa_ie->count = elems->ext_chansw_ie->count;
137 csa_ie->mode = elems->ext_chansw_ie->mode;
138 } else if (elems->ch_switch_ie) {
139 new_chan_no = elems->ch_switch_ie->new_ch_num;
140 csa_ie->count = elems->ch_switch_ie->count;
141 csa_ie->mode = elems->ch_switch_ie->mode;
142 } else {
143 /* nothing here we understand */
144 return 1;
145 }
146
147 /* Mesh Channel Switch Parameters Element */
148 if (elems->mesh_chansw_params_ie) {
149 csa_ie->ttl = elems->mesh_chansw_params_ie->mesh_ttl;
150 csa_ie->mode = elems->mesh_chansw_params_ie->mesh_flags;
151 csa_ie->pre_value = le16_to_cpu(
152 elems->mesh_chansw_params_ie->mesh_pre_value);
153
154 if (elems->mesh_chansw_params_ie->mesh_flags &
155 WLAN_EID_CHAN_SWITCH_PARAM_REASON)
156 csa_ie->reason_code = le16_to_cpu(
157 elems->mesh_chansw_params_ie->mesh_reason);
158 }
159
160 new_freq = ieee80211_channel_to_frequency(new_chan_no, new_band);
161 new_chan = ieee80211_get_channel(sdata->local->hw.wiphy, new_freq);
162 if (!new_chan || new_chan->flags & IEEE80211_CHAN_DISABLED) {
163 sdata_info(sdata,
164 "BSS %pM switches to unsupported channel (%d MHz),
disconnecting\n",
165 bssid, new_freq);
166 return -EINVAL;
167 }
168
169 if (sec_chan_offs) {
170 secondary_channel_offset = sec_chan_offs->sec_chan_offs;
171 } else if (!(sta_flags & IEEE80211_STA_DISABLE_HT)) {
172 /* If the secondary channel offset IE is not present,
173 * we can't know what's the post-CSA offset, so the
174 * best we can do is use 20MHz.
175 */
176 secondary_channel_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
177 }
178
179 switch (secondary_channel_offset) {
180 default:
181 /* secondary_channel_offset was present but is invalid */
182 case IEEE80211_HT_PARAM_CHA_SEC_NONE:
183 cfg80211_chandef_create(&csa_ie->chandef, new_chan,
184 NL80211_CHAN_HT20);
185 break;
186 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
187 cfg80211_chandef_create(&csa_ie->chandef, new_chan,
188 NL80211_CHAN_HT40PLUS);
189 break;
190 case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
191 cfg80211_chandef_create(&csa_ie->chandef, new_chan,
192 NL80211_CHAN_HT40MINUS);
193 break;
194 case -1:
195 cfg80211_chandef_create(&csa_ie->chandef, new_chan,
196 NL80211_CHAN_NO_HT);
197 /* keep width for 5/10 MHz channels */
198 switch (sdata->vif.bss_conf.chandef.width) {
199 case NL80211_CHAN_WIDTH_5:
200 case NL80211_CHAN_WIDTH_10:
201 csa_ie->chandef.width =
202 sdata->vif.bss_conf.chandef.width;
203 break;
204 default:
205 break;
206 }
207 break;
208 }
209
210 if (wide_bw_chansw_ie) {
211 u8 new_channel_width = wide_bw_chansw_ie->new_channel_width;
212 u8 new_seg0 = wide_bw_chansw_ie->new_center_freq_seg0;
213 u8 new_seg1 = wide_bw_chansw_ie->new_center_freq_seg1;
214 enum ieee80211_vht_chanwidth act_chanwidth =
215 ieee80211_vht_get_actual_chwidth(
216 new_channel_width, new_seg0, new_seg1);
217 enum ieee80211_center_freq_seg1 seg1_location =
218 ieee80211_get_center_freq_seg1_location(sdata,
219 vht_cap_info,
220 act_chanwidth);
221 struct ieee80211_vht_operation vht_oper = {
222 .chan_width = new_channel_width,
223 .center_freq_seg0_idx = new_seg0,
224 /* .basic_mcs_set doesn't matter */
225 };
226 struct ieee80211_ht_operation ht_oper = {};
227
228 if (seg1_location == IEEE80211_CENTER_FREQ_SEG1_VHT_OPER)
229 vht_oper.center_freq_seg1_idx = new_seg1;
230 else if (seg1_location == IEEE80211_CENTER_FREQ_SEG1_HT_OPER)
231 ht_oper.operation_mode =
232 (le16_to_cpu(new_seg1) <<
233
IEEE80211_HT_OP_MODE_CCFS2_SHIFT);
234
235 /* default, for the case of IEEE80211_VHT_CHANWIDTH_USE_HT,
236 * to the previously parsed chandef
237 */
238 new_vht_chandef = csa_ie->chandef;
239
240 /* ignore if parsing fails */
241 if (!ieee80211_chandef_vht_oper(&sdata->local->hw,
242 vht_cap_info,
243 &vht_oper, &ht_oper,
244 &new_vht_chandef))
245 new_vht_chandef.chan = NULL;
246
247 if (sta_flags & IEEE80211_STA_DISABLE_80P80MHZ &&
248 new_vht_chandef.width == NL80211_CHAN_WIDTH_80P80)
249 ieee80211_chandef_downgrade(&new_vht_chandef);
250 if (sta_flags & IEEE80211_STA_DISABLE_160MHZ &&
251 new_vht_chandef.width == NL80211_CHAN_WIDTH_160)
252 ieee80211_chandef_downgrade(&new_vht_chandef);
253 }
254
255 /* if VHT data is there validate & use it */
256 if (new_vht_chandef.chan) {
257 if (!cfg80211_chandef_compatible(&new_vht_chandef,
258 &csa_ie->chandef)) {
259 sdata_info(sdata,
260 "BSS %pM: CSA has inconsistent channel data, disconnecting\n",
261 bssid);
262 return -EINVAL;
263 }
264 csa_ie->chandef = new_vht_chandef;
265 }
266
267 if (elems->max_channel_switch_time)
268 csa_ie->max_switch_time =
269 (elems->max_channel_switch_time[0] << 0) |
270 (elems->max_channel_switch_time[1] << 8) |
271 (elems->max_channel_switch_time[2] << 16);
272
273 return 0;
274 }
275
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org