aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/pci.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 57133bf..c4383e6 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -212,6 +212,21 @@ pci_writel(struct pci_device *dev, uint32_t offset, uint32_t val)
__builtin_unreachable();
}
+/*
+ * Set command register bits.
+ *
+ * @dev: Device whose command register to modify.
+ * @bits: Bits to set.
+ */
+void
+pci_set_cmdreg(struct pci_device *dev, uint16_t bits)
+{
+ uint32_t tmp;
+
+ tmp = pci_readl(dev, 0x4) | bits;
+ pci_writel(dev, 0x4, tmp);
+}
+
struct pci_device *
pci_get_device(struct pci_lookup lookup, uint16_t lookup_type)
{