From abdb714fd900d6d10bf0ed406746a824ec2569a1 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Tue, 5 Nov 2019 18:20:21 -0800 Subject: [PATCH] Read timeslot count --- utils/mqnic-config.c | 2 ++ utils/mqnic.c | 2 ++ utils/mqnic.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/utils/mqnic-config.c b/utils/mqnic-config.c index 0cbfbbca4..2852c8371 100644 --- a/utils/mqnic-config.c +++ b/utils/mqnic-config.c @@ -197,6 +197,8 @@ int main(int argc, char *argv[]) printf("Sched stride: 0x%08x\n", dev_port->sched_stride); printf("Sched type: 0x%08x\n", dev_port->sched_type); + printf("Timeslot count: %d\n", dev_port->tdma_timeslot_count); + if (period_nsec > 0) { printf("Configure port TDMA schedule\n"); diff --git a/utils/mqnic.c b/utils/mqnic.c index 1af0ba986..3040c95ff 100644 --- a/utils/mqnic.c +++ b/utils/mqnic.c @@ -142,6 +142,8 @@ struct mqnic *mqnic_open(const char *dev_name) port->sched_offset = mqnic_reg_read32(port->regs, MQNIC_PORT_REG_SCHED_OFFSET); port->sched_stride = mqnic_reg_read32(port->regs, MQNIC_PORT_REG_SCHED_STRIDE); port->sched_type = mqnic_reg_read32(port->regs, MQNIC_PORT_REG_SCHED_TYPE); + + port->tdma_timeslot_count = mqnic_reg_read32(port->regs, MQNIC_PORT_REG_TDMA_TIMESLOT_COUNT); } } diff --git a/utils/mqnic.h b/utils/mqnic.h index dd68ceccb..fd3215f6f 100644 --- a/utils/mqnic.h +++ b/utils/mqnic.h @@ -58,6 +58,8 @@ struct mqnic_port { uint32_t sched_offset; uint32_t sched_stride; uint32_t sched_type; + + uint32_t tdma_timeslot_count; }; struct mqnic_if {