diff mbox

[4/4] uefi: uefidump: add the VLAN subtype-20 support on messaging device path type for uefidump(LP#:1255387)

Message ID 1385532590-30991-1-git-send-email-ivan.hu@canonical.com
State Accepted
Headers show

Commit Message

Ivan Hu Nov. 27, 2013, 6:09 a.m. UTC
Add the VLAN subtype 20 support on messaging device path follow the section 9.3.5.14 on UEFI spec2.4.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/lib/include/fwts_uefi.h  |    6 ++++++
 src/uefi/uefidump/uefidump.c |    6 ++++++
 2 files changed, 12 insertions(+)

Comments

Colin Ian King Nov. 27, 2013, 12:48 p.m. UTC | #1
On 27/11/13 06:09, Ivan Hu wrote:
> Add the VLAN subtype 20 support on messaging device path follow the section 9.3.5.14 on UEFI spec2.4.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/lib/include/fwts_uefi.h  |    6 ++++++
>  src/uefi/uefidump/uefidump.c |    6 ++++++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
> index 4add24e..e0bdf29 100644
> --- a/src/lib/include/fwts_uefi.h
> +++ b/src/lib/include/fwts_uefi.h
> @@ -206,6 +206,7 @@ typedef enum {
>  	FWTS_UEFI_USB_CLASS_DEVICE_PATH_SUBTYPE =	(0x0f),
>  	FWTS_UEFI_USB_WWID_DEVICE_PATH_SUBTYPE =	(0x10),
>  	FWTS_UEFI_SATA_DEVICE_PATH_SUBTYPE = 		(0x12),
> +	FWTS_UEFI_VLAN_DEVICE_PATH_SUBTYPE = 		(0x14),
>  	FWTS_UEFI_FIBRE_CHANNEL_EX_DEVICE_PATH_SUBTYPE = (0x15)
>  
>  } messaging_dev_path_subtypes;
> @@ -397,6 +398,11 @@ typedef struct {
>  
>  typedef struct {
>  	fwts_uefi_dev_path dev_path;
> +	uint16_t vlanid;
> +} fwts_uefi_vlan_dev_path;
> +
> +typedef struct {
> +	fwts_uefi_dev_path dev_path;
>  	uint32_t partition_number;
>  	uint64_t partition_start;
>  	uint64_t partition_size;
> diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
> index 542df11..e4899ab 100644
> --- a/src/uefi/uefidump/uefidump.c
> +++ b/src/uefi/uefidump/uefidump.c
> @@ -368,6 +368,12 @@ static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c
>  				path = uefidump_vprintf(path, ",%s)", tmp);
>  			}
>  			break;
> +		case FWTS_UEFI_VLAN_DEVICE_PATH_SUBTYPE:
> +			if (dev_path_len >= sizeof(fwts_uefi_vlan_dev_path)) {
> +				fwts_uefi_vlan_dev_path *v = (fwts_uefi_vlan_dev_path *)dev_path;
> +				path = uefidump_vprintf(path, "\\VLAN(0x%" PRIx16 ")", v->vlanid);
> +			}
> +			break;
>  		default:
>  			path = uefidump_vprintf(path, "\\Unknown-MESSAGING-DEV-PATH(0x%" PRIx8 ")", dev_path->subtype);
>  			break;
> 
Checked it with the spec, looks good to me.

Keng-Yu, can you re-work the patch subject line before applying this.
There should be a space before the "(LP" text, and the text should be
.."uefidump (LP: #1255387)" and not "uefidump(LP#:1255387)"

Acked-by: Colin Ian King <colin.king@canonical.com>
Keng-Yu Lin Dec. 3, 2013, 3:28 a.m. UTC | #2
On Wed, Nov 27, 2013 at 2:09 PM, Ivan Hu <ivan.hu@canonical.com> wrote:
> Add the VLAN subtype 20 support on messaging device path follow the section 9.3.5.14 on UEFI spec2.4.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/lib/include/fwts_uefi.h  |    6 ++++++
>  src/uefi/uefidump/uefidump.c |    6 ++++++
>  2 files changed, 12 insertions(+)
>
> diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
> index 4add24e..e0bdf29 100644
> --- a/src/lib/include/fwts_uefi.h
> +++ b/src/lib/include/fwts_uefi.h
> @@ -206,6 +206,7 @@ typedef enum {
>         FWTS_UEFI_USB_CLASS_DEVICE_PATH_SUBTYPE =       (0x0f),
>         FWTS_UEFI_USB_WWID_DEVICE_PATH_SUBTYPE =        (0x10),
>         FWTS_UEFI_SATA_DEVICE_PATH_SUBTYPE =            (0x12),
> +       FWTS_UEFI_VLAN_DEVICE_PATH_SUBTYPE =            (0x14),
>         FWTS_UEFI_FIBRE_CHANNEL_EX_DEVICE_PATH_SUBTYPE = (0x15)
>
>  } messaging_dev_path_subtypes;
> @@ -397,6 +398,11 @@ typedef struct {
>
>  typedef struct {
>         fwts_uefi_dev_path dev_path;
> +       uint16_t vlanid;
> +} fwts_uefi_vlan_dev_path;
> +
> +typedef struct {
> +       fwts_uefi_dev_path dev_path;
>         uint32_t partition_number;
>         uint64_t partition_start;
>         uint64_t partition_size;
> diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
> index 542df11..e4899ab 100644
> --- a/src/uefi/uefidump/uefidump.c
> +++ b/src/uefi/uefidump/uefidump.c
> @@ -368,6 +368,12 @@ static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c
>                                 path = uefidump_vprintf(path, ",%s)", tmp);
>                         }
>                         break;
> +               case FWTS_UEFI_VLAN_DEVICE_PATH_SUBTYPE:
> +                       if (dev_path_len >= sizeof(fwts_uefi_vlan_dev_path)) {
> +                               fwts_uefi_vlan_dev_path *v = (fwts_uefi_vlan_dev_path *)dev_path;
> +                               path = uefidump_vprintf(path, "\\VLAN(0x%" PRIx16 ")", v->vlanid);
> +                       }
> +                       break;
>                 default:
>                         path = uefidump_vprintf(path, "\\Unknown-MESSAGING-DEV-PATH(0x%" PRIx8 ")", dev_path->subtype);
>                         break;
> --
> 1.7.9.5
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
diff mbox

Patch

diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
index 4add24e..e0bdf29 100644
--- a/src/lib/include/fwts_uefi.h
+++ b/src/lib/include/fwts_uefi.h
@@ -206,6 +206,7 @@  typedef enum {
 	FWTS_UEFI_USB_CLASS_DEVICE_PATH_SUBTYPE =	(0x0f),
 	FWTS_UEFI_USB_WWID_DEVICE_PATH_SUBTYPE =	(0x10),
 	FWTS_UEFI_SATA_DEVICE_PATH_SUBTYPE = 		(0x12),
+	FWTS_UEFI_VLAN_DEVICE_PATH_SUBTYPE = 		(0x14),
 	FWTS_UEFI_FIBRE_CHANNEL_EX_DEVICE_PATH_SUBTYPE = (0x15)
 
 } messaging_dev_path_subtypes;
@@ -397,6 +398,11 @@  typedef struct {
 
 typedef struct {
 	fwts_uefi_dev_path dev_path;
+	uint16_t vlanid;
+} fwts_uefi_vlan_dev_path;
+
+typedef struct {
+	fwts_uefi_dev_path dev_path;
 	uint32_t partition_number;
 	uint64_t partition_start;
 	uint64_t partition_size;
diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
index 542df11..e4899ab 100644
--- a/src/uefi/uefidump/uefidump.c
+++ b/src/uefi/uefidump/uefidump.c
@@ -368,6 +368,12 @@  static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c
 				path = uefidump_vprintf(path, ",%s)", tmp);
 			}
 			break;
+		case FWTS_UEFI_VLAN_DEVICE_PATH_SUBTYPE:
+			if (dev_path_len >= sizeof(fwts_uefi_vlan_dev_path)) {
+				fwts_uefi_vlan_dev_path *v = (fwts_uefi_vlan_dev_path *)dev_path;
+				path = uefidump_vprintf(path, "\\VLAN(0x%" PRIx16 ")", v->vlanid);
+			}
+			break;
 		default:
 			path = uefidump_vprintf(path, "\\Unknown-MESSAGING-DEV-PATH(0x%" PRIx8 ")", dev_path->subtype);
 			break;