Message ID | 20100308173838.GC20953@ldl.fc.hp.com |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
> -----Original Message----- > From: Alex Chiang [mailto:achiang@hp.com] > Sent: Monday, March 08, 2010 11:09 PM > To: K, Narendra > Cc: Domsch, Matt; netdev@vger.kernel.org; linux- > hotplug@vger.kernel.org; linux-pci@vger.kernel.org; Hargrave, Jordan; > Shandilya, Sandeep K; Rose, Charles; Iyer, Shyam > Subject: Re: [PATCH] Export smbios strings associated with onboard > devicesto sysfs > > * 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. > Sure, thanks. With regards, Narendra K -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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; } }