Patchwork acpi: acpidump: Add MCHI table (LP: #1261484)

login
register
mail settings
Submitter Colin King
Date Dec. 16, 2013, 6:19 p.m.
Message ID <1387217970-6322-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/301776/
State Accepted
Headers show

Comments

Colin King - Dec. 16, 2013, 6:19 p.m.
From: Colin Ian King <colin.king@canonical.com>

Add MCHI (Management Controller Host Interface Table).

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/acpidump/acpidump.c | 28 +++++++++++++++++++++++++++-
 src/lib/include/fwts_acpi.h  | 19 +++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)
Ivan Hu - Dec. 23, 2013, 6:35 a.m.
On 12/17/2013 02:19 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Add MCHI (Management Controller Host Interface Table).
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/acpidump/acpidump.c | 28 +++++++++++++++++++++++++++-
>   src/lib/include/fwts_acpi.h  | 19 +++++++++++++++++++
>   2 files changed, 46 insertions(+), 1 deletion(-)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index 2b2c050..68f1c9e 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -1850,6 +1850,33 @@ static void acpidump_dbg2(fwts_framework *fw, const fwts_acpi_table_info *table)
>   	}
>   }
>
> +/*
> + *  acpidump_mchi()
> + *	dump mchi, Management Controller Host Interface Table
> + *	http://www.dmtf.org/standards/published_documents/DSP0256_1.0.0.pdf
> + */
> +static void acpidump_mchi(fwts_framework *fw, const fwts_acpi_table_info *table)
> +{
> +	static const fwts_acpidump_field mchi_fields[] = {
> +		FIELD_UINT("Interface Type", 		fwts_acpi_table_mchi, interface_type),
> +		FIELD_UINT("Protocol Identifier", 	fwts_acpi_table_mchi, protocol_identifier),
> +		FIELD_UINT("Protocol Data", 		fwts_acpi_table_mchi, protocol_data),
> +		FIELD_UINT("Interrupt Type", 		fwts_acpi_table_mchi, interrupt_type),
> +		FIELD_UINT("GPE", 			fwts_acpi_table_mchi, gpe),
> +		FIELD_UINT("PCI Device Flag", 		fwts_acpi_table_mchi, pci_device_flag),
> +		FIELD_UINT("Global System Interrupt",	fwts_acpi_table_mchi, global_system_interrupt),
> +		FIELD_GAS ("Base Address", 		fwts_acpi_table_mchi, base_address),
> +		FIELD_UINT("PCI Segment Group Number",	fwts_acpi_table_mchi, pci_segment_group_number),
> +		FIELD_UINT("PCI Bus Number", 		fwts_acpi_table_mchi, pci_bus_number),
> +		FIELD_UINT("PCI Device Number",  	fwts_acpi_table_mchi, pci_device_number),
> +		FIELD_UINT("PCI Function Number", 	fwts_acpi_table_mchi, pci_function_number),
> +		FIELD_END
> +	};
> +
> +	acpi_dump_table_fields(fw, table->data, mchi_fields, 0, table->length);
> +}
> +
> +
>   typedef struct {
>   	const char *name;		/* ACPI table signature */
>   	void (*func)(fwts_framework *fw, const fwts_acpi_table_info *table);
> @@ -1865,7 +1892,6 @@ typedef struct {
>   #define acpidump_hest		acpi_dump_raw_table
>   #define acpidump_ibft		acpi_dump_raw_table
>   #define acpidump_ivrs		acpi_dump_raw_table
> -#define acpidump_mchi		acpi_dump_raw_table
>   #define acpidump_msct		acpi_dump_raw_table
>   #define acpidump_msdm		acpi_dump_raw_table
>   #define acpidump_mpst		acpi_dump_raw_table
> diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
> index 34619bd..dbf7f57 100644
> --- a/src/lib/include/fwts_acpi.h
> +++ b/src/lib/include/fwts_acpi.h
> @@ -733,6 +733,25 @@ typedef struct {
>   	uint16_t	address_size_offset;
>   } __attribute__ ((packed)) fwts_acpi_table_dbg2_info;
>
> +/*
> + *  http://www.dmtf.org/standards/published_documents/DSP0256_1.0.0.pdf
> + */
> +typedef struct {
> +	fwts_acpi_table_header	header;
> +	uint8_t		interface_type;
> +	uint8_t		protocol_identifier;
> +	uint64_t	protocol_data;
> +	uint8_t		interrupt_type;
> +	uint8_t		gpe;
> +	uint8_t		pci_device_flag;
> +	uint32_t	global_system_interrupt;
> +	fwts_acpi_gas	base_address;
> +	uint8_t		pci_segment_group_number;
> +	uint8_t		pci_bus_number;
> +	uint8_t		pci_device_number;
> +	uint8_t		pci_function_number;
> +} __attribute__ ((packed)) fwts_acpi_table_mchi;
> +
>   void fwts_acpi_table_get_header(fwts_acpi_table_header *hdr, uint8_t *data);
>
>   #endif
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
Alex Hung - Dec. 23, 2013, 11:26 a.m.
On 12/17/2013 02:19 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Add MCHI (Management Controller Host Interface Table).
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/acpidump/acpidump.c | 28 +++++++++++++++++++++++++++-
>   src/lib/include/fwts_acpi.h  | 19 +++++++++++++++++++
>   2 files changed, 46 insertions(+), 1 deletion(-)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index 2b2c050..68f1c9e 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -1850,6 +1850,33 @@ static void acpidump_dbg2(fwts_framework *fw, const fwts_acpi_table_info *table)
>   	}
>   }
>
> +/*
> + *  acpidump_mchi()
> + *	dump mchi, Management Controller Host Interface Table
> + *	http://www.dmtf.org/standards/published_documents/DSP0256_1.0.0.pdf
> + */
> +static void acpidump_mchi(fwts_framework *fw, const fwts_acpi_table_info *table)
> +{
> +	static const fwts_acpidump_field mchi_fields[] = {
> +		FIELD_UINT("Interface Type", 		fwts_acpi_table_mchi, interface_type),
> +		FIELD_UINT("Protocol Identifier", 	fwts_acpi_table_mchi, protocol_identifier),
> +		FIELD_UINT("Protocol Data", 		fwts_acpi_table_mchi, protocol_data),
> +		FIELD_UINT("Interrupt Type", 		fwts_acpi_table_mchi, interrupt_type),
> +		FIELD_UINT("GPE", 			fwts_acpi_table_mchi, gpe),
> +		FIELD_UINT("PCI Device Flag", 		fwts_acpi_table_mchi, pci_device_flag),
> +		FIELD_UINT("Global System Interrupt",	fwts_acpi_table_mchi, global_system_interrupt),
> +		FIELD_GAS ("Base Address", 		fwts_acpi_table_mchi, base_address),
> +		FIELD_UINT("PCI Segment Group Number",	fwts_acpi_table_mchi, pci_segment_group_number),
> +		FIELD_UINT("PCI Bus Number", 		fwts_acpi_table_mchi, pci_bus_number),
> +		FIELD_UINT("PCI Device Number",  	fwts_acpi_table_mchi, pci_device_number),
> +		FIELD_UINT("PCI Function Number", 	fwts_acpi_table_mchi, pci_function_number),
> +		FIELD_END
> +	};
> +
> +	acpi_dump_table_fields(fw, table->data, mchi_fields, 0, table->length);
> +}
> +
> +
>   typedef struct {
>   	const char *name;		/* ACPI table signature */
>   	void (*func)(fwts_framework *fw, const fwts_acpi_table_info *table);
> @@ -1865,7 +1892,6 @@ typedef struct {
>   #define acpidump_hest		acpi_dump_raw_table
>   #define acpidump_ibft		acpi_dump_raw_table
>   #define acpidump_ivrs		acpi_dump_raw_table
> -#define acpidump_mchi		acpi_dump_raw_table
>   #define acpidump_msct		acpi_dump_raw_table
>   #define acpidump_msdm		acpi_dump_raw_table
>   #define acpidump_mpst		acpi_dump_raw_table
> diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
> index 34619bd..dbf7f57 100644
> --- a/src/lib/include/fwts_acpi.h
> +++ b/src/lib/include/fwts_acpi.h
> @@ -733,6 +733,25 @@ typedef struct {
>   	uint16_t	address_size_offset;
>   } __attribute__ ((packed)) fwts_acpi_table_dbg2_info;
>
> +/*
> + *  http://www.dmtf.org/standards/published_documents/DSP0256_1.0.0.pdf
> + */
> +typedef struct {
> +	fwts_acpi_table_header	header;
> +	uint8_t		interface_type;
> +	uint8_t		protocol_identifier;
> +	uint64_t	protocol_data;
> +	uint8_t		interrupt_type;
> +	uint8_t		gpe;
> +	uint8_t		pci_device_flag;
> +	uint32_t	global_system_interrupt;
> +	fwts_acpi_gas	base_address;
> +	uint8_t		pci_segment_group_number;
> +	uint8_t		pci_bus_number;
> +	uint8_t		pci_device_number;
> +	uint8_t		pci_function_number;
> +} __attribute__ ((packed)) fwts_acpi_table_mchi;
> +
>   void fwts_acpi_table_get_header(fwts_acpi_table_header *hdr, uint8_t *data);
>
>   #endif
>

Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
index 2b2c050..68f1c9e 100644
--- a/src/acpi/acpidump/acpidump.c
+++ b/src/acpi/acpidump/acpidump.c
@@ -1850,6 +1850,33 @@  static void acpidump_dbg2(fwts_framework *fw, const fwts_acpi_table_info *table)
 	}
 }
 
+/*
+ *  acpidump_mchi()
+ *	dump mchi, Management Controller Host Interface Table
+ *	http://www.dmtf.org/standards/published_documents/DSP0256_1.0.0.pdf
+ */
+static void acpidump_mchi(fwts_framework *fw, const fwts_acpi_table_info *table)
+{
+	static const fwts_acpidump_field mchi_fields[] = {
+		FIELD_UINT("Interface Type", 		fwts_acpi_table_mchi, interface_type),
+		FIELD_UINT("Protocol Identifier", 	fwts_acpi_table_mchi, protocol_identifier),
+		FIELD_UINT("Protocol Data", 		fwts_acpi_table_mchi, protocol_data),
+		FIELD_UINT("Interrupt Type", 		fwts_acpi_table_mchi, interrupt_type),
+		FIELD_UINT("GPE", 			fwts_acpi_table_mchi, gpe),
+		FIELD_UINT("PCI Device Flag", 		fwts_acpi_table_mchi, pci_device_flag),
+		FIELD_UINT("Global System Interrupt",	fwts_acpi_table_mchi, global_system_interrupt),
+		FIELD_GAS ("Base Address", 		fwts_acpi_table_mchi, base_address),
+		FIELD_UINT("PCI Segment Group Number",	fwts_acpi_table_mchi, pci_segment_group_number),
+		FIELD_UINT("PCI Bus Number", 		fwts_acpi_table_mchi, pci_bus_number),
+		FIELD_UINT("PCI Device Number",  	fwts_acpi_table_mchi, pci_device_number),
+		FIELD_UINT("PCI Function Number", 	fwts_acpi_table_mchi, pci_function_number),
+		FIELD_END
+	};
+
+	acpi_dump_table_fields(fw, table->data, mchi_fields, 0, table->length);
+}
+
+
 typedef struct {
 	const char *name;		/* ACPI table signature */
 	void (*func)(fwts_framework *fw, const fwts_acpi_table_info *table);
@@ -1865,7 +1892,6 @@  typedef struct {
 #define acpidump_hest		acpi_dump_raw_table
 #define acpidump_ibft		acpi_dump_raw_table
 #define acpidump_ivrs		acpi_dump_raw_table
-#define acpidump_mchi		acpi_dump_raw_table
 #define acpidump_msct		acpi_dump_raw_table
 #define acpidump_msdm		acpi_dump_raw_table
 #define acpidump_mpst		acpi_dump_raw_table
diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
index 34619bd..dbf7f57 100644
--- a/src/lib/include/fwts_acpi.h
+++ b/src/lib/include/fwts_acpi.h
@@ -733,6 +733,25 @@  typedef struct {
 	uint16_t	address_size_offset;
 } __attribute__ ((packed)) fwts_acpi_table_dbg2_info;
 
+/*
+ *  http://www.dmtf.org/standards/published_documents/DSP0256_1.0.0.pdf
+ */
+typedef struct {
+	fwts_acpi_table_header	header;
+	uint8_t		interface_type;
+	uint8_t		protocol_identifier;
+	uint64_t	protocol_data;
+	uint8_t		interrupt_type;
+	uint8_t		gpe;
+	uint8_t		pci_device_flag;
+	uint32_t	global_system_interrupt;
+	fwts_acpi_gas	base_address;
+	uint8_t		pci_segment_group_number;
+	uint8_t		pci_bus_number;
+	uint8_t		pci_device_number;
+	uint8_t		pci_function_number;
+} __attribute__ ((packed)) fwts_acpi_table_mchi;
+
 void fwts_acpi_table_get_header(fwts_acpi_table_header *hdr, uint8_t *data);
 
 #endif