From ce07b7382089ba0b57d3d390b6af56bd651cc5c4 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Thu, 28 Jan 2016 18:59:52 +0100 Subject: [PATCH] Updated Cubox next (4.3.4) + added patches for Atheros. Tested --- config/linux-cubox-next.config | 42 ++++++----- .../cubox-next/403-ath_regd_optional.patch | 58 +++++++++++++++ ...lock_atheros_regulatory_restrictions.patch | 70 +++++++++++++++++++ 3 files changed, 153 insertions(+), 17 deletions(-) create mode 100644 patch/kernel/cubox-next/403-ath_regd_optional.patch create mode 100644 patch/kernel/cubox-next/unlock_atheros_regulatory_restrictions.patch diff --git a/config/linux-cubox-next.config b/config/linux-cubox-next.config index ed99cad3dc..98f3f6c2c7 100644 --- a/config/linux-cubox-next.config +++ b/config/linux-cubox-next.config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.3.3 Kernel Configuration +# Linux/arm 4.3.4 Kernel Configuration # CONFIG_ARM=y CONFIG_ARM_HAS_SG_CHAIN=y @@ -1240,17 +1240,8 @@ CONFIG_RFKILL_GPIO=m CONFIG_NET_9P=m # CONFIG_NET_9P_DEBUG is not set # CONFIG_CAIF is not set -CONFIG_CEPH_LIB=m -CONFIG_NFC=m -# CONFIG_NFC_DIGITAL is not set -# CONFIG_NFC_NCI is not set -# CONFIG_NFC_HCI is not set - -# -# Near Field Communication (NFC) devices -# -# CONFIG_NFC_PN533 is not set -# CONFIG_NFC_SIM is not set +# CONFIG_CEPH_LIB is not set +# CONFIG_NFC is not set CONFIG_LWTUNNEL=y CONFIG_HAVE_BPF_JIT=y @@ -1904,20 +1895,37 @@ CONFIG_RTL8187_LEDS=y # CONFIG_ADM8211 is not set # CONFIG_MAC80211_HWSIM is not set # CONFIG_MWL8K is not set +CONFIG_ATH_COMMON=m CONFIG_ATH_CARDS=m +CONFIG_ATH_USER_REGD=y # CONFIG_ATH_DEBUG is not set -# CONFIG_ATH5K is not set -# CONFIG_ATH5K_PCI is not set -# CONFIG_ATH9K is not set +CONFIG_ATH5K=m +# CONFIG_ATH5K_DEBUG is not set +CONFIG_ATH5K_PCI=y +CONFIG_ATH9K_HW=m +CONFIG_ATH9K_COMMON=m +CONFIG_ATH9K_BTCOEX_SUPPORT=y +CONFIG_ATH9K=m +CONFIG_ATH9K_PCI=y +# CONFIG_ATH9K_AHB is not set +# CONFIG_ATH9K_DEBUGFS is not set +# CONFIG_ATH9K_DYNACK is not set +# CONFIG_ATH9K_WOW is not set +CONFIG_ATH9K_RFKILL=y +# CONFIG_ATH9K_CHANNEL_CONTEXT is not set +CONFIG_ATH9K_PCOEM=y # CONFIG_ATH9K_HTC is not set # CONFIG_CARL9170 is not set CONFIG_ATH6KL=m CONFIG_ATH6KL_SDIO=m # CONFIG_ATH6KL_USB is not set # CONFIG_ATH6KL_DEBUG is not set -# CONFIG_AR5523 is not set +CONFIG_AR5523=m # CONFIG_WIL6210 is not set -# CONFIG_ATH10K is not set +CONFIG_ATH10K=m +CONFIG_ATH10K_PCI=m +# CONFIG_ATH10K_DEBUG is not set +# CONFIG_ATH10K_DEBUGFS is not set # CONFIG_WCN36XX is not set # CONFIG_B43 is not set # CONFIG_B43LEGACY is not set diff --git a/patch/kernel/cubox-next/403-ath_regd_optional.patch b/patch/kernel/cubox-next/403-ath_regd_optional.patch new file mode 100644 index 0000000000..8c79e47e69 --- /dev/null +++ b/patch/kernel/cubox-next/403-ath_regd_optional.patch @@ -0,0 +1,58 @@ +--- a/drivers/net/wireless/ath/regd.c ++++ b/drivers/net/wireless/ath/regd.c +@@ -341,6 +341,10 @@ ath_reg_apply_beaconing_flags(struct wip + struct ieee80211_channel *ch; + unsigned int i; + ++#ifdef CPTCFG_ATH_USER_REGD ++ return; ++#endif ++ + for (band = 0; band < IEEE80211_NUM_BANDS; band++) { + if (!wiphy->bands[band]) + continue; +@@ -374,6 +378,10 @@ ath_reg_apply_ir_flags(struct wiphy *wip + { + struct ieee80211_supported_band *sband; + ++#ifdef CPTCFG_ATH_USER_REGD ++ return; ++#endif ++ + sband = wiphy->bands[IEEE80211_BAND_2GHZ]; + if (!sband) + return; +@@ -402,6 +410,10 @@ static void ath_reg_apply_radar_flags(st + struct ieee80211_channel *ch; + unsigned int i; + ++#ifdef CPTCFG_ATH_USER_REGD ++ return; ++#endif ++ + if (!wiphy->bands[IEEE80211_BAND_5GHZ]) + return; + +@@ -631,6 +643,10 @@ ath_regd_init_wiphy(struct ath_regulator + { + const struct ieee80211_regdomain *regd; + ++#ifdef CPTCFG_ATH_USER_REGD ++ return 0; ++#endif ++ + wiphy->reg_notifier = reg_notifier; + wiphy->regulatory_flags |= REGULATORY_STRICT_REG | + REGULATORY_CUSTOM_REG; +--- a/drivers/net/wireless/ath/Kconfig ++++ b/drivers/net/wireless/ath/Kconfig +@@ -21,6 +21,9 @@ menuconfig ATH_CARDS + + if ATH_CARDS + ++config ATH_USER_REGD ++ bool "Do not enforce EEPROM regulatory restrictions" ++ + config ATH_DEBUG + bool "Atheros wireless debugging" + ---help--- \ No newline at end of file diff --git a/patch/kernel/cubox-next/unlock_atheros_regulatory_restrictions.patch b/patch/kernel/cubox-next/unlock_atheros_regulatory_restrictions.patch new file mode 100644 index 0000000000..65324ca249 --- /dev/null +++ b/patch/kernel/cubox-next/unlock_atheros_regulatory_restrictions.patch @@ -0,0 +1,70 @@ +diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c +index ccc4c71..71a4d00 100644 +--- a/drivers/net/wireless/ath/regd.c ++++ b/drivers/net/wireless/ath/regd.c +@@ -49,12 +49,9 @@ static int __ath_regd_init(struct ath_regulatory *reg); + #define ATH9K_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 40, 0, 30,\ + NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) + +-#define ATH9K_2GHZ_ALL ATH9K_2GHZ_CH01_11, \ +- ATH9K_2GHZ_CH12_13, \ +- ATH9K_2GHZ_CH14 ++#define ATH9K_2GHZ_ALL REG_RULE(2400, 2483, 40, 0, 30, 0) + +-#define ATH9K_5GHZ_ALL ATH9K_5GHZ_5150_5350, \ +- ATH9K_5GHZ_5470_5850 ++#define ATH9K_5GHZ_ALL REG_RULE(5140, 5860, 40, 0, 30, 0) + + /* This one skips what we call "mid band" */ + #define ATH9K_5GHZ_NO_MIDBAND ATH9K_5GHZ_5150_5350, \ +@@ -76,9 +73,8 @@ static const struct ieee80211_regdomain ath_world_regdom_63_65 = { + .n_reg_rules = 4, + .alpha2 = "99", + .reg_rules = { +- ATH9K_2GHZ_CH01_11, +- ATH9K_2GHZ_CH12_13, +- ATH9K_5GHZ_NO_MIDBAND, ++ ATH9K_2GHZ_ALL, ++ ATH9K_5GHZ_ALL, + } + }; + +@@ -87,8 +83,8 @@ static const struct ieee80211_regdomain ath_world_regdom_64 = { + .n_reg_rules = 3, + .alpha2 = "99", + .reg_rules = { +- ATH9K_2GHZ_CH01_11, +- ATH9K_5GHZ_NO_MIDBAND, ++ ATH9K_2GHZ_ALL, ++ ATH9K_5GHZ_ALL, + } + }; + +@@ -97,7 +93,7 @@ static const struct ieee80211_regdomain ath_world_regdom_66_69 = { + .n_reg_rules = 3, + .alpha2 = "99", + .reg_rules = { +- ATH9K_2GHZ_CH01_11, ++ ATH9K_2GHZ_ALL, + ATH9K_5GHZ_ALL, + } + }; +@@ -107,8 +103,7 @@ static const struct ieee80211_regdomain ath_world_regdom_67_68_6A_6C = { + .n_reg_rules = 4, + .alpha2 = "99", + .reg_rules = { +- ATH9K_2GHZ_CH01_11, +- ATH9K_2GHZ_CH12_13, ++ ATH9K_2GHZ_ALL, + ATH9K_5GHZ_ALL, + } + }; +@@ -174,7 +169,7 @@ EXPORT_SYMBOL(ath_is_49ghz_allowed); + /* Frequency is one where radar detection is required */ + static bool ath_is_radar_freq(u16 center_freq) + { +- return (center_freq >= 5260 && center_freq <= 5700); ++ return false; + } + + /*