199767f8919635c4928607450d9e0abb932109ceToomas Soome/* $FreeBSD$ */
199767f8919635c4928607450d9e0abb932109ceToomas SoomeCopyright (c) 1999 - 2002 Intel Corporation. All rights reserved
199767f8919635c4928607450d9e0abb932109ceToomas SoomeThis software and associated documentation (if any) is furnished
199767f8919635c4928607450d9e0abb932109ceToomas Soomeunder a license and may only be used or copied in accordance
199767f8919635c4928607450d9e0abb932109ceToomas Soomewith the terms of the license. Except as permitted by such
199767f8919635c4928607450d9e0abb932109ceToomas Soomelicense, no part of this software or documentation may be
199767f8919635c4928607450d9e0abb932109ceToomas Soomereproduced, stored in a retrieval system, or transmitted in any
199767f8919635c4928607450d9e0abb932109ceToomas Soomeform or by any means without the express written consent of
199767f8919635c4928607450d9e0abb932109ceToomas SoomeIntel Corporation.
199767f8919635c4928607450d9e0abb932109ceToomas Soome Defines for parsing the EFI Device Path structures
199767f8919635c4928607450d9e0abb932109ceToomas SoomeRevision History
199767f8919635c4928607450d9e0abb932109ceToomas Soome// Device Path structures - Section C
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define END_DEVICE_PATH_LENGTH (sizeof(EFI_DEVICE_PATH))
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define DP_IS_END_SUBTYPE(a) ( ((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE )
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define DevicePathType(a) ( ((a)->Type) & EFI_DP_TYPE_MASK )
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define DevicePathNodeLength(a) ( ((a)->Length[0]) | ((a)->Length[1] << 8) )
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define NextDevicePathNode(a) ( (EFI_DEVICE_PATH *) ( ((UINT8 *) (a)) + DevicePathNodeLength(a)))
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define IsDevicePathType(a, t) ( DevicePathType(a) == t )
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define IsDevicePathEndType(a) IsDevicePathType(a, END_DEVICE_PATH_TYPE)
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define IsDevicePathEndSubType(a) ( (a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE )
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define IsDevicePathEnd(a) ( IsDevicePathEndType(a) && IsDevicePathEndSubType(a) )
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define IsDevicePathUnpacked(a) ( (a)->Type & EFI_DP_TYPE_UNPACKED )
199767f8919635c4928607450d9e0abb932109ceToomas Soome (a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; \
199767f8919635c4928607450d9e0abb932109ceToomas Soome { 0xcf31fac5, 0xc24e, 0x11d2, {0x85, 0xf3, 0x0, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b} }
199767f8919635c4928607450d9e0abb932109ceToomas Soome// EISA ID Macro
199767f8919635c4928607450d9e0abb932109ceToomas Soome// EISA ID Definition 32-bits
199767f8919635c4928607450d9e0abb932109ceToomas Soome// bits[15:0] - three character compressed ASCII EISA ID.
199767f8919635c4928607450d9e0abb932109ceToomas Soome// bits[31:16] - binary number
199767f8919635c4928607450d9e0abb932109ceToomas Soome// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16))
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Use VENDOR_DEVICE_PATH struct */
199767f8919635c4928607450d9e0abb932109ceToomas Soome { 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
199767f8919635c4928607450d9e0abb932109ceToomas Soome { 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
199767f8919635c4928607450d9e0abb932109ceToomas Soome { 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43} }
199767f8919635c4928607450d9e0abb932109ceToomas Soome { 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88} }
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Use VENDOR_DEVICE_PATH struct */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define SIZE_OF_FILEPATH_DEVICE_PATH EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* DeviceType definitions - from BBS specification */
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef union {
199767f8919635c4928607450d9e0abb932109ceToomas Soome UNKNOWN_DEVICE_VENDOR_DEVICE_PATH UnknownVendor;
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef union {