/** @file\r
DevicePathToText protocol as defined in the UEFI 2.0 specification.\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
((SAS_DEVICE_PATH *) Vendor)->RelativeTargetPort\r
);\r
Info = (((SAS_DEVICE_PATH *) Vendor)->DeviceTopology);\r
- if ((Info & 0x0f) == 0) {\r
+ if (((Info & 0x0f) == 0) && ((Info & BIT7) == 0)) {\r
CatPrint (Str, L"NoTopology,0,0,0,");\r
- } else if (((Info & 0x0f) == 1) || ((Info & 0x0f) == 2)) {\r
+ } else if (((Info & 0x0f) <= 2) && ((Info & BIT7) == 0)) {\r
CatPrint (\r
Str,\r
L"%s,%s,%s,",\r
- ((Info & (0x1 << 4)) != 0) ? L"SATA" : L"SAS",\r
- ((Info & (0x1 << 5)) != 0) ? L"External" : L"Internal",\r
- ((Info & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct"\r
+ ((Info & BIT4) != 0) ? L"SATA" : L"SAS",\r
+ ((Info & BIT5) != 0) ? L"External" : L"Internal",\r
+ ((Info & BIT6) != 0) ? L"Expanded" : L"Direct"\r
);\r
if ((Info & 0x0f) == 1) {\r
CatPrint (Str, L"0,");\r
} else {\r
- CatPrint (Str, L"0x%x,", (Info >> 8) & 0xff);\r
+ //\r
+ // Value 0x0 thru 0xFF -> Drive 1 thru Drive 256\r
+ //\r
+ CatPrint (Str, L"0x%x,", ((Info >> 8) & 0xff) + 1);\r
}\r
} else {\r
- CatPrint (Str, L"0,0,0,0,");\r
+ CatPrint (Str, L"0x%x,0,0,0,", Info);\r
}\r
\r
CatPrint (Str, L"0x%x)", ((SAS_DEVICE_PATH *) Vendor)->Reserved);\r
}\r
CatPrint (Str, L",0x%x,", SasEx->RelativeTargetPort);\r
\r
- if ((SasEx->DeviceTopology & 0x0f) == 0) {\r
+ if (((SasEx->DeviceTopology & 0x0f) == 0) && ((SasEx->DeviceTopology & BIT7) == 0)) {\r
CatPrint (Str, L"NoTopology,0,0,0");\r
- } else if (((SasEx->DeviceTopology & 0x0f) == 1) || ((SasEx->DeviceTopology & 0x0f) == 2)) {\r
+ } else if (((SasEx->DeviceTopology & 0x0f) <= 2) && ((SasEx->DeviceTopology & BIT7) == 0)) {\r
CatPrint (\r
Str,\r
L"%s,%s,%s,",\r
- ((SasEx->DeviceTopology & (0x1 << 4)) != 0) ? L"SATA" : L"SAS",\r
- ((SasEx->DeviceTopology & (0x1 << 5)) != 0) ? L"External" : L"Internal",\r
- ((SasEx->DeviceTopology & (0x1 << 6)) != 0) ? L"Expanded" : L"Direct"\r
+ ((SasEx->DeviceTopology & BIT4) != 0) ? L"SATA" : L"SAS",\r
+ ((SasEx->DeviceTopology & BIT5) != 0) ? L"External" : L"Internal",\r
+ ((SasEx->DeviceTopology & BIT6) != 0) ? L"Expanded" : L"Direct"\r
);\r
if ((SasEx->DeviceTopology & 0x0f) == 1) {\r
CatPrint (Str, L"0");\r
} else {\r
- CatPrint (Str, L"0x%x", (SasEx->DeviceTopology >> 8) & 0xff);\r
+ //\r
+ // Value 0x0 thru 0xFF -> Drive 1 thru Drive 256\r
+ //\r
+ CatPrint (Str, L"0x%x", ((SasEx->DeviceTopology >> 8) & 0xff) + 1);\r
}\r
} else {\r
- CatPrint (Str, L"0,0,0,0");\r
+ CatPrint (Str, L"0x%x,0,0,0", SasEx->DeviceTopology);\r
}\r
\r
CatPrint (Str, L")");\r