diff mbox

[3/3] uefibootpath: add test for the UFS device path

Message ID 1446714053-7424-4-git-send-email-ivan.hu@canonical.com
State Rejected
Headers show

Commit Message

Ivan Hu Nov. 5, 2015, 9 a.m. UTC
Sync up with uefi spec. 2.5 for new messaging device path, UFS device path.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/uefi/uefibootpath/uefibootpath.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Comments

Colin Ian King Nov. 5, 2015, 1:11 p.m. UTC | #1
On 05/11/15 09:00, Ivan Hu wrote:
> Sync up with uefi spec. 2.5 for new messaging device path, UFS device path.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/uefi/uefibootpath/uefibootpath.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/src/uefi/uefibootpath/uefibootpath.c b/src/uefi/uefibootpath/uefibootpath.c
> index 3232bd1..ae6957c 100644
> --- a/src/uefi/uefibootpath/uefibootpath.c
> +++ b/src/uefi/uefibootpath/uefibootpath.c
> @@ -563,6 +563,27 @@ static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d
>  				errors++;
>  			}
>  			break;
> +		case FWTS_UEFI_UFS_DEVICE_PATH_SUBTYPE:
> +			if (len != sizeof(fwts_uefi_ufs_dev_path)) {
> +				fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIUFSDevPathLength",
> +					"The length of UFS(Universal Flash Storage) is %" PRIu16 " bytes "
> +					"and differs from UEFI specification defined %" PRIu16 " bytes.",
> +					len,
> +					(uint16_t)sizeof(fwts_uefi_ufs_dev_path));
> +				errors++;
> +			}
> +
> +			fwts_uefi_ufs_dev_path *ufs = (fwts_uefi_ufs_dev_path *)dev_path;
> +			if (ufs->target_id != 0) {
> +				fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIPUNFieldInvalid",
> +					"The Target ID on the UFS interface(PUN) is %" PRIu8 " ."
> +					"This value should be 0 for current UFS2.0 spec compliance "
> +					"and reserve/introduce this field to support multiple devices "
> +					"per UFS port.",
> +					ufs->target_id);
> +				errors++;
> +			}
> +			break;
>  		default:
>  			fwts_log_info_verbatum(fw, "Unknow subtype of Messaging Device PaERRORth.");

"Unknow" should be "Unknown"

Not sure what the "PaERRORth." is, should that be "Path." ?


>  			break;
>
diff mbox

Patch

diff --git a/src/uefi/uefibootpath/uefibootpath.c b/src/uefi/uefibootpath/uefibootpath.c
index 3232bd1..ae6957c 100644
--- a/src/uefi/uefibootpath/uefibootpath.c
+++ b/src/uefi/uefibootpath/uefibootpath.c
@@ -563,6 +563,27 @@  static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d
 				errors++;
 			}
 			break;
+		case FWTS_UEFI_UFS_DEVICE_PATH_SUBTYPE:
+			if (len != sizeof(fwts_uefi_ufs_dev_path)) {
+				fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIUFSDevPathLength",
+					"The length of UFS(Universal Flash Storage) is %" PRIu16 " bytes "
+					"and differs from UEFI specification defined %" PRIu16 " bytes.",
+					len,
+					(uint16_t)sizeof(fwts_uefi_ufs_dev_path));
+				errors++;
+			}
+
+			fwts_uefi_ufs_dev_path *ufs = (fwts_uefi_ufs_dev_path *)dev_path;
+			if (ufs->target_id != 0) {
+				fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIPUNFieldInvalid",
+					"The Target ID on the UFS interface(PUN) is %" PRIu8 " ."
+					"This value should be 0 for current UFS2.0 spec compliance "
+					"and reserve/introduce this field to support multiple devices "
+					"per UFS port.",
+					ufs->target_id);
+				errors++;
+			}
+			break;
 		default:
 			fwts_log_info_verbatum(fw, "Unknow subtype of Messaging Device PaERRORth.");
 			break;