Re: iwlwifi(4) on riscv64 (intel ax200)

From: Tassilo Philipp <tphilipp_at_potion-studios.com>
Date: Mon, 05 Jan 2026 13:16:42 UTC
Sorry, should've inlined the patch, for it to show up in the mailing 
list archive, as well:


--- /usr/src/sys/contrib/dev/iwlwifi/pcie/gen1_2/trans.c
+++ /usr/src/sys/contrib/dev/iwlwifi/pcie/gen1_2/trans.c
@@ -2060,6 +2060,7 @@

  void iwl_trans_pcie_check_product_reset_mode(struct pci_dev *pdev)
  {
+#ifdef CONFIG_ACPI
  	union acpi_object *res;

  	res = iwl_trans_pcie_call_prod_reset_dsm(pdev,
@@ -2077,11 +2078,13 @@
  				    res->integer.value);

  	ACPI_FREE(res);
+#endif
  }

  static void iwl_trans_pcie_set_product_reset(struct pci_dev *pdev, bool enable,
  					     bool integrated)
  {
+#ifdef CONFIG_ACPI
  	union acpi_object *res;
  	u16 mode = enable ? DSM_INTERNAL_PLDR_MODE_EN_PROD_RESET : 0;
  
@@ -2104,10 +2107,12 @@
  	IWL_DEBUG_DEV_POWER(&pdev->dev, "%sabled product reset via DSM\n",
  			    enable ? "En" : "Dis");
  	iwl_trans_pcie_check_product_reset_mode(pdev);
+#endif
  }

  void iwl_trans_pcie_check_product_reset_status(struct pci_dev *pdev)
  {
+#ifdef CONFIG_ACPI
  	union acpi_object *res;

  	res = iwl_trans_pcie_call_prod_reset_dsm(pdev,
@@ -2125,6 +2130,7 @@
  				    res->integer.value);

  	ACPI_FREE(res);
+#endif
  }

  static void iwl_trans_pcie_call_reset(struct pci_dev *pdev)
--- /usr/src/sys/modules/iwlwifi/Makefile
+++ /usr/src/sys/modules/iwlwifi/Makefile
@@ -4,7 +4,7 @@

  WITH_CONFIG_PM=	0
  WITH_DEBUGFS=	0
-WITH_CONFIG_ACPI=	1
+WITH_CONFIG_ACPI=	0

  KMOD=	if_iwlwifi
  
--- /usr/ports/net/wifi-firmware-kmod/Makefile.inc
+++ /usr/ports/net/wifi-firmware-kmod/Makefile.inc
@@ -77,7 +77,7 @@
  DIST_SUBDIR=	linux-firmware/${FWDRV}fw
  EXTRACT_ONLY=
  
-ONLY_FOR_ARCHS=	aarch64 amd64 i386
+ONLY_FOR_ARCHS=	aarch64 amd64 i386 riscv64
  ONLY_FOR_ARCHS_REASON=	LinuxKPI driver only available for these architectures

  USES=		uidfix

On Mon, Jan 05, 2026 at 02:04:58PM +0100, Tassilo Philipp wrote:
> I thought I simply share this here, maybe it's useful to someone. I 
> got an intel wifi-6 ax200 m.2 slot card working on a HiFive Unmatched 
> board w/ fbsd 15.0. It seems to work fine for me, so far, but it's in 
> no way thoroughly tested...
>
> In order to build the if_iwlwifi kernel module I needed to disable 
> ACPI in the module's Makefile, and patch a source file to add some 
> missing ACPI related #ifdefs.
>
> Also, some firmware files need to be built and installed via ports' 
> net/wifi-firmware-iwlwifi-kmod. Those firmware files can be built on 
> any platform - when building them on riscv64 themselves, a small patch 
> needs to be applied to net/wifi-firmware-kmod so riscv64 isn't 
> excluded, though.
>
> Anywho, to have a seemingly working iwlwifi(4) on my riscv64 setup, 
> the following steps were needed:
>
> 1) make sure src is installed
> 2) apply attached patch (which does the tweaks described above)
> 3) build/install kernel module from source:
>    cd /usr/src/sys/modules/iwlwifi
>    make
>    make install clean 
> 4) install firmware port:
>    cd /usr/ports/net/wifi-firmware-iwlwifi-kmod
>    make install clean 
> 5) kldload wlan_ccmp wlan_amrr if_iwlwifi
>
> As said, thought that I share this here, happy that it's working, but 
> no idea or guarantee about stability and correctness.
>
> Cheers
>

> --- /usr/src/sys/contrib/dev/iwlwifi/pcie/gen1_2/trans.c
> +++ /usr/src/sys/contrib/dev/iwlwifi/pcie/gen1_2/trans.c
> @@ -2060,6 +2060,7 @@
> 
> void iwl_trans_pcie_check_product_reset_mode(struct pci_dev *pdev) 
> {
> +#ifdef CONFIG_ACPI
> 	union acpi_object *res;
> 
> 	res = iwl_trans_pcie_call_prod_reset_dsm(pdev,
> @@ -2077,11 +2078,13 @@
> 				    res->integer.value);
> 
> 	ACPI_FREE(res);
> +#endif
> }
> 
> static void iwl_trans_pcie_set_product_reset(struct pci_dev *pdev, bool enable, 
> 					     bool integrated)
> {
> +#ifdef CONFIG_ACPI
> 	union acpi_object *res;
> 	u16 mode = enable ? DSM_INTERNAL_PLDR_MODE_EN_PROD_RESET : 0;
> 
> @@ -2104,10 +2107,12 @@
> 	IWL_DEBUG_DEV_POWER(&pdev->dev, "%sabled product reset via DSM\n", 
> 			    enable ? "En" : "Dis"); 
> 	iwl_trans_pcie_check_product_reset_mode(pdev);
> +#endif
> }
> 
> void iwl_trans_pcie_check_product_reset_status(struct pci_dev *pdev) 
> {
> +#ifdef CONFIG_ACPI
> 	union acpi_object *res;
> 
> 	res = iwl_trans_pcie_call_prod_reset_dsm(pdev,
> @@ -2125,6 +2130,7 @@
> 				    res->integer.value);
> 
> 	ACPI_FREE(res);
> +#endif
> }
> 
> static void iwl_trans_pcie_call_reset(struct pci_dev *pdev)
> --- /usr/src/sys/modules/iwlwifi/Makefile
> +++ /usr/src/sys/modules/iwlwifi/Makefile
> @@ -4,7 +4,7 @@
> 
> WITH_CONFIG_PM=	0
> WITH_DEBUGFS=	0
> -WITH_CONFIG_ACPI=	1
> +WITH_CONFIG_ACPI=	0
> 
> KMOD=	if_iwlwifi
> 
> --- /usr/ports/net/wifi-firmware-kmod/Makefile.inc
> +++ /usr/ports/net/wifi-firmware-kmod/Makefile.inc
> @@ -77,7 +77,7 @@
> DIST_SUBDIR=	linux-firmware/${FWDRV}fw
> EXTRACT_ONLY=
> 
> -ONLY_FOR_ARCHS=	aarch64 amd64 i386
> +ONLY_FOR_ARCHS=	aarch64 amd64 i386 riscv64
> ONLY_FOR_ARCHS_REASON=	LinuxKPI driver only available for these architectures
> 
> USES=		uidfix