patches: make iwlwifi use the old thermal APIs
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 10 Jul 2016 13:56:38 +0000 (15:56 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 13 Jul 2016 17:16:30 +0000 (19:16 +0200)
The thermal API changed in the last kernel versions, make iwlwifi use
the correct interface for each kernel version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
patches/collateral-evolutions/network/0070-thermal/iwlwifi.patch [new file with mode: 0644]

diff --git a/patches/collateral-evolutions/network/0070-thermal/iwlwifi.patch b/patches/collateral-evolutions/network/0070-thermal/iwlwifi.patch
new file mode 100644 (file)
index 0000000..1b37844
--- /dev/null
@@ -0,0 +1,56 @@
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+@@ -637,7 +637,11 @@ send:
+ }
+ static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
++                                unsigned long *temperature)
++#else
+                                 int *temperature)
++#endif
+ {
+       struct iwl_mvm *mvm = (struct iwl_mvm *)device->devdata;
+       int ret;
+@@ -662,7 +666,11 @@ out:
+ }
+ static int iwl_mvm_tzone_get_trip_temp(struct thermal_zone_device *device,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
++                                     int trip, unsigned long *temp)
++#else
+                                      int trip, int *temp)
++#endif
+ {
+       struct iwl_mvm *mvm = (struct iwl_mvm *)device->devdata;
+@@ -685,8 +693,13 @@ static int iwl_mvm_tzone_get_trip_type(s
+       return 0;
+ }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
+ static int iwl_mvm_tzone_set_trip_temp(struct thermal_zone_device *device,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
++                                     int trip, unsigned long temp)
++#else
+                                      int trip, int temp)
++#endif
+ {
+       struct iwl_mvm *mvm = (struct iwl_mvm *)device->devdata;
+       struct iwl_mvm_thermal_device *tzone;
+@@ -739,12 +752,15 @@ out:
+       mutex_unlock(&mvm->mutex);
+       return ret;
+ }
++#endif /* >= 3.6 */
+ static  struct thermal_zone_device_ops tzone_ops = {
+       .get_temp = iwl_mvm_tzone_get_temp,
+       .get_trip_temp = iwl_mvm_tzone_get_trip_temp,
+       .get_trip_type = iwl_mvm_tzone_get_trip_type,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
+       .set_trip_temp = iwl_mvm_tzone_set_trip_temp,
++#endif
+ };
+ /* make all trips writable */