summaryrefslogtreecommitdiff
path: root/io-module/mtac.c
diff options
context:
space:
mode:
Diffstat (limited to 'io-module/mtac.c')
-rw-r--r--io-module/mtac.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/io-module/mtac.c b/io-module/mtac.c
index 6a80576..43436f8 100644
--- a/io-module/mtac.c
+++ b/io-module/mtac.c
@@ -72,6 +72,16 @@ static ssize_t ap_show_product_info(struct kobject *kobj, struct kobj_attribute
ap_eeprom[port_index].mac_addr[3],
ap_eeprom[port_index].mac_addr[4],
ap_eeprom[port_index].mac_addr[5]);
+ } else if (! strcmp(attr->attr.name, "eui")) {
+ value = sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
+ ap_eeprom[port_index].eui[0],
+ ap_eeprom[port_index].eui[1],
+ ap_eeprom[port_index].eui[2],
+ ap_eeprom[port_index].eui[3],
+ ap_eeprom[port_index].eui[4],
+ ap_eeprom[port_index].eui[5],
+ ap_eeprom[port_index].eui[6],
+ ap_eeprom[port_index].eui[7]);
} else {
log_error("attribute [%s] not found", attr->attr.name);
value = -1;
@@ -98,8 +108,20 @@ static bool ap_add_product_info_attributes(int port, int type, struct attribute*
case MTAC_GPIOB_0_0:
case MTAC_MFSER_0_0:
+ break;
+
case MTAC_LORA_0_0:
+ case MTAC_LORA_1_0:
+ sprintf(buf, "eui");
+ kobj_attr = create_attribute(buf, MTS_ATTR_MODE_RO);
+ if (! kobj_attr) {
+ log_error("failed to create attribute [%s] in port %d", buf, port);
+ return false;
+ }
+ kobj_attr->show = ap_show_product_info;
+ attrs[(*index)++] = &kobj_attr->attr;
break;
+
default:
log_error("invalid accessory card type");
return false;