Page MenuHomeFreeBSD

D58878.diff
No OneTemporary

D58878.diff

diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h
--- a/sys/compat/linuxkpi/common/include/linux/pci.h
+++ b/sys/compat/linuxkpi/common/include/linux/pci.h
@@ -437,6 +437,24 @@
return (1 << type);
}
+static inline int
+pci_select_bars(struct pci_dev *pdev, unsigned long flags)
+{
+ int bars, bar;
+
+ bars = 0;
+ /* We only support BARs here; Linux may support more types. */
+ for (bar = PCIR_MAX_BAR_0; bar >= 0; bar--) {
+ int bar_flags;
+
+ bar_flags = pci_resource_flags(pdev, bar);
+ if ((bar_flags & flags) != 0)
+ bars |= (1 << bar);
+ }
+
+ return (bars);
+}
+
static inline const char *
pci_name(struct pci_dev *d)
{
@@ -1585,6 +1603,17 @@
return (-ENXIO);
}
+static inline int
+pci_msix_vec_count(struct pci_dev *pdev)
+{
+ int avail;
+
+ avail = pci_msix_count(pdev->dev.bsddev);
+ if (avail == 0)
+ return (-EINVAL);
+ return (avail);
+}
+
static inline int
pci_wake_from_d3(struct pci_dev *pdev, bool enable)
{

File Metadata

Mime Type
text/plain
Expires
Thu, Aug 20, 3:52 AM (6 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36878551
Default Alt Text
D58878.diff (1015 B)

Event Timeline