libefivar: Handle Sata device path when optional para is not specified
Sata device path format:Sata(HPN, PMPN, LUN)
According to UEFI Spec, the PMPN is an integer between
0 and 65535 and is optional. If not provided, the default is 0xFFFF.
This commit is to do the enhancement for Sata device path
when optional para is not specified.
Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1243
Obtained from: 6d9b9bbb61
Pull Request: https://github.com/freebsd/freebsd-src/pull/581
This commit is contained in:
parent
9a62aa9329
commit
4e83ac7d2e
@ -3594,7 +3594,15 @@ DevPathFromTextSata (
|
|||||||
(UINT16) sizeof (SATA_DEVICE_PATH)
|
(UINT16) sizeof (SATA_DEVICE_PATH)
|
||||||
);
|
);
|
||||||
Sata->HBAPortNumber = (UINT16) Strtoi (Param1);
|
Sata->HBAPortNumber = (UINT16) Strtoi (Param1);
|
||||||
Sata->PortMultiplierPortNumber = (UINT16) Strtoi (Param2);
|
|
||||||
|
//
|
||||||
|
// According to UEFI spec, if PMPN is not provided, the default is 0xFFFF
|
||||||
|
//
|
||||||
|
if (*Param2 == '\0' ) {
|
||||||
|
Sata->PortMultiplierPortNumber = 0xFFFF;
|
||||||
|
} else {
|
||||||
|
Sata->PortMultiplierPortNumber = (UINT16) Strtoi (Param2);
|
||||||
|
}
|
||||||
Sata->Lun = (UINT16) Strtoi (Param3);
|
Sata->Lun = (UINT16) Strtoi (Param3);
|
||||||
|
|
||||||
return (EFI_DEVICE_PATH_PROTOCOL *) Sata;
|
return (EFI_DEVICE_PATH_PROTOCOL *) Sata;
|
||||||
|
Loading…
Reference in New Issue
Block a user