From nobody Sun Feb 27 16:47:38 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9975019E9910; Sun, 27 Feb 2022 16:47:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K68ZL4yzmz4lWg; Sun, 27 Feb 2022 16:47:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645980458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OO3ZgRM/jG1Nku4aTYH/TUGrh2MDQcOAIgGjRx/sfqE=; b=sINg4ym0r+85qouMIl8QsRSu9gTmyh7BJmFvmV7vILIm+RnEscl008s2D9BI6dm5fB9eGo d1mG7ti7m2GIi/hNTHfTEEgvLpXXay9t9k26UnuEdfO+XfIMetIaNWDrAUn4mk5KnTAPBC 7U0tcGMfbh5FDeW78zloBGyLMFXizeRKkq8y8Av6AWjcE5s1MYdp9DbvPgIloHnj3Ga+5J vjFcNCbXbB9VR7rLDRuPU6klQ25xYqVC3sqMwkBhcZ0ufJ2s9wg6QD3DyTvxGRyed51mtv Y209BrNE265yhhxYFtYQYBRietox42tNxrZYkvlav21nBzW5YPHEGnGz2rbDLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 320202ACB; Sun, 27 Feb 2022 16:47:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21RGlcaS036703; Sun, 27 Feb 2022 16:47:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21RGlcHL036702; Sun, 27 Feb 2022 16:47:38 GMT (envelope-from git) Date: Sun, 27 Feb 2022 16:47:38 GMT Message-Id: <202202271647.21RGlcHL036702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 0081638344b4 - main - libefivar: Reverse the byte order of BD_ADDR for Bluetooth List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0081638344b48c70fdf5da4e5a5bf9e9f672d7ca Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645980458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OO3ZgRM/jG1Nku4aTYH/TUGrh2MDQcOAIgGjRx/sfqE=; b=yyDgdIBaHnQTx9w52MWTPq1JCwYfQrCvNNBjpb0XZBcAPR7s397FQrsF4owyANbTrlLL/F GlNlPVMqeqKQhHs1RTitRkzHt1fkiRM6EwUrBGFfn/eaWoJD5knAOhhUkWN2CjeN0Ix9A1 8b8GPcP+04OvYO3gdUxmkH4z3DFy+sA5z7ELAwUSqfxSfJXRPEfy6saLq3FIXktJqhCYL+ 7E8xeP2+g4O2XR+J54EieEEwyneBxXqpeg+qNtNMg10FV/2MSr0j9itA0JyixT0LcX0mK9 NaWWR8Vjwr1sAZ/8BOC8S6xU8JJQfJgiwyEDJJjlysaGfNKv6waHpIs3ITFHPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645980458; a=rsa-sha256; cv=none; b=IiLCncCS+vfvtupirbbR0xAziMXOO42yV8UeOUFHL4wFxz7MSFj+f8rqegDxFEeKKBWrJq JNKjK+E0XeYENgrs5yugNZbhlChtjPMsIrbkrwMOuGAPl7f1AtLdZHyzYF1YWuqwx9Bjdh CKX5NNYA60JqTrHEof0Z1oVFzd1nYces6Btzy0WISXXCWLFxdyY/JDBWp/dJACyYrO6U4m WEWL09rbdCtax34QKEA92TQWtjtIwnhP1n21/xNQ0xnuohYGZRdhOgBQSXiD5XhBApRWo4 rM79nP3xdx2zeXcUe0bwxqROSnKaMEN0KQWnQEnMu14fC8Dq4kzizsEyrzwe3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0081638344b48c70fdf5da4e5a5bf9e9f672d7ca commit 0081638344b48c70fdf5da4e5a5bf9e9f672d7ca Author: Jose Luis Duran AuthorDate: 2022-02-24 00:03:10 +0000 Commit: Warner Losh CommitDate: 2022-02-27 16:12:21 +0000 libefivar: Reverse the byte order of BD_ADDR for Bluetooth For the following two functions: DevPathFromTextBluetooth() DevPathToTextBluetooth() The Bluetooth device address "UINT8 Address[6]" is displayed with the order from Address[5] to Address[0]. This commit reverses the order. Obtained from: https://github.com/tianocore/edk2/commit/4fc8277133fb011d028b4e0a42444ab6f552d0b9 Pull Request: https://github.com/freebsd/freebsd-src/pull/581 --- lib/libefivar/efivar-dp-format.c | 12 ++++++------ lib/libefivar/efivar-dp-parse.c | 37 +++++++++++-------------------------- 2 files changed, 17 insertions(+), 32 deletions(-) diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c index 14f6adc2fd98..eaff7754019c 100644 --- a/lib/libefivar/efivar-dp-format.c +++ b/lib/libefivar/efivar-dp-format.c @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); DevicePathToText protocol as defined in the UEFI 2.0 specification. (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
-Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1680,12 +1680,12 @@ DevPathToTextBluetooth ( UefiDevicePathLibCatPrint ( Str, "Bluetooth(%02x%02x%02x%02x%02x%02x)", - Bluetooth->BD_ADDR.Address[5], - Bluetooth->BD_ADDR.Address[4], - Bluetooth->BD_ADDR.Address[3], - Bluetooth->BD_ADDR.Address[2], + Bluetooth->BD_ADDR.Address[0], Bluetooth->BD_ADDR.Address[1], - Bluetooth->BD_ADDR.Address[0] + Bluetooth->BD_ADDR.Address[2], + Bluetooth->BD_ADDR.Address[3], + Bluetooth->BD_ADDR.Address[4], + Bluetooth->BD_ADDR.Address[5] ); } diff --git a/lib/libefivar/efivar-dp-parse.c b/lib/libefivar/efivar-dp-parse.c index 02c32971f4c6..ea78d5a1f930 100644 --- a/lib/libefivar/efivar-dp-parse.c +++ b/lib/libefivar/efivar-dp-parse.c @@ -2781,35 +2781,20 @@ DevPathFromTextBluetooth ( ) { CHAR16 *BluetoothStr; - CHAR16 *Walker; - CHAR16 *TempNumBuffer; - UINTN TempBufferSize; - INT32 Index; BLUETOOTH_DEVICE_PATH *BluetoothDp; BluetoothStr = GetNextParamStr (&TextDeviceNode); - BluetoothDp = (BLUETOOTH_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_BLUETOOTH_DP, - (UINT16) sizeof (BLUETOOTH_DEVICE_PATH) - ); - - Index = sizeof (BLUETOOTH_ADDRESS) - 1; - Walker = BluetoothStr; - while (!IS_NULL(*Walker) && Index >= 0) { - TempBufferSize = 2 * sizeof(CHAR16) + StrSize("0x"); - TempNumBuffer = AllocateZeroPool (TempBufferSize); - if (TempNumBuffer == NULL) { - break; - } - StrCpyS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), "0x"); - StrnCatS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), Walker, 2); - BluetoothDp->BD_ADDR.Address[Index] = (UINT8)Strtoi (TempNumBuffer); - FreePool (TempNumBuffer); - Walker += 2; - Index--; - } - + BluetoothDp = (BLUETOOTH_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_BLUETOOTH_DP, + (UINT16) sizeof (BLUETOOTH_DEVICE_PATH) + ); + StrHexToBytes ( + BluetoothStr, + sizeof (BLUETOOTH_ADDRESS) * 2, + BluetoothDp->BD_ADDR.Address, + sizeof (BLUETOOTH_ADDRESS) + ); return (EFI_DEVICE_PATH_PROTOCOL *) BluetoothDp; }