Просмотр исходного кода

qcacmn: Update timer modification API to return the status

The current timer modification API does not return the status
of the underlying OS specific API.

The return status of the underlying API could be useful
to detect if the timer was modified even before the timer
has expired before the last update to the timer.

Update the API to return the status of the underlying API.

CRs-Fixed: 2835319
Change-Id: Ieade0ff82386f959d7f29264a25b75a96a72e644
Vivek 4 лет назад
Родитель
Сommit
081f6f0549
2 измененных файлов с 8 добавлено и 8 удалено
  1. 4 4
      qdf/inc/qdf_timer.h
  2. 4 4
      qdf/linux/src/i_qdf_timer.h

+ 4 - 4
qdf/inc/qdf_timer.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2016, 2018-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2016, 2018-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -74,11 +74,11 @@ static inline void qdf_timer_start(qdf_timer_t *timer, int msec)
  *
  * If QDF timer multiplier is set, the timeout value may get scaled.
  *
- * Return: none
+ * Return: true if @timer is already active, false if @timer was not active
  */
-static inline void qdf_timer_mod(qdf_timer_t *timer, int msec)
+static inline bool qdf_timer_mod(qdf_timer_t *timer, int msec)
 {
-	__qdf_timer_mod(timer, msec);
+	return __qdf_timer_mod(timer, msec);
 }
 
 /**

+ 4 - 4
qdf/linux/src/i_qdf_timer.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -131,10 +131,10 @@ static inline void __qdf_timer_start(struct __qdf_timer_t *timer, uint32_t msec)
 	add_timer(os_timer);
 }
 
-static inline void __qdf_timer_mod(struct __qdf_timer_t *timer, uint32_t msec)
+static inline bool __qdf_timer_mod(struct __qdf_timer_t *timer, uint32_t msec)
 {
-	mod_timer(&timer->os_timer,
-		  jiffies + __qdf_scaled_msecs_to_jiffies(msec));
+	return mod_timer(&timer->os_timer,
+			 jiffies + __qdf_scaled_msecs_to_jiffies(msec));
 }
 
 static inline bool __qdf_timer_stop(struct __qdf_timer_t *timer)