--******************************************************************************************************************** -- Created: 30-Mar-2010 17:02:10 by OpenVMS SDL EV3-3 -- Source: 22-AUG-2005 16:16:53 $1$DGA7274:[STARLET_ADA.LIS]WWIDDEF.SDL;1 --******************************************************************************************************************** with SYSTEM; use SYSTEM; with STARLET; use STARLET; with CONDITION_HANDLING; use CONDITION_HANDLING; package WWIDDEF is -- module $WWIDDEF IDENT X-4 -- -- Longword header prefixed to the World-Wide Identifier used in fibre channel. -- A WWID can be in any one of the eleven formats specified here. At this time -- though, only seven of these formats (WWID types 1-4, 9-11) are implemented -- in OpenVMS. -- -- Note that this is a common header, used by OpenVMS, Digital UNIX, and the -- Console. Any changes to this structure should be made in cooperation with -- these other groups. -- WWIDHDR_M_WWID_LENGTH : constant := 16#000FFFFF#; WWIDHDR_M_ASCII_DATA : constant := 16#00100000#; WWIDHDR_M_WWID_TYPE : constant := 16#FF000000#; WWIDHDR_K_IEEE_REGEXT : constant := 1; -- 1: Page83, ID type 3, NAA 0110 WWIDHDR_K_IEEE_REG : constant := 2; -- 2: Page83, ID type 3, NAA 0101 WWIDHDR_K_PG83TY1_VID : constant := 3; -- 3: PID+Page83, ID type 1 WWIDHDR_K_PG80_SERIALNO : constant := 4; -- 4: VID+PID+Ser_No from Page80 WWIDHDR_K_INQ_SERIALNO : constant := 5; -- 5: VID+PID+Ser_No from std. inq. data WWIDHDR_K_TGT_IDENT : constant := 6; -- 6: VID+PID+Persistent_Tgt_ID WWIDHDR_K_BTL : constant := 7; -- 7: VID+PID+Bus_No+Tgt_ID+LUN WWIDHDR_K_DEC_UNIQUE : constant := 8; -- 8: HSZ-specific serial no's. WWIDHDR_K_HSZ_THISOTHER : constant := 9; -- 9: THIS/OTHER ser. no. (older HSZs) WWIDHDR_K_IEEE48_VEXT : constant := 10; -- 10: Page83, ID type 3, NAA 0010 WWIDHDR_K_IEEE48_0EXT : constant := 11; -- 11: Page83, ID type 3, NAA 0001 WWIDHDR_K_IEEE_EUI64 : constant := 12; -- 12: Page83, ID type 2 WWIDHDR_K_ISCSI_NAME : constant := 13; -- 13: X-4 iSCSI Name type WWIDHDR_HEADER_FIELDS_TYPE is record WWID_LENGTH : UNSIGNED_20; -- Length of WWID data ASCII_DATA : BOOLEAN; -- Data is in ASCII format RESERVED1 : UNSIGNED_3; -- Reserved WWID_TYPE : UNSIGNED_8; -- WWID format type end record; for WWIDHDR_HEADER_FIELDS_TYPE use record WWID_LENGTH at 0 range 0 .. 19; ASCII_DATA at 2 range 4 .. 4; RESERVED1 at 2 range 5 .. 7; WWID_TYPE at 3 range 0 .. 7; end record; for WWIDHDR_HEADER_FIELDS_TYPE'SIZE use 32; WWIDHDR_HEADER_FIELDS_TYPE_INIT : constant WWIDHDR_HEADER_FIELDS_TYPE := (WWID_LENGTH => 0, ASCII_DATA => FALSE, RESERVED1 => 0, WWID_TYPE => 0); type WWIDHDR_TYPE is record HEADER_FIELDS : WWIDHDR_HEADER_FIELDS_TYPE; end record; for WWIDHDR_TYPE use record HEADER_FIELDS at 0 range 0 .. 31; end record; for WWIDHDR_TYPE'SIZE use 32; WWIDHDR_TYPE_INIT : constant WWIDHDR_TYPE := ( HEADER_FIELDS => WWIDHDR_HEADER_FIELDS_TYPE_INIT); -- -- World-Wide Identifier -- -- Includes the 4-byte header defined above and the body of the WWID. The -- largest WWID is currently the type that includes Vendor ID (8 bytes), -- Product ID (16 bytes), and Serial Number (up to 251 bytes). Rounding up -- to the nearest quadword boundary, this comes out to 276 bytes. -- type WWID_TYPE is record HEADER : WWIDHDR_TYPE; DATA : INTEGER_8_ARRAY (1 .. 276); end record; for WWID_TYPE use record HEADER at 0 range 0 .. 31; DATA at 4 range 0 .. 2207; end record; for WWID_TYPE'SIZE use 2240; WWID_TYPE_INIT : constant WWID_TYPE := (HEADER => WWIDHDR_TYPE_INIT, DATA => (others => 0)); WWID_K_LENGTH : constant := 280; -- -- Serial Number WWID -- -- This is the WWID that gets put together from both standard and Page 80 -- inquiry data. The Product ID and Vendor ID come from standard inquiry data. -- The Serial Number comes from Vital Product Data Page 80. The Header is the -- standard WWID header defined above. -- type SN_WWID_TYPE is record HEADER : WWIDHDR_TYPE; VENDOR_ID : UNSIGNED_BYTE_ARRAY (1 .. 8); PRODUCT_ID : UNSIGNED_BYTE_ARRAY (1 .. 16); SERIAL_NO : UNSIGNED_BYTE_ARRAY (1 .. 252); end record; for SN_WWID_TYPE use record HEADER at 0 range 0 .. 31; VENDOR_ID at 4 range 0 .. 63; PRODUCT_ID at 12 range 0 .. 127; SERIAL_NO at 28 range 0 .. 2015; end record; for SN_WWID_TYPE'SIZE use 2240; SN_WWID_TYPE_INIT : constant SN_WWID_TYPE := (HEADER => WWIDHDR_TYPE_INIT, VENDOR_ID => (others => 0), PRODUCT_ID => (others => 0), SERIAL_NO => (others => 0)); SN_WWID_K_LENGTH : constant := 280; -- -- The longest WWID is one that is made from the device's serial number, -- product ID, and vendor ID. -- 4 8 16 <= 252 -- +------+------------+-------------------+-----------------------------------+ -- |Header| Vendor | Product | Serial Number | -- +------+------------+-------------------+-----------------------------------+ -- -- Maximum WWID length comes out to 4+8+16+252 = 280 bytes. -- WWID_K_MAX_LENGTH : constant := 280; -- -- WWID Table Entry -- -- The WWID table is created during boot by EXEC_INIT and is used by both -- EXEC_INIT and, later on in the boot, STACONFIG. The table stores informa- -- tion about all devices that have been registered by the user at the console. -- type WWID_TYPE is record HEADER : WWIDHDR_TYPE; FCWWID : INTEGER_8_ARRAY (1 .. 112); end record; for WWID_TYPE use record HEADER at 0 range 0 .. 31; FCWWID at 4 range 0 .. 895; end record; for WWID_TYPE'SIZE use 928; WWID_TYPE_INIT : constant WWID_TYPE := (HEADER => WWIDHDR_TYPE_INIT, FCWWID => (others => 0)); type WWIDENT_TYPE is record UNIT_NO : INTEGER_32; DNP : INTEGER_32; WWIDLEN : UNSIGNED_LONGWORD; WWID : WWID_TYPE; end record; for WWIDENT_TYPE use record UNIT_NO at 0 range 0 .. 31; DNP at 4 range 0 .. 31; WWIDLEN at 8 range 0 .. 31; WWID at 12 range 0 .. 927; end record; for WWIDENT_TYPE'SIZE use 1024; WWIDENT_TYPE_INIT : constant WWIDENT_TYPE := (UNIT_NO => 0, DNP => 0, WWIDLEN => 0, WWID => WWID_TYPE_INIT); WWIDENT_K_LENGTH : constant := 128; WWIDTBL_K_MAX_ENTRIES : constant := 1000; -- Max. entries in a WWID Table -- -- This structure points to a Fibre Channel adapter ID. This WWID differs -- from the other WWIDs in this file in that it is obtained directly from -- the adapter rather than the SCSI Device Identification page. Consequently, -- there is no header, vendor, and product information associated with -- this 64 bit identifier. The format of this 64 bit WWID is an IEEE 48 bit -- address with additional information as defined in the FC-PH. But we -- don't really care about the FC-PH format since all we want to do is display -- the 64 bits using the asci hex format of XXXX-XXXX-XXXX-XXXX, which is the -- widely accepted format used to display this information. -- type FC_WWID_64B_TYPE is record NAME : UNSIGNED_BYTE_ARRAY (1 .. 8); end record; for FC_WWID_64B_TYPE use record NAME at 0 range 0 .. 63; end record; for FC_WWID_64B_TYPE'SIZE use 64; FC_WWID_64B_TYPE_INIT : constant FC_WWID_64B_TYPE := (NAME => (others => 0)); end WWIDDEF;