Skip to content

Commit

Permalink
Store NVME serial number to smbios
Browse files Browse the repository at this point in the history
Store NVME serial number to smbios at efiwrapper.

Tracked-On: OAM-112587
Signed-off-by: Guo, Jade <[email protected]>
  • Loading branch information
jiaxuan-guo committed Nov 8, 2023
1 parent 1b79ef8 commit e2cb78c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/nvme/NvmExpressHci.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <efi.h>
#include <efilib.h>
#include <arch/io.h>

#include "smbios.h"
#include "NvmExpress.h"

/**
Expand Down Expand Up @@ -953,6 +953,8 @@ NvmeControllerInit (
DEBUG_NVME ((EFI_D_INFO, " Oncs : 0x%x\n", Private->ControllerData->Oncs));
DEBUG_NVME ((EFI_D_INFO, " Oacs : 0x%x\n", Private->ControllerData->Oacs));

smbios_set(TYPE_PRODUCT, offsetof(SMBIOS_TYPE1, SerialNumber), Sn);

//
// Create two I/O completion queues.
// One for blocking I/O, one for non-blocking I/O.
Expand Down
7 changes: 7 additions & 0 deletions include/libefiwrapper/smbios.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@

#define SMBIOS_UNDEFINED "N/A"

#define offsetof(st, m) __builtin_offsetof(st, m)
//copy from celadon/hardware/intel/kernelflinger/include/smbios.h
#define TYPE_BIOS 0
#define TYPE_PRODUCT 1
#define TYPE_BOARD 2
#define TYPE_CHASSIS 3

EFI_STATUS smbios_init(EFI_SYSTEM_TABLE *st);
EFI_STATUS smbios_free(EFI_SYSTEM_TABLE *st);
EFI_STATUS smbios_set(UINT8 type, UINT8 offset, const char *value);
Expand Down

0 comments on commit e2cb78c

Please sign in to comment.