summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-06-22 03:19:38 -0400
committerIan Moffett <ian@osmora.org>2025-06-22 03:19:38 -0400
commitbee68b89ef60aa40cbefe305c7f0c738cf3c2a9d (patch)
tree2fca3cb575202c11862d1616cc8222b74367d80e
parent7d212c1bc146ec9040d1db7af530a66bf530df66 (diff)
kernel: e1000: Grant NIC PCI MMIO/DMA capabilities
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sys/dev/phy/e1000.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/phy/e1000.c b/sys/dev/phy/e1000.c
index ad20e52..c9782a5 100644
--- a/sys/dev/phy/e1000.c
+++ b/sys/dev/phy/e1000.c
@@ -100,6 +100,20 @@ e1000_chip_init(struct e1000_nic *np)
return 0;
}
+/*
+ * Enables PCI specific bits like bus mastering (for DMA)
+ * as well as MMIO.
+ */
+static void
+e1000_init_pci(void)
+{
+ uint32_t tmp;
+
+ tmp = pci_readl(e1000, PCIREG_CMDSTATUS);
+ tmp |= (PCI_BUS_MASTERING | PCI_MEM_SPACE);
+ pci_writel(e1000, PCIREG_CMDSTATUS, tmp);
+}
+
static int
e1000_init(void)
{
@@ -124,6 +138,7 @@ e1000_init(void)
return status;
}
+ e1000_init_pci();
e1000_chip_init(&nic);
return 0;
}