diff --git a/utils/mqnic.c b/utils/mqnic.c index 3040c95ff..462e9e2f7 100644 --- a/utils/mqnic.c +++ b/utils/mqnic.c @@ -144,6 +144,12 @@ struct mqnic *mqnic_open(const char *dev_name) 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); + + for (int m = 0; m < port->sched_count; m++) + { + struct mqnic_sched *sched = &port->sched[m]; + sched->regs = port->regs + port->sched_offset + port->sched_stride*m; + } } } diff --git a/utils/mqnic.h b/utils/mqnic.h index fd3215f6f..45d52fe4b 100644 --- a/utils/mqnic.h +++ b/utils/mqnic.h @@ -45,6 +45,14 @@ either expressed or implied, of The Regents of the University of California. struct mqnic; +struct mqnic_sched { + struct mqnic *mqnic; + struct mqnic_if *mqnic_if; + struct mqnic_port *mqnic_port; + + volatile uint8_t *regs; +}; + struct mqnic_port { struct mqnic *mqnic; struct mqnic_if *mqnic_if; @@ -60,6 +68,8 @@ struct mqnic_port { uint32_t sched_type; uint32_t tdma_timeslot_count; + + struct mqnic_sched sched[MQNIC_MAX_SCHED]; }; struct mqnic_if {