summaryrefslogtreecommitdiff
path: root/io-module
diff options
context:
space:
mode:
authorMykyta Dorokhin <mykyta.dorokhin@globallogic.com>2022-06-22 15:57:36 +0300
committerJohn Klug <john.klug@multitech.com>2022-09-23 12:36:04 -0500
commit203864e4f32b983178b80534dc53b50c3325e352 (patch)
tree5804aafeaa1531b735519ed273e2218de3738dd1 /io-module
parente1329a3976a8884e2c568f2434df82e6eadb2775 (diff)
downloadmts-io-203864e4f32b983178b80534dc53b50c3325e352.tar.gz
mts-io-203864e4f32b983178b80534dc53b50c3325e352.tar.bz2
mts-io-203864e4f32b983178b80534dc53b50c3325e352.zip
mtcap3: respect backoff timers on radio reset
Diffstat (limited to 'io-module')
-rw-r--r--io-module/machine/mtcap3.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/io-module/machine/mtcap3.c b/io-module/machine/mtcap3.c
index 9a81e1c..3c99077 100644
--- a/io-module/machine/mtcap3.c
+++ b/io-module/machine/mtcap3.c
@@ -325,6 +325,27 @@ static ssize_t mts_attr_store_radio_reset_mtcap3(struct device *dev,
return -EINVAL;
}
+ /* check reset timings is enabled */
+ if (value != -1 && NULL != timings_data) {
+ /* check reset timer is started */
+ if (radio_reset_timer_is_start == 1) {
+ log_info("radio reset timer is running.");
+ return count;
+ }
+
+ /* check reset timer available is started */
+ if (radio_reset_available_timer_is_start == 1) {
+ del_timer(&radio_reset_available_timer);
+ radio_reset_available_timer_is_start = 0;
+ }
+
+ /* reset timer not started, start it */
+ mod_timer(&radio_reset_timer, jiffies + msecs_to_jiffies((timings_data[timings_data_index]) * 1000));
+ /* save timings_data_stop_seconds */
+ timings_data_stop_seconds = timings_data[timings_data_index] + time_now_secs();
+ radio_reset_timer_is_start = 1;
+ }
+
reset_radio_udev_discovery();
mutex_lock(&mts_io_mutex);