aboutsummaryrefslogtreecommitdiff
path: root/lib/libefivar
Commit message (Collapse)AuthorAgeFilesLines
* efivar: Move dump functions into libefivarStéphane Rochoy2026-04-283-0/+204
| | | | | | | | | To allow their use by efibootmgr. Signed-off-by: stephane.rochoy@stormshield.eu Reviewed by: imp Sponsored by: Stormshield Pull-Request: https://github.com/freebsd/freebsd-src/pull/2167
* libefivar: Apply uncrustify changesJose Luis Duran2025-11-251-50/+52
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdePkg package Note that the link above no longer exists. The commit message was kept verbatim. An original copy of the bug report can be found at: https://web.archive.org/web/20241008121707/https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Obtained from: https://github.com/tianocore/edk2/commit/2f88bd3a1296c522317f1c21377876de63de5be7 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
* libefivar: Change OPTIONAL keyword usage styleJose Luis Duran2025-11-251-5/+5
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params. Note that the link above no longer exists. The commit message was kept verbatim. An archive of the bug report can be found at: https://web.archive.org/web/20240714185609/https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Obtained from: https://github.com/tianocore/edk2/commit/d0e2f8232a26453fc0191629ed44ff2a46ea073e Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
* libefivar: Support UefiDevicePathLib under StandaloneMmJose Luis Duran2025-11-251-33/+0
| | | | | | | | | | | | | | | This change added an instance of UefiDevicePathLib for StandaloneMm. It abstracts DevicePathFromHandle function into different files for Standalone MM and other instances to avoid linking gBS into MM_STANDALONE drivers. No functional change intended, as this function and its invocation are ifdefd out. Obtained from: https://github.com/tianocore/edk2/commit/14a746bb6a92d59669c67a970479558734cf2383 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
* libefivar: Replace BSD License with BSD+Patent LicenseJose Luis Duran2025-11-251-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Note that the link above no longer exists. The commit message was kept verbatim. An archive of the bug report can be found at: https://web.archive.org/web/20240714192319/https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Obtained from: https://github.com/tianocore/edk2/commit/9344f0921518309295da89c221d10cbead8531aa Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
* libefivar: Add sanity check for FilePath device pathJose Luis Duran2025-11-251-1/+10
| | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1497 Current implementation of IsDevicePathValid() is not enough for type of MEDIA_FILEPATH_DP, which has NULL-terminated string in the device path. This patch add a simple NULL character check at Length position. Note that the link above no longer exists. The commit message was kept verbatim. An archived version of the bug report can be found at: https://web.archive.org/web/20240714191428/https://bugzilla.tianocore.org/show_bug.cgi?id=1497 Add the const keyword to avoid errors/warnings about dropping a const qualifier. Obtained from: https://github.com/tianocore/edk2/commit/2f7a96d6ec13b292d6f31295f3195913921173e1 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
* libefivar: Add a checking stepJose Luis Duran2025-11-251-10/+9
| | | | | | | | | | | | | | | | | Add a checking step in DevicePathUtilities.c to verify DevicePath. https://bugzilla.tianocore.org/show_bug.cgi?id=1372 v2: Remove ASSERT() and the redundant checking step. Update related description. Note that the link above no longer exists. The commit message was kept verbatim. An archived version of the bug report can be found at: https://web.archive.org/web/20240714192353/bugzilla.tianocore.org/show_bug.cgi?id=1372 Obtained from: https://github.com/tianocore/edk2/commit/fd02394228ee1dc2378cccfde6098c461f96dd42 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
* libefivar: MdePkg: Clean up source filesJose Luis Duran2025-11-251-38/+38
| | | | | | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF No functional change. Obtained from: https://github.com/tianocore/edk2/commit/9095d37b8fe5bfc3d02adad6ba7fd7359ebc0107 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
* libefivar: Add and comment out unused functionsJose Luis Duran2025-11-251-2/+320
| | | | | | | | | | | This commit introduces gratuitous white space and unused functions. This functionality is guarded/commented out. This change is necessary to reduce the differences with the reference file in subsequent commits. No functional change intended. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
* libefivar: Move functions to match reference fileJose Luis Duran2025-11-251-101/+99
| | | | | | | | Move a few functions to match their locations in the reference file. No functional change intended. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
* libefivar: Standardize #ifndef __FreeBSD__Jose Luis Duran2025-11-252-3/+1
| | | | | | | | | | Standardize preprocessor directives that comment out unused functions (essentially #if 0). No functional change intended. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
* libefivar: Fix (some) typosJose Luis Duran2025-11-254-8/+8
| | | | | | | | | | | | | | | Fix typos in the files that are owned by the project. Bring back a "duplicate word" removal (node node), which should have been "node Node", the second "node" is not capitalized in the reference file (yet). We'll bring it back capitalized to avoid it from triggering automated checking scripts and possibly reverting this change again. A few other typos were not fixed, as we strive to keep as close to the reference files as possible, these fixes should be submitted to the reference project (tianocore/edk2) in the not so distant future. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1894
* edk2: Move ProcessorBind.h to contrib/edk2Warner Losh2025-11-161-3/+0
| | | | | | | | | | | | | | | | | | | Have our own ProcessorBind.h. It just includes sys/efi-edk2.h, but undefines TRUE, FALSE and MAC. The first two are from acpica and are redefined to something almost the same. MAC is a global option that, well, interferes with using EDK2, dangit. I suppose I should redefine it after, but I don't think you can save the value of a pre-processor variable. This breaks a little with the tradition of having this in a seprate directory and using build magic. However, the build is already magical enough and having this here makes things less magical. Also, EDK2 puts this in a processor specific directory, so we won't have conflicts (they need it there since they run on more processors than we do: we can just include sys/efi-edk2.h which covers the smallar variance we have in processors). Sponsored by: Netflix
* efi: Move edk2 compat defines to sys/efi-edk2.hWarner Losh2025-11-167-123/+2
| | | | | | | | | | | | | | | | | | | | Create efi-freebsd.h, which is safe to include from the FreeBSD context (all of userland, except the small bits we share with edk2 and the kernel). This defines anything that we need. At the moment, it just includes NULL definitions. Create efi-edk2.h, which is approximately ProcessorBind.h from edk2 that we can include in FreeBSD compontents that are re-using edk2 components (bits of the boot laoder, and libefi*). Update the efi_gid definitions to match edk2 better. Add this file to badfiles.inc, since we can't write it in a way that's compatible. This is copied from the old efi-osdep.h. This has to be done in one commit that's bigger than I like since we can't easily move things piecemeal around they are so inter-related. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D53651
* efivar: Kill needless sys/cdefs.hWarner Losh2025-05-254-4/+0
| | | | Sponsored by: Netflix
* efivar: Use struct guid_table instead of uuid_tableWarner Losh2025-05-012-24/+21
| | | | | | | | | | | | | uuid_table was the linux name. When libefivar was started, I tried to make it compatible with Linux. However, that's no longer relevant: (a) little to no Linux code was subsequently ported and (b) Linux compat has eroded. This erodes it a bit more to cope with the uuid_t -> efi_guid_t changes. This also moves a couple of functions around to reduce copying and updates consumers for the visible parts of this change. Sponsored by: Netflix Reviewed by: tsoome, kib Differential Revision: https://reviews.freebsd.org/D50060
* efivar: Use bool instead of intWarner Losh2025-05-011-2/+3
| | | | | | Sponsored by: Netflix Reviewed by: tsoome, kib Differential Revision: https://reviews.freebsd.org/D50059
* efivar: Move to new ioctl structWarner Losh2025-05-011-8/+8
| | | | | | | | | Move to the newer ioctl 'struct efi_var_ioctl' which uses efi_guid_t instead of struct uuid. This allows for direct assignment agaain. Sponsored by: Netflix Reviewed by: tsoome, kib Differential Revision: https://reviews.freebsd.org/D50058
* libefi: Update to use the efi_guid_t from sys/efi.hWarner Losh2025-05-011-9/+4
| | | | | Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D50038
* efivar: Allow uuid_t and efi_guid_t to be different types.Warner Losh2025-05-011-4/+4
| | | | | | | | | | While they are binarily the same, the API are different. To use EDK2 more effectively, we need to transition to using EDK@'s API rather than the uuid_t API. This change makes the code neutral on the subject. Sponsored by: Netflix Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D50035
* efivar: Test uuid against zeroWarner Losh2025-05-011-4/+1
| | | | | | | | | | Test the passed in GuID against a guid of all 0's. This removes another place that has to worry about the difference between uuit_t and EFI_GUID. Sponsored by: Netflix Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D50034
* efivar: Use memcmp instead of uuid_ functions to compareWarner Losh2025-05-011-5/+2
| | | | | | | | | | In these cases, memcmp is a perfectly fine substitute for the uuid functions. We don't need checking to make sure the uuids are good, we know the pointers are non-ULL, etc. memcmp will reduce the number of places we need to know these are actually UUIDs, or similar. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D50033
* efivar: Add some explicit casts to uuid_tWarner Losh2025-05-011-6/+6
| | | | | | | | Since we know we're type-punning the EFI_GUID to a uuid_t, add some explicit casts even though, at the moment, we typedef one to the other. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D50032
* libefivar: Simplify Z / zero defineWarner Losh2025-04-231-1/+1
| | | | | | | This really onl needs to be one zero long for the entire structure to be initialized. Use this form instead. Sponsored by: Netflix
* libefivar: Prefer EFI_GUID to GUIDWarner Losh2025-04-231-4/+4
| | | | | | | | | | There's more references to EFI_GUID than to GUID, so prefer using that. The EFI_GUID is closely relate to UUID, but not quite identical to it and those slight differences matter sometimes as well (which is how I found these). Since nearly all the EFI code (ours and EDK2) prefers EGI_GUID, use that proactively here. Sponsored by: Netflix
* libefivar: Add Display Only format for Hard DriveJose Luis Duran2025-02-201-4/+8
| | | | | | | | | Ref: UEFI Specification Version 2.1 (Errata D) (released October 2008) Reviewed by: imp, emaste Approved by: emaste (mentor) Obtained from: https://github.com/tianocore/edk2/commit/9e6537469d4700d9d793ee21e9c2f2e7ddbb2176 Differential Revision: https://reviews.freebsd.org/D49060
* libefivar: CodeQL FixesJose Luis Duran2025-02-202-154/+340
| | | | | | | | | | | | | | | | | | | | | | | | | | These libefivar files correspond to the following EDK2 Tianocore routines: efivar-dp-format.c -> MdePkg/Library/UefiDevicePathLib/DevicePathToText.c efivar-dp-parse.c -> MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c The following changes were apparently applied upstream to appease their CodeQL workflows on GitHub. Note that some of these changes are logically contradictory, however avoiding differences between the two code bases is a priority, as noted in the review. Commit message from upstream: Includes changes across the repo for the following CodeQL rules: - cpp/comparison-with-wider-type - cpp/overflow-buffer - cpp/redundant-null-check-param - cpp/uselesstest Reviewed by: imp Approved by: emaste (mentor) Obtained from: https://github.com/tianocore/edk2/commit/b7735a087afce6a5157b61e5450b6848ed535a14 Differential Revision: https://reviews.freebsd.org/D49059
* libefivar: Fix sed patternJose Luis Duran2025-02-201-1/+1
| | | | | | | | | Add a 'g' flag to allow the replacement to occur more than once on the same line. Reviewed by: imp, emaste Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D49058
* libefivar: Fix AcpiEx print logicJose Luis Duran2024-09-061-26/+44
| | | | | | | | | | | | | Add logic that checks if the code doesn't overflow ACPI_EXTENDED_HID_DEVICE_PATH node when searching for optional strings. If the string is not provided in the device path node default value of "\0" is used. Upstream PR: https://bugzilla.tianocore.org/show_bug.cgi?id=4555 Obtained from: https://github.com/tianocore/edk2/commit/96ed60dfd7d4818a532216d64ee87b13fae5c726 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1388
* lib: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-165-10/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-162-2/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-164-8/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* libefivar: Use a void cast in unimplemented stubs.John Baldwin2023-06-271-2/+2
| | | | | | This "consumes" an otherwise unused argument. Differential Revision: https://reviews.freebsd.org/D40650
* efivar: Really look for labels for the provider with right efimediaWarner Losh2023-02-161-17/+47
| | | | | | | | | | | | | | | | | The prior code mistakently thought that the g_consumer that hung off the provider we found were the right thing to use to find all the glabel aliases for this node. However, the only way to find that is to iterate through all the geoms that belong to the glabel geom class, looking for those geoms with the same name as the provider with the right efimedia. Do this in a way that caches glabel class, and allows for it to be absent. Tighten the filter for mounted filesystems to only look for the ones that are mounted on /dev/.. since the rest of the code assumes that. MFC After: 3 days Sponsored by: Netflix Reviewed by: corvink, asomers Differential Revision: https://reviews.freebsd.org/D38619
* efivar: support device paths as well as mounted paths in path_to_dpWarner Losh2023-02-161-3/+14
| | | | | | | | | | | | In path_to_dp, allow passing in either the actual device path "eg /dev/foo/bar" or the path where the device is mounted (say /mnt/baz/bing). In the former case we'll assume the path within the device is nothing (the relpath). In the latter, we'll take from the mount point on down as the relpath. Sponsored by: Netflix Reviewed by: corvink, manu, asomers Differential Revision: https://reviews.freebsd.org/D38616
* efivar: Allow NULL paths in build_dpWarner Losh2023-02-161-11/+13
| | | | | | | | | Allow there to be NULL paths in buildp. This lets us return the device path to the partition, as well as to files on the partition. Sponsored by: Netflix Reviewed by: corvink, manu, asomers Differential Revision: https://reviews.freebsd.org/D38615
* efivar: Try harder to find label's efimediaWarner Losh2023-02-161-0/+9
| | | | | | | | | | | | If there's no efimedia attribute on the provider, and the provider's a glabel, then find the 'parent' geom. In this case, the provider's name is label-type/name, but the geom's label will that of the underlying device (eg ada0p1). If it is, recurisvely call find_geom_efimedia with the geom's name, which shuold have the efimedia attribute. Sponsored by: Netflix Reviewed by: corvink, manu, asomers Differential Revision: https://reviews.freebsd.org/D38614
* libefivar: Add note about extra compiler flagsWarner Losh2023-02-151-1/+2
| | | | | | | | | | Add a note about why we need these extra compiler flags to suppress warnings. EDK2 upstream code is being used verbatim and as of the last update these issuse persist, but are benign. Sponsored by: Netflix Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D38613
* libefivar: Fix a buffer overread.John Baldwin2022-10-031-1/+2
| | | | | | | | | | | | | DevPathToTextUsbWWID allocates a separate copy of the SerialNumber string to append a null terminator if the original string is not null terminated. However, by using AllocateCopyPool, it tries to copy 'Length + 1' words from the existing string containing 'Length' characters into the target string. Split the copy out to only copy 'Length' characters instead. Reviewed by: imp, emaste Reported by: GCC 12 -Wstringop-overread Differential Revision: https://reviews.freebsd.org/D36826
* libefivar(3): Fix a typo in a source code commentGordon Bergling2022-03-281-1/+1
| | | | | | - s/partiton/partition/ MFC after: 3 days
* libefivar: Apply uncrustify changesJose Luis Duran2022-02-275-1449/+1494
| | | | | | | | | | | | | | Apply uncrustify changes to .c/.h files. Reduce the diffs with EDK2 to aid with future merges. The unconventional way we've imported this code makes using a vendor branch to manage it at the very least tricky. Update FreeBSD-update to reflect the slight shift in advise. Reviewed by: imp Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Obtained from: https://github.com/tianocore/edk2/commit/2f88bd3a1296c522317f1c21377876de63de5be7 Pull Request: https://github.com/freebsd/freebsd-src/pull/581
* libefivar: Change OPTIONAL keyword usage styleJose Luis Duran2022-02-271-3/+3
| | | | | | | | Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params. Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Obtained from: https://github.com/tianocore/edk2/commit/d0e2f8232a26453fc0191629ed44ff2a46ea073e Pull Request: https://github.com/freebsd/freebsd-src/pull/581
* libefivar: Replace BSD License with BSD+Patent LicenseJose Luis Duran2022-02-273-21/+3
| | | | | | | | | | | | | | | | | | Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Obtained from: https://github.com/tianocore/edk2/commit/9344f0921518309295da89c221d10cbead8531aa Pull Request: https://github.com/freebsd/freebsd-src/pull/581
* libefivar: Check Length para before use in DevPathToTextUsbWWIDJose Luis Duran2022-02-271-1/+1
| | | | | | | | | In function DevPathToTextUsbWWID, the Length parameter is used without check. This patch is to add check before using it. Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1336 Obtained from: https://github.com/tianocore/edk2/commit/d8e702693a8c292220131dc4234a36e2c9fff614 Pull Request: https://github.com/freebsd/freebsd-src/pull/581
* libefivar: Fix incorrect check for DisplayOnly text format in AcpiExJose Luis Duran2022-02-271-1/+1
| | | | | | | | | | | | | | | | | | Text format for AcpiEx device path in UEFI Spec: AcpiEx(HID,CID,UID,HIDSTR,CIDSTR,UIDSTR) AcpiEx(HID|HIDSTR,(CID|CIDSTR,UID|UIDSTR))(Display Only) When convert device path to text for AcpiEx device path, current code check AllowShortcuts parameter to convert the device path to DisplayOnly text format(shorter text representation) by mistake. It should check DisplayOnly parameter. This commit is to fix this issue. Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1312 Obtained from: https://github.com/tianocore/edk2/commit/e9ab1635a2cfa1cb588996dcd5cc157fb44decb1 Pull Request: https://github.com/freebsd/freebsd-src/pull/581
* libefivar: Handle AcpiExp device path when optional para is not specifiedJose Luis Duran2022-02-272-8/+26
| | | | | | | | | | | | | | | AcpiExp text device path: AcpiExp(HID,CID,UIDSTR) And according to UEFI spec, the CID parameter is optional and has a default value of 0. But current implementation miss to check following cases for the AcpiExp. FromText: when text device is AcpiExp(HID,,UIDSTR)/AcpiExp(HID,0,UIDSTR) ToText: when the CID is 0 in the node structure This commit is to do the enhancement. Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1243 Obtained from: https://github.com/tianocore/edk2/commit/a8b5750901faa63ff5570634851e648b8e335e5a Pull Request: https://github.com/freebsd/freebsd-src/pull/581
* libefivar: Handle USBxxx device path when optional para is not specifiedJose Luis Duran2022-02-271-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | According to UEFI spec, for the Messaging Device Path with USB Class SubType, some paras are optional in the text device path. Take UsbClass(VID,PID,Class,SubClass,Protocol) for example, The VID is an integer between 0 and 65535 and is optional. The default value is 0xFFFF. The PID is an integer between 0 and 65535 and is optional. The default value is 0xFFFF. The Class is an integer between 0 and 255 and is optional. The default value is 0xFF. The SubClass is an integer between 0 and 255 and is optional. The default value is 0xFF. The Protocol is an integer between 0 and 255 and is optional. The default value is 0xFF. So if any the optional para is not specified in the text device, we should set related para in the node structure to default value. This commit is to do the enhancement for USB Class device path when optional para is not specified. Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1243 Obtained from: https://github.com/tianocore/edk2/commit/3874108034eb3f1d5d5180df33a5dfdd5fab5d25 Pull Request: https://github.com/freebsd/freebsd-src/pull/581