From 698fd2f104891233cd56a21f2db31fdbf5bc6d1a Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Sun, 24 Apr 2022 22:51:37 -0700 Subject: [PATCH] Consistent naming of library functions and structs Signed-off-by: Alex Forencich --- lib/mqnic/mqnic.c | 16 ++++++++-------- lib/mqnic/mqnic.h | 32 ++++++++++++++++---------------- lib/mqnic/mqnic_if.c | 20 ++++++++++---------- lib/mqnic/mqnic_sched_block.c | 8 ++++---- lib/mqnic/mqnic_scheduler.c | 2 +- lib/mqnic/reg_block.c | 14 +++++++------- lib/mqnic/reg_block.h | 8 ++++---- utils/mqnic-bmc.c | 16 ++++++++-------- utils/mqnic-config.c | 4 ++-- utils/mqnic-dump.c | 10 +++++----- utils/mqnic-fw.c | 6 +++--- 11 files changed, 68 insertions(+), 68 deletions(-) diff --git a/lib/mqnic/mqnic.c b/lib/mqnic/mqnic.c index 4eafbab51..da75575d9 100644 --- a/lib/mqnic/mqnic.c +++ b/lib/mqnic/mqnic.c @@ -281,7 +281,7 @@ static int mqnic_try_open(struct mqnic *dev, const char *fmt, ...) goto fail_reset; } - dev->rb_list = enumerate_reg_block_list(dev->regs, 0, dev->regs_size); + dev->rb_list = mqnic_enumerate_reg_block_list(dev->regs, 0, dev->regs_size); if (!dev->rb_list) { @@ -290,7 +290,7 @@ static int mqnic_try_open(struct mqnic *dev, const char *fmt, ...) } // Read ID registers - dev->fw_id_rb = find_reg_block(dev->rb_list, MQNIC_RB_FW_ID_TYPE, MQNIC_RB_FW_ID_VER, 0); + dev->fw_id_rb = mqnic_find_reg_block(dev->rb_list, MQNIC_RB_FW_ID_TYPE, MQNIC_RB_FW_ID_VER, 0); if (!dev->fw_id_rb) { @@ -302,7 +302,7 @@ static int mqnic_try_open(struct mqnic *dev, const char *fmt, ...) fail_enum: if (dev->rb_list) - free_reg_block_list(dev->rb_list); + mqnic_free_reg_block_list(dev->rb_list); fail_reset: fail_mmap_regs: if (dev->ram) @@ -360,7 +360,7 @@ static int mqnic_try_open_if_name(struct mqnic *dev, const char *if_name) struct mqnic *mqnic_open(const char *dev_name) { struct mqnic *dev = calloc(1, sizeof(struct mqnic)); - struct reg_block *rb; + struct mqnic_reg_block *rb; if (!dev) { @@ -414,16 +414,16 @@ open: struct tm *tm_info = gmtime(&build_date); strftime(dev->build_date_str, sizeof(dev->build_date_str), "%F %T", tm_info); - rb = find_reg_block(dev->rb_list, MQNIC_RB_APP_INFO_TYPE, MQNIC_RB_APP_INFO_VER, 0); + rb = mqnic_find_reg_block(dev->rb_list, MQNIC_RB_APP_INFO_TYPE, MQNIC_RB_APP_INFO_VER, 0); if (rb) { dev->app_id = mqnic_reg_read32(rb->regs, MQNIC_RB_APP_INFO_REG_ID); } - dev->phc_rb = find_reg_block(dev->rb_list, MQNIC_RB_PHC_TYPE, MQNIC_RB_PHC_VER, 0); + dev->phc_rb = mqnic_find_reg_block(dev->rb_list, MQNIC_RB_PHC_TYPE, MQNIC_RB_PHC_VER, 0); // Enumerate interfaces - dev->if_rb = find_reg_block(dev->rb_list, MQNIC_RB_IF_TYPE, MQNIC_RB_IF_VER, 0); + dev->if_rb = mqnic_find_reg_block(dev->rb_list, MQNIC_RB_IF_TYPE, MQNIC_RB_IF_VER, 0); if (!dev->if_rb) { @@ -477,7 +477,7 @@ void mqnic_close(struct mqnic *dev) } if (dev->rb_list) - free_reg_block_list(dev->rb_list); + mqnic_free_reg_block_list(dev->rb_list); if (dev->ram) munmap((void *)dev->ram, dev->ram_size); diff --git a/lib/mqnic/mqnic.h b/lib/mqnic/mqnic.h index 509ac01d8..00cfeae09 100644 --- a/lib/mqnic/mqnic.h +++ b/lib/mqnic/mqnic.h @@ -52,7 +52,7 @@ struct mqnic_sched { int index; - struct reg_block *rb; + struct mqnic_reg_block *rb; uint32_t type; uint32_t offset; @@ -72,7 +72,7 @@ struct mqnic_sched_block { size_t regs_size; volatile uint8_t *regs; - struct reg_block *rb_list; + struct mqnic_reg_block *rb_list; uint32_t sched_count; struct mqnic_sched *sched[MQNIC_MAX_SCHED]; @@ -87,14 +87,14 @@ struct mqnic_if { volatile uint8_t *regs; volatile uint8_t *csr_regs; - struct reg_block *rb_list; - struct reg_block *if_ctrl_rb; - struct reg_block *event_queue_rb; - struct reg_block *tx_queue_rb; - struct reg_block *tx_cpl_queue_rb; - struct reg_block *rx_queue_rb; - struct reg_block *rx_cpl_queue_rb; - struct reg_block *rx_queue_map_rb; + struct mqnic_reg_block *rb_list; + struct mqnic_reg_block *if_ctrl_rb; + struct mqnic_reg_block *event_queue_rb; + struct mqnic_reg_block *tx_queue_rb; + struct mqnic_reg_block *tx_cpl_queue_rb; + struct mqnic_reg_block *rx_queue_rb; + struct mqnic_reg_block *rx_cpl_queue_rb; + struct mqnic_reg_block *rx_queue_map_rb; uint32_t if_features; @@ -137,10 +137,10 @@ struct mqnic { size_t ram_size; volatile uint8_t *ram; - struct reg_block *rb_list; - struct reg_block *fw_id_rb; - struct reg_block *if_rb; - struct reg_block *phc_rb; + struct mqnic_reg_block *rb_list; + struct mqnic_reg_block *fw_id_rb; + struct mqnic_reg_block *if_rb; + struct mqnic_reg_block *phc_rb; uint32_t fpga_id; const char *fpga_part; @@ -182,11 +182,11 @@ uint32_t mqnic_interface_get_rx_queue_map_rss_mask(struct mqnic_if *interface, i uint32_t mqnic_interface_get_rx_queue_map_app_mask(struct mqnic_if *interface, int port); // mqnic_sched_block.c -struct mqnic_sched_block *mqnic_sched_block_open(struct mqnic_if *interface, int index, struct reg_block *block_rb); +struct mqnic_sched_block *mqnic_sched_block_open(struct mqnic_if *interface, int index, struct mqnic_reg_block *block_rb); void mqnic_sched_block_close(struct mqnic_sched_block *block); // mqnic_scheduler.c -struct mqnic_sched *mqnic_sched_open(struct mqnic_sched_block *block, int index, struct reg_block *rb); +struct mqnic_sched *mqnic_sched_open(struct mqnic_sched_block *block, int index, struct mqnic_reg_block *rb); void mqnic_sched_close(struct mqnic_sched *sched); #endif /* MQNIC_H */ diff --git a/lib/mqnic/mqnic_if.c b/lib/mqnic/mqnic_if.c index 53f415b78..9a75a15da 100644 --- a/lib/mqnic/mqnic_if.c +++ b/lib/mqnic/mqnic_if.c @@ -58,7 +58,7 @@ struct mqnic_if *mqnic_if_open(struct mqnic *dev, int index, volatile uint8_t *r } // Enumerate registers - interface->rb_list = enumerate_reg_block_list(interface->regs, dev->if_csr_offset, interface->regs_size); + interface->rb_list = mqnic_enumerate_reg_block_list(interface->regs, dev->if_csr_offset, interface->regs_size); if (!interface->rb_list) { @@ -66,7 +66,7 @@ struct mqnic_if *mqnic_if_open(struct mqnic *dev, int index, volatile uint8_t *r goto fail; } - interface->if_ctrl_rb = find_reg_block(interface->rb_list, MQNIC_RB_IF_CTRL_TYPE, MQNIC_RB_IF_CTRL_VER, 0); + interface->if_ctrl_rb = mqnic_find_reg_block(interface->rb_list, MQNIC_RB_IF_CTRL_TYPE, MQNIC_RB_IF_CTRL_VER, 0); if (!interface->if_ctrl_rb) { @@ -80,7 +80,7 @@ struct mqnic_if *mqnic_if_open(struct mqnic *dev, int index, volatile uint8_t *r interface->max_tx_mtu = mqnic_reg_read32(interface->if_ctrl_rb->regs, MQNIC_RB_IF_CTRL_REG_MAX_TX_MTU); interface->max_rx_mtu = mqnic_reg_read32(interface->if_ctrl_rb->regs, MQNIC_RB_IF_CTRL_REG_MAX_RX_MTU); - interface->event_queue_rb = find_reg_block(interface->rb_list, MQNIC_RB_EVENT_QM_TYPE, MQNIC_RB_EVENT_QM_VER, 0); + interface->event_queue_rb = mqnic_find_reg_block(interface->rb_list, MQNIC_RB_EVENT_QM_TYPE, MQNIC_RB_EVENT_QM_VER, 0); if (!interface->event_queue_rb) { @@ -95,7 +95,7 @@ struct mqnic_if *mqnic_if_open(struct mqnic *dev, int index, volatile uint8_t *r if (interface->event_queue_count > MQNIC_MAX_EVENT_RINGS) interface->event_queue_count = MQNIC_MAX_EVENT_RINGS; - interface->tx_queue_rb = find_reg_block(interface->rb_list, MQNIC_RB_TX_QM_TYPE, MQNIC_RB_TX_QM_VER, 0); + interface->tx_queue_rb = mqnic_find_reg_block(interface->rb_list, MQNIC_RB_TX_QM_TYPE, MQNIC_RB_TX_QM_VER, 0); if (!interface->tx_queue_rb) { @@ -110,7 +110,7 @@ struct mqnic_if *mqnic_if_open(struct mqnic *dev, int index, volatile uint8_t *r if (interface->tx_queue_count > MQNIC_MAX_TX_RINGS) interface->tx_queue_count = MQNIC_MAX_TX_RINGS; - interface->tx_cpl_queue_rb = find_reg_block(interface->rb_list, MQNIC_RB_TX_CQM_TYPE, MQNIC_RB_TX_CQM_VER, 0); + interface->tx_cpl_queue_rb = mqnic_find_reg_block(interface->rb_list, MQNIC_RB_TX_CQM_TYPE, MQNIC_RB_TX_CQM_VER, 0); if (!interface->tx_cpl_queue_rb) { @@ -125,7 +125,7 @@ struct mqnic_if *mqnic_if_open(struct mqnic *dev, int index, volatile uint8_t *r if (interface->tx_cpl_queue_count > MQNIC_MAX_TX_CPL_RINGS) interface->tx_cpl_queue_count = MQNIC_MAX_TX_CPL_RINGS; - interface->rx_queue_rb = find_reg_block(interface->rb_list, MQNIC_RB_RX_QM_TYPE, MQNIC_RB_RX_QM_VER, 0); + interface->rx_queue_rb = mqnic_find_reg_block(interface->rb_list, MQNIC_RB_RX_QM_TYPE, MQNIC_RB_RX_QM_VER, 0); if (!interface->rx_queue_rb) { @@ -140,7 +140,7 @@ struct mqnic_if *mqnic_if_open(struct mqnic *dev, int index, volatile uint8_t *r if (interface->rx_queue_count > MQNIC_MAX_RX_RINGS) interface->rx_queue_count = MQNIC_MAX_RX_RINGS; - interface->rx_cpl_queue_rb = find_reg_block(interface->rb_list, MQNIC_RB_RX_CQM_TYPE, MQNIC_RB_RX_CQM_VER, 0); + interface->rx_cpl_queue_rb = mqnic_find_reg_block(interface->rb_list, MQNIC_RB_RX_CQM_TYPE, MQNIC_RB_RX_CQM_VER, 0); if (!interface->rx_cpl_queue_rb) { @@ -155,7 +155,7 @@ struct mqnic_if *mqnic_if_open(struct mqnic *dev, int index, volatile uint8_t *r if (interface->rx_cpl_queue_count > MQNIC_MAX_RX_CPL_RINGS) interface->rx_cpl_queue_count = MQNIC_MAX_RX_CPL_RINGS; - interface->rx_queue_map_rb = find_reg_block(interface->rb_list, MQNIC_RB_RX_QUEUE_MAP_TYPE, MQNIC_RB_RX_QUEUE_MAP_VER, 0); + interface->rx_queue_map_rb = mqnic_find_reg_block(interface->rb_list, MQNIC_RB_RX_QUEUE_MAP_TYPE, MQNIC_RB_RX_QUEUE_MAP_VER, 0); if (!interface->rx_queue_map_rb) { @@ -165,7 +165,7 @@ struct mqnic_if *mqnic_if_open(struct mqnic *dev, int index, volatile uint8_t *r for (int k = 0; k < interface->sched_block_count; k++) { - struct reg_block *sched_block_rb = find_reg_block(interface->rb_list, MQNIC_RB_SCHED_BLOCK_TYPE, MQNIC_RB_SCHED_BLOCK_VER, k); + struct mqnic_reg_block *sched_block_rb = mqnic_find_reg_block(interface->rb_list, MQNIC_RB_SCHED_BLOCK_TYPE, MQNIC_RB_SCHED_BLOCK_VER, k); struct mqnic_sched_block *sched_block; if (!sched_block_rb) @@ -201,7 +201,7 @@ void mqnic_if_close(struct mqnic_if *interface) } if (interface->rb_list) - free_reg_block_list(interface->rb_list); + mqnic_free_reg_block_list(interface->rb_list); free(interface); } diff --git a/lib/mqnic/mqnic_sched_block.c b/lib/mqnic/mqnic_sched_block.c index 7f500486d..cda6a1168 100644 --- a/lib/mqnic/mqnic_sched_block.c +++ b/lib/mqnic/mqnic_sched_block.c @@ -36,7 +36,7 @@ either expressed or implied, of The Regents of the University of California. #include #include -struct mqnic_sched_block *mqnic_sched_block_open(struct mqnic_if *interface, int index, struct reg_block *block_rb) +struct mqnic_sched_block *mqnic_sched_block_open(struct mqnic_if *interface, int index, struct mqnic_reg_block *block_rb) { struct mqnic_sched_block *block = calloc(1, sizeof(struct mqnic_sched_block)); @@ -50,7 +50,7 @@ struct mqnic_sched_block *mqnic_sched_block_open(struct mqnic_if *interface, int block->index = index; - block->rb_list = enumerate_reg_block_list(interface->regs, offset, interface->regs_size); + block->rb_list = mqnic_enumerate_reg_block_list(interface->regs, offset, interface->regs_size); if (!block->rb_list) { @@ -59,7 +59,7 @@ struct mqnic_sched_block *mqnic_sched_block_open(struct mqnic_if *interface, int } block->sched_count = 0; - for (struct reg_block *rb = block->rb_list; rb->type && rb->version; rb++) + for (struct mqnic_reg_block *rb = block->rb_list; rb->type && rb->version; rb++) { if (rb->type == MQNIC_RB_SCHED_RR_TYPE && rb->version == MQNIC_RB_SCHED_RR_VER) { @@ -94,7 +94,7 @@ void mqnic_sched_block_close(struct mqnic_sched_block *block) } if (block->rb_list) - free_reg_block_list(block->rb_list); + mqnic_free_reg_block_list(block->rb_list); free(block); } diff --git a/lib/mqnic/mqnic_scheduler.c b/lib/mqnic/mqnic_scheduler.c index 5b6cba0e2..83c03f2d0 100644 --- a/lib/mqnic/mqnic_scheduler.c +++ b/lib/mqnic/mqnic_scheduler.c @@ -36,7 +36,7 @@ either expressed or implied, of The Regents of the University of California. #include #include -struct mqnic_sched *mqnic_sched_open(struct mqnic_sched_block *block, int index, struct reg_block *rb) +struct mqnic_sched *mqnic_sched_open(struct mqnic_sched_block *block, int index, struct mqnic_reg_block *rb) { struct mqnic_sched *sched = calloc(1, sizeof(struct mqnic_sched)); diff --git a/lib/mqnic/reg_block.c b/lib/mqnic/reg_block.c index 8279c5987..d159c7cc9 100644 --- a/lib/mqnic/reg_block.c +++ b/lib/mqnic/reg_block.c @@ -38,10 +38,10 @@ either expressed or implied, of The Regents of the University of California. #include #include -struct reg_block *enumerate_reg_block_list(volatile uint8_t *base, size_t offset, size_t size) +struct mqnic_reg_block *mqnic_enumerate_reg_block_list(volatile uint8_t *base, size_t offset, size_t size) { int max_count = 8; - struct reg_block *reg_block_list = calloc(max_count, sizeof(struct reg_block)); + struct mqnic_reg_block *reg_block_list = calloc(max_count, sizeof(struct mqnic_reg_block)); int count = 0; volatile uint8_t *ptr; @@ -86,9 +86,9 @@ struct reg_block *enumerate_reg_block_list(volatile uint8_t *base, size_t offset if (count >= max_count) { - struct reg_block *tmp; + struct mqnic_reg_block *tmp; max_count += 4; - tmp = realloc(reg_block_list, max_count * sizeof(struct reg_block)); + tmp = realloc(reg_block_list, max_count * sizeof(struct mqnic_reg_block)); if (!tmp) goto fail; reg_block_list = tmp; @@ -101,9 +101,9 @@ fail: return NULL; } -struct reg_block *find_reg_block(struct reg_block *list, uint32_t type, uint32_t version, int index) +struct mqnic_reg_block *mqnic_find_reg_block(struct mqnic_reg_block *list, uint32_t type, uint32_t version, int index) { - struct reg_block *rb = list; + struct mqnic_reg_block *rb = list; while (rb->regs) { @@ -125,7 +125,7 @@ struct reg_block *find_reg_block(struct reg_block *list, uint32_t type, uint32_t return NULL; } -void free_reg_block_list(struct reg_block *list) +void mqnic_free_reg_block_list(struct mqnic_reg_block *list) { free(list); } diff --git a/lib/mqnic/reg_block.h b/lib/mqnic/reg_block.h index f317b3819..a9fe83637 100644 --- a/lib/mqnic/reg_block.h +++ b/lib/mqnic/reg_block.h @@ -37,15 +37,15 @@ either expressed or implied, of The Regents of the University of California. #include #include -struct reg_block { +struct mqnic_reg_block { uint32_t type; uint32_t version; volatile uint8_t *base; volatile uint8_t *regs; }; -struct reg_block *enumerate_reg_block_list(volatile uint8_t *base, size_t offset, size_t size); -struct reg_block *find_reg_block(struct reg_block *list, uint32_t type, uint32_t version, int index); -void free_reg_block_list(struct reg_block *list); +struct mqnic_reg_block *mqnic_enumerate_reg_block_list(volatile uint8_t *base, size_t offset, size_t size); +struct mqnic_reg_block *mqnic_find_reg_block(struct mqnic_reg_block *list, uint32_t type, uint32_t version, int index); +void mqnic_free_reg_block_list(struct mqnic_reg_block *list); #endif /* REG_BLOCK_H */ diff --git a/utils/mqnic-bmc.c b/utils/mqnic-bmc.c index 765d2777f..80d2234c0 100644 --- a/utils/mqnic-bmc.c +++ b/utils/mqnic-bmc.c @@ -47,14 +47,14 @@ static void usage(char *name) name); } -uint32_t mqnic_alveo_bmc_reg_read(struct reg_block *rb, uint32_t reg) +uint32_t mqnic_alveo_bmc_reg_read(struct mqnic_reg_block *rb, uint32_t reg) { mqnic_reg_write32(rb->regs, MQNIC_RB_ALVEO_BMC_REG_ADDR, reg); mqnic_reg_read32(rb->regs, MQNIC_RB_ALVEO_BMC_REG_DATA); // dummy read return mqnic_reg_read32(rb->regs, MQNIC_RB_ALVEO_BMC_REG_DATA); } -void mqnic_alveo_bmc_reg_write(struct reg_block *rb, uint32_t reg, uint32_t val) +void mqnic_alveo_bmc_reg_write(struct mqnic_reg_block *rb, uint32_t reg, uint32_t val) { mqnic_reg_write32(rb->regs, MQNIC_RB_ALVEO_BMC_REG_ADDR, reg); mqnic_reg_write32(rb->regs, MQNIC_RB_ALVEO_BMC_REG_DATA, val); @@ -123,7 +123,7 @@ struct sensor_channel alveo_bmc_sensors[] = { {0, "", ""} }; -int mqnic_gecko_bmc_read(struct reg_block *rb) +int mqnic_gecko_bmc_read(struct mqnic_reg_block *rb) { uint32_t val; int timeout = 20000; @@ -157,7 +157,7 @@ int mqnic_gecko_bmc_read(struct reg_block *rb) return -1; } -int mqnic_gecko_bmc_write(struct reg_block *rb, uint16_t cmd, uint32_t data) +int mqnic_gecko_bmc_write(struct mqnic_reg_block *rb, uint16_t cmd, uint32_t data) { int ret; ret = mqnic_gecko_bmc_read(rb); @@ -171,7 +171,7 @@ int mqnic_gecko_bmc_write(struct reg_block *rb, uint16_t cmd, uint32_t data) return 0; } -int mqnic_gecko_bmc_query(struct reg_block *rb, uint16_t cmd, uint32_t data) +int mqnic_gecko_bmc_query(struct mqnic_reg_block *rb, uint16_t cmd, uint32_t data) { int ret; @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) char *device = NULL; struct mqnic *dev; - struct reg_block *bmc_rb; + struct mqnic_reg_block *bmc_rb; name = strrchr(argv[0], '/'); name = name ? 1+name : argv[0]; @@ -237,7 +237,7 @@ int main(int argc, char *argv[]) mqnic_print_fw_id(dev); - if ((bmc_rb = find_reg_block(dev->rb_list, MQNIC_RB_ALVEO_BMC_TYPE, MQNIC_RB_ALVEO_BMC_VER, 0))) + if ((bmc_rb = mqnic_find_reg_block(dev->rb_list, MQNIC_RB_ALVEO_BMC_TYPE, MQNIC_RB_ALVEO_BMC_VER, 0))) { printf("Detected Xilinx Alveo board with MSP430 BMC\n"); @@ -297,7 +297,7 @@ int main(int argc, char *argv[]) printf("\n"); } } - else if ((bmc_rb = find_reg_block(dev->rb_list, MQNIC_RB_GECKO_BMC_TYPE, MQNIC_RB_GECKO_BMC_VER, 0))) + else if ((bmc_rb = mqnic_find_reg_block(dev->rb_list, MQNIC_RB_GECKO_BMC_TYPE, MQNIC_RB_GECKO_BMC_VER, 0))) { printf("Detected Silicom board with Gecko BMC\n"); diff --git a/utils/mqnic-config.c b/utils/mqnic-config.c index 988bc408e..d8ae93d81 100644 --- a/utils/mqnic-config.c +++ b/utils/mqnic-config.c @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) int port = 0; int sched_block = 0; - struct reg_block *rb; + struct mqnic_reg_block *rb; struct timespec ts_now; struct timespec ts_start; @@ -226,7 +226,7 @@ int main(int argc, char *argv[]) printf("Sched count: %d\n", dev_sched_block->sched_count); - rb = find_reg_block(dev_sched_block->rb_list, MQNIC_RB_TDMA_SCH_TYPE, MQNIC_RB_TDMA_SCH_VER, 0); + rb = mqnic_find_reg_block(dev_sched_block->rb_list, MQNIC_RB_TDMA_SCH_TYPE, MQNIC_RB_TDMA_SCH_VER, 0); if (dev->phc_rb && rb) { diff --git a/utils/mqnic-dump.c b/utils/mqnic-dump.c index c7459c8a8..e923e6b91 100644 --- a/utils/mqnic-dump.c +++ b/utils/mqnic-dump.c @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) printf("RAM region size: %lu\n", dev->ram_size); printf("Device-level register blocks:\n"); - for (struct reg_block *rb = dev->rb_list; rb->regs; rb++) + for (struct mqnic_reg_block *rb = dev->rb_list; rb->regs; rb++) printf(" type 0x%08x (v %d.%d.%d.%d)\n", rb->type, rb->version >> 24, (rb->version >> 16) & 0xff, (rb->version >> 8) & 0xff, rb->version & 0xff); @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) mqnic_reg_read32(dev->phc_rb->regs, MQNIC_RB_PHC_REG_NOM_PERIOD_FNS)); ch = 0; - for (struct reg_block *rb = dev->rb_list; rb->regs; rb++) + for (struct mqnic_reg_block *rb = dev->rb_list; rb->regs; rb++) { if (rb->type == MQNIC_RB_PHC_PEROUT_TYPE && rb->version == MQNIC_RB_PHC_PEROUT_VER) { @@ -174,7 +174,7 @@ int main(int argc, char *argv[]) } printf("Interface-level register blocks:\n"); - for (struct reg_block *rb = dev_interface->rb_list; rb->regs; rb++) + for (struct mqnic_reg_block *rb = dev_interface->rb_list; rb->regs; rb++) printf(" type 0x%08x (v %d.%d.%d.%d)\n", rb->type, rb->version >> 24, (rb->version >> 16) & 0xff, (rb->version >> 8) & 0xff, rb->version & 0xff); @@ -239,13 +239,13 @@ int main(int argc, char *argv[]) } printf("Scheduler block-level register blocks:\n"); - for (struct reg_block *rb = dev_sched_block->rb_list; rb->regs; rb++) + for (struct mqnic_reg_block *rb = dev_sched_block->rb_list; rb->regs; rb++) printf(" type 0x%08x (v %d.%d.%d.%d)\n", rb->type, rb->version >> 24, (rb->version >> 16) & 0xff, (rb->version >> 8) & 0xff, rb->version & 0xff); printf("Sched count: %d\n", dev_sched_block->sched_count); - for (struct reg_block *rb = dev_sched_block->rb_list; rb->regs; rb++) + for (struct mqnic_reg_block *rb = dev_sched_block->rb_list; rb->regs; rb++) { if (rb->type == MQNIC_RB_SCHED_RR_TYPE && rb->version == MQNIC_RB_SCHED_RR_VER) { diff --git a/utils/mqnic-fw.c b/utils/mqnic-fw.c index 5e53a6b7d..9ac1a1fcd 100644 --- a/utils/mqnic-fw.c +++ b/utils/mqnic-fw.c @@ -566,7 +566,7 @@ int main(int argc, char *argv[]) struct mqnic *dev = NULL; - struct reg_block *flash_rb = NULL; + struct mqnic_reg_block *flash_rb = NULL; struct flash_device *pri_flash = NULL; struct flash_device *sec_flash = NULL; @@ -678,7 +678,7 @@ int main(int argc, char *argv[]) size_t segment_size = 0; size_t segment_offset = 0; - if ((flash_rb = find_reg_block(dev->rb_list, MQNIC_RB_SPI_FLASH_TYPE, 0, 0))) + if ((flash_rb = mqnic_find_reg_block(dev->rb_list, MQNIC_RB_SPI_FLASH_TYPE, 0, 0))) { uint32_t reg_val; @@ -768,7 +768,7 @@ int main(int argc, char *argv[]) flash_size = pri_flash->size; } } - else if ((flash_rb = find_reg_block(dev->rb_list, MQNIC_RB_BPI_FLASH_TYPE, 0, 0))) + else if ((flash_rb = mqnic_find_reg_block(dev->rb_list, MQNIC_RB_BPI_FLASH_TYPE, 0, 0))) { uint32_t reg_val;