Skip to content

Instantly share code, notes, and snippets.

@alexalouit
Last active June 12, 2020 14:36
Show Gist options
  • Save alexalouit/e7a72f1c455db424722c2c4859aa8e87 to your computer and use it in GitHub Desktop.
Save alexalouit/e7a72f1c455db424722c2c4859aa8e87 to your computer and use it in GitHub Desktop.
compile atheros noregulatory
$ apt-get install linux-headers-`uname -r`
$ apt-get install linux-source
$ mkdir -p ~/build/ath; cd ~/build/ath
$ tar -xvf /usr/src/linux-source-`uname -r`.tar.xz
# patch linux-source-`uname -r`/drivers/net/wireless/ath/regd.c
$ cp /boot/config-`uname -r` ~/build/ath/.config
$ cp /usr/src/linux-headers-`uname -r`/Module.symvers ~/build/ath/linux-source-`uname -r`/
$ cd linux-source-`uname -r`
$ make oldconfig
$ make prepare
$ make scripts
$ make SUBDIRS=drivers/net/wireless/ath modules
$ install -b ~/build/ath/drivers/net/wireless/ath/ath.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/ath/ath.ko
$ depmod -a
$ iw reg set US
$ nano /etc/default/crda
# add US to REGDOMAIN
# then reboot or load module by hand
--- drivers/net/wireless/ath/regd.c 2017-09-13 00:12:11.038844554 +0200
+++ drivers/net/wireless/ath/regd.c 2017-09-13 00:13:32.676068380 +0200
@@ -341,6 +341,8 @@
struct ieee80211_channel *ch;
unsigned int i;
+ return;
+
for (band = 0; band < NUM_NL80211_BANDS; band++) {
if (!wiphy->bands[band])
continue;
@@ -374,6 +376,8 @@
{
struct ieee80211_supported_band *sband;
+ return;
+
sband = wiphy->bands[NL80211_BAND_2GHZ];
if (!sband)
return;
@@ -402,6 +406,8 @@
struct ieee80211_channel *ch;
unsigned int i;
+ return;
+
if (!wiphy->bands[NL80211_BAND_5GHZ])
return;
@@ -632,6 +638,8 @@
{
const struct ieee80211_regdomain *regd;
+ return 0;
+
wiphy->reg_notifier = reg_notifier;
wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
REGULATORY_CUSTOM_REG;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment