twisteroidambassador / arch-linux-ath-user-regd Goto Github PK
View Code? Open in Web Editor NEWArch Linux kernel with patched Atheros drivers to ignore regulatory domain in EEPROM.
Arch Linux kernel with patched Atheros drivers to ignore regulatory domain in EEPROM.
I have found a site [1] which contains instructions on how to patch ath10k to ignore regulatory domain in EEPROM. Since I have a Qualcomm Atheros card which is affected by the problem, I tried the solution and it worked.
For me, I do the following steps in /tmp/
because it is faster, especially when extracting the kernel source code:
Step 1. Get the kernel source code, e.g. https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.14.14.tar.xz
(Download the appropriate version according to the result of uname -r
).
Step 2. Extract it, e.g. tar -xvJf linux-4.14.14.tar.xz
Step 3. Edit drivers/net/wireless/ath/regd.c
in the extracted directory:
There are four parts to be patched in the aforementioned file:
Part 1:
static void
ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
struct ath_regulatory *reg,
enum nl80211_reg_initiator initiator)
{
enum nl80211_band band;
struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch;
unsigned int i;
+#ifdef CONFIG_ATH_USER_REGD
+ return;
+#endif
for (band = 0; band < NUM_NL80211_BANDS; band++) {
if (!wiphy->bands[band])
continue;
sband = wiphy->bands[band];
for (i = 0; i < sband->n_channels; i++) {
ch = &sband->channels[i];
__ath_reg_apply_beaconing_flags(wiphy, reg,
initiator, ch);
}
}
}
Part 2:
static void
ath_reg_apply_ir_flags(struct wiphy *wiphy,
struct ath_regulatory *reg,
enum nl80211_reg_initiator initiator)
{
struct ieee80211_supported_band *sband;
+#ifdef CONFIG_ATH_USER_REGD
+ return;
+#endif
sband = wiphy->bands[NL80211_BAND_2GHZ];
if (!sband)
return;
Part 3:
static void ath_reg_apply_radar_flags(struct wiphy *wiphy)
{
struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch;
unsigned int i;
+#ifdef CONFIG_ATH_USER_REGD
+ return;
+#endif
if (!wiphy->bands[NL80211_BAND_5GHZ])
return;
sband = wiphy->bands[NL80211_BAND_5GHZ];
Part 4:
static int
ath_regd_init_wiphy(struct ath_regulatory *reg,
struct wiphy *wiphy,
void (*reg_notifier)(struct wiphy *wiphy,
struct regulatory_request *request))
{
const struct ieee80211_regdomain *regd;
wiphy->reg_notifier = reg_notifier;
+#ifdef CONFIG_ATH_USER_REGD
+ return 0;
+#endif
wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
REGULATORY_CUSTOM_REG;
if (ath_is_world_regd(reg)) {
Step 4. Edit drivers/net/wireless/ath/Kconfig
in the extracted directory:
if WLAN_VENDOR_ATH
+config ATH_USER_REGD
+ bool "Do not enforce EEPROM regulatory restrictions"
+ default n
config ATH_DEBUG
bool "Atheros wireless debugging"
---help---
Say Y, if you want to debug atheros wireless drivers.
Right now only ath9k makes use of this.
Step 5. Run the following commands:
make clean && make mrproper
cp /usr/lib/modules/$(uname -r)/build/Module.symvers ./
# Copy current existing kernel configuration
zcat /proc/config.gz > .config
make oldconfig && make prepare
If the following appears:
Wireless LAN (WLAN) [Y/n/?] y
ADMtek devices (WLAN_VENDOR_ADMTEK) [Y/n/?] y
ADMtek ADM8211 support (ADM8211) [M/n/?] m
Atheros/Qualcomm devices (WLAN_VENDOR_ATH) [Y/n/?] y
Do not enforce EEPROM regulatory restrictions (ATH_USER_REGD) [N/y]
Enter y
.
Then, start the compilation:
make scripts
make M=drivers/net/wireless/ath
Step 6. Replace the kernel module by entering the following commands:
# Use xz. Although the website says to use gzip, which will not work. From the file list on https://www.archlinux.org/packages/core/x86_64/linux/ , one can see that xz is used.
xz drivers/net/wireless/ath/ath.ko
sudo cp -f drivers/net/wireless/ath/ath.ko.xz /lib/modules/$(uname -r)/kernel/drivers/net/wireless/ath/ath.ko.xz
sudo depmod -a
Step 7. Reboot.
The above method does not require the compilation of the entire kernel, which takes many hours.
Hi,
I found that there is a power limit related update for 402-ath_regd_optional.patch.
79a768a90fa94c0a38c9def1992cc974c091e286
That patch maybe helpful as I was suffering week signal strength issue after applying your patch.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.