Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111870328
D27549.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D27549.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
@@ -493,6 +493,28 @@
return (NULL);
}
+device_t
+pci_find_class_from(uint8_t class, uint8_t subclass, 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 &&
+ dinfo->cfg.subclass == subclass) {
+ 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
@@ -666,6 +666,7 @@
device_t pci_find_dbsf(uint32_t, uint8_t, uint8_t, uint8_t);
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);
/* 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
Mon, Mar 10, 2:37 PM (16 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17085363
Default Alt Text
D27549.diff (1 KB)
Attached To
Mode
D27549: pci: Add pci_find_class_from
Attached
Detach File
Event Timeline
Log In to Comment