====== Fedora iwlwifi Wi-Fi 6GHz DSM Unlock ======
===== Problem Statement =====
From Linux kernels ≥5.16, Intel committed a new feature to iwlwifi, "[[https://patchwork.kernel.org/project/linux-wireless/patch/iwlwifi.20211024181719.2fa34d31383c.I6504005c60882c94e6e58f64cab4e42e6481ce08@changeid/|iwlwifi: mvm: read 6E enablement flags from DSM and pass to FW]]".
In an ideal world, the commit results in this process flow:
- Computer OEM builds laptop integrating an Intel 802.11ax Wi-Fi card e.g. Intel AX210
- Computer OEM adds [[https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/09_ACPI-Defined_Devices_and_Device-Specific_Objects/ACPIdefined_Devices_and_DeviceSpecificObjects.html|ACPI Device Specific Methods]] into their BIOS ACPI tables that control [[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/wireless/intel/iwlwifi/fw/acpi.h#n132|Intel Wi-Fi features]] to fulfil regulatory responsibilities, such as:
* Enabling Wi-Fi 6E
* Enabling 802.11ax
* Enabling UNII-4 channels (channel 149-165)
* Etc.
- Intel driver reads ACPI DSMs
- Intel driver forwards DSMs to the Intel 802.11ax card's firmware
- Intel 802.11ax Wi-Fi card firmware restricts card features accordingly
However, there are already OEMs who have neglected to set Wi-Fi 6E/6GHz enablement in their BIOS ACPI tables accordingly, e.g.:
* [[https://forums.lenovo.com/t5/ThinkStation-Workstations/P360-Tiny-Bios-not-return-correct-oem-uhb-allow-bitmap-value-for-Wifi-6E-6GHz/m-p/5260797|Lenovo ThinkStation P360 Tiny]]
* [[https://community.frame.work/t/kernel-5-16-6ghz-disabled-ax210/15675|Framework 11th Gen Intel Core]]
* ThinkPad P14s Gen 2 Intel (my personal laptop)
Notably, these are products which list Wi-Fi 6E among their features in their spec sheets ([[https://psref.lenovo.com/syspool/Sys/PDF/ThinkStation/ThinkStation_P360_Tiny/ThinkStation_P360_Tiny_Spec.pdf|P360 Tiny]]|[[https://psref.lenovo.com/syspool/Sys/PDF/ThinkPad/ThinkPad_P14s_Gen_2_Intel/ThinkPad_P14s_Gen_2_Intel_Spec.pdf|P14s Gen 2 Intel]]|[[https://frame.work/products/laptop-11-gen-intel|Framework]]).
Unfortunately, there is no way to bypass the regulatory restrictions set by iwlwifi, as [[https://patchwork.kernel.org/project/linux-wireless/patch/1418664362-8319-2-git-send-email-arik@wizery.com/|the Linux wireless regulatory framework now allows wireless drivers to managed its own regulatory rules]], taking precedence over the userspace regulatory domain.
Essentially, with the combination of:
* Intel 802.11ax Wi-Fi card (MVM firmware)
* Linux kernel ≥5.16
* OEM (Lenovo, Framework, others?) BIOS with (mis)configured Intel Wi-Fi ACPI DSM tables
..., Wi-Fi 6GHz band cannot be utilized in userspace even when in an environment where Wi-Fi 6E is available for unlicensed, indoor use, without a BIOS update from the OEM.
===== Unlocking Wi-Fi 6E =====
The simplest fix to re-enable Wi-Fi 6E with the above combination of hardware and software, is to just bypass the code block introduced by the iwlwifi commit:
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index 1d5ee4330..ab182a1f8 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -1229,13 +1229,13 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)
&iwl_guid, &value);
if (!ret)
cmd.chan_state_active_bitmap = cpu_to_le32(value);
-
+/*
ret = iwl_acpi_get_dsm_u32(mvm->fwrt.dev, 0,
DSM_FUNC_ENABLE_6E,
&iwl_guid, &value);
if (!ret)
cmd.oem_uhb_allow_bitmap = cpu_to_le32(value);
-
+*/
ret = iwl_acpi_get_dsm_u32(mvm->fwrt.dev, 0,
DSM_FUNC_FORCE_DISABLE_CHANNELS,
&iwl_guid, &value);
Re-compiling your kernel is going to be easier than convincing your OEM's tech support to issue a BIOS update, so let's do that on Fedora in the meantime.
- Follow the [[https://docs.fedoraproject.org/en-US/quick-docs/kernel-build-custom/|Fedora documentation on building a kernel from the Fedora dist-git]] but stop before the ''fedpkg local'' step
* Remember to checkout the correct branch for the Fedora version you are running
- Edit ''linux-kernel-test.patch'' and paste the above patch in
* I tried adding the patch as a different file and adding a patch to ''kernel.spec'' but ''fedpkg'' no longer iterates through additional patch definitions
- Optional but highly recommended: ''sudo dnf install ccache'', if your kernel build fails for any reason, this greatly speeds up subsequent rebuilds (''fedpkg'' clears the build folder each time it is invocated)
- ''fedpkg local''
- ''cd x86_64 && ls''
- ''sudo dnf install '' followed by the packages you need, probably:
* ''kernel kernel-core kernel-modules kernel-modules-core kernel-modules-extra''
* If you use DKMS, probably ''kernel-devel kernel-devel-matched''
- Reboot into the new kernel
* If you use Secure Boot, be sure to enrol the new MOK key
- Verify Wi-Fi 6E channels are now either enabled or ''no IR'' rather than ''disabled'':\\
$ iw list|egrep "\* 6[0-9]+ MHz"
* 6015 MHz [13] (22.0 dBm) (no IR)
* 6035 MHz [17] (22.0 dBm) (no IR)
* 6055 MHz [21] (22.0 dBm) (no IR)
* 6075 MHz [25] (22.0 dBm) (no IR)
* 6095 MHz [29] (22.0 dBm) (no IR)
* 6115 MHz [33] (22.0 dBm) (no IR)
* 6135 MHz [37] (22.0 dBm) (no IR)
* 6155 MHz [41] (22.0 dBm) (no IR)
* 6175 MHz [45] (22.0 dBm) (no IR)
* 6195 MHz [49] (22.0 dBm) (no IR)
* 6215 MHz [53] (22.0 dBm) (no IR)
* 6235 MHz [57] (22.0 dBm) (no IR)
* 6255 MHz [61] (22.0 dBm) (no IR)
* 6275 MHz [65] (22.0 dBm) (no IR)
* 6295 MHz [69] (22.0 dBm) (no IR)
* 6315 MHz [73] (22.0 dBm) (no IR)
* 6335 MHz [77] (22.0 dBm) (no IR)
* 6355 MHz [81] (22.0 dBm) (no IR)
* 6375 MHz [85] (22.0 dBm) (no IR)
* 6395 MHz [89] (22.0 dBm) (no IR)
* 6415 MHz [93] (22.0 dBm) (no IR)
[snip]