diff mbox

[3/3] dmi: dmicheck: add checks for new type 43

Message ID 1494632063-26683-3-git-send-email-alex.hung@canonical.com
State Accepted
Headers show

Commit Message

Alex Hung May 12, 2017, 11:34 p.m. UTC
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/dmi/dmicheck/dmicheck.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Colin Ian King May 15, 2017, 8:19 a.m. UTC | #1
On 13/05/17 00:34, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/dmi/dmicheck/dmicheck.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
> index 85b49d5..9471d70 100644
> --- a/src/dmi/dmicheck/dmicheck.c
> +++ b/src/dmi/dmicheck/dmicheck.c
> @@ -1801,10 +1801,18 @@ static void dmicheck_entry(fwts_framework *fw,
>  					data[0x4], table, addr, "Reference Designation", 0x4);
>  			break;
>  
> -		case 126: /* 7.44 */
> +		case 43: /* 7.44 */
> +			table = "TPM Device (Type 43)";
> +			if (hdr->length < 0x16)
> +				break;
> +			dmi_str_check(fw, table, addr, "Description", hdr, 0x12);
> +			dmi_reserved_bits_check(fw, table, addr, "Characteristics", hdr, sizeof(uint64_t), 0x13, 6, 63);
> +			break;
> +
> +		case 126: /* 7.45 */
>  			table = "Inactive (Type 126)";
>  			break;
> -		case SMBIOS_END_OF_TABLE: /* 7.45 */
> +		case SMBIOS_END_OF_TABLE: /* 7.46 */
>  			table = "End of Table (Type 127)";
>  			break;
>  		default:
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
Ivan Hu May 23, 2017, 8:05 a.m. UTC | #2
On 05/13/2017 07:34 AM, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>   src/dmi/dmicheck/dmicheck.c | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
> index 85b49d5..9471d70 100644
> --- a/src/dmi/dmicheck/dmicheck.c
> +++ b/src/dmi/dmicheck/dmicheck.c
> @@ -1801,10 +1801,18 @@ static void dmicheck_entry(fwts_framework *fw,
>   					data[0x4], table, addr, "Reference Designation", 0x4);
>   			break;
>   
> -		case 126: /* 7.44 */
> +		case 43: /* 7.44 */
> +			table = "TPM Device (Type 43)";
> +			if (hdr->length < 0x16)
> +				break;
> +			dmi_str_check(fw, table, addr, "Description", hdr, 0x12);
> +			dmi_reserved_bits_check(fw, table, addr, "Characteristics", hdr, sizeof(uint64_t), 0x13, 6, 63);
> +			break;
> +
> +		case 126: /* 7.45 */
>   			table = "Inactive (Type 126)";
>   			break;
> -		case SMBIOS_END_OF_TABLE: /* 7.45 */
> +		case SMBIOS_END_OF_TABLE: /* 7.46 */
>   			table = "End of Table (Type 127)";
>   			break;
>   		default:
Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox

Patch

diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
index 85b49d5..9471d70 100644
--- a/src/dmi/dmicheck/dmicheck.c
+++ b/src/dmi/dmicheck/dmicheck.c
@@ -1801,10 +1801,18 @@  static void dmicheck_entry(fwts_framework *fw,
 					data[0x4], table, addr, "Reference Designation", 0x4);
 			break;
 
-		case 126: /* 7.44 */
+		case 43: /* 7.44 */
+			table = "TPM Device (Type 43)";
+			if (hdr->length < 0x16)
+				break;
+			dmi_str_check(fw, table, addr, "Description", hdr, 0x12);
+			dmi_reserved_bits_check(fw, table, addr, "Characteristics", hdr, sizeof(uint64_t), 0x13, 6, 63);
+			break;
+
+		case 126: /* 7.45 */
 			table = "Inactive (Type 126)";
 			break;
-		case SMBIOS_END_OF_TABLE: /* 7.45 */
+		case SMBIOS_END_OF_TABLE: /* 7.46 */
 			table = "End of Table (Type 127)";
 			break;
 		default: