Parcourir la source

qcacmn: Revert "Fix kernel 4.15 timer list dependencies"

This reverts change Id9c29413ca0d21533a0afae245595051fa3a400f. This
change was a work around to allow compiling against legacy code. Now
that these compilation issues have been resolved, remove the work
around.

Change-Id: I38a474f50076320cf961d6fd340960e4c9b148a0
CRs-Fixed: 2401315
Dustin Brown il y a 6 ans
Parent
commit
e6c7bff8d9
2 fichiers modifiés avec 22 ajouts et 56 suppressions
  1. 0 4
      qdf/inc/qdf_timer.h
  2. 22 52
      qdf/linux/src/i_qdf_timer.h

+ 0 - 4
qdf/inc/qdf_timer.h

@@ -27,11 +27,7 @@
 #include <qdf_types.h>
 #include <i_qdf_timer.h>
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 typedef struct __qdf_timer_t qdf_timer_t;
-#else
-typedef __qdf_timer_t qdf_timer_t;
-#endif
 
 /**
  * qdf_timer_init() - initialize a timer

+ 22 - 52
qdf/linux/src/i_qdf_timer.h

@@ -37,18 +37,15 @@
 #define qdf_msecs_to_jiffies(msec) \
 	(qdf_timer_get_multiplier() * msecs_to_jiffies(msec))
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 struct __qdf_timer_t {
 	struct timer_list os_timer;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	qdf_timer_func_t callback;
 	void *context;
-};
-#else
-typedef struct timer_list __qdf_timer_t;
 #endif
+};
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
-
 static inline void __os_timer_shim(struct timer_list *os_timer)
 {
 	struct __qdf_timer_t *timer = from_timer(timer, os_timer, os_timer);
@@ -77,38 +74,6 @@ static inline QDF_STATUS __qdf_timer_init(struct __qdf_timer_t *timer,
 	return QDF_STATUS_SUCCESS;
 }
 
-static inline void __qdf_timer_start(struct __qdf_timer_t *timer, uint32_t msec)
-{
-	struct timer_list *os_timer = &timer->os_timer;
-
-	os_timer->expires = jiffies + qdf_msecs_to_jiffies(msec);
-	add_timer(os_timer);
-}
-
-static inline void __qdf_timer_mod(struct __qdf_timer_t *timer, uint32_t msec)
-{
-	mod_timer(&timer->os_timer, jiffies + qdf_msecs_to_jiffies(msec));
-}
-
-static inline bool __qdf_timer_stop(struct __qdf_timer_t *timer)
-{
-	return !!del_timer(&timer->os_timer);
-}
-
-static inline void __qdf_timer_free(struct __qdf_timer_t *timer)
-{
-	struct timer_list *os_timer = &timer->os_timer;
-
-	del_timer_sync(os_timer);
-
-	if (object_is_on_stack(os_timer))
-		destroy_timer_on_stack(os_timer);
-}
-
-static inline bool __qdf_timer_sync_cancel(struct __qdf_timer_t *timer)
-{
-	return del_timer_sync(&timer->os_timer);
-}
 #else
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
@@ -118,10 +83,11 @@ static inline bool __qdf_timer_sync_cancel(struct __qdf_timer_t *timer)
 
 typedef void (*__legacy_timer_callback_t)(unsigned long arg);
 
-static inline QDF_STATUS __qdf_timer_init(__qdf_timer_t *os_timer,
+static inline QDF_STATUS __qdf_timer_init(struct __qdf_timer_t *timer,
 					  qdf_timer_func_t func, void *arg,
 					  QDF_TIMER_TYPE type)
 {
+	struct timer_list *os_timer = &timer->os_timer;
 	bool is_on_stack = object_is_on_stack(os_timer);
 	__legacy_timer_callback_t callback = (__legacy_timer_callback_t)func;
 	unsigned long ctx = (unsigned long)arg;
@@ -141,35 +107,39 @@ static inline QDF_STATUS __qdf_timer_init(__qdf_timer_t *os_timer,
 
 	return QDF_STATUS_SUCCESS;
 }
+#endif /* KERNEL_VERSION(4, 15, 0)*/
 
-static inline void __qdf_timer_start(__qdf_timer_t *timer, uint32_t msec)
+static inline void __qdf_timer_start(struct __qdf_timer_t *timer, uint32_t msec)
 {
-	timer->expires = jiffies + qdf_msecs_to_jiffies(msec);
-	add_timer(timer);
+	struct timer_list *os_timer = &timer->os_timer;
+
+	os_timer->expires = jiffies + qdf_msecs_to_jiffies(msec);
+	add_timer(os_timer);
 }
 
-static inline void __qdf_timer_mod(__qdf_timer_t *timer, uint32_t msec)
+static inline void __qdf_timer_mod(struct __qdf_timer_t *timer, uint32_t msec)
 {
-	mod_timer(timer, jiffies + qdf_msecs_to_jiffies(msec));
+	mod_timer(&timer->os_timer, jiffies + qdf_msecs_to_jiffies(msec));
 }
 
-static inline bool __qdf_timer_stop(__qdf_timer_t *timer)
+static inline bool __qdf_timer_stop(struct __qdf_timer_t *timer)
 {
-	return !!del_timer(timer);
+	return !!del_timer(&timer->os_timer);
 }
 
-static inline void __qdf_timer_free(__qdf_timer_t *timer)
+static inline void __qdf_timer_free(struct __qdf_timer_t *timer)
 {
-	del_timer_sync(timer);
+	struct timer_list *os_timer = &timer->os_timer;
 
-	if (object_is_on_stack(timer))
-		destroy_timer_on_stack(timer);
+	del_timer_sync(os_timer);
+
+	if (object_is_on_stack(os_timer))
+		destroy_timer_on_stack(os_timer);
 }
 
-static inline bool __qdf_timer_sync_cancel(__qdf_timer_t *timer)
+static inline bool __qdf_timer_sync_cancel(struct __qdf_timer_t *timer)
 {
-	return del_timer_sync(timer);
+	return del_timer_sync(&timer->os_timer);
 }
 
-#endif /* KERNEL_VERSION(4, 15, 0)*/
 #endif /* _I_QDF_TIMER_H */