summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/eeprom_main.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/src/eeprom_main.c b/src/eeprom_main.c
index a51aaa9..d8a81e8 100644
--- a/src/eeprom_main.c
+++ b/src/eeprom_main.c
@@ -319,13 +319,13 @@ static int mtcdt3b_yaml_out(const char *name, struct mtcdt3b_eeprom_layout *mtcd
fprintf(file, "capa-eth-switch: %s\n", DEVICE_CAPA(mtcdt3b_eeprom->capa, MTCDT3B_CAPA_ETH_SWITCH) ? "true" : "false");
fprintf(file, "hw-version-eth-switch: %hu\n", mtcdt3b_eeprom->hw_version_eth_switch);
fprintf(file, "mac-eth-switch: \"%02X:%02X:%02X:%02X:%02X:%02X\"\n",
- mtcdt3b_eeprom->mac_eth_switch[0],
- mtcdt3b_eeprom->mac_eth_switch[1],
- mtcdt3b_eeprom->mac_eth_switch[2],
- mtcdt3b_eeprom->mac_eth_switch[3],
- mtcdt3b_eeprom->mac_eth_switch[4],
- mtcdt3b_eeprom->mac_eth_switch[5]);
- fprintf(file, "...\n");
+ mtcdt3b_eeprom->mac_eth_switch[0],
+ mtcdt3b_eeprom->mac_eth_switch[1],
+ mtcdt3b_eeprom->mac_eth_switch[2],
+ mtcdt3b_eeprom->mac_eth_switch[3],
+ mtcdt3b_eeprom->mac_eth_switch[4],
+ mtcdt3b_eeprom->mac_eth_switch[5]);
+ fprintf(file, "...\n");
fclose(file);
@@ -497,8 +497,8 @@ static void mtcdt3b_eeprom_inspect(struct mtcdt3b_eeprom_layout *mtcdt3b_eeprom)
log_info("capa-eth-switch: %s", DEVICE_CAPA(mtcdt3b_eeprom->capa, MTCDT3B_CAPA_ETH_SWITCH) ? "yes" : "no");
log_info("hw-version-eth-switch: %hu", mtcdt3b_eeprom->hw_version_eth_switch);
log_info("mac-eth-switch: \"%02X:%02X:%02X:%02X:%02X:%02X\"",
- mtcdt3b_eeprom->mac_eth_switch[0],
- mtcdt3b_eeprom->mac_eth_switch[1],
+ mtcdt3b_eeprom->mac_eth_switch[0],
+ mtcdt3b_eeprom->mac_eth_switch[1],
mtcdt3b_eeprom->mac_eth_switch[2],
mtcdt3b_eeprom->mac_eth_switch[3],
mtcdt3b_eeprom->mac_eth_switch[4],
@@ -549,11 +549,11 @@ static void usage(FILE *out) {
fprintf(out, " --update |\n");
fprintf(out, " --accessory-card\n");
#ifdef MTCDT3B
- fprintf(out, " --base-board\n");
- fprintf(out, " --slot i=0,device-id=<device-id>,lora-eui=<EUI-64>,i=1,...\n");
- fprintf(out, " --capa-eth-switch \n");
- fprintf(out, " --eth-switch-version <switch-version> \n");
- fprintf(out, " --eth-switch-mac-addr <switch-mac-addr> \n");
+ fprintf(out, " --base-board\n");
+ fprintf(out, " --slot i=0,device-id=<device-id>,lora-eui=<EUI-64>,i=1,...\n");
+ fprintf(out, " --capa-eth-switch \n");
+ fprintf(out, " --eth-switch-version <switch-version> \n");
+ fprintf(out, " --eth-switch-mac-addr <switch-mac-addr> \n");
#endif
fprintf(out, " }\n");
fprintf(out, "\n");
@@ -978,26 +978,24 @@ int main(int argc, char *argv[]) {
case CMD_OPT_CAPA_ETH_SWITCH:
if (base_board) {
DEVICE_CAPA_SET(mtcdt3b_eeprom.capa, MTCDT3B_CAPA_ETH_SWITCH);
- break;
}
- break;
+ break;
case CMD_OPT_ETH_SWITCH_VERSION:
if (base_board) {
uint16_t u16;
if (sscanf(optarg, "%hu", &u16) != 1) {
- log_error("invalid eth-switch-version %s", optarg);
- usage(stderr);
- exit(1);
+ log_error("invalid eth-switch-version %s", optarg);
+ usage(stderr);
+ exit(1);
}
if (u16 < ETH_SWITCH_MIN || u16 >= ETH_SWITCH_MAX) {
- log_error("invalid eth-switch-version %s", optarg);
- usage(stderr);
- exit(1);
+ log_error("invalid eth-switch-version %s", optarg);
+ usage(stderr);
+ exit(1);
}
mtcdt3b_eeprom.hw_version_eth_switch = u16;
- break;
}
- break;
+ break;
case CMD_OPT_ETH_SWITCH_MAC_ADDR:
if (base_board) {
tmp = hwaddr_aton(optarg, mtcdt3b_eeprom.mac_eth_switch, sizeof(mtcdt3b_eeprom.mac_eth_switch));
@@ -1006,9 +1004,8 @@ int main(int argc, char *argv[]) {
usage(stderr);
exit(1);
}
- break;
}
- break;
+ break;
#endif
default:
usage(stderr);