From fdf74fa06b2c61caa2674d71d89256f361479027 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Thu, 5 Oct 2023 23:04:14 +0100 Subject: [PATCH] add mt7915, 7615 wifi modules 7915 won't work until we have working MTD, because it needs to read calibration data from flash --- devices/belkin-rt3200/default.nix | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/devices/belkin-rt3200/default.nix b/devices/belkin-rt3200/default.nix index 4057982..0bf595d 100644 --- a/devices/belkin-rt3200/default.nix +++ b/devices/belkin-rt3200/default.nix @@ -24,7 +24,16 @@ }; }; - module = {pkgs, config, lib, ... }: { + module = {pkgs, config, lib, ... }: + let firmware = pkgs.stdenv.mkDerivation { + name = "wlan-firmware"; + phases = ["installPhase"]; + installPhase = '' + mkdir $out + cp ${pkgs.linux-firmware}/lib/firmware/mediatek/{mt7915,mt7615,mt7622}* $out + ''; + }; + in { imports = [ ../../modules/arch/aarch64.nix ]; kernel = { src = pkgs.pkgsBuildBuild.fetchurl { @@ -111,12 +120,22 @@ boot.commandLine = [ "console=ttyS0,115200" ]; + filesystem = + let inherit (pkgs.pseudofile) dir symlink; + in + dir { + lib = dir { + firmware = dir { + mediatek = symlink firmware; + }; + }; + }; hardware = let openwrt = pkgs.openwrt; mac80211 = pkgs.mac80211.override { - drivers = ["mac80211_hwsim"]; + drivers = [ "mt7915e" "mt7615e"]; klibBuild = config.system.outputs.kernel.modulesupport; }; in { @@ -149,6 +168,10 @@ ifname = "wlan0"; dependencies = [ mac80211 ]; }; + wlan5 = link.build { + ifname = "wlan1"; + dependencies = [ mac80211 ]; + }; }; };