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

Read interface and port features in driver

This commit is contained in:
Alex Forencich 2019-08-19 23:28:27 -07:00
parent 5f066b9fcd
commit b77d21702a
3 changed files with 5 additions and 0 deletions

View File

@ -237,6 +237,7 @@ struct mqnic_priv {
bool port_up;
u32 if_id;
u32 if_features;
u32 event_queue_count;
u32 event_queue_offset;
u32 tx_queue_count;

View File

@ -367,6 +367,8 @@ int mqnic_init_netdev(struct mqnic_dev *mdev, int port, u8 __iomem *hw_addr)
// read ID registers
priv->if_id = ioread32(priv->csr_hw_addr+MQNIC_IF_REG_IF_ID);
dev_info(dev, "IF ID: 0x%08x", priv->if_id);
priv->if_features = ioread32(priv->csr_hw_addr+MQNIC_IF_REG_IF_FEATURES);
dev_info(dev, "IF features: 0x%08x", priv->if_features);
priv->event_queue_count = ioread32(priv->csr_hw_addr+MQNIC_IF_REG_EVENT_QUEUE_COUNT);
dev_info(dev, "Event queue count: %d", priv->event_queue_count);

View File

@ -56,6 +56,8 @@ int mqnic_create_port(struct mqnic_priv *priv, struct mqnic_port **port_ptr, int
// read ID registers
port->port_id = ioread32(port->hw_addr+MQNIC_PORT_REG_PORT_ID);
dev_info(dev, "Port ID: 0x%08x", port->port_id);
port->port_features = ioread32(port->hw_addr+MQNIC_PORT_REG_PORT_FEATURES);
dev_info(dev, "Port features: 0x%08x", port->port_features);
port->sched_count = ioread32(port->hw_addr+MQNIC_PORT_REG_SCHED_COUNT);
dev_info(dev, "Scheduler count: %d", port->sched_count);