Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167107783
D58878.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1015 B
Referenced Files
None
Subscribers
None
D58878.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D58878: LinuxKPI: pci: add pci_select_bars() and pci_msix_vec_count()
Attached
Detach File
Event Timeline
Log In to Comment