]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mac80211: Fix compilation of iwlwifi driver 19948/head
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 3 Sep 2025 20:42:48 +0000 (22:42 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Thu, 4 Sep 2025 10:10:06 +0000 (12:10 +0200)
The Intel iwlwifi mld driver uses some updated thermal functions. Adapt
the driver to compile again kernel 6.6 again.

Fixes: 9c82d499995b ("mac80211: iwlwifi fix BE200 probe")
Link: https://github.com/openwrt/openwrt/pull/19948
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/kernel/mac80211/patches/build/020-intel-mld-compile.patch [new file with mode: 0644]

diff --git a/package/kernel/mac80211/patches/build/020-intel-mld-compile.patch b/package/kernel/mac80211/patches/build/020-intel-mld-compile.patch
new file mode 100644 (file)
index 0000000..b501ec7
--- /dev/null
@@ -0,0 +1,54 @@
+Fix Intel mld thermal compilation
+
+Do the same changes done also in iwlwifi/mvm/tt.c in the iwlwifi/mld/thermal.c file.
+
+This fixes the compilation.
+
+--- a/drivers/net/wireless/intel/iwlwifi/mld/thermal.c
++++ b/drivers/net/wireless/intel/iwlwifi/mld/thermal.c
+@@ -209,9 +209,15 @@ unlock:
+       return ret;
+ }
++#if LINUX_VERSION_IS_GEQ(6,11,0)
+ static int iwl_mld_tzone_set_trip_temp(struct thermal_zone_device *device,
+                                      const struct thermal_trip *trip,
+                                      int temp)
++#else
++static int iwl_mld_tzone_set_trip_temp(struct thermal_zone_device *device,
++                                     int trip,
++                                     int temp)
++#endif
+ {
+       struct iwl_mld *mld = thermal_zone_device_priv(device);
+       int ret;
+@@ -248,18 +254,29 @@ static void iwl_mld_thermal_zone_registe
+               [0 ... IWL_MAX_DTS_TRIPS - 1] = {
+                       .temperature = THERMAL_TEMP_INVALID,
+                       .type = THERMAL_TRIP_PASSIVE,
++#if LINUX_VERSION_IS_GEQ(6,9,0)
+                       .flags = THERMAL_TRIP_FLAG_RW_TEMP,
++#endif
+               },
+       };
+       BUILD_BUG_ON(ARRAY_SIZE(name) >= THERMAL_NAME_LENGTH);
+       sprintf(name, "iwlwifi_%u", atomic_inc_return(&counter) & 0xFF);
++#if LINUX_VERSION_IS_GEQ(6,9,0)
+       mld->tzone =
+               thermal_zone_device_register_with_trips(name, trips,
+                                                       IWL_MAX_DTS_TRIPS,
+                                                       mld, &tzone_ops,
+                                                       NULL, 0, 0);
++#else
++      mld->tzone =
++              thermal_zone_device_register_with_trips(name, trips,
++                                                      IWL_MAX_DTS_TRIPS, 0,
++                                                      mld, &tzone_ops,
++                                                      NULL, 0, 0);
++#endif
++
+       if (IS_ERR(mld->tzone)) {
+               IWL_DEBUG_TEMP(mld,
+                              "Failed to register to thermal zone (err = %ld)\n",