diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-10-23 10:14:47 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-10-23 10:14:47 +0000 |
commit | 82824f615c4ad647de0609478d6c10bd9a97b684 (patch) | |
tree | 72b23af92c4847458cf34a541aabf846cb6241a5 /sys/arch/i386 | |
parent | 8d47f618b1c0acab1a832a81bec93239f772c2ba (diff) |
store specific strings for smbios baseboard vendor, product and serial
Often vendor and product strings will match for system information and
baseboard but in the case of the GPD Pocket system information vendor
is 'Default string' and baseboard information vendor is expected to be
'AMI Corporation'. This is needed for a drm panel orientation quirk.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/bios.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c index 13980f7c21c..278c5c58e48 100644 --- a/sys/arch/i386/i386/bios.c +++ b/sys/arch/i386/i386/bios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bios.c,v 1.123 2019/08/04 14:28:58 kettenis Exp $ */ +/* $OpenBSD: bios.c,v 1.124 2019/10/23 10:14:46 jsg Exp $ */ /* * Copyright (c) 1997-2001 Michael Shalayeff @@ -141,6 +141,9 @@ const char *smbios_uninfo[] = { char smbios_bios_date[64]; +char smbios_board_vendor[64]; +char smbios_board_prod[64]; +char smbios_board_serial[64]; int biosprobe(struct device *parent, void *match, void *aux) @@ -962,8 +965,34 @@ smbios_info(char *str) havebb = smbios_find_table(SMBIOS_TYPE_BASEBOARD, &btbl); sys = (struct smbios_sys *)stbl.tblhdr; - if (havebb) + if (havebb) { board = (struct smbios_board *)btbl.tblhdr; + + sminfop = NULL; + if ((p = smbios_get_string(&btbl, board->vendor, + sminfo, sizeof(sminfo))) != NULL) + sminfop = fixstring(p); + if (sminfop) + strlcpy(smbios_board_vendor, sminfop, + sizeof(smbios_board_vendor)); + + sminfop = NULL; + if ((p = smbios_get_string(&btbl, board->product, + sminfo, sizeof(sminfo))) != NULL) + sminfop = fixstring(p); + if (sminfop) + strlcpy(smbios_board_prod, sminfop, + sizeof(smbios_board_prod)); + + sminfop = NULL; + if ((p = smbios_get_string(&btbl, board->serial, + sminfo, sizeof(sminfo))) != NULL) + sminfop = fixstring(p); + if (sminfop) + strlcpy(smbios_board_serial, sminfop, + sizeof(smbios_board_serial)); + } + /* * Some smbios implementations have no system vendor or * product strings, some have very uninformative data which is |