From patchwork Thu Feb 18 20:40:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan_Hargrave@Dell.com X-Patchwork-Id: 584936 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 1B6F9140BAC for ; Fri, 19 Feb 2016 07:40:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=dell.com header.i=@dell.com header.b=rYFk0lrr; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1948177AbcBRUkf (ORCPT ); Thu, 18 Feb 2016 15:40:35 -0500 Received: from AUSXIPPS310.us.dell.com ([143.166.148.211]:45708 "EHLO ausxipps310.us.dell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1948070AbcBRUke convert rfc822-to-8bit (ORCPT ); Thu, 18 Feb 2016 15:40:34 -0500 DomainKey-Signature: s=smtpout; d=dell.com; c=nofws; q=dns; h=X-LoopCount0:X-IronPort-AV:From:To:CC:Subject: Thread-Topic:Thread-Index:Date:Message-ID:Accept-Language: Content-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader:x-originating-ip: Content-Type:Content-Transfer-Encoding:MIME-Version: Return-Path; b=fCdQkGXZSxiWdHnMmCBPizaMW3CuY0tc7JYHEPrKfHSYt77wsOwmprE5 v89Dxxz3rCvERvwbwQiVQqYEo9IvgSW4HbqsZOKtSfjVia57Wby5DnuIB yf5UE8Sdo36+NLDGyL36Pa8wi4iY4KJ1rDNsbkaHndmw9yyNBPozH+uCi Q=; DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1455828033; x=1487364033; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=8ACGDZsyKryMKxxBvDmEZTmGShNXEPk8UuAqOz3e8o4=; b=rYFk0lrriq54dRqaKsd3Izjn8lGJ2pTUgQCTdCbrFp1tfTNX4fcik0dB EQWriYXF3E4aBlYn/mSk96IOVENEohHiKqYeLYOWDh68MIsZk9FKYmxpd RxmH5JLAjTgcjoSj3YW7NEvxUxhzfkBiZ2ceZrNfVVwA2aBxbG7peaq4I Q=; X-LoopCount0: from 10.170.28.41 X-IronPort-AV: E=Sophos;i="5.22,467,1449554400"; d="scan'208";a="283974850" From: To: , , , , CC: , , , Subject: [PATCH v3] Create pci slot files for SMBIOS Type 9 entries Thread-Topic: [PATCH v3] Create pci slot files for SMBIOS Type 9 entries Thread-Index: AQHRaoyWeBYlxIFMuUyGAVfsBRHtkw== Date: Thu, 18 Feb 2016 20:40:32 +0000 Message-ID: <1455827823254.98505@Dell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.9.160.250] MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 --- 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); }