1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-16 08:12:53 +08:00

Read interface and port features in userspace code

This commit is contained in:
Alex Forencich 2019-08-19 23:29:09 -07:00
parent b77d21702a
commit 1fc15d234d
2 changed files with 4 additions and 0 deletions

View File

@ -99,6 +99,7 @@ struct mqnic *mqnic_open(const char *dev_name)
interface->csr_regs = interface->regs + dev->if_csr_offset;
interface->if_id = mqnic_reg_read32(interface->csr_regs, MQNIC_IF_REG_IF_ID);
interface->if_features = mqnic_reg_read32(interface->csr_regs, MQNIC_IF_REG_IF_FEATURES);
interface->event_queue_count = mqnic_reg_read32(interface->csr_regs, MQNIC_IF_REG_EVENT_QUEUE_COUNT);
interface->event_queue_offset = mqnic_reg_read32(interface->csr_regs, MQNIC_IF_REG_EVENT_QUEUE_OFFSET);
@ -135,6 +136,7 @@ struct mqnic *mqnic_open(const char *dev_name)
port->regs = interface->regs + interface->port_offset + interface->port_stride*l;
port->port_id = mqnic_reg_read32(port->regs, MQNIC_PORT_REG_PORT_ID);
port->port_features = mqnic_reg_read32(port->regs, MQNIC_PORT_REG_PORT_FEATURES);
port->sched_count = mqnic_reg_read32(port->regs, MQNIC_PORT_REG_SCHED_COUNT);
port->sched_offset = mqnic_reg_read32(port->regs, MQNIC_PORT_REG_SCHED_OFFSET);

View File

@ -52,6 +52,7 @@ struct mqnic_port {
volatile uint8_t *regs;
uint32_t port_id;
uint32_t port_features;
uint32_t sched_count;
uint32_t sched_offset;
@ -66,6 +67,7 @@ struct mqnic_if {
volatile uint8_t *csr_regs;
uint32_t if_id;
uint32_t if_features;
uint32_t event_queue_count;
uint32_t event_queue_offset;