diff mbox

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

Message ID 1448009210-26453-3-git-send-email-ivan.hu@canonical.com
State Accepted
Headers show

Commit Message

Ivan Hu Nov. 20, 2015, 8:46 a.m. UTC
Sync up with uefi spec. 2.5 for new messaging device path, bluetooth device path

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

Comments

Colin Ian King Nov. 23, 2015, 9:14 a.m. UTC | #1
On 20/11/15 08:46, Ivan Hu wrote:
> Sync up with uefi spec. 2.5 for new messaging device path, bluetooth device path
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/uefi/uefibootpath/uefibootpath.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/src/uefi/uefibootpath/uefibootpath.c b/src/uefi/uefibootpath/uefibootpath.c
> index af2dbc1..fd7293c 100644
> --- a/src/uefi/uefibootpath/uefibootpath.c
> +++ b/src/uefi/uefibootpath/uefibootpath.c
> @@ -594,6 +594,16 @@ static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d
>  				errors++;
>  			}
>  			break;
> +		case FWTS_UEFI_BLUETOOTH_DEVICE_PATH_SUBTYPE:
> +			if (len != sizeof(fwts_uefi_bluetooth_dev_path)) {
> +				fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIBluetoothDevPathLength",
> +					"The length of Bluetooth device path is %" PRIu16 " bytes "
> +					"and differs from UEFI specification defined %" PRIu16 " bytes.",
> +					len,
> +					(uint16_t)sizeof(fwts_uefi_bluetooth_dev_path));
> +				errors++;
> +			}
> +			break;
>  		default:
>  			fwts_log_info_verbatum(fw, "Unknown subtype of Messaging Device Path.");
>  			break;
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
Alex Hung Nov. 25, 2015, 2:33 a.m. UTC | #2
On 2015-11-20 04:46 PM, Ivan Hu wrote:
> Sync up with uefi spec. 2.5 for new messaging device path, bluetooth device path
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>   src/uefi/uefibootpath/uefibootpath.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/src/uefi/uefibootpath/uefibootpath.c b/src/uefi/uefibootpath/uefibootpath.c
> index af2dbc1..fd7293c 100644
> --- a/src/uefi/uefibootpath/uefibootpath.c
> +++ b/src/uefi/uefibootpath/uefibootpath.c
> @@ -594,6 +594,16 @@ static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d
>   				errors++;
>   			}
>   			break;
> +		case FWTS_UEFI_BLUETOOTH_DEVICE_PATH_SUBTYPE:
> +			if (len != sizeof(fwts_uefi_bluetooth_dev_path)) {
> +				fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIBluetoothDevPathLength",
> +					"The length of Bluetooth device path is %" PRIu16 " bytes "
> +					"and differs from UEFI specification defined %" PRIu16 " bytes.",
> +					len,
> +					(uint16_t)sizeof(fwts_uefi_bluetooth_dev_path));
> +				errors++;
> +			}
> +			break;
>   		default:
>   			fwts_log_info_verbatum(fw, "Unknown subtype of Messaging Device Path.");
>   			break;
>

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

Patch

diff --git a/src/uefi/uefibootpath/uefibootpath.c b/src/uefi/uefibootpath/uefibootpath.c
index af2dbc1..fd7293c 100644
--- a/src/uefi/uefibootpath/uefibootpath.c
+++ b/src/uefi/uefibootpath/uefibootpath.c
@@ -594,6 +594,16 @@  static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d
 				errors++;
 			}
 			break;
+		case FWTS_UEFI_BLUETOOTH_DEVICE_PATH_SUBTYPE:
+			if (len != sizeof(fwts_uefi_bluetooth_dev_path)) {
+				fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIBluetoothDevPathLength",
+					"The length of Bluetooth device path is %" PRIu16 " bytes "
+					"and differs from UEFI specification defined %" PRIu16 " bytes.",
+					len,
+					(uint16_t)sizeof(fwts_uefi_bluetooth_dev_path));
+				errors++;
+			}
+			break;
 		default:
 			fwts_log_info_verbatum(fw, "Unknown subtype of Messaging Device Path.");
 			break;