linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] Create pci slot files for SMBIOS Type 9 entries
@ 2016-02-18 20:40 Jordan_Hargrave
  2016-04-10 22:17 ` Bjorn Helgaas
  0 siblings, 1 reply; 4+ messages in thread
From: Jordan_Hargrave @ 2016-02-18 20:40 UTC (permalink / raw)
  To: bhelgaas, helgaas, tglx, mingo, hpa; +Cc: linux-kernel, linux-pci, x86, jharg93

The following diff builds on the "[PATCHv3] Save SMBIOS Type 9 System Slots"

This will create a /sys/bus/pci/slots/XXX file for each Type 9 entry.  This will be \
used for systemd enumeration of NICs.

Only build if CONFIG_DMI is set

Signed-off-by: Jordan Hargrave <Jordan_Hargrave@dell.com>
---
 arch/x86/pci/common.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index eccd4d9..bfa3c85 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -173,6 +173,27 @@ void pcibios_fixup_bus(struct pci_bus *b)
 
 void pcibios_add_bus(struct pci_bus *bus)
 {
+#ifdef CONFIG_DMI
+	const struct dmi_device *dmi;
+	struct dmi_dev_onboard *dslot;
+	char sname[128];
+
+	dmi = NULL;
+	while ((dmi = dmi_find_device(DMI_DEV_TYPE_DEV_SLOT,
+				      NULL, dmi)) != NULL) {
+		dslot = dmi->device_data;
+		if (dslot->segment == pci_domain_nr(bus) &&
+		    dslot->bus == bus->number) {
+			dev_info(&bus->dev, "Found SMBIOS Slot %s\n",
+				 dslot->dev.name);
+			snprintf(sname, sizeof(sname), "%s-%d",
+				 dslot->dev.name,
+				 dslot->instance);
+			pci_create_slot(bus, dslot->devfn,
+					sname, NULL);
+		}
+	}
+#endif
 	acpi_pci_add_bus(bus);
 }
 
-- 
2.5.0






 
--jordan hargrave
 Dell Enterprise Linux Engineering  

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-13  6:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 20:40 [PATCH v3] Create pci slot files for SMBIOS Type 9 entries Jordan_Hargrave
2016-04-10 22:17 ` Bjorn Helgaas
2016-04-12 23:36   ` Jordan Hargrave
2016-04-13  6:31     ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).