1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-30 08:32:52 +08:00

Add mqnic_sched struct

This commit is contained in:
Alex Forencich 2019-11-05 18:21:08 -08:00
parent abdb714fd9
commit 29d223f0ab
2 changed files with 16 additions and 0 deletions

View File

@ -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;
}
}
}

View File

@ -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 {