915-fix-wl_timer-for-4_15.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --- a/driver/wl_linux.c
  2. +++ b/driver/wl_linux.c
  3. @@ -235,7 +235,11 @@ struct wl_info {
  4. };
  5. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
  6. +static void wl_timer(struct timer_list *tl);
  7. +#else
  8. static void wl_timer(ulong data);
  9. +#endif
  10. static void _wl_timer(wl_timer_t *t);
  11. #ifdef WLC_HIGH_ONLY
  12. @@ -2512,6 +2516,18 @@ wl_timer_task(wl_task_t *task)
  13. }
  14. #endif /* WLC_HIGH_ONLY */
  15. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
  16. +static void
  17. +wl_timer(struct timer_list *tl)
  18. +{
  19. + wl_timer_t *t = from_timer(t, tl, timer);
  20. +#ifndef WLC_HIGH_ONLY
  21. + _wl_timer(t);
  22. +#else
  23. + wl_schedule_task(t->wl, wl_timer_task, t);
  24. +#endif /* WLC_HIGH_ONLY */
  25. +}
  26. +#else
  27. static void
  28. wl_timer(ulong data)
  29. {
  30. @@ -2522,6 +2538,7 @@ wl_timer(ulong data)
  31. wl_schedule_task(t->wl, wl_timer_task, t);
  32. #endif /* WLC_HIGH_ONLY */
  33. }
  34. +#endif /* linux >= 4.15.0 */
  35. static void
  36. _wl_timer(wl_timer_t *t)
  37. @@ -2573,9 +2590,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(
  38. bzero(t, sizeof(wl_timer_t));
  39. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
  40. + timer_setup(&t->timer, wl_timer, 0);
  41. +#else
  42. init_timer(&t->timer);
  43. t->timer.data = (ulong) t;
  44. t->timer.function = wl_timer;
  45. +#endif
  46. t->wl = wl;
  47. t->fn = fn;
  48. t->arg = arg;