[PATCH] wifi: mt76: mt7925: add regulatory wiphy self manager support
kernel test robot
lkp at intel.com
Wed Jun 3 13:27:39 PDT 2026
Hi JB,
kernel test robot noticed the following build errors:
[auto build test ERROR on wireless-next/main]
[also build test ERROR on wireless/main linus/master v7.1-rc6 next-20260602]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/JB-Tsai/wifi-mt76-mt7925-add-regulatory-wiphy-self-manager-support/20260603-155908
base: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link: https://lore.kernel.org/r/20260603075331.1234691-1-jb.tsai%40mediatek.com
patch subject: [PATCH] wifi: mt76: mt7925: add regulatory wiphy self manager support
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20260603/202606032205.iaSDVq2Z-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project f43d6834093b19baf79beda8c0337ab020ac5f17)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260603/202606032205.iaSDVq2Z-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606032205.iaSDVq2Z-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/net/wireless/mediatek/mt76/mt7925/regd.c:361:43: error: passing 'const struct ieee80211_regdomain *' to parameter of type 'struct ieee80211_regdomain *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
361 | return regulatory_set_wiphy_regd(wiphy, &mt7925_regd_ww);
| ^~~~~~~~~~~~~~~
include/net/cfg80211.h:8082:38: note: passing argument to parameter 'rd' here
8082 | struct ieee80211_regdomain *rd);
| ^
1 error generated.
vim +361 drivers/net/wireless/mediatek/mt76/mt7925/regd.c
286
287 int mt7925_regd_update(struct mt792x_phy *phy, char *alpha2)
288 {
289 struct wiphy *wiphy = phy->mt76->hw->wiphy;
290 struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
291 struct mt792x_dev *dev = mt792x_hw_dev(hw);
292 struct mt7925_regd_rule *mt7925_rule;
293 struct mt76_dev *mdev = &dev->mt76;
294 struct ieee80211_regdomain *regd;
295 struct ieee80211_reg_rule *rule;
296 struct mt7925_regd_rule_ev *ev;
297 int i, num_of_rules = 0;
298 struct sk_buff *skb;
299 int ret = 0;
300
301 if (dev->hw_full_reset)
302 return 0;
303
304 if (!MT7925_REGD_SUPPORTED(phy))
305 return -EOPNOTSUPP;
306
307 mt792x_mutex_acquire(dev);
308 skb = mt7925_regd_query_regdb(phy, alpha2);
309 mt792x_mutex_release(dev);
310
311 if (!skb)
312 return -EINVAL;
313
314 ev = (struct mt7925_regd_rule_ev *)(skb->data + 4);
315 num_of_rules = le32_to_cpu(ev->n_reg_rules);
316
317 if (!num_of_rules ||
318 WARN_ON_ONCE(num_of_rules > NL80211_MAX_SUPP_REG_RULES)) {
319 ret = -EINVAL;
320 goto err;
321 }
322
323 regd = kzalloc(struct_size(regd, reg_rules, num_of_rules), GFP_KERNEL);
324 if (!regd) {
325 ret = -ENOMEM;
326 goto err;
327 }
328
329 for (i = 0; i < num_of_rules; i++) {
330 mt7925_rule = &ev->reg_rule[i];
331 rule = ®d->reg_rules[i];
332
333 rule->freq_range.start_freq_khz =
334 MHZ_TO_KHZ(mt7925_rule->start_freq);
335 rule->freq_range.end_freq_khz =
336 MHZ_TO_KHZ(mt7925_rule->end_freq);
337 rule->freq_range.max_bandwidth_khz =
338 MHZ_TO_KHZ(mt7925_rule->max_bw);
339 /* not used by fw */
340 rule->power_rule.max_antenna_gain = DBI_TO_MBI(6);
341 rule->power_rule.max_eirp = DBM_TO_MBM(22);
342 rule->flags = mt7925_rule->flags;
343 }
344
345 regd->n_reg_rules = num_of_rules;
346 regd->dfs_region = ev->dfs_region;
347
348 memcpy(regd->alpha2, alpha2, 2);
349 memcpy(mdev->alpha2, alpha2, 2);
350
351 dev->regd_change = true;
352 mt7925_mcu_regd_update(dev, alpha2, ENVIRON_ANY);
353
354 ret = regulatory_set_wiphy_regd(wiphy, regd);
355
356 kfree(regd);
357 err:
358 dev_kfree_skb(skb);
359
360 if (ret < 0)
> 361 return regulatory_set_wiphy_regd(wiphy, &mt7925_regd_ww);
362
363 return ret;
364 }
365 EXPORT_SYMBOL_GPL(mt7925_regd_update);
366
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
More information about the Linux-mediatek
mailing list