Skip to content

Commit d751f1e

Browse files
committed
mac80211: Fix compilation of iwlwifi driver
The Intel iwlwifi mld driver uses some updated thermal functions. Adapt the driver to compile again kernel 6.6 again. Fixes: 9c82d49 ("mac80211: iwlwifi fix BE200 probe") Link: openwrt#19948 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent 350d8a0 commit d751f1e

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Fix Intel mld thermal compilation
2+
3+
Do the same changes done also in iwlwifi/mvm/tt.c in the iwlwifi/mld/thermal.c file.
4+
5+
This fixes the compilation.
6+
7+
--- a/drivers/net/wireless/intel/iwlwifi/mld/thermal.c
8+
+++ b/drivers/net/wireless/intel/iwlwifi/mld/thermal.c
9+
@@ -209,9 +209,15 @@ unlock:
10+
return ret;
11+
}
12+
13+
+#if LINUX_VERSION_IS_GEQ(6,11,0)
14+
static int iwl_mld_tzone_set_trip_temp(struct thermal_zone_device *device,
15+
const struct thermal_trip *trip,
16+
int temp)
17+
+#else
18+
+static int iwl_mld_tzone_set_trip_temp(struct thermal_zone_device *device,
19+
+ int trip,
20+
+ int temp)
21+
+#endif
22+
{
23+
struct iwl_mld *mld = thermal_zone_device_priv(device);
24+
int ret;
25+
@@ -248,18 +254,29 @@ static void iwl_mld_thermal_zone_registe
26+
[0 ... IWL_MAX_DTS_TRIPS - 1] = {
27+
.temperature = THERMAL_TEMP_INVALID,
28+
.type = THERMAL_TRIP_PASSIVE,
29+
+#if LINUX_VERSION_IS_GEQ(6,9,0)
30+
.flags = THERMAL_TRIP_FLAG_RW_TEMP,
31+
+#endif
32+
},
33+
};
34+
35+
BUILD_BUG_ON(ARRAY_SIZE(name) >= THERMAL_NAME_LENGTH);
36+
37+
sprintf(name, "iwlwifi_%u", atomic_inc_return(&counter) & 0xFF);
38+
+#if LINUX_VERSION_IS_GEQ(6,9,0)
39+
mld->tzone =
40+
thermal_zone_device_register_with_trips(name, trips,
41+
IWL_MAX_DTS_TRIPS,
42+
mld, &tzone_ops,
43+
NULL, 0, 0);
44+
+#else
45+
+ mld->tzone =
46+
+ thermal_zone_device_register_with_trips(name, trips,
47+
+ IWL_MAX_DTS_TRIPS, 0,
48+
+ mld, &tzone_ops,
49+
+ NULL, 0, 0);
50+
+#endif
51+
+
52+
if (IS_ERR(mld->tzone)) {
53+
IWL_DEBUG_TEMP(mld,
54+
"Failed to register to thermal zone (err = %ld)\n",

0 commit comments

Comments
 (0)