Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148383288
D48745.1786563466.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48745.1786563466.diff
View Options
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -523,6 +523,27 @@
return (NULL);
}
+device_t
+pci_find_base_class_from(uint8_t class, device_t from)
+{
+ struct pci_devinfo *dinfo;
+ bool found = false;
+
+ STAILQ_FOREACH(dinfo, &pci_devq, pci_links) {
+ if (from != NULL && found == false) {
+ if (from != dinfo->cfg.dev)
+ continue;
+ found = true;
+ continue;
+ }
+ if (dinfo->cfg.baseclass == class) {
+ return (dinfo->cfg.dev);
+ }
+ }
+
+ return (NULL);
+}
+
static int
pci_printf(pcicfgregs *cfg, const char *fmt, ...)
{
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -670,6 +670,7 @@
device_t pci_find_device(uint16_t, uint16_t);
device_t pci_find_class(uint8_t class, uint8_t subclass);
device_t pci_find_class_from(uint8_t class, uint8_t subclass, device_t devfrom);
+device_t pci_find_base_class_from(uint8_t class, device_t devfrom);
/* Can be used by drivers to manage the MSI-X table. */
int pci_pending_msix(device_t dev, u_int index);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 12, 7:37 PM (18 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29399855
Default Alt Text
D48745.1786563466.diff (1 KB)
Attached To
Mode
D48745: pci: Add `pci_find_base_class_from()`
Attached
Detach File
Event Timeline
Log In to Comment