Skip to content

regdomain: Automatically set the wireless regularity domain#207

Merged
ptr1337 merged 4 commits intomasterfrom
wireless-reg-set
Feb 28, 2026
Merged

regdomain: Automatically set the wireless regularity domain#207
ptr1337 merged 4 commits intomasterfrom
wireless-reg-set

Conversation

@ptr1337
Copy link
Copy Markdown
Member

@ptr1337 ptr1337 commented Feb 13, 2026

Signed-off-by: Peter Jung <admin@ptr1337.dev>
@ptr1337 ptr1337 self-assigned this Feb 13, 2026
@ptr1337 ptr1337 added the enhancement New feature or request label Feb 13, 2026

This comment was marked as outdated.

Comment thread usr/lib/iw-set-regdomain Outdated

if [ -f "$LOCALTIME" ]
then
ZONE=$(readlink -f $LOCALTIME)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just query it via timedatectl show -P "Timezone"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been mainly picked from the KDE distribution. We can of course make changes

Signed-off-by: Peter Jung <admin@ptr1337.dev>

This comment was marked as outdated.

@Revival8697
Copy link
Copy Markdown

Must it be set the correct country instead of US, legally speaking?

If not, just set it to US to get full band.

@ptr1337
Copy link
Copy Markdown
Member Author

ptr1337 commented Feb 27, 2026

Must it be set the correct country instead of US, legally speaking?

If not, just set it to US to get full band.

It depends on the country. Some countries do not allow Wifi 7 for example and enabling it at them would be an violation. Reason this would be important, specially for mobile device to not use illegal frequencies.

@Revival8697
Copy link
Copy Markdown

It depends on the country. Some countries do not allow Wifi 7 for example and enabling it at them would be an violation. Reason this would be important, specially for mobile device to not use illegal frequencies.

That responsibility should be on the AP side but okay.

@ptr1337
Copy link
Copy Markdown
Member Author

ptr1337 commented Feb 27, 2026

It depends on the country. Some countries do not allow Wifi 7 for example and enabling it at them would be an violation. Reason this would be important, specially for mobile device to not use illegal frequencies.

That responsibility should be on the AP side but okay.

No, because the device itself can also set specific frequencies. The device also needs to enable/disable these specific frequencies if not allowed. You can research in regulations.

@Revival8697
Copy link
Copy Markdown

No, because the device itself can also set specific frequencies. The device also needs to enable/disable these specific frequencies if not allowed. You can research in regulations.

My understanding is that this responsibility lies with the AP. A client can request but does not control spectrum usage. It is the AP that would be at fault for transmitting on an illegal band.

@ptr1337
Copy link
Copy Markdown
Member Author

ptr1337 commented Feb 27, 2026

No, because the device itself can also set specific frequencies. The device also needs to enable/disable these specific frequencies if not allowed. You can research in regulations.

My understanding is that this responsibility lies with the AP. A client can request but does not control spectrum usage. It is the AP that would be at fault for transmitting on an illegal band.

No, thats not true :)
https://wireless.docs.kernel.org/en/latest/en/developers/regulatory.html
https://www.wwt.com/blog/automated-frequency-coordination-afc-for-6ghz-wi-fi
https://approve-it.net/professional-blog/how-is-wi-fi-6-wi-fi-6e-and-wi-fi-7-impacting-global-regulatory-compliance/

I work in this sector for UWB in my daytoday job and its required to implement the detection on the client side. as example in russia its not allowed to enable UWB, either on client or AP/receiver side.

That is because you could interfere with signals from the military or other restricted frequency/usecases.

Right now on CachyOS to get Wifi 7 the user needs to set the US as region for example manually. This PR will set it automatically.

Signed-off-by: Peter Jung <admin@ptr1337.dev>
Copy link
Copy Markdown
Member

@sirlucjan sirlucjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lucjan at cachyos ~ 21:24:54    
❯ systemctl status cachyos-iw-set-regdomain.service
○ cachyos-iw-set-regdomain.service - Set Wireless Regulatory Domain on Timezone Change
     Loaded: loaded (/usr/lib/systemd/system/cachyos-iw-set-regdomain.service; static)
     Active: inactive (dead) since Fri 2026-02-27 21:21:03 CET; 3min 54s ago
 Invocation: f305361cb1fc444ab7734dd9ad63b2e3
    Process: 999 ExecStart=/usr/lib/iw-set-regdomain (code=exited, status=0/SUCCESS)
   Main PID: 999 (code=exited, status=0/SUCCESS)
   Mem peak: 2.5M
        CPU: 9ms

lut 27 21:21:03 cachyos systemd[1]: Starting Set Wireless Regulatory Domain on Timezone Change...
lut 27 21:21:03 cachyos systemd[1]: cachyos-iw-set-regdomain.service: Deactivated successfully.
lut 27 21:21:03 cachyos systemd[1]: Finished Set Wireless Regulatory Domain on Timezone Change.
lucjan at cachyos ~ 21:24:57    
❯ iw reg get                                       
global
country PL: DFS-ETSI
        (2400 - 2483 @ 40), (N/A, 20), (N/A)
        (5150 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
        (5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
        (5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
        (5725 - 5875 @ 80), (N/A, 13), (N/A)
        (5945 - 6425 @ 320), (N/A, 23), (N/A), NO-OUTDOOR
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)

Signed-off-by: Peter Jung <admin@ptr1337.dev>
@ptr1337
Copy link
Copy Markdown
Member Author

ptr1337 commented Feb 28, 2026

Time to merge this! Thanks for KDE for giving this awesome idea! :))

@ptr1337 ptr1337 merged commit f589cbc into master Feb 28, 2026
@ptr1337 ptr1337 deleted the wireless-reg-set branch February 28, 2026 10:57
@Barmem
Copy link
Copy Markdown

Barmem commented Mar 4, 2026

Can I disable it?

@ptr1337
Copy link
Copy Markdown
Member Author

ptr1337 commented Mar 4, 2026

Can I disable it?

Yes, you can remove iw or mask the user service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants