summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Pientsov <andrii.pientsov@globallogic.com>2021-01-26 12:53:21 +0200
committerAndrii Pientsov <andrii.pientsov@globallogic.com>2021-01-26 12:53:21 +0200
commit5f3299b873fb5511caf2dd187253f812ce2e2bbb (patch)
treeb6e9e7bcbfd47ecec4c9496a40ce5411871e82fd
parent9b99510b47c2dd72af07dea3c75979a2bac0ac26 (diff)
downloadmts-io-5f3299b873fb5511caf2dd187253f812ce2e2bbb.tar.gz
mts-io-5f3299b873fb5511caf2dd187253f812ce2e2bbb.tar.bz2
mts-io-5f3299b873fb5511caf2dd187253f812ce2e2bbb.zip
Add oem-strings for MTRE hardware
-rw-r--r--io-module/machine/mtre.c4
-rw-r--r--io-module/mts-io.c12
2 files changed, 16 insertions, 0 deletions
diff --git a/io-module/machine/mtre.c b/io-module/machine/mtre.c
index c703294..f14862f 100644
--- a/io-module/machine/mtre.c
+++ b/io-module/machine/mtre.c
@@ -269,6 +269,10 @@ static struct attribute *mtre_0_0_platform_attributes[] = {
&dev_attr_led_sig2_i2c_mtre.attr, /* (cellular) Link Quality */
&dev_attr_led_sig3_i2c_mtre.attr, /* (cellular) Link Quality */
&dev_attr_led_sig4_i2c_mtre.attr, /* (cellular) Link Quality */
+#ifdef MTRE
+ &dev_attr_oem_string1.attr,
+ &dev_attr_oem_string2.attr,
+#endif
NULL,
};
diff --git a/io-module/mts-io.c b/io-module/mts-io.c
index b4f779c..ac023bb 100644
--- a/io-module/mts-io.c
+++ b/io-module/mts-io.c
@@ -602,6 +602,12 @@ static ssize_t mts_attr_show_product_info(struct device *dev,
id_eeprom.lora_eui[5],
id_eeprom.lora_eui[6],
id_eeprom.lora_eui[7]);
+#ifdef MTRE
+ } else if (strcmp(attr->attr.name, "oem-string1") == 0) {
+ value = sprintf(buf, "%.32s\n", id_eeprom.oem_string1);
+ } else if (strcmp(attr->attr.name, "oem-string2") == 0) {
+ value = sprintf(buf, "%.32s\n", id_eeprom.oem_string2);
+#endif
}
else {
log_error("attribute '%s' not found", attr->attr.name);
@@ -627,6 +633,12 @@ static DEVICE_ATTR_RO_MTS(dev_attr_imei, "imei",
mts_attr_show_product_info);
static DEVICE_ATTR_RO_MTS(dev_attr_eth_mac, "mac-eth",
mts_attr_show_product_info);
+#ifdef MTRE
+static DEVICE_ATTR_RO_MTS(dev_attr_oem_string1, "oem-string1",
+ mts_attr_show_product_info);
+static DEVICE_ATTR_RO_MTS(dev_attr_oem_string2, "oem-string2",
+ mts_attr_show_product_info);
+#endif
static int get_radio_model_from_product_id(void) {
int rc = RADIO_UNKNOWN;