Skip to content

Commit e542e0d

Browse files
committed
Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
Pull dmi update from Jean Delvare. * 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: firmware/dmi: Report DMI Bios & EC firmware release
2 parents 3925c3b + f5152f4 commit e542e0d

4 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎drivers/firmware/dmi-id.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ DEFINE_DMI_ATTR_WITH_SHOW(bios_vendor, 0444, DMI_BIOS_VENDOR);
4242
DEFINE_DMI_ATTR_WITH_SHOW(bios_version, 0444, DMI_BIOS_VERSION);
4343
DEFINE_DMI_ATTR_WITH_SHOW(bios_date, 0444, DMI_BIOS_DATE);
4444
DEFINE_DMI_ATTR_WITH_SHOW(sys_vendor, 0444, DMI_SYS_VENDOR);
45+
DEFINE_DMI_ATTR_WITH_SHOW(bios_release, 0444, DMI_BIOS_RELEASE);
46+
DEFINE_DMI_ATTR_WITH_SHOW(ec_firmware_release, 0444, DMI_EC_FIRMWARE_RELEASE);
4547
DEFINE_DMI_ATTR_WITH_SHOW(product_name, 0444, DMI_PRODUCT_NAME);
4648
DEFINE_DMI_ATTR_WITH_SHOW(product_version, 0444, DMI_PRODUCT_VERSION);
4749
DEFINE_DMI_ATTR_WITH_SHOW(product_serial, 0400, DMI_PRODUCT_SERIAL);
@@ -78,6 +80,8 @@ static ssize_t get_modalias(char *buffer, size_t buffer_size)
7880
{ "bvn", DMI_BIOS_VENDOR },
7981
{ "bvr", DMI_BIOS_VERSION },
8082
{ "bd", DMI_BIOS_DATE },
83+
{ "br", DMI_BIOS_RELEASE },
84+
{ "efr", DMI_EC_FIRMWARE_RELEASE },
8185
{ "svn", DMI_SYS_VENDOR },
8286
{ "pn", DMI_PRODUCT_NAME },
8387
{ "pvr", DMI_PRODUCT_VERSION },
@@ -187,6 +191,8 @@ static void __init dmi_id_init_attr_table(void)
187191
ADD_DMI_ATTR(bios_vendor, DMI_BIOS_VENDOR);
188192
ADD_DMI_ATTR(bios_version, DMI_BIOS_VERSION);
189193
ADD_DMI_ATTR(bios_date, DMI_BIOS_DATE);
194+
ADD_DMI_ATTR(bios_release, DMI_BIOS_RELEASE);
195+
ADD_DMI_ATTR(ec_firmware_release, DMI_EC_FIRMWARE_RELEASE);
190196
ADD_DMI_ATTR(sys_vendor, DMI_SYS_VENDOR);
191197
ADD_DMI_ATTR(product_name, DMI_PRODUCT_NAME);
192198
ADD_DMI_ATTR(product_version, DMI_PRODUCT_VERSION);

‎drivers/firmware/dmi_scan.c‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,34 @@ static void __init dmi_save_ident(const struct dmi_header *dm, int slot,
186186
dmi_ident[slot] = p;
187187
}
188188

189+
static void __init dmi_save_release(const struct dmi_header *dm, int slot,
190+
int index)
191+
{
192+
const u8 *minor, *major;
193+
char *s;
194+
195+
/* If the table doesn't have the field, let's return */
196+
if (dmi_ident[slot] || dm->length < index)
197+
return;
198+
199+
minor = (u8 *) dm + index;
200+
major = (u8 *) dm + index - 1;
201+
202+
/* As per the spec, if the system doesn't support this field,
203+
* the value is FF
204+
*/
205+
if (*major == 0xFF && *minor == 0xFF)
206+
return;
207+
208+
s = dmi_alloc(8);
209+
if (!s)
210+
return;
211+
212+
sprintf(s, "%u.%u", *major, *minor);
213+
214+
dmi_ident[slot] = s;
215+
}
216+
189217
static void __init dmi_save_uuid(const struct dmi_header *dm, int slot,
190218
int index)
191219
{
@@ -444,6 +472,8 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
444472
dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
445473
dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
446474
dmi_save_ident(dm, DMI_BIOS_DATE, 8);
475+
dmi_save_release(dm, DMI_BIOS_RELEASE, 21);
476+
dmi_save_release(dm, DMI_EC_FIRMWARE_RELEASE, 23);
447477
break;
448478
case 1: /* System Information */
449479
dmi_save_ident(dm, DMI_SYS_VENDOR, 4);

‎include/linux/mod_devicetable.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,8 @@ enum dmi_field {
532532
DMI_BIOS_VENDOR,
533533
DMI_BIOS_VERSION,
534534
DMI_BIOS_DATE,
535+
DMI_BIOS_RELEASE,
536+
DMI_EC_FIRMWARE_RELEASE,
535537
DMI_SYS_VENDOR,
536538
DMI_PRODUCT_NAME,
537539
DMI_PRODUCT_VERSION,

‎scripts/mod/file2alias.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,8 @@ static const struct dmifield {
954954
{ "bvn", DMI_BIOS_VENDOR },
955955
{ "bvr", DMI_BIOS_VERSION },
956956
{ "bd", DMI_BIOS_DATE },
957+
{ "br", DMI_BIOS_RELEASE },
958+
{ "efr", DMI_EC_FIRMWARE_RELEASE },
957959
{ "svn", DMI_SYS_VENDOR },
958960
{ "pn", DMI_PRODUCT_NAME },
959961
{ "pvr", DMI_PRODUCT_VERSION },

0 commit comments

Comments
 (0)