diff mbox series

Add fwts-devel mailing list information to README

Message ID 20180706144310.57032-1-elliott@hpe.com
State Superseded
Headers show
Series Add fwts-devel mailing list information to README | expand

Commit Message

Elliott, Robert (Servers) July 6, 2018, 2:43 p.m. UTC
Add the fwts-devel mailing list address and web page to README.

Signed-off-by: Robert Elliott <elliott@hpe.com>
---
 README               |  4 ++++
 src/acpi/nfit/nfit.c | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)

Comments

Elliott, Robert (Servers) July 6, 2018, 4:23 p.m. UTC | #1
> -----Original Message-----
> From: Elliott, Robert (Persistent Memory)
> Sent: Friday, July 6, 2018 9:43 AM
> To: fwts-devel@lists.ubuntu.com
> Cc: Elliott, Robert (Persistent Memory) <elliott@hpe.com>
> Subject: [PATCH] Add fwts-devel mailing list information to README
> 
> Add the fwts-devel mailing list address and web page to README.
> 
> Signed-off-by: Robert Elliott <elliott@hpe.com>
> ---
>  README               |  4 ++++
>  src/acpi/nfit/nfit.c | 38 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 42 insertions(+)
> 
> diff --git a/README b/README
> index ba45af10..f96cb973 100644
> --- a/README
> +++ b/README
> @@ -271,3 +271,7 @@ fwts reference guide:
>  fwts LiveCD:
>  	http://fwts.ubuntu.com/fwts-live/
> 
> +fwts-devel mailing list:
> +	fwts-devel@lists.ubuntu.com
> +	https://lists.ubuntu.com/mailman/listinfo/fwts-devel
> +
> diff --git a/src/acpi/nfit/nfit.c b/src/acpi/nfit/nfit.c
> index 961e5f28..6ccd05bd 100644
> --- a/src/acpi/nfit/nfit.c
> +++ b/src/acpi/nfit/nfit.c
> @@ -50,6 +50,35 @@ static bool check_length(fwts_framework *fw, int actual, int min, const char *na
>  	return true;
>  }
> 
> +static bool scan_nfit_smbios(fwts_framework *fw, int len, uint8_t *table) {

Sorry, I'll resend this one; it included part of the next patch.
diff mbox series

Patch

diff --git a/README b/README
index ba45af10..f96cb973 100644
--- a/README
+++ b/README
@@ -271,3 +271,7 @@  fwts reference guide:
 fwts LiveCD:
 	http://fwts.ubuntu.com/fwts-live/
 
+fwts-devel mailing list:
+	fwts-devel@lists.ubuntu.com
+	https://lists.ubuntu.com/mailman/listinfo/fwts-devel
+
diff --git a/src/acpi/nfit/nfit.c b/src/acpi/nfit/nfit.c
index 961e5f28..6ccd05bd 100644
--- a/src/acpi/nfit/nfit.c
+++ b/src/acpi/nfit/nfit.c
@@ -50,6 +50,35 @@  static bool check_length(fwts_framework *fw, int actual, int min, const char *na
 	return true;
 }
 
+static bool scan_nfit_smbios(fwts_framework *fw, int len, uint8_t *table) {
+	fwts_dmi_header *hdr;
+	int entry = 0;
+
+	while (len > 4) {
+		hdr = (fwts_dmi_header *) table;
+
+		fwts_log_info_verbatim(fw, "  NFIT SMBIOS Entry %d:", entry++);
+		fwts_log_info_verbatim(fw, "    Type:                                   0x%2.2" PRIx8, hdr->type);
+		fwts_log_info_verbatim(fw, "    Length:                                 0x%2.2" PRIx8, hdr->length);
+		fwts_log_info_verbatim(fw, "    Handle:                                 0x%4.4" PRIx16, hdr->handle);
+
+		if (hdr->length < 4) {
+			fwts_failed(fw, LOG_LEVEL_HIGH, "NFIT_SMBIOS_EntryLength",
+				    "NFIT SMBIOS Entry length %d bytes is too short (less than 4 bytes)",
+				    hdr->length);
+			return false;
+		}
+		len -= hdr->length;
+		table += hdr->length;
+	}
+	if (len) {
+		fwts_failed(fw, LOG_LEVEL_HIGH, "NFIT_SMBIOS_ListLength",
+			    "NFIT SMBIOS structure does not end with a complete entry");
+		return false;
+	}
+	return true;
+}
+
 static int nfit_init(fwts_framework *fw)
 {
 	if (fwts_acpi_find_table(fw, "NFIT", 0, &table) != FWTS_OK) {
@@ -278,6 +307,15 @@  static int nfit_test1(fwts_framework *fw)
 			}
 
 			fwts_log_info_verbatim(fw, "    Reserved:                               0x%8.8" PRIx32, nfit_struct->reserved);
+			if (nfit_struct->reserved != 0)
+				reserved_passed = nfit_struct->reserved;
+
+			if (entry->length < 8)
+				break;
+
+			ret = scan_nfit_smbios(fw, entry->length - 8, nfit_struct->smbios);
+			if (!ret)
+				passed = false;
 
 		} else if (entry->type == FWTS_ACPI_NFIT_TYPE_CONTROL_REGION) {
 			fwts_acpi_table_nfit_control_range *nfit_struct = (fwts_acpi_table_nfit_control_range *) entry;