From: Alex Chiang <achiang@hp.com>
To: Narendra K <Narendra_K@dell.com>
Cc: matt_domsch@dell.com, netdev@vger.kernel.org,
linux-hotplug@vger.kernel.org, linux-pci@vger.kernel.org,
jordan_hargrave@dell.com, sandeep_k_shandilya@dell.com,
charles_rose@dell.com, shyam_iyer@dell.com
Subject: Re: [PATCH] Export smbios strings associated with onboard devices to sysfs
Date: Mon, 8 Mar 2010 10:38:38 -0700 [thread overview]
Message-ID: <20100308173838.GC20953@ldl.fc.hp.com> (raw)
In-Reply-To: <20100302173302.GA20936@mock.linuxdev.us.dell.com>
* Narendra K <Narendra_K@dell.com>:
>
> Resending the patch with review comments incorporated.
>
> Signed-off-by: Jordan Hargrave <Jordan_Hargrave@dell.com>
> Signed-off-by: Narendra K <Narendra_K@dell.com>
Here is a patch I wrote that would be nice if you could
incorporate into your patch series.
It adds support for HP OEM SMBIOS record Type 209, so that you
can populate the 'label' attribute on existing HP platforms.
It needs that hunk I suggested in my previous mail to apply
cleanly.
Thanks,
/ac
From: Alex Chiang <achiang@hp.com>
dmi: save OEM defined slot information
Some legacy platforms provide onboard device information in an SMBIOS
OEM-defined field, notably HP Proliants.
This information can be used to provide information to userspace that
allows correlation between a Linux PCI device and a chassis label.
Save this information so that it can be exposed to userspace. We choose
the string "Embedded NIC %d" since there are known platforms from other
vendors (Dell) that provide a string in this format for their onboard
NICs (although theirs is provided by a Type 41 record). This consistency
will help simplify life for userspace tools.
Only support HP platforms for now. If we need support for another vendor
in the future, we can write a fancier implementation then.
This code was inspired by the implementation in the userspace dmidecode
tool, which was originally written by John Cagle.
Signed-off-by: Alex Chiang <achiang@hp.com>
---
dmi_scan.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
---
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 5a81a8b..cb2a57a 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -314,6 +314,33 @@ 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
@@ -360,6 +387,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;
}
}
next prev parent reply other threads:[~2010-03-08 17:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-25 20:29 [PATCH] Export smbios strings associated with onboard devices to sysfs Narendra K
2010-02-25 20:49 ` Domsch, Matt
[not found] ` <EDA0A4495861324DA2618B4C45DCB3EE6122A2@blrx3m08.blr.amer.dell.com>
2010-03-02 17:33 ` Narendra K
2010-03-02 18:28 ` Greg KH
2010-03-08 17:34 ` Alex Chiang
2010-03-08 17:38 ` Alex Chiang [this message]
2010-03-08 17:57 ` [PATCH] Export smbios strings associated with onboard devicesto sysfs Narendra_K
2010-02-25 21:40 ` [PATCH] Export smbios strings associated with onboard devices to sysfs Alex Chiang
2010-02-25 21:46 ` Domsch, Matt
2010-02-25 22:20 ` Alex Chiang
2010-03-02 17:42 ` [PATCH] Export smbios strings associated with onboard devicesto sysfs Narendra_K
2010-02-25 22:55 ` [PATCH] Export smbios strings associated with onboard devices to sysfs Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100308173838.GC20953@ldl.fc.hp.com \
--to=achiang@hp.com \
--cc=Narendra_K@dell.com \
--cc=charles_rose@dell.com \
--cc=jordan_hargrave@dell.com \
--cc=linux-hotplug@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=matt_domsch@dell.com \
--cc=netdev@vger.kernel.org \
--cc=sandeep_k_shandilya@dell.com \
--cc=shyam_iyer@dell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).