From 1fc15d234dfe133875da5bc97670333c0144195b Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Mon, 19 Aug 2019 23:29:09 -0700 Subject: [PATCH] Read interface and port features in userspace code --- utils/mqnic.c | 2 ++ utils/mqnic.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/utils/mqnic.c b/utils/mqnic.c index 2e3126d1c..1af0ba986 100644 --- a/utils/mqnic.c +++ b/utils/mqnic.c @@ -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); diff --git a/utils/mqnic.h b/utils/mqnic.h index e852d0cab..dd68ceccb 100644 --- a/utils/mqnic.h +++ b/utils/mqnic.h @@ -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;