summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hatch <Jeff.Hatch@multitech.com>2017-06-22 09:13:32 -0500
committerJeff Hatch <Jeff.Hatch@multitech.com>2017-07-12 07:54:21 -0500
commit24e90a03d024b0b0121f4e44ddf561e3002bc6b3 (patch)
tree41124aaafb19b8005cde2cdc88773ecf849b8b22
parentc113a1d5d7ab480039d52a7de6c98f22928ce4c4 (diff)
downloadmts-io-24e90a03d024b0b0121f4e44ddf561e3002bc6b3.tar.gz
mts-io-24e90a03d024b0b0121f4e44ddf561e3002bc6b3.tar.bz2
mts-io-24e90a03d024b0b0121f4e44ddf561e3002bc6b3.zip
Allow reset of the radio modem any time when needed, not dependent on the radio-reset backoff timers. Without this change the backoff timer feature doesn't allow reset of the radio modem more than once per backoff timeout (ie. once in 600s, 900s, etc.)
-rw-r--r--io-module/mtcap.c6
-rw-r--r--io-module/mtr.c6
-rw-r--r--io-module/mts_io.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/io-module/mtcap.c b/io-module/mtcap.c
index 048a59e..490bee2 100644
--- a/io-module/mtcap.c
+++ b/io-module/mtcap.c
@@ -343,7 +343,7 @@ static ssize_t mts_attr_store_radio_power_mtcap(struct device *dev,
static ssize_t mts_attr_store_radio_reset_mtcap(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
- int value;
+ int value; /* 0 = normal reset; -1 = forced reset */
int err;
int radio_model = get_radio_model_from_product_id();
@@ -351,12 +351,12 @@ static ssize_t mts_attr_store_radio_reset_mtcap(struct device *dev,
return -EINVAL;
}
- if (value != 0) {
+ if (value != 0 && value != -1) {
return -EINVAL;
}
/* check reset timings is enabled */
- if (NULL != timings_data) {
+ if (value != -1 && NULL != timings_data) {
/* check reset timer is started */
if (radio_reset_timer_is_start == 1) {
log_info("cell radio reset timer is running. \n");
diff --git a/io-module/mtr.c b/io-module/mtr.c
index 712dc62..4e44988 100644
--- a/io-module/mtr.c
+++ b/io-module/mtr.c
@@ -1070,18 +1070,18 @@ static ssize_t mts_attr_store_radio_power_mtr(struct device *dev,
static ssize_t mts_attr_store_radio_reset_mtr(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
- int value;
+ int value; /* 0 = normal reset; -1 = forced reset */
int err;
if (sscanf(buf, "%i", &value) != 1) {
return -EINVAL;
}
- if (value != 0) {
+ if (value != 0 && value != -1) {
return -EINVAL;
}
/* check reset timings is enabled */
- if (NULL != timings_data) {
+ 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. \n");
diff --git a/io-module/mts_io.c b/io-module/mts_io.c
index f47e2ea..aad181f 100644
--- a/io-module/mts_io.c
+++ b/io-module/mts_io.c
@@ -253,19 +253,19 @@ static DEVICE_ATTR_RO_MTS(dev_attr_reset, "reset", mts_attr_show_gpio_pin);
static ssize_t mts_attr_store_radio_reset(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
- int value;
+ int value; /* 0 = normal reset; -1 = forced reset */
int err;
struct gpio_pin *pin;
if (sscanf(buf, "%i", &value) != 1) {
return -EINVAL;
}
- if (value != 0) {
+ if (value != 0 && value != -1) {
return -EINVAL;
}
/* check reset timings is enabled */
- if (NULL != timings_data) {
+ 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. \n");