diff options
author | Volodymyr Vorobiov <volodymyr.vorobiov@globallogic.com> | 2022-09-15 17:40:52 +0300 |
---|---|---|
committer | Volodymyr Vorobiov <volodymyr.vorobiov@globallogic.com> | 2022-09-15 17:40:52 +0300 |
commit | dc1ab19c393118ba60a30cb18fef43e34fad927c (patch) | |
tree | af077b2a45ac02bfab46a3356fcb575f61c2d901 | |
parent | f3e37d4f13d2d089835cee94099eca6410e53893 (diff) | |
download | mts-id-eeprom-dc1ab19c393118ba60a30cb18fef43e34fad927c.tar.gz mts-id-eeprom-dc1ab19c393118ba60a30cb18fef43e34fad927c.tar.bz2 mts-id-eeprom-dc1ab19c393118ba60a30cb18fef43e34fad927c.zip |
[MTX-4620] MTCDT3 R.6.2.0: support in mts-id-eeprom for MTCDT3AC GP-1742
Change flag sub-board to daughter-board and some fix
-rw-r--r-- | src/eeprom_main.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/eeprom_main.c b/src/eeprom_main.c index 04887c8..7b1c78c 100644 --- a/src/eeprom_main.c +++ b/src/eeprom_main.c @@ -359,11 +359,11 @@ static int mtcdt3dc_yaml_out(const char *name, struct mtcdt3dc_eeprom_layout *mt fprintf(file, "vendor-id: \"%.32s\"\n", mtcdt3dc_eeprom->vendor_id); fprintf(file, "product-id: \"%.32s\"\n", mtcdt3dc_eeprom->product_id); fprintf(file, "device-id: \"%.32s\"\n", mtcdt3dc_eeprom->device_id); - fprintf(file, "hardware-id: \"%.32s\"\n", mtcdt3dc_eeprom->hw_version); + fprintf(file, "hw-version: \"%.32s\"\n", mtcdt3dc_eeprom->hw_version); fprintf(file, "capa-mei-serial: %.32s\n", DEVICE_CAPA(mtcdt3dc_eeprom->capa, MTCDT3DC_CAPA_SERIAL) ? "true" : "false"); fprintf(file, "capa-mtac: %.32s\n", DEVICE_CAPA(mtcdt3dc_eeprom->capa, MTCDT3DC_CAPA_MTAC) ? "true" : "false"); - fprintf(file, "mei-serial count: %hu\n", mtcdt3dc_eeprom->serial_cnt); - fprintf(file, "mtac count: %hu\n", mtcdt3dc_eeprom->mtac_cnt); + fprintf(file, "mei-serial-count: %hu\n", mtcdt3dc_eeprom->serial_cnt); + fprintf(file, "mtac-count: %hu\n", mtcdt3dc_eeprom->mtac_cnt); fprintf(file, "...\n"); fclose(file); @@ -556,8 +556,8 @@ static void mtcdt3dc_eeprom_inspect(struct mtcdt3dc_eeprom_layout *mtcdt3dc_eepr { log_info("vendor-id: %.32s", mtcdt3dc_eeprom->vendor_id); log_info("product-id: %.32s", mtcdt3dc_eeprom->product_id); - log_info("hw-version: %.32s", mtcdt3dc_eeprom->hw_version); log_info("device-id: %.32s", mtcdt3dc_eeprom->device_id); + log_info("hw-version: %.32s", mtcdt3dc_eeprom->hw_version); log_info("capa-mei-serial: %.32s", DEVICE_CAPA(mtcdt3dc_eeprom->capa, MTCDT3DC_CAPA_MTAC) ? "true" : "false"); log_info("capa-mtac: %.32s", DEVICE_CAPA(mtcdt3dc_eeprom->capa, MTCDT3DC_CAPA_SERIAL) ? "true" : "false"); log_info("mei-serial count: %hu", mtcdt3dc_eeprom->serial_cnt); @@ -615,7 +615,7 @@ static void usage(FILE *out) { fprintf(out, " --accessory-card\n"); #ifdef MTCDT3B fprintf(out, " --base-board\n"); - fprintf(out, " --sub-board\n"); + fprintf(out, " --daughter-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, " --capa-mtac \n"); @@ -666,7 +666,7 @@ enum { #endif #ifdef MTCDT3B CMD_OPT_BASE_BOARD, - CMD_OPT_DC_BOARD, + CMD_OPT_DAUGHTER_BOARD, CMD_OPT_SLOTS, CMD_OPT_CAPA_ETH_SWITCH, CMD_OPT_ETH_SWITCH_VERSION, @@ -720,7 +720,7 @@ static struct option long_options[] = { {"accessory-card", 0, NULL, CMD_OPT_ACCESSORY_CARD}, #ifdef MTCDT3B {"base-board", 0, NULL, CMD_OPT_BASE_BOARD}, - {"sub-board", 0, NULL, CMD_OPT_DC_BOARD}, + {"daughter-board", 0, NULL, CMD_OPT_DAUGHTER_BOARD}, {"slots", 1, NULL, CMD_OPT_SLOTS}, {"capa-eth-switch", 0, NULL, CMD_OPT_CAPA_ETH_SWITCH}, {"capa-mtac", 0, NULL, CMD_OPT_CAPA_MTAC}, @@ -761,7 +761,7 @@ int main(int argc, char *argv[]) { int accessory_card = 0; #ifdef MTCDT3B int base_board = 0; - int dc_board = 0; + int daughter_board = 0; char *slots = NULL; #endif char *vendor_id = NULL; @@ -819,8 +819,8 @@ int main(int argc, char *argv[]) { base_board = 1; break; - case CMD_OPT_DC_BOARD: - dc_board = 1; + case CMD_OPT_DAUGHTER_BOARD: + daughter_board = 1; break; #endif @@ -848,13 +848,13 @@ int main(int argc, char *argv[]) { if (accessory_card) { tmp = read(fd, (char *) &ap_eeprom, eeprom_size); #ifdef MTCDT3B - } else if (base_board) { - tmp = read(fd, (char *) &mtcdt3b_eeprom, eeprom_size); + } else if (base_board) { + tmp = read(fd, (char *) &mtcdt3b_eeprom, eeprom_size); - } else if (dc_board) { - tmp = read(fd, (char *) &mtcdt3dc_eeprom, eeprom_size); + } else if (daughter_board) { + tmp = read(fd, (char *) &mtcdt3dc_eeprom, eeprom_size); #endif - } else { + } else { tmp = read(fd, (char *) &id_eeprom, eeprom_size); } @@ -873,7 +873,7 @@ int main(int argc, char *argv[]) { } else if (base_board) { log_info("loaded ap eeprom from %s successfully", in_file); mtcdt3b_eeprom_inspect(&mtcdt3b_eeprom); - } else if (dc_board) { + } else if (daughter_board) { mtcdt3dc_eeprom_inspect(&mtcdt3dc_eeprom); #endif } else { @@ -909,7 +909,7 @@ int main(int argc, char *argv[]) { // handled above break; - case CMD_OPT_DC_BOARD: + case CMD_OPT_DAUGHTER_BOARD: // handled above break; @@ -1064,13 +1064,13 @@ int main(int argc, char *argv[]) { break; #ifdef MTCDT3B case CMD_OPT_CAPA_MTAC: - if (dc_board) { + if (daughter_board) { DEVICE_CAPA_SET(mtcdt3dc_eeprom.capa, MTCDT3DC_CAPA_MTAC); } break; case CMD_OPT_CAPA_SERIAL: - if (dc_board) { + if (daughter_board) { DEVICE_CAPA_SET(mtcdt3dc_eeprom.capa, MTCDT3DC_CAPA_SERIAL); } break; @@ -1157,7 +1157,7 @@ int main(int argc, char *argv[]) { } break; case CMD_OPT_NUM_MTAC: - if (dc_board) { + if (daughter_board) { uint16_t u16_mtac_test; if (sscanf(optarg, "%hu", &u16_mtac_test) != 1) { log_error("invalid mtac count %s", optarg); @@ -1174,7 +1174,7 @@ int main(int argc, char *argv[]) { break; case CMD_OPT_NUM_SERIAL: - if (dc_board) { + if (daughter_board) { uint16_t u16_serial_test; if (sscanf(optarg, "%hu", &u16_serial_test) !=1) { log_error("invalid serial count %s", optarg); @@ -1202,10 +1202,10 @@ int main(int argc, char *argv[]) { capa_clear = 0; } - if(dc_board && capa_clear) { - memset(mtcdt3dc_eeprom.capa, 0, sizeof(mtcdt3dc_eeprom.capa)); - capa_clear = 0; - } + if(daughter_board && capa_clear) { + memset(mtcdt3dc_eeprom.capa, 0, sizeof(mtcdt3dc_eeprom.capa)); + capa_clear = 0; + } #endif if(capa_clear) { @@ -1224,7 +1224,7 @@ int main(int argc, char *argv[]) { else if (base_board) EEPROM_SET(mtcdt3b_eeprom,vendor_id) - else if (dc_board) + else if (daughter_board) EEPROM_SET(mtcdt3dc_eeprom,vendor_id) #endif else @@ -1237,7 +1237,7 @@ int main(int argc, char *argv[]) { else if (base_board) EEPROM_SET(mtcdt3b_eeprom,product_id) - else if (dc_board) + else if (daughter_board) EEPROM_SET(mtcdt3dc_eeprom,product_id) #endif @@ -1250,7 +1250,7 @@ int main(int argc, char *argv[]) { #ifdef MTCDT3B else if (base_board) EEPROM_SET(mtcdt3b_eeprom,device_id) - else if (dc_board) + else if (daughter_board) EEPROM_SET(mtcdt3dc_eeprom,device_id) #endif @@ -1263,7 +1263,7 @@ int main(int argc, char *argv[]) { #ifdef MTCDT3B else if (base_board) EEPROM_SET(mtcdt3b_eeprom,hw_version) - else if (dc_board) + else if (daughter_board) EEPROM_SET(mtcdt3dc_eeprom,hw_version) #endif @@ -1455,7 +1455,7 @@ int main(int argc, char *argv[]) { else if (base_board) bin_out(out_file, (char*) &mtcdt3b_eeprom); - else if (dc_board) + else if (daughter_board) bin_out(out_file, (char*) &mtcdt3dc_eeprom); #endif else { @@ -1469,7 +1469,7 @@ int main(int argc, char *argv[]) { else if (base_board) mtcdt3b_yaml_out(out_file, &mtcdt3b_eeprom); - else if (dc_board) + else if (daughter_board) mtcdt3dc_yaml_out(out_file, &mtcdt3dc_eeprom); #endif else @@ -1488,7 +1488,7 @@ int main(int argc, char *argv[]) { else if (base_board) mtcdt3b_eeprom_inspect(&mtcdt3b_eeprom); - else if (dc_board) + else if (daughter_board) mtcdt3dc_eeprom_inspect(&mtcdt3dc_eeprom); #endif else |