From 65479e206b62a9b269d3825f8cc5e9d660d583ec Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 12 Feb 2024 20:41:10 +0000 Subject: [PATCH] use regular kernel not backports for mac80211 the kernel on most devices is now newer than the version that the backported drivers were backported from --- devices/belkin-rt3200/default.nix | 16 ++++++++++------ devices/gl-ar750/default.nix | 21 ++++++++++++++------- devices/gl-mt300a/default.nix | 14 +++++++++++--- devices/gl-mt300n-v2/default.nix | 15 ++++++++++++--- devices/tp-archer-ax23/default.nix | 17 +++++++++++------ devices/turris-omnia/default.nix | 16 ++++++++++++---- modules/wlan.nix | 8 ++++++++ 7 files changed, 78 insertions(+), 29 deletions(-) diff --git a/devices/belkin-rt3200/default.nix b/devices/belkin-rt3200/default.nix index 720bf02..9e1ce90 100644 --- a/devices/belkin-rt3200/default.nix +++ b/devices/belkin-rt3200/default.nix @@ -149,6 +149,13 @@ WATCHDOG = "y"; MEDIATEK_WATCHDOG = "y"; }; + conditionalConfig = { + WLAN= { + MT7615E = "m"; + MT7622_WMAC = "y"; + MT7915E = "m"; + }; + }; }; boot = { commandLine = [ "console=ttyS0,115200" ]; @@ -169,12 +176,9 @@ hardware = let openwrt = pkgs.openwrt; - mac80211 = pkgs.mac80211.override { - drivers = [ - "mt7615e" - "mt7915e" - ]; - klibBuild = config.system.outputs.kernel.modulesupport; + mac80211 = pkgs.kmodloader.override { + targets = ["mt7615e" "mt7915e"]; + inherit (config.system.outputs) kernel; }; in { ubi = { diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix index 37b225c..db308db 100644 --- a/devices/gl-ar750/default.nix +++ b/devices/gl-ar750/default.nix @@ -71,9 +71,9 @@ cp $blobdir/board.bin $out/ath10k/QCA9887/hw1.0/ ''; }; - mac80211 = pkgs.mac80211.override { - drivers = ["ath9k" "ath10k_pci"]; - klibBuild = config.system.outputs.kernel.modulesupport; + mac80211 = pkgs.kmodloader.override { + targets = ["ath9k" "ath10k_pci"]; + inherit (config.system.outputs) kernel; }; ath10k_cal_data = let @@ -211,14 +211,21 @@ WATCHDOG = "y"; ATH79_WDT = "y"; # watchdog timer - # this is all copied from nixwrt ath79 config. Clearly not all - # of it is device config, some of it is wifi config or - # installation method config or ... - EARLY_PRINTK = "y"; PRINTK_TIME = "y"; }; + conditionalConfig = { + WLAN = { + WLAN_VENDOR_ATH = "y"; + ATH_COMMON = "m"; + ATH9K = "m"; + ATH9K_AHB = "y"; + ATH10K = "m"; + ATH10K_PCI = "y"; + ATH10K_DEBUG = "y"; + }; + }; }; }; } diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix index cbfccbd..9fb6c0e 100644 --- a/devices/gl-mt300a/default.nix +++ b/devices/gl-mt300a/default.nix @@ -47,9 +47,9 @@ let inherit (pkgs.liminix.networking) interface; inherit (pkgs) openwrt; - mac80211 = pkgs.mac80211.override { - drivers = ["rt2800soc"]; - klibBuild = config.system.outputs.kernel.modulesupport; + mac80211 = pkgs.kmodloader.override { + targets = ["rt2800soc"]; + inherit (config.system.outputs) kernel; }; in { imports = [ @@ -178,6 +178,14 @@ } // lib.optionalAttrs (config.system.service ? vlan) { SWCONFIG = "y"; }; + conditionalConfig = { + WLAN = { + WLAN_VENDOR_RALINK = "y"; + RT2800SOC = "m"; + RT2X00 = "m"; + }; + }; + }; }; } diff --git a/devices/gl-mt300n-v2/default.nix b/devices/gl-mt300n-v2/default.nix index 2d9bb65..3bc8368 100644 --- a/devices/gl-mt300n-v2/default.nix +++ b/devices/gl-mt300n-v2/default.nix @@ -43,9 +43,9 @@ inherit (pkgs.pseudofile) dir symlink; inherit (pkgs) openwrt; - mac80211 = pkgs.mac80211.override { - drivers = ["mt7603e"]; - klibBuild = config.system.outputs.kernel.modulesupport; + mac80211 = pkgs.kmodloader.override { + targets = ["mt7603e"]; + inherit (config.system.outputs) kernel; }; wlan_firmware = pkgs.fetchurl { url = "https://github.com/openwrt/mt76/raw/f24b56f935392ca1d35fae5fd6e56ef9deda4aad/firmware/mt7628_e2.bin"; @@ -185,6 +185,15 @@ RALINK_WDT = "y"; # watchdog MT7621_WDT = "y"; # or it might be this one }; + conditionalConfig = { + WLAN = { + WLAN_VENDOR_RALINK = "y"; + WLAN_VENDOR_MEDIATEK = "y"; + MT7603E = "m"; + }; + }; + }; + }; } diff --git a/devices/tp-archer-ax23/default.nix b/devices/tp-archer-ax23/default.nix index 2357e69..d870c42 100644 --- a/devices/tp-archer-ax23/default.nix +++ b/devices/tp-archer-ax23/default.nix @@ -322,9 +322,14 @@ ZSTD_COMPRESS="y"; ZSTD_DECOMPRESS="y"; } // lib.optionalAttrs (config.system.service ? watchdog) { - RALINK_WDT = "y"; # watchdog - MT7621_WDT = "y"; # or it might be this one - }; + RALINK_WDT = "y"; # watchdog + MT7621_WDT = "y"; # or it might be this one + }; + conditionalConfig = { + WLAN = { + MT7915E = "m"; + }; + }; }; tplink-safeloader.board = "ARCHER-AX23-V1"; boot = { @@ -353,11 +358,11 @@ hardware = let openwrt = pkgs.openwrt; - mac80211 = pkgs.mac80211.override { - drivers = [ + mac80211 = pkgs.kmodloader.override { + targets = [ "mt7915e" ]; - klibBuild = config.system.outputs.kernel.modulesupport; + inherit (config.system.outputs) kernel; }; in { # from OEM bootlog (openwrt wiki): diff --git a/devices/turris-omnia/default.nix b/devices/turris-omnia/default.nix index 64c6db7..39bbc64 100644 --- a/devices/turris-omnia/default.nix +++ b/devices/turris-omnia/default.nix @@ -286,9 +286,17 @@ USB_XHCI_MVEBU = "y"; USB_XHCI_HCD = "y"; }; + WLAN = { + WLAN_VENDOR_ATH = "y"; + ATH_COMMON = "m"; + ATH9K = "m"; + ATH9K_PCI = "y"; + ATH10K = "m"; + ATH10K_PCI = "m"; + ATH10K_DEBUG = "y"; + }; }; }; - boot = { commandLine = [ "console=ttyS0,115200" @@ -328,9 +336,9 @@ }; hardware = let - mac80211 = pkgs.mac80211.override { - drivers = ["ath9k_pci" "ath10k_pci"]; - klibBuild = config.system.outputs.kernel.modulesupport; + mac80211 = pkgs.kmodloader.override { + inherit (config.system.outputs) kernel; + targets = ["ath9k" "ath10k_pci"]; }; in { defaultOutput = "mtdimage"; diff --git a/modules/wlan.nix b/modules/wlan.nix index 6e62dda..3a3dfe8 100644 --- a/modules/wlan.nix +++ b/modules/wlan.nix @@ -46,6 +46,14 @@ in { CRYPTO_SHA1 = "y"; ENCRYPTED_KEYS = "y"; KEYS = "y"; + + WLAN = "y"; + CFG80211 = "m"; + MAC80211 = "m"; + EXPERT = "y"; + CFG80211_CERTIFICATION_ONUS = "y"; + CFG80211_REQUIRE_SIGNED_REGDB = "n"; # depends on ONUS + CFG80211_CRDA_SUPPORT = "n"; }; }; };