LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* DMI: add-type-41
@ 2008-01-25 20:19 Wim Van Sebroeck
  2008-02-08  5:33 ` Matt Domsch
  0 siblings, 1 reply; 3+ messages in thread
From: Wim Van Sebroeck @ 2008-01-25 20:19 UTC (permalink / raw)
  To: LKML

Hi All,

Would appreciate feedback on this patch.

Thanks in advance,
Wim.

commit 4956e4e5e77b5a8f87bcfe6127ef17a406edf94b
Author: Wim Van Sebroeck <wim@iguana.be>
Date:   Mon Dec 31 17:21:33 2007 +0000

    [PATCH] SMBIOS/DMI - add type 41 = Onboard Devices Extended Information
    
    From version 2.6 of the SMBIOS standard, type 10 (On Board Devices Information)
    becomes obsolete. The reason for this is that no further fields can be added to
    this structure without adversely affecting existing software's ability to
    properly parse the data.
    
    Therefore type 41 (Onboard Devices Extended Information) was added.
    The structure is as follows:
    	struct smbios_type_41 {
    		u8 type;
    		u8 length;
    		u16 handle;
    		u8 reference_designation_string;
    		u8 device_type;		/* same device type as in type 10 */
    		u8 device_type_instance;
    		u16 segment_group_number;
    		u8 bus_number;
    		u8 device_function_number;
    	};
    
    For more info: http://www.dmtf.org/standards/smbios
    
    Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 0cdadea..c1b2891 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -222,6 +222,28 @@ static void __init dmi_save_ipmi_device(const struct dmi_header *dm)
 	list_add(&dev->list, &dmi_devices);
 }
 
+static void __init dmi_save_extended_devices(const struct dmi_header *dm)
+{
+	const u8 *d = (u8*) dm + 5;
+	struct dmi_device *dev;
+
+	/* Skip disabled device */
+	if ((*d & 0x80) == 0)
+		return;
+
+	dev = dmi_alloc(sizeof(*dev));
+	if (!dev) {
+		printk(KERN_ERR "dmi_save_extended_devices: out of memory.\n");
+		return;
+	}
+
+	dev->type = *d-- & 0x7f;
+	dev->name = dmi_string(dm, *d);
+	dev->device_data = NULL;
+
+	list_add(&dev->list, &dmi_devices);
+}
+
 /*
  *	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
@@ -264,6 +286,9 @@ static void __init dmi_decode(const struct dmi_header *dm)
 		break;
 	case 38:	/* IPMI Device Information */
 		dmi_save_ipmi_device(dm);
+		break;
+	case 41:	/* Onboard Devices Extended Information */
+		dmi_save_extended_devices(dm);
 	}
 }
 
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 00fc7a9..f9ba4b0 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -35,8 +35,11 @@ enum dmi_device_type {
 	DMI_DEV_TYPE_ETHERNET,
 	DMI_DEV_TYPE_TOKENRING,
 	DMI_DEV_TYPE_SOUND,
+	DMI_DEV_TYPE_PATA,
+	DMI_DEV_TYPE_SATA,
+	DMI_DEV_TYPE_SAS,
 	DMI_DEV_TYPE_IPMI = -1,
-	DMI_DEV_TYPE_OEM_STRING = -2
+	DMI_DEV_TYPE_OEM_STRING = -2,
 };
 
 struct dmi_header {

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

* Re: DMI: add-type-41
  2008-01-25 20:19 DMI: add-type-41 Wim Van Sebroeck
@ 2008-02-08  5:33 ` Matt Domsch
  2008-02-08 18:25   ` Wim Van Sebroeck
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Domsch @ 2008-02-08  5:33 UTC (permalink / raw)
  To: Wim Van Sebroeck; +Cc: LKML

On Fri, Jan 25, 2008 at 09:19:11PM +0100, Wim Van Sebroeck wrote:
> Hi All,
> 
> Would appreciate feedback on this patch.
> 
> Thanks in advance,
> Wim.
> 
> commit 4956e4e5e77b5a8f87bcfe6127ef17a406edf94b
> Author: Wim Van Sebroeck <wim@iguana.be>
> Date:   Mon Dec 31 17:21:33 2007 +0000
> 
>     [PATCH] SMBIOS/DMI - add type 41 = Onboard Devices Extended Information

Is there something in the kernel that will consume this data, or is it
being exported in /sys/class/dmi/id somehow?  There will be one table
entry per device (Dell PowerEdge x9xx servers with recent BIOS do so).

FWIW, my biosdevname app consumes this data, using dmidecode from
userspace.


-- 
Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux

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

* Re: DMI: add-type-41
  2008-02-08  5:33 ` Matt Domsch
@ 2008-02-08 18:25   ` Wim Van Sebroeck
  0 siblings, 0 replies; 3+ messages in thread
From: Wim Van Sebroeck @ 2008-02-08 18:25 UTC (permalink / raw)
  To: Matt Domsch; +Cc: LKML

Hi Matt,

> >     [PATCH] SMBIOS/DMI - add type 41 = Onboard Devices Extended Information
> 
> Is there something in the kernel that will consume this data, or is it
> being exported in /sys/class/dmi/id somehow?  There will be one table
> entry per device (Dell PowerEdge x9xx servers with recent BIOS do so).
> 
> FWIW, my biosdevname app consumes this data, using dmidecode from
> userspace.

Just like smbios/dmi type 10 we add the the info to the dmi_devices list.
The dmi_find_device function (see drivers/firmware/dmi_scan.c) makes this
info available to other device drivers (like drivers/ata/ata_piix.c,
drivers/misc/thinkpad_acpi.c, drivers/watchdog/ibmasr.c and
drivers/char/ipmi/ipmi_si_intf.c).

The dmi_devices list is a different list then the dmi_ident table that stores
the BIOS, PRODUCT, BOARD and CHASSIS info (and that is exported to /sys/class/dmi/* ).
The dmi_devices list is not exported to sysfs as far as I know.

My opinion: if we have type 10 we will need type 41 in the future. If we don't need
type 10 then we don't need type 41 neither (since we can use dmidecode in userspace).

Greetings,
Wim.


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

end of thread, other threads:[~2008-02-08 18:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-25 20:19 DMI: add-type-41 Wim Van Sebroeck
2008-02-08  5:33 ` Matt Domsch
2008-02-08 18:25   ` Wim Van Sebroeck

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).