summaryrefslogtreecommitdiff
path: root/io-module
diff options
context:
space:
mode:
authorMykyta Dorokhin <mykyta.dorokhin@globallogic.com>2016-10-31 11:52:14 +0200
committerMykyta Dorokhin <mykyta.dorokhin@globallogic.com>2016-10-31 11:52:39 +0200
commit02c87437da63b8f07e8f19244b69d7927586e636 (patch)
tree34d97e06db94a0322875413eab2304a77cf0701a /io-module
parent974fd95ac6bb3fddd75aa1103206e954be5cb055 (diff)
downloadmts-io-02c87437da63b8f07e8f19244b69d7927586e636.tar.gz
mts-io-02c87437da63b8f07e8f19244b69d7927586e636.tar.bz2
mts-io-02c87437da63b8f07e8f19244b69d7927586e636.zip
eeprom: add lora_eui 8 byte field1.4.2
Diffstat (limited to 'io-module')
-rw-r--r--io-module/mtp.c5
-rw-r--r--io-module/mts_eeprom.h3
-rw-r--r--io-module/mts_io.c27
3 files changed, 32 insertions, 3 deletions
diff --git a/io-module/mtp.c b/io-module/mtp.c
index 74867e3..9e411b2 100644
--- a/io-module/mtp.c
+++ b/io-module/mtp.c
@@ -472,6 +472,9 @@ static DEVICE_ATTR_MTS(dev_attr_led_lora_gpio_mtp, "led-lora",
static DEVICE_ATTR_MTS(dev_attr_led_wifi_gpio_mtp, "led-wifi",
mts_attr_show_gpio_pin, mts_attr_store_gpio_pin);
+static DEVICE_ATTR_RO_MTS(dev_attr_lora_eui, "lora-eui",
+ mts_attr_show_product_info);
+
static struct attribute *mtp_0_0_platform_attributes[] = {
&dev_attr_vendor_id.attr,
&dev_attr_product_id.attr,
@@ -500,6 +503,8 @@ static struct attribute *mtp_0_0_platform_attributes[] = {
&dev_attr_led_lora_gpio_mtp.attr,
&dev_attr_led_wifi_gpio_mtp.attr,
+ &dev_attr_lora_eui.attr,
+
NULL,
};
diff --git a/io-module/mts_eeprom.h b/io-module/mts_eeprom.h
index d3c7edc..6697fd5 100644
--- a/io-module/mts_eeprom.h
+++ b/io-module/mts_eeprom.h
@@ -21,7 +21,8 @@ struct mts_id_eeprom_layout {
uint8_t mac_bluetooth[6];
uint8_t mac_wifi[6];
uint8_t uuid[16];
- uint8_t reserved[286];
+ uint8_t lora_eui[8];
+ uint8_t reserved[278];
};
/* accessory card EEPROM */
diff --git a/io-module/mts_io.c b/io-module/mts_io.c
index 7e3d1f0..0b22592 100644
--- a/io-module/mts_io.c
+++ b/io-module/mts_io.c
@@ -47,7 +47,7 @@
#include "mts_io.h"
-#define DRIVER_VERSION "v1.4.1"
+#define DRIVER_VERSION "v1.4.2"
#define DRIVER_AUTHOR "James Maki <jmaki@multitech.com>"
#define DRIVER_DESC "MTS-IO Controller"
#define DRIVER_NAME "mts-io"
@@ -599,7 +599,18 @@ static ssize_t mts_attr_show_product_info(struct device *dev,
id_eeprom.mac_addr[3],
id_eeprom.mac_addr[4],
id_eeprom.mac_addr[5]);
- } else {
+ } else if (strcmp(attr->attr.name, "lora-eui") == 0) {
+ value = sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
+ id_eeprom.lora_eui[0],
+ id_eeprom.lora_eui[1],
+ id_eeprom.lora_eui[2],
+ id_eeprom.lora_eui[3],
+ id_eeprom.lora_eui[4],
+ id_eeprom.lora_eui[5],
+ id_eeprom.lora_eui[6],
+ id_eeprom.lora_eui[7]);
+ }
+ else {
log_error("attribute '%s' not found", attr->attr.name);
value = -1;
}
@@ -866,6 +877,18 @@ static int mts_id_eeprom_load()
}
log_info("uuid: %s", (char*)buf);
+ if (mts_hw_version == MTP_0_0) {
+ log_info("lora-eui: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X",
+ id_eeprom.lora_eui[0],
+ id_eeprom.lora_eui[1],
+ id_eeprom.lora_eui[2],
+ id_eeprom.lora_eui[3],
+ id_eeprom.lora_eui[4],
+ id_eeprom.lora_eui[5],
+ id_eeprom.lora_eui[6],
+ id_eeprom.lora_eui[7]);
+ }
+
return 0;
}