From patchwork Fri May 28 12:06:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Narendra K X-Patchwork-Id: 102899 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4SE9Owd010105 for ; Fri, 28 May 2010 14:09:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756056Ab0E1OJX (ORCPT ); Fri, 28 May 2010 10:09:23 -0400 Received: from ausxippc101.us.dell.com ([143.166.85.207]:5421 "EHLO ausxippc101.us.dell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755533Ab0E1OJW convert rfc822-to-8bit (ORCPT ); Fri, 28 May 2010 10:09:22 -0400 X-LoopCount1: from 10.9.160.253 From: "K, Narendra" To: "netdev@vger.kernel.org" , "linux-hotplug@vger.kernel.org" , "linux-pci@vger.kernel.org" CC: "achiang@hp.com" , "Domsch, Matt" , "Hargrave, Jordan" , "Rose, Charles" , "Nijhawan, Vijay" Date: Fri, 28 May 2010 07:06:45 -0500 Subject: [PATCH 2/2] dmi: save OEM defined slot information Thread-Topic: [PATCH 2/2] dmi: save OEM defined slot information Thread-Index: Acr+XsCiypeE0bzfSISjQe6XAoYdbw== Message-ID: <20100528120644.GB24114@littleblue.us.dell.com> Accept-Language: en-US Content-Language: en-US X-MS-Exchange-Organization-AuthAs: Internal X-MS-Exchange-Organization-AuthMechanism: 0b X-MS-Exchange-Organization-AuthSource: AUSX7HPC101.AMER.DELL.COM X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originalarrivaltime: 28 May 2010 12:06:46.0183 (UTC) FILETIME=[3E76BB70:01CAFE5E] x-loopcount0: from 10.9.160.253 user-agent: Mutt/1.4.2.2i MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 28 May 2010 14:09:24 +0000 (UTC) diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 7d8439b..291b876 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -311,6 +311,32 @@ static void __init dmi_save_extended_devices(const struct dmi_header *dm) dmi_save_one_device(*d & 0x7f, dmi_string_nosave(dm, *(d - 1))); } +static void __init dmi_save_oem_devices(const struct dmi_header *dm) { + int bus, devfn, count; + const u8 *d = (u8 *)dm + 4; + char name[20]; + + /* Only handle HP extensions for now */ + if (strcmp(dmi_ident[DMI_BIOS_VENDOR], "HP")) + return; + + count = 1; + while ((d + 8) <= ((u8 *)dm + dm->length)) { + if ((*d == 0x00 && *(d + 1) == 0x00) || + (*d == 0xff && *(d + 1) == 0xff)) + goto next; + + bus = *(d + 1); + devfn = *d; + sprintf(name, "Embedded NIC %d", count); + dmi_save_devslot(-1, 0, bus, devfn, name); + +next: + count++; + d += 8; + } +} + /* * Process a DMI table entry. Right now all we care about are the BIOS * and machine entries. For 2.5 we should pull the smbus controller info @@ -357,6 +383,9 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy) case 41: /* Onboard Devices Extended Information */ dmi_save_extended_devices(dm); break; + case 209: + dmi_save_oem_devices(dm); + break; } }