Handling user regdom hints while having intersected world regdom
Hi.
When a setup has multiple wifi cards anounncing different regdoms, the regularitory subsystem stores an intersected world regdom using aplha2 "98".
I wonder what the correct result should be, when I call "iw reg set 00" or with any other country code?
Because in my system with multiple cards nothing happened.
I added a lot of debug messages and I found the request is rejected with REG_REQ_IGNORE in __reg_process_hint_user (in net/wireless/reg.c:2371).
In this check, last_request is considered (the request before my user request), which in my case was the driver request for the second card leading to the intersected regdom. But since "98" doesn't match the regdom provided by the driver, the check returns true and the request gets rejected.
The comment above the check mentions not yet processed requests, but I doubt that checking the current regdom against the last_request regdom helps in my case. But from reading the code I got there is a "processed" flag for each requst.
So maybe a patch like below is enough? Or are there more things to consider? Or maybe I'm wrong and the current behavior is intended?!
Regards
Peter
net/wireless/reg.c +0 -0
@@ -2428,15 +2428,15 @@ __reg_process_hint_user(struct regulatory_request
*user_request) /*
* Process user requests only after previous user/driver/core
* requests have been processed
*/
if ((lr->initiator == NL80211_REGDOM_SET_BY_CORE ||
lr->initiator == NL80211_REGDOM_SET_BY_DRIVER ||
lr->initiator == NL80211_REGDOM_SET_BY_USER) &&
- regdom_changes(lr->alpha2))
+ !lr->processed)
return REG_REQ_IGNORE;
if (!regdom_changes(user_request->alpha2))
return REG_REQ_ALREADY_SET;
return REG_REQ_OK;}
Hi
After this change, on interface reconfig regdomains for both int. and usb radio are no longer 98. instead they are both set to US (int. radio regdomain) while usb should be set to GB. I am not sure if there is an easy way to handle this.
Bad thing is that regdomains still intersect for few seconds on usb card insert and during that time int. radio resets it's txpower to max->described in this bug issue:
https://bugs.openwrt.org/index.php?do=details&task_id=1745