[PATCH 3/3] uefibootpath: add test for the BMC device path
Ivan Hu
ivan.hu at canonical.com
Thu Nov 5 08:46:54 UTC 2015
Sync up with uefi spec. 2.5 for new hardware device path, BMC device path.
Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
---
src/uefi/uefibootpath/uefibootpath.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/uefi/uefibootpath/uefibootpath.c b/src/uefi/uefibootpath/uefibootpath.c
index 140e20b..51a38cc 100644
--- a/src/uefi/uefibootpath/uefibootpath.c
+++ b/src/uefi/uefibootpath/uefibootpath.c
@@ -119,6 +119,24 @@ static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d
errors++;
}
break;
+ case FWTS_UEFI_BMC_DEV_PATH_SUBTYPE:
+ if (len != sizeof(fwts_uefi_bmc_dev_path)) {
+ fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIBMCDevPathLength",
+ "The length of BMC Device Path is %" PRIu16 " bytes "
+ "and differs from UEFI specification defined %" PRIu16 " bytes.",
+ len,
+ (uint16_t)sizeof(fwts_uefi_bmc_dev_path));
+ errors++;
+ }
+
+ fwts_uefi_bmc_dev_path *b = (fwts_uefi_bmc_dev_path *)dev_path;
+ if (b->interface_type > 3) {
+ fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIBMCDevPathIntfTypeInvalid",
+ "The definition on interface type of BMC Device Path is 0-3"
+ ", which is out of the defined range.");
+ errors++;
+ }
+ break;
default:
fwts_log_info_verbatum(fw, "Unknow subtype of Hardware Device Path.");
break;
--
1.9.1
More information about the fwts-devel
mailing list