Hacker News new | ask | show | jobs
by dataflow 1273 days ago
How does a Wi-Fi chip know what country it's operating in to know what the relevant DFS channels are?
4 comments

It's either set by the user, or it's already set on the device based on the market the product is selling into. Phones have GPS though, so I'm not sure how that factors into it.
It's usually programmed into an EEPROM inside the device. Nowadays for compliance reasons, the radio firmware may enforce it rather than the software driver.
It'll have a region set by the manufacturer in it's firmware. IEEE 802.11d-2001 also added country information to AP beacons and probes. Nearby access points will advertise a country code to each other. Hostapd and/or the Wi-Fi device firmware can take advantage of that.

[1]: https://en.wikipedia.org/wiki/IEEE_802.11d-2001

[2]: https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf

Fun fact: Access points can also advertise a timestamp and timezone.

[3]: https://openwrt.org/docs/guide-user/network/wifi/basic#bss_t...

APs are normally programmed based on the market they're sold into. Client devices receive information about which regulatory domain they're in from the AP they're connecting to.
Can't imagine mom and pop shop on aliexpress is programming APs individually based on the recipient address.
There's no technical mechanism to prevent someone operating an AP inappropriately. That's more an opportunity to discover how effective your local enforcement agency is.
The brand I use has a drop down menu to select from.

Also, regarding WiFi equipment. Finding out the quality of consumer WiFi gear is near impossible before buying, because of so many other factors affecting wifi performance (especially that I use mostly 2.4ghz). If anyone has a foolproof method for this please let me know.