Patchwork [1/4] uefi: uefidump: add the Fibre Channel Ex subtype-21 support on messaging device path type for uefidump(LP#:1255387)

login
register
mail settings
Submitter Ivan Hu
Date Nov. 27, 2013, 6:09 a.m.
Message ID <1385532540-30879-1-git-send-email-ivan.hu@canonical.com>
Download mbox | patch
Permalink /patch/294492/
State Accepted
Headers show

Comments

Ivan Hu - Nov. 27, 2013, 6:09 a.m.
Add the Fibre Channel Ex subtype 21 support on messaging device path follow the section 9.3.5.3 on UEFI spec2.4.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/lib/include/fwts_uefi.h  |   11 ++++++++++-
 src/uefi/uefidump/uefidump.c |    6 ++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
Colin King - Nov. 27, 2013, 12:21 p.m.
On 27/11/13 06:09, Ivan Hu wrote:
> Add the Fibre Channel Ex subtype 21 support on messaging device path follow the section 9.3.5.3 on UEFI spec2.4.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/lib/include/fwts_uefi.h  |   11 ++++++++++-
>  src/uefi/uefidump/uefidump.c |    6 ++++++
>  2 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
> index f21d2c7..40a171a 100644
> --- a/src/lib/include/fwts_uefi.h
> +++ b/src/lib/include/fwts_uefi.h
> @@ -203,7 +203,9 @@ typedef enum {
>  	FWTS_UEFI_IPV4_DEVICE_PATH_SUBTYPE =		(0x0c),
>  	FWTS_UEFI_IPV6_DEVICE_PATH_SUBTYPE =		(0x0d),
>  	FWTS_UEFI_UART_DEVICE_PATH_SUBTYPE =		(0x0e),
> -	FWTS_UEFI_USB_CLASS_DEVICE_PATH_SUBTYPE =	(0x0f)
> +	FWTS_UEFI_USB_CLASS_DEVICE_PATH_SUBTYPE =	(0x0f),
> +	FWTS_UEFI_FIBRE_CHANNEL_EX_DEVICE_PATH_SUBTYPE = (0x15)
> +
>  } messaging_dev_path_subtypes;
>  
>  typedef enum {
> @@ -372,6 +374,13 @@ typedef struct {
>  
>  typedef struct {
>  	fwts_uefi_dev_path dev_path;
> +	uint32_t reserved;
> +	uint64_t wwn;
> +	uint64_t lun;
> +} fwts_uefi_fibre_channel_ex_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 50a08b4..93b47dd 100644
> --- a/src/uefi/uefidump/uefidump.c
> +++ b/src/uefi/uefidump/uefidump.c
> @@ -336,6 +336,12 @@ static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c
>  					v->guid.info4[4], v->guid.info4[5], v->guid.info4[6], v->guid.info4[7]);
>  			}
>  			break;
> +		case FWTS_UEFI_FIBRE_CHANNEL_EX_DEVICE_PATH_SUBTYPE:
> +			if (dev_path_len >= sizeof(fwts_uefi_fibre_channel_ex_dev_path)) {
> +				fwts_uefi_fibre_channel_ex_dev_path *f = (fwts_uefi_fibre_channel_ex_dev_path *)dev_path;
> +				path = uefidump_vprintf(path, "\\FIBREEX(0x%" PRIx64 ",0x%" PRIx64 ")", f->wwn, f->lun);
> +			}
> +			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:20 a.m.
On Wed, Nov 27, 2013 at 8:21 PM, Colin Ian King
<colin.king@canonical.com> wrote:
> On 27/11/13 06:09, Ivan Hu wrote:
>> Add the Fibre Channel Ex subtype 21 support on messaging device path follow the section 9.3.5.3 on UEFI spec2.4.
>>
>> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
>> ---
>>  src/lib/include/fwts_uefi.h  |   11 ++++++++++-
>>  src/uefi/uefidump/uefidump.c |    6 ++++++
>>  2 files changed, 16 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
>> index f21d2c7..40a171a 100644
>> --- a/src/lib/include/fwts_uefi.h
>> +++ b/src/lib/include/fwts_uefi.h
>> @@ -203,7 +203,9 @@ typedef enum {
>>       FWTS_UEFI_IPV4_DEVICE_PATH_SUBTYPE =            (0x0c),
>>       FWTS_UEFI_IPV6_DEVICE_PATH_SUBTYPE =            (0x0d),
>>       FWTS_UEFI_UART_DEVICE_PATH_SUBTYPE =            (0x0e),
>> -     FWTS_UEFI_USB_CLASS_DEVICE_PATH_SUBTYPE =       (0x0f)
>> +     FWTS_UEFI_USB_CLASS_DEVICE_PATH_SUBTYPE =       (0x0f),
>> +     FWTS_UEFI_FIBRE_CHANNEL_EX_DEVICE_PATH_SUBTYPE = (0x15)
>> +
>>  } messaging_dev_path_subtypes;
>>
>>  typedef enum {
>> @@ -372,6 +374,13 @@ typedef struct {
>>
>>  typedef struct {
>>       fwts_uefi_dev_path dev_path;
>> +     uint32_t reserved;
>> +     uint64_t wwn;
>> +     uint64_t lun;
>> +} fwts_uefi_fibre_channel_ex_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 50a08b4..93b47dd 100644
>> --- a/src/uefi/uefidump/uefidump.c
>> +++ b/src/uefi/uefidump/uefidump.c
>> @@ -336,6 +336,12 @@ static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c
>>                                       v->guid.info4[4], v->guid.info4[5], v->guid.info4[6], v->guid.info4[7]);
>>                       }
>>                       break;
>> +             case FWTS_UEFI_FIBRE_CHANNEL_EX_DEVICE_PATH_SUBTYPE:
>> +                     if (dev_path_len >= sizeof(fwts_uefi_fibre_channel_ex_dev_path)) {
>> +                             fwts_uefi_fibre_channel_ex_dev_path *f = (fwts_uefi_fibre_channel_ex_dev_path *)dev_path;
>> +                             path = uefidump_vprintf(path, "\\FIBREEX(0x%" PRIx64 ",0x%" PRIx64 ")", f->wwn, f->lun);
>> +                     }
>> +                     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>
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
index f21d2c7..40a171a 100644
--- a/src/lib/include/fwts_uefi.h
+++ b/src/lib/include/fwts_uefi.h
@@ -203,7 +203,9 @@  typedef enum {
 	FWTS_UEFI_IPV4_DEVICE_PATH_SUBTYPE =		(0x0c),
 	FWTS_UEFI_IPV6_DEVICE_PATH_SUBTYPE =		(0x0d),
 	FWTS_UEFI_UART_DEVICE_PATH_SUBTYPE =		(0x0e),
-	FWTS_UEFI_USB_CLASS_DEVICE_PATH_SUBTYPE =	(0x0f)
+	FWTS_UEFI_USB_CLASS_DEVICE_PATH_SUBTYPE =	(0x0f),
+	FWTS_UEFI_FIBRE_CHANNEL_EX_DEVICE_PATH_SUBTYPE = (0x15)
+
 } messaging_dev_path_subtypes;
 
 typedef enum {
@@ -372,6 +374,13 @@  typedef struct {
 
 typedef struct {
 	fwts_uefi_dev_path dev_path;
+	uint32_t reserved;
+	uint64_t wwn;
+	uint64_t lun;
+} fwts_uefi_fibre_channel_ex_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 50a08b4..93b47dd 100644
--- a/src/uefi/uefidump/uefidump.c
+++ b/src/uefi/uefidump/uefidump.c
@@ -336,6 +336,12 @@  static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c
 					v->guid.info4[4], v->guid.info4[5], v->guid.info4[6], v->guid.info4[7]);
 			}
 			break;
+		case FWTS_UEFI_FIBRE_CHANNEL_EX_DEVICE_PATH_SUBTYPE:
+			if (dev_path_len >= sizeof(fwts_uefi_fibre_channel_ex_dev_path)) {
+				fwts_uefi_fibre_channel_ex_dev_path *f = (fwts_uefi_fibre_channel_ex_dev_path *)dev_path;
+				path = uefidump_vprintf(path, "\\FIBREEX(0x%" PRIx64 ",0x%" PRIx64 ")", f->wwn, f->lun);
+			}
+			break;
 		default:
 			path = uefidump_vprintf(path, "\\Unknown-MESSAGING-DEV-PATH(0x%" PRIx8 ")", dev_path->subtype);
 			break;