2 * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
\r
3 * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
\r
4 * Copyright (c) 2002-2006 Mellanox Technologies LTD. All rights reserved.
\r
5 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
\r
6 * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.
\r
8 * This software is available to you under the OpenIB.org BSD license
\r
11 * Redistribution and use in source and binary forms, with or
\r
12 * without modification, are permitted provided that the following
\r
13 * conditions are met:
\r
15 * - Redistributions of source code must retain the above
\r
16 * copyright notice, this list of conditions and the following
\r
19 * - Redistributions in binary form must reproduce the above
\r
20 * copyright notice, this list of conditions and the following
\r
21 * disclaimer in the documentation and/or other materials
\r
22 * provided with the distribution.
\r
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
37 #if !defined(__IB_TYPES_H__)
\r
38 #define __IB_TYPES_H__
\r
40 #include <complib/cl_types.h>
\r
41 #include <complib/cl_byteswap.h>
\r
44 #pragma warning( disable : 4201) //nameless union/structure
\r
47 #define IB_CONCAT(str1, str2) str1##str2
\r
49 #define TO_LONG_PTR(type,member_name) \
\r
50 union { type member_name; uint64_t IB_CONCAT(member_name,_padding); }
\r
56 #define AL_INLINE static inline
\r
58 #if defined( EXPORT_AL_SYMBOLS )
\r
59 #define AL_EXPORT __declspec(dllexport)
\r
61 #define AL_EXPORT __declspec(dllimport)
\r
63 #define AL_API __stdcall
\r
64 #define AL_INLINE AL_EXPORT inline
\r
65 #endif /* CL_KERNEL */
\r
71 #endif /* __cplusplus */
\r
74 /****h* IBA Base/Constants
\r
79 * The following constants are used throughout the IBA code base.
\r
81 * Definitions are from the InfiniBand Architecture Specification v1.2
\r
85 /****d* IBA Base: Constants/MAD_BLOCK_SIZE
\r
90 * Size of a non-RMPP MAD datagram.
\r
94 #define MAD_BLOCK_SIZE 256
\r
97 /****d* IBA Base: Constants/MAD_RMPP_HDR_SIZE
\r
102 * Size of an RMPP header, including the common MAD header.
\r
106 #define MAD_RMPP_HDR_SIZE 36
\r
109 /****d* IBA Base: Constants/MAD_RMPP_DATA_SIZE
\r
111 * MAD_RMPP_DATA_SIZE
\r
114 * Size of an RMPP transaction data section.
\r
118 #define MAD_RMPP_DATA_SIZE (MAD_BLOCK_SIZE - MAD_RMPP_HDR_SIZE)
\r
121 /****d* IBA Base: Constants/MAD_BLOCK_GRH_SIZE
\r
123 * MAD_BLOCK_GRH_SIZE
\r
126 * Size of a MAD datagram, including the GRH.
\r
130 #define MAD_BLOCK_GRH_SIZE 296
\r
133 /****d* IBA Base: Constants/IB_LID_PERMISSIVE
\r
135 * IB_LID_PERMISSIVE
\r
142 #define IB_LID_PERMISSIVE 0xFFFF
\r
145 /****d* IBA Base: Constants/IB_DEFAULT_PKEY
\r
150 * P_Key value for the default partition.
\r
154 #define IB_DEFAULT_PKEY 0xFFFF
\r
157 /****d* IBA Base: Constants/IB_QP1_WELL_KNOWN_Q_KEY
\r
159 * IB_QP1_WELL_KNOWN_Q_KEY
\r
162 * Well-known Q_Key for QP1 privileged mode access (15.4.2).
\r
166 #define IB_QP1_WELL_KNOWN_Q_KEY CL_NTOH32(0x80010000)
\r
170 #define IB_QP1 CL_NTOH32(1)
\r
172 #define IB_QP_PRIVILEGED_Q_KEY CL_NTOH32(0x80000000)
\r
174 /****d* IBA Base: Constants/IB_LID_UCAST_START
\r
176 * IB_LID_UCAST_START
\r
179 * Lowest valid unicast LID value.
\r
183 #define IB_LID_UCAST_START_HO 0x0001
\r
184 #define IB_LID_UCAST_START (CL_HTON16(IB_LID_UCAST_START_HO))
\r
187 /****d* IBA Base: Constants/IB_LID_UCAST_END
\r
192 * Highest valid unicast LID value.
\r
196 #define IB_LID_UCAST_END_HO 0xBFFF
\r
197 #define IB_LID_UCAST_END (CL_HTON16(IB_LID_UCAST_END_HO))
\r
200 /****d* IBA Base: Constants/IB_LID_MCAST_START
\r
202 * IB_LID_MCAST_START
\r
205 * Lowest valid multicast LID value.
\r
209 #define IB_LID_MCAST_START_HO 0xC000
\r
210 #define IB_LID_MCAST_START (CL_HTON16(IB_LID_MCAST_START_HO))
\r
213 /****d* IBA Base: Constants/IB_LID_MCAST_END
\r
218 * Highest valid multicast LID value.
\r
222 #define IB_LID_MCAST_END_HO 0xFFFE
\r
223 #define IB_LID_MCAST_END (CL_HTON16(IB_LID_MCAST_END_HO))
\r
226 /****d* IBA Base: Constants/IB_DEFAULT_SUBNET_PREFIX
\r
228 * IB_DEFAULT_SUBNET_PREFIX
\r
231 * Default subnet GID prefix.
\r
235 #define IB_DEFAULT_SUBNET_PREFIX (CL_HTON64(0xFE80000000000000ULL))
\r
238 /****d* IBA Base: Constants/IB_NODE_NUM_PORTS_MAX
\r
240 * IB_NODE_NUM_PORTS_MAX
\r
243 * Maximum number of ports in a single node (14.2.5.7).
\r
246 #define IB_NODE_NUM_PORTS_MAX 0xFE
\r
249 /****d* IBA Base: Constants/IB_INVALID_PORT_NUM
\r
251 * IB_INVALID_PORT_NUM
\r
254 * Value used to indicate an invalid port number (14.2.5.10).
\r
258 #define IB_INVALID_PORT_NUM 0xFF
\r
261 /****d* IBA Base: Constants/IB_SUBNET_PATH_HOPS_MAX
\r
263 * IB_SUBNET_PATH_HOPS_MAX
\r
266 * Maximum number of directed route switch hops in a subnet (14.2.1.2).
\r
270 #define IB_SUBNET_PATH_HOPS_MAX 64
\r
273 /****d* IBA Base: Constants/IB_PKEY_MAX_BLOCKS
\r
275 * IB_PKEY_MAX_BLOCKS
\r
278 * Maximum number of PKEY blocks (14.2.5.7).
\r
282 #define IB_PKEY_MAX_BLOCKS 2048
\r
285 /****d* IBA Base: Constants/IB_MCAST_MAX_BLOCK_ID
\r
287 * IB_MCAST_MAX_BLOCK_ID
\r
290 * Maximum number of Multicast port mask blocks
\r
294 #define IB_MCAST_MAX_BLOCK_ID 511
\r
297 /****d* IBA Base: Constants/IB_MCAST_BLOCK_ID_MASK_HO
\r
299 * IB_MCAST_BLOCK_ID_MASK_HO
\r
302 * Mask (host order) to recover the Multicast block ID.
\r
306 #define IB_MCAST_BLOCK_ID_MASK_HO 0x000001FF
\r
309 /****d* IBA Base: Constants/IB_MCAST_BLOCK_SIZE
\r
311 * IB_MCAST_BLOCK_SIZE
\r
314 * Number of port mask entries in a multicast forwarding table block.
\r
318 #define IB_MCAST_BLOCK_SIZE 32
\r
321 /****d* IBA Base: Constants/IB_MCAST_MASK_SIZE
\r
323 * IB_MCAST_MASK_SIZE
\r
326 * Number of port mask bits in each entry in the multicast forwarding table.
\r
330 #define IB_MCAST_MASK_SIZE 16
\r
333 /****d* IBA Base: Constants/IB_MCAST_POSITION_MASK_HO
\r
335 * IB_MCAST_POSITION_MASK_HO
\r
338 * Mask (host order) to recover the multicast block position.
\r
342 #define IB_MCAST_POSITION_MASK_HO 0xF0000000
\r
345 /****d* IBA Base: Constants/IB_MCAST_POSITION_MAX
\r
347 * IB_MCAST_POSITION_MAX
\r
350 * Maximum value for the multicast block position.
\r
354 #define IB_MCAST_POSITION_MAX 0xF
\r
357 /****d* IBA Base: Constants/IB_MCAST_POSITION_SHIFT
\r
359 * IB_MCAST_POSITION_SHIFT
\r
362 * Shift value to normalize the multicast block position value.
\r
366 #define IB_MCAST_POSITION_SHIFT 28
\r
369 /****d* IBA Base: Constants/IB_PKEY_ENTRIES_MAX
\r
371 * IB_PKEY_ENTRIES_MAX
\r
374 * Maximum number of PKEY entries per port (14.2.5.7).
\r
378 #define IB_PKEY_ENTRIES_MAX (IB_PKEY_MAX_BLOCKS * IB_PKEY_BLOCK_SIZE)
\r
381 /****d* IBA Base: Constants/IB_PKEY_BASE_MASK
\r
383 * IB_PKEY_BASE_MASK
\r
386 * Masks for the base P_Key value given a P_Key Entry.
\r
390 #define IB_PKEY_BASE_MASK (CL_HTON16(0x7FFF))
\r
393 /****d* IBA Base: Constants/IB_PKEY_TYPE_MASK
\r
395 * IB_PKEY_TYPE_MASK
\r
398 * Masks for the P_Key membership type given a P_Key Entry.
\r
402 #define IB_PKEY_TYPE_MASK (CL_NTOH16(0x8000))
\r
405 /****d* IBA Base: Constants/IB_DEFAULT_PARTIAL_PKEY
\r
407 * IB_DEFAULT_PARTIAL_PKEY
\r
410 * 0x7FFF in network order
\r
414 #define IB_DEFAULT_PARTIAL_PKEY (CL_HTON16(0x7FFF))
\r
417 /****d* IBA Base: Constants/IB_MCLASS_SUBN_LID
\r
419 * IB_MCLASS_SUBN_LID
\r
422 * Subnet Management Class, Subnet Manager LID routed (13.4.4)
\r
426 #define IB_MCLASS_SUBN_LID 0x01
\r
429 /****d* IBA Base: Constants/IB_MCLASS_SUBN_DIR
\r
431 * IB_MCLASS_SUBN_DIR
\r
434 * Subnet Management Class, Subnet Manager directed route (13.4.4)
\r
438 #define IB_MCLASS_SUBN_DIR 0x81
\r
441 /****d* IBA Base: Constants/IB_MCLASS_SUBN_ADM
\r
443 * IB_MCLASS_SUBN_ADM
\r
446 * Subnet Management Class, Subnet Administration (13.4.4)
\r
450 #define IB_MCLASS_SUBN_ADM 0x03
\r
453 /****d* IBA Base: Constants/IB_MCLASS_PERF
\r
458 * Subnet Management Class, Performance Manager (13.4.4)
\r
462 #define IB_MCLASS_PERF 0x04
\r
465 /****d* IBA Base: Constants/IB_MCLASS_BM
\r
470 * Subnet Management Class, Baseboard Manager (13.4.4)
\r
474 #define IB_MCLASS_BM 0x05
\r
477 /****d* IBA Base: Constants/IB_MCLASS_DEV_MGMT
\r
479 * IB_MCLASS_DEV_MGMT
\r
482 * Subnet Management Class, Device Management (13.4.4)
\r
486 #define IB_MCLASS_DEV_MGMT 0x06
\r
489 /****d* IBA Base: Constants/IB_MCLASS_COMM_MGMT
\r
491 * IB_MCLASS_COMM_MGMT
\r
494 * Subnet Management Class, Communication Management (13.4.4)
\r
498 #define IB_MCLASS_COMM_MGMT 0x07
\r
501 /****d* IBA Base: Constants/IB_MCLASS_SNMP
\r
506 * Subnet Management Class, SNMP Tunneling (13.4.4)
\r
510 #define IB_MCLASS_SNMP 0x08
\r
513 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_LOW_RANGE_MIN
\r
515 * IB_MCLASS_VENDOR_LOW_RANGE_MIN
\r
518 * Subnet Management Class, Vendor Specific Low Range Start
\r
522 #define IB_MCLASS_VENDOR_LOW_RANGE_MIN 0x09
\r
525 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_LOW_RANGE_MAX
\r
527 * IB_MCLASS_VENDOR_LOW_RANGE_MAX
\r
530 * Subnet Management Class, Vendor Specific Low Range End
\r
534 #define IB_MCLASS_VENDOR_LOW_RANGE_MAX 0x0f
\r
537 #define IB_MLX_VENDOR_CLASS1 0x9
\r
538 #define IB_MLX_VENDOR_CLASS2 0xA
\r
540 /****d* IBA Base: Constants/IB_MCLASS_DEV_ADM
\r
542 * IB_MCLASS_DEV_ADM
\r
545 * Subnet Management Class, Device Administration
\r
549 #define IB_MCLASS_DEV_ADM 0x10
\r
552 /****d* IBA Base: Constants/IB_MCLASS_BIS
\r
557 * Subnet Management Class, BIS
\r
561 #define IB_MCLASS_BIS 0x12
\r
564 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_HIGH_RANGE_MIN
\r
566 * IB_MCLASS_VENDOR_HIGH_RANGE_MIN
\r
569 * Subnet Management Class, Vendor Specific High Range Start
\r
573 #define IB_MCLASS_VENDOR_HIGH_RANGE_MIN 0x30
\r
576 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_HIGH_RANGE_MAX
\r
578 * IB_MCLASS_VENDOR_HIGH_RANGE_MAX
\r
581 * Subnet Management Class, Vendor Specific High Range End
\r
585 #define IB_MCLASS_VENDOR_HIGH_RANGE_MAX 0x4f
\r
588 /****f* IBA Base: Types/ib_class_is_vendor_specific_low
\r
590 * ib_class_is_vendor_specific_low
\r
593 * Indicates if the Class Code if a vendor specific class from
\r
598 static inline boolean_t
\r
599 ib_class_is_vendor_specific_low(
\r
600 IN const uint8_t class_code )
\r
602 return( (class_code >= IB_MCLASS_VENDOR_LOW_RANGE_MIN) &&
\r
603 (class_code <= IB_MCLASS_VENDOR_LOW_RANGE_MAX));
\r
608 * [in] The Management Datagram Class Code
\r
611 * TRUE if the class is in the Low range of Vendor Specific MADs
\r
617 * IB_MCLASS_VENDOR_LOW_RANGE_MIN, IB_MCLASS_VENDOR_LOW_RANGE_MAX
\r
620 /****f* IBA Base: Types/ib_class_is_vendor_specific_high
\r
622 * ib_class_is_vendor_specific_high
\r
625 * Indicates if the Class Code if a vendor specific class from
\r
630 static inline boolean_t
\r
631 ib_class_is_vendor_specific_high(
\r
632 IN const uint8_t class_code )
\r
634 return( (class_code >= IB_MCLASS_VENDOR_HIGH_RANGE_MIN) &&
\r
635 (class_code <= IB_MCLASS_VENDOR_HIGH_RANGE_MAX));
\r
640 * [in] The Management Datagram Class Code
\r
643 * TRUE if the class is in the High range of Vendor Specific MADs
\r
649 * IB_MCLASS_VENDOR_HIGH_RANGE_MIN, IB_MCLASS_VENDOR_HIGH_RANGE_MAX
\r
653 /****f* IBA Base: Types/ib_class_is_vendor_specific
\r
655 * ib_class_is_vendor_specific
\r
658 * Indicates if the Class Code if a vendor specific class
\r
662 static inline boolean_t
\r
663 ib_class_is_vendor_specific(
\r
664 IN const uint8_t class_code )
\r
666 return( ib_class_is_vendor_specific_low(class_code) ||
\r
667 ib_class_is_vendor_specific_high(class_code) );
\r
672 * [in] The Management Datagram Class Code
\r
675 * TRUE if the class is a Vendor Specific MAD
\r
681 * ib_class_is_vendor_specific_low, ib_class_is_vendor_specific_high
\r
684 /****f* IBA Base: Types/ib_class_is_rmpp
\r
689 * Indicates if the Class Code supports RMPP
\r
693 AL_INLINE boolean_t AL_API
\r
695 IN const uint8_t class_code )
\r
697 return( (class_code == IB_MCLASS_SUBN_ADM) ||
\r
698 (class_code == IB_MCLASS_DEV_MGMT) ||
\r
699 (class_code == IB_MCLASS_DEV_ADM) ||
\r
700 (class_code == IB_MCLASS_BIS) ||
\r
701 ib_class_is_vendor_specific_high( class_code ) );
\r
706 * [in] The Management Datagram Class Code
\r
709 * TRUE if the class supports RMPP
\r
720 /****d* IBA Base: Constants/IB_MAX_METHOD
\r
725 * Total number of methods available to a class, not including the R-bit.
\r
729 #define IB_MAX_METHODS 128
\r
732 /****d* IBA Base: Constants/IB_MAD_METHOD_RESP_MASK
\r
734 * IB_MAD_METHOD_RESP_MASK
\r
737 * Response mask to extract 'R' bit from the method field. (13.4.5)
\r
741 #define IB_MAD_METHOD_RESP_MASK 0x80
\r
744 /****d* IBA Base: Constants/IB_MAD_METHOD_GET
\r
746 * IB_MAD_METHOD_GET
\r
749 * Get() Method (13.4.5)
\r
753 #define IB_MAD_METHOD_GET 0x01
\r
756 /****d* IBA Base: Constants/IB_MAD_METHOD_SET
\r
758 * IB_MAD_METHOD_SET
\r
761 * Set() Method (13.4.5)
\r
765 #define IB_MAD_METHOD_SET 0x02
\r
768 /****d* IBA Base: Constants/IB_MAD_METHOD_GET_RESP
\r
770 * IB_MAD_METHOD_GET_RESP
\r
773 * GetResp() Method (13.4.5)
\r
777 #define IB_MAD_METHOD_GET_RESP 0x81
\r
780 #define IB_MAD_METHOD_DELETE 0x15
\r
782 /****d* IBA Base: Constants/IB_MAD_METHOD_GETTABLE
\r
784 * IB_MAD_METHOD_GETTABLE
\r
787 * SubnAdmGetTable() Method (15.2.2)
\r
791 #define IB_MAD_METHOD_GETTABLE 0x12
\r
794 /****d* IBA Base: Constants/IB_MAD_METHOD_GETTABLE_RESP
\r
796 * IB_MAD_METHOD_GETTABLE_RESP
\r
799 * SubnAdmGetTableResp() Method (15.2.2)
\r
803 #define IB_MAD_METHOD_GETTABLE_RESP 0x92
\r
807 #define IB_MAD_METHOD_GETTRACETABLE 0x13
\r
808 #define IB_MAD_METHOD_GETMULTI 0x14
\r
809 #define IB_MAD_METHOD_GETMULTI_RESP 0x94
\r
812 /****d* IBA Base: Constants/IB_MAD_METHOD_SEND
\r
814 * IB_MAD_METHOD_SEND
\r
817 * Send() Method (13.4.5)
\r
821 #define IB_MAD_METHOD_SEND 0x03
\r
824 /****d* IBA Base: Constants/IB_MAD_METHOD_TRAP
\r
826 * IB_MAD_METHOD_TRAP
\r
829 * Trap() Method (13.4.5)
\r
833 #define IB_MAD_METHOD_TRAP 0x05
\r
836 /****d* IBA Base: Constants/IB_MAD_METHOD_REPORT
\r
838 * IB_MAD_METHOD_REPORT
\r
841 * Report() Method (13.4.5)
\r
845 #define IB_MAD_METHOD_REPORT 0x06
\r
848 /****d* IBA Base: Constants/IB_MAD_METHOD_REPORT_RESP
\r
850 * IB_MAD_METHOD_REPORT_RESP
\r
853 * ReportResp() Method (13.4.5)
\r
857 #define IB_MAD_METHOD_REPORT_RESP 0x86
\r
860 /****d* IBA Base: Constants/IB_MAD_METHOD_TRAP_REPRESS
\r
862 * IB_MAD_METHOD_TRAP_REPRESS
\r
865 * TrapRepress() Method (13.4.5)
\r
869 #define IB_MAD_METHOD_TRAP_REPRESS 0x07
\r
872 /****d* IBA Base: Constants/IB_MAD_STATUS_BUSY
\r
874 * IB_MAD_STATUS_BUSY
\r
877 * Temporarily busy, MAD discarded (13.4.7)
\r
881 #define IB_MAD_STATUS_BUSY (CL_HTON16(0x0001))
\r
884 /****d* IBA Base: Constants/IB_MAD_STATUS_REDIRECT
\r
886 * IB_MAD_STATUS_REDIRECT
\r
889 * QP Redirection required (13.4.7)
\r
893 #define IB_MAD_STATUS_REDIRECT (CL_HTON16(0x0002))
\r
896 /****d* IBA Base: Constants/IB_MAD_STATUS_UNSUP_CLASS_VER
\r
898 * IB_MAD_STATUS_UNSUP_CLASS_VER
\r
901 * Unsupported class version (13.4.7)
\r
905 #define IB_MAD_STATUS_UNSUP_CLASS_VER (CL_HTON16(0x0004))
\r
908 /****d* IBA Base: Constants/IB_MAD_STATUS_UNSUP_METHOD
\r
910 * IB_MAD_STATUS_UNSUP_METHOD
\r
913 * Unsupported method (13.4.7)
\r
917 #define IB_MAD_STATUS_UNSUP_METHOD (CL_HTON16(0x0008))
\r
920 /****d* IBA Base: Constants/IB_MAD_STATUS_UNSUP_METHOD_ATTR
\r
922 * IB_MAD_STATUS_UNSUP_METHOD_ATTR
\r
925 * Unsupported method/attribute combination (13.4.7)
\r
929 #define IB_MAD_STATUS_UNSUP_METHOD_ATTR (CL_HTON16(0x000C))
\r
932 /****d* IBA Base: Constants/IB_MAD_STATUS_INVALID_FIELD
\r
934 * IB_MAD_STATUS_INVALID_FIELD
\r
937 * Attribute contains one or more invalid fields (13.4.7)
\r
941 #define IB_MAD_STATUS_INVALID_FIELD (CL_HTON16(0x001C))
\r
944 #define IB_MAD_STATUS_CLASS_MASK (CL_HTON16(0xFF00))
\r
946 #define IB_SA_MAD_STATUS_SUCCESS (CL_HTON16(0x0000))
\r
947 #define IB_SA_MAD_STATUS_NO_RESOURCES (CL_HTON16(0x0100))
\r
948 #define IB_SA_MAD_STATUS_REQ_INVALID (CL_HTON16(0x0200))
\r
949 #define IB_SA_MAD_STATUS_NO_RECORDS (CL_HTON16(0x0300))
\r
950 #define IB_SA_MAD_STATUS_TOO_MANY_RECORDS (CL_HTON16(0x0400))
\r
951 #define IB_SA_MAD_STATUS_INVALID_GID (CL_HTON16(0x0500))
\r
952 #define IB_SA_MAD_STATUS_INSUF_COMPS (CL_HTON16(0x0600))
\r
954 #define IB_DM_MAD_STATUS_NO_IOC_RESP (CL_HTON16(0x0100))
\r
955 #define IB_DM_MAD_STATUS_NO_SVC_ENTRIES (CL_HTON16(0x0200))
\r
956 #define IB_DM_MAD_STATUS_IOC_FAILURE (CL_HTON16(0x8000))
\r
958 /****d* IBA Base: Constants/IB_MAD_ATTR_CLASS_PORT_INFO
\r
960 * IB_MAD_ATTR_CLASS_PORT_INFO
\r
963 * ClassPortInfo attribute (13.4.8)
\r
967 #define IB_MAD_ATTR_CLASS_PORT_INFO (CL_NTOH16(0x0001))
\r
970 /****d* IBA Base: Constants/IB_MAD_ATTR_NOTICE
\r
972 * IB_MAD_ATTR_NOTICE
\r
975 * Notice attribute (13.4.8)
\r
979 #define IB_MAD_ATTR_NOTICE (CL_NTOH16(0x0002))
\r
982 /****d* IBA Base: Constants/IB_MAD_ATTR_INFORM_INFO
\r
984 * IB_MAD_ATTR_INFORM_INFO
\r
987 * InformInfo attribute (13.4.8)
\r
991 #define IB_MAD_ATTR_INFORM_INFO (CL_NTOH16(0x0003))
\r
994 /****d* IBA Base: Constants/IB_MAD_ATTR_NODE_DESC
\r
996 * IB_MAD_ATTR_NODE_DESC
\r
999 * NodeDescription attribute (14.2.5)
\r
1003 #define IB_MAD_ATTR_NODE_DESC (CL_NTOH16(0x0010))
\r
1005 /****d* IBA Base: Constants/IB_MAD_ATTR_PORT_SMPL_CTRL
\r
1007 * IB_MAD_ATTR_PORT_SMPL_CTRL
\r
1010 * NodeDescription attribute (16.1.2)
\r
1014 #define IB_MAD_ATTR_PORT_SMPL_CTRL (CL_NTOH16(0x0010))
\r
1017 /****d* IBA Base: Constants/IB_MAD_ATTR_NODE_INFO
\r
1019 * IB_MAD_ATTR_NODE_INFO
\r
1022 * NodeInfo attribute (14.2.5)
\r
1026 #define IB_MAD_ATTR_NODE_INFO (CL_NTOH16(0x0011))
\r
1029 /****d* IBA Base: Constants/IB_MAD_ATTR_PORT_SMPL_RSLT
\r
1031 * IB_MAD_ATTR_PORT_SMPL_RSLT
\r
1034 * NodeInfo attribute (16.1.2)
\r
1038 #define IB_MAD_ATTR_PORT_SMPL_RSLT (CL_NTOH16(0x0011))
\r
1041 /****d* IBA Base: Constants/IB_MAD_ATTR_SWITCH_INFO
\r
1043 * IB_MAD_ATTR_SWITCH_INFO
\r
1046 * SwitchInfo attribute (14.2.5)
\r
1050 #define IB_MAD_ATTR_SWITCH_INFO (CL_NTOH16(0x0012))
\r
1053 /****d* IBA Base: Constants/IB_MAD_ATTR_PORT_CNTRS
\r
1055 * IB_MAD_ATTR_PORT_CNTRS
\r
1058 * SwitchInfo attribute (16.1.2)
\r
1062 #define IB_MAD_ATTR_PORT_CNTRS (CL_NTOH16(0x0012))
\r
1065 /****d* IBA Base: Constants/IB_MAD_ATTR_GUID_INFO
\r
1067 * IB_MAD_ATTR_GUID_INFO
\r
1070 * GUIDInfo attribute (14.2.5)
\r
1074 #define IB_MAD_ATTR_GUID_INFO (CL_NTOH16(0x0014))
\r
1077 /****d* IBA Base: Constants/IB_MAD_ATTR_PORT_INFO
\r
1079 * IB_MAD_ATTR_PORT_INFO
\r
1082 * PortInfo attribute (14.2.5)
\r
1086 #define IB_MAD_ATTR_PORT_INFO (CL_NTOH16(0x0015))
\r
1089 /****d* IBA Base: Constants/IB_MAD_ATTR_P_KEY_TABLE
\r
1091 * IB_MAD_ATTR_P_KEY_TABLE
\r
1094 * PartitionTable attribute (14.2.5)
\r
1098 #define IB_MAD_ATTR_P_KEY_TABLE (CL_NTOH16(0x0016))
\r
1101 /****d* IBA Base: Constants/IB_MAD_ATTR_SLVL_TABLE
\r
1103 * IB_MAD_ATTR_SLVL_TABLE
\r
1106 * SL VL Mapping Table attribute (14.2.5)
\r
1110 #define IB_MAD_ATTR_SLVL_TABLE (CL_NTOH16(0x0017))
\r
1113 /****d* IBA Base: Constants/IB_MAD_ATTR_VL_ARBITRATION
\r
1115 * IB_MAD_ATTR_VL_ARBITRATION
\r
1118 * VL Arbitration Table attribute (14.2.5)
\r
1122 #define IB_MAD_ATTR_VL_ARBITRATION (CL_NTOH16(0x0018))
\r
1125 /****d* IBA Base: Constants/IB_MAD_ATTR_LIN_FWD_TBL
\r
1127 * IB_MAD_ATTR_LIN_FWD_TBL
\r
1130 * Switch linear forwarding table
\r
1134 #define IB_MAD_ATTR_LIN_FWD_TBL (CL_NTOH16(0x0019))
\r
1137 /****d* IBA Base: Constants/IB_MAD_ATTR_RND_FWD_TBL
\r
1139 * IB_MAD_ATTR_RND_FWD_TBL
\r
1142 * Switch random forwarding table
\r
1146 #define IB_MAD_ATTR_RND_FWD_TBL (CL_NTOH16(0x001A))
\r
1149 /****d* IBA Base: Constants/IB_MAD_ATTR_MCAST_FWD_TBL
\r
1151 * IB_MAD_ATTR_MCAST_FWD_TBL
\r
1154 * Switch multicast forwarding table
\r
1158 #define IB_MAD_ATTR_MCAST_FWD_TBL (CL_NTOH16(0x001B))
\r
1161 /****d* IBA Base: Constants/IB_MAD_ATTR_NODE_RECORD
\r
1163 * IB_MAD_ATTR_NODE_RECORD
\r
1166 * NodeRecord attribute (15.2.5)
\r
1170 #define IB_MAD_ATTR_NODE_RECORD (CL_NTOH16(0x0011))
\r
1173 /****d* IBA Base: Constants/IB_MAD_ATTR_PORTINFO_RECORD
\r
1175 * IB_MAD_ATTR_PORTINFO_RECORD
\r
1178 * PortInfoRecord attribute (15.2.5)
\r
1182 #define IB_MAD_ATTR_PORTINFO_RECORD (CL_NTOH16(0x0012))
\r
1185 /****d* IBA Base: Constants/IB_MAD_ATTR_SWITCH_INFO_RECORD
\r
1187 * IB_MAD_ATTR_SWITCH_INFO_RECORD
\r
1190 * SwitchInfoRecord attribute (15.2.5)
\r
1194 #define IB_MAD_ATTR_SWITCH_INFO_RECORD (CL_NTOH16(0x0014))
\r
1197 /****d* IBA Base: Constants/IB_MAD_ATTR_LINK_RECORD
\r
1199 * IB_MAD_ATTR_LINK_RECORD
\r
1202 * LinkRecord attribute (15.2.5)
\r
1206 #define IB_MAD_ATTR_LINK_RECORD (CL_NTOH16(0x0020))
\r
1209 /****d* IBA Base: Constants/IB_MAD_ATTR_SM_INFO
\r
1211 * IB_MAD_ATTR_SM_INFO
\r
1214 * SMInfo attribute (14.2.5)
\r
1218 #define IB_MAD_ATTR_SM_INFO (CL_NTOH16(0x0020))
\r
1221 /****d* IBA Base: Constants/IB_MAD_ATTR_SMINFO_RECORD
\r
1223 * IB_MAD_ATTR_SMINFO_RECORD
\r
1226 * SMInfoRecord attribute (15.2.5)
\r
1230 #define IB_MAD_ATTR_SMINFO_RECORD (CL_NTOH16(0x0018))
\r
1233 /****d* IBA Base: Constants/IB_MAD_ATTR_GUIDINFO_RECORD
\r
1235 * IB_MAD_ATTR_GUIDINFO_RECORD
\r
1238 * GuidInfoRecord attribute (15.2.5)
\r
1242 #define IB_MAD_ATTR_GUIDINFO_RECORD (CL_NTOH16(0x0030))
\r
1245 /****d* IBA Base: Constants/IB_MAD_ATTR_VENDOR_DIAG
\r
1247 * IB_MAD_ATTR_VENDOR_DIAG
\r
1250 * VendorDiag attribute (14.2.5)
\r
1254 #define IB_MAD_ATTR_VENDOR_DIAG (CL_NTOH16(0x0030))
\r
1257 /****d* IBA Base: Constants/IB_MAD_ATTR_LED_INFO
\r
1259 * IB_MAD_ATTR_LED_INFO
\r
1262 * LedInfo attribute (14.2.5)
\r
1266 #define IB_MAD_ATTR_LED_INFO (CL_NTOH16(0x0031))
\r
1269 /****d* IBA Base: Constants/IB_MAD_ATTR_SERVICE_RECORD
\r
1271 * IB_MAD_ATTR_SERVICE_RECORD
\r
1274 * ServiceRecord attribute (15.2.5)
\r
1278 #define IB_MAD_ATTR_SERVICE_RECORD (CL_NTOH16(0x0031))
\r
1281 /****d* IBA Base: Constants/IB_MAD_ATTR_LFT_RECORD
\r
1283 * IB_MAD_ATTR_LFT_RECORD
\r
1286 * LinearForwardingTableRecord attribute (15.2.5.6)
\r
1290 #define IB_MAD_ATTR_LFT_RECORD (CL_NTOH16(0x0015))
\r
1293 /****d* IBA Base: Constants/IB_MAD_ATTR_MFT_RECORD
\r
1295 * IB_MAD_ATTR_MFT_RECORD
\r
1298 * MulticastForwardingTableRecord attribute (15.2.5.8)
\r
1302 #define IB_MAD_ATTR_MFT_RECORD (CL_NTOH16(0x0017))
\r
1305 /****d* IBA Base: Constants/IB_MAD_ATTR_PKEYTBL_RECORD
\r
1307 * IB_MAD_ATTR_PKEYTBL_RECORD
\r
1310 * PKEY Table Record attribute (15.2.5)
\r
1314 #define IB_MAD_ATTR_PKEY_TBL_RECORD (CL_NTOH16(0x0033))
\r
1317 /****d* IBA Base: Constants/IB_MAD_ATTR_PATH_RECORD
\r
1319 * IB_MAD_ATTR_PATH_RECORD
\r
1322 * PathRecord attribute (15.2.5)
\r
1326 #define IB_MAD_ATTR_PATH_RECORD (CL_NTOH16(0x0035))
\r
1329 /****d* IBA Base: Constants/IB_MAD_ATTR_VLARB_RECORD
\r
1331 * IB_MAD_ATTR_VLARB_RECORD
\r
1334 * VL Arbitration Table Record attribute (15.2.5)
\r
1338 #define IB_MAD_ATTR_VLARB_RECORD (CL_NTOH16(0x0036))
\r
1341 /****d* IBA Base: Constants/IB_MAD_ATTR_SLVL_RECORD
\r
1343 * IB_MAD_ATTR_SLVL_RECORD
\r
1346 * SLtoVL Mapping Table Record attribute (15.2.5)
\r
1350 #define IB_MAD_ATTR_SLVL_RECORD (CL_NTOH16(0x0013))
\r
1353 /****d* IBA Base: Constants/IB_MAD_ATTR_MCMEMBER_RECORD
\r
1355 * IB_MAD_ATTR_MCMEMBER_RECORD
\r
1358 * MCMemberRecord attribute (15.2.5)
\r
1362 #define IB_MAD_ATTR_MCMEMBER_RECORD (CL_NTOH16(0x0038))
\r
1365 /****d* IBA Base: Constants/IB_MAD_ATTR_TRACE_RECORD
\r
1367 * IB_MAD_ATTR_TRACE_RECORD
\r
1370 * TraceRecord attribute (15.2.5)
\r
1374 #define IB_MAD_ATTR_TRACE_RECORD (CL_NTOH16(0x0039))
\r
1377 /****d* IBA Base: Constants/IB_MAD_ATTR_MULTIPATH_RECORD
\r
1379 * IB_MAD_ATTR_MULTIPATH_RECORD
\r
1382 * MultiPathRecord attribute (15.2.5)
\r
1386 #define IB_MAD_ATTR_MULTIPATH_RECORD (CL_NTOH16(0x003A))
\r
1389 /****d* IBA Base: Constants/IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
\r
1391 * IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
\r
1394 * Service Association Record attribute (15.2.5)
\r
1398 #define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD (CL_NTOH16(0x003B))
\r
1401 /****d* IBA Base: Constants/IB_MAD_ATTR_INFORM_INFO_RECORD
\r
1403 * IB_MAD_ATTR_INFORM_INFO_RECORD
\r
1406 * InformInfo Record attribute (15.2.5)
\r
1410 #define IB_MAD_ATTR_INFORM_INFO_RECORD (CL_NTOH16(0x00F3))
\r
1412 /****d* IBA Base: Constants/IB_MAD_ATTR_IO_UNIT_INFO
\r
1414 * IB_MAD_ATTR_IO_UNIT_INFO
\r
1417 * IOUnitInfo attribute (16.3.3)
\r
1421 #define IB_MAD_ATTR_IO_UNIT_INFO (CL_NTOH16(0x0010))
\r
1424 /****d* IBA Base: Constants/IB_MAD_ATTR_IO_CONTROLLER_PROFILE
\r
1426 * IB_MAD_ATTR_IO_CONTROLLER_PROFILE
\r
1429 * IOControllerProfile attribute (16.3.3)
\r
1433 #define IB_MAD_ATTR_IO_CONTROLLER_PROFILE (CL_NTOH16(0x0011))
\r
1436 /****d* IBA Base: Constants/IB_MAD_ATTR_SERVICE_ENTRIES
\r
1438 * IB_MAD_ATTR_SERVICE_ENTRIES
\r
1441 * ServiceEntries attribute (16.3.3)
\r
1445 #define IB_MAD_ATTR_SERVICE_ENTRIES (CL_NTOH16(0x0012))
\r
1448 /****d* IBA Base: Constants/IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT
\r
1450 * IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT
\r
1453 * DiagnosticTimeout attribute (16.3.3)
\r
1457 #define IB_MAD_ATTR_DIAGNOSTIC_TIMEOUT (CL_NTOH16(0x0020))
\r
1460 /****d* IBA Base: Constants/IB_MAD_ATTR_PREPARE_TO_TEST
\r
1462 * IB_MAD_ATTR_PREPARE_TO_TEST
\r
1465 * PrepareToTest attribute (16.3.3)
\r
1469 #define IB_MAD_ATTR_PREPARE_TO_TEST (CL_NTOH16(0x0021))
\r
1472 /****d* IBA Base: Constants/IB_MAD_ATTR_TEST_DEVICE_ONCE
\r
1474 * IB_MAD_ATTR_TEST_DEVICE_ONCE
\r
1477 * TestDeviceOnce attribute (16.3.3)
\r
1481 #define IB_MAD_ATTR_TEST_DEVICE_ONCE (CL_NTOH16(0x0022))
\r
1484 /****d* IBA Base: Constants/IB_MAD_ATTR_TEST_DEVICE_LOOP
\r
1486 * IB_MAD_ATTR_TEST_DEVICE_LOOP
\r
1489 * TestDeviceLoop attribute (16.3.3)
\r
1493 #define IB_MAD_ATTR_TEST_DEVICE_LOOP (CL_NTOH16(0x0023))
\r
1496 /****d* IBA Base: Constants/IB_MAD_ATTR_DIAG_CODE
\r
1498 * IB_MAD_ATTR_DIAG_CODE
\r
1501 * DiagCode attribute (16.3.3)
\r
1505 #define IB_MAD_ATTR_DIAG_CODE (CL_NTOH16(0x0024))
\r
1508 /****d* IBA Base: Constants/IB_NODE_TYPE_CA
\r
1513 * Encoded generic node type used in MAD attributes (13.4.8.2)
\r
1517 #define IB_NODE_TYPE_CA 0x01
\r
1520 /****d* IBA Base: Constants/IB_NODE_TYPE_SWITCH
\r
1522 * IB_NODE_TYPE_SWITCH
\r
1525 * Encoded generic node type used in MAD attributes (13.4.8.2)
\r
1529 #define IB_NODE_TYPE_SWITCH 0x02
\r
1532 /****d* IBA Base: Constants/IB_NODE_TYPE_ROUTER
\r
1534 * IB_NODE_TYPE_ROUTER
\r
1537 * Encoded generic node type used in MAD attributes (13.4.8.2)
\r
1541 #define IB_NODE_TYPE_ROUTER 0x03
\r
1544 /****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_CA
\r
1546 * IB_NOTICE_NODE_TYPE_CA
\r
1549 * Encoded generic node type used in MAD attributes (13.4.8.2)
\r
1553 #define IB_NOTICE_NODE_TYPE_CA (CL_NTOH32(0x000001))
\r
1556 /****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_SWITCH
\r
1558 * IB_NOTICE_NODE_TYPE_SWITCH
\r
1561 * Encoded generic node type used in MAD attributes (13.4.8.2)
\r
1565 #define IB_NOTICE_NODE_TYPE_SWITCH (CL_NTOH32(0x000002))
\r
1568 /****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_ROUTER
\r
1570 * IB_NOTICE_NODE_TYPE_ROUTER
\r
1573 * Encoded generic node type used in MAD attributes (13.4.8.2)
\r
1577 #define IB_NOTICE_NODE_TYPE_ROUTER (CL_NTOH32(0x000003))
\r
1580 /****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_SUBN_MGMT
\r
1582 * IB_NOTICE_NODE_TYPE_SUBN_MGMT
\r
1585 * Encoded generic node type used in MAD attributes (13.4.8.2).
\r
1586 * Note that this value is not defined for the NodeType field
\r
1587 * of the NodeInfo attribute (14.2.5.3).
\r
1591 #define IB_NOTICE_NODE_TYPE_SUBN_MGMT (CL_NTOH32(0x000004))
\r
1594 /****d* IBA Base: Constants/IB_MTU_LEN_TYPE
\r
1599 * Encoded path MTU.
\r
1605 * others: reserved
\r
1609 #define IB_MTU_LEN_256 1
\r
1610 #define IB_MTU_LEN_512 2
\r
1611 #define IB_MTU_LEN_1024 3
\r
1612 #define IB_MTU_LEN_2048 4
\r
1613 #define IB_MTU_LEN_4096 5
\r
1615 #define IB_MIN_MTU IB_MTU_LEN_256
\r
1616 #define IB_MAX_MTU IB_MTU_LEN_4096
\r
1620 /****d* IBA Base: Constants/IB_PATH_SELECTOR_TYPE
\r
1622 * IB_PATH_SELECTOR_TYPE
\r
1626 * 0: greater than specified
\r
1627 * 1: less than specified
\r
1628 * 2: exactly the specified
\r
1629 * 3: largest available
\r
1633 #define IB_PATH_SELECTOR_GREATER_THAN 0
\r
1634 #define IB_PATH_SELECTOR_LESS_THAN 1
\r
1635 #define IB_PATH_SELECTOR_EXACTLY 2
\r
1636 #define IB_PATH_SELECTOR_LARGEST 3
\r
1639 /****d* IBA Base: Constants/IB_SMINFO_STATE_NOTACTIVE
\r
1641 * IB_SMINFO_STATE_NOTACTIVE
\r
1644 * Encoded state value used in the SMInfo attribute.
\r
1648 #define IB_SMINFO_STATE_NOTACTIVE 0
\r
1651 /****d* IBA Base: Constants/IB_SMINFO_STATE_DISCOVERING
\r
1653 * IB_SMINFO_STATE_DISCOVERING
\r
1656 * Encoded state value used in the SMInfo attribute.
\r
1660 #define IB_SMINFO_STATE_DISCOVERING 1
\r
1663 /****d* IBA Base: Constants/IB_SMINFO_STATE_STANDBY
\r
1665 * IB_SMINFO_STATE_STANDBY
\r
1668 * Encoded state value used in the SMInfo attribute.
\r
1672 #define IB_SMINFO_STATE_STANDBY 2
\r
1675 /****d* IBA Base: Constants/IB_SMINFO_STATE_MASTER
\r
1677 * IB_SMINFO_STATE_MASTER
\r
1680 * Encoded state value used in the SMInfo attribute.
\r
1684 #define IB_SMINFO_STATE_MASTER 3
\r
1687 /****d* IBA Base: Constants/IB_PATH_REC_SL_MASK
\r
1689 * IB_PATH_REC_SL_MASK
\r
1692 * Mask for the sl field for path record
\r
1696 #define IB_PATH_REC_SL_MASK 0x000F
\r
1698 /****d* IBA Base: Constants/IB_PATH_REC_QOS_CLASS_MASK
\r
1700 * IB_PATH_REC_QOS_CLASS_MASK
\r
1703 * Mask for the QoS class field for path record
\r
1707 #define IB_PATH_REC_QOS_CLASS_MASK 0xFFF0
\r
1709 /****d* IBA Base: Constants/IB_PATH_REC_SELECTOR_MASK
\r
1711 * IB_PATH_REC_SELECTOR_MASK
\r
1714 * Mask for the selector field for path record MTU, rate,
\r
1715 * and packet lifetime.
\r
1719 #define IB_PATH_REC_SELECTOR_MASK 0xC0
\r
1721 /****d* IBA Base: Constants/IB_MULTIPATH_REC_SELECTOR_MASK
\r
1723 * IB_MULTIPATH_REC_SELECTOR_MASK
\r
1726 * Mask for the selector field for multipath record MTU, rate,
\r
1727 * and packet lifetime.
\r
1731 #define IB_MULTIPATH_REC_SELECTOR_MASK 0xC0
\r
1734 /****d* IBA Base: Constants/IB_PATH_REC_BASE_MASK
\r
1736 * IB_PATH_REC_BASE_MASK
\r
1739 * Mask for the base value field for path record MTU, rate,
\r
1740 * and packet lifetime.
\r
1744 #define IB_PATH_REC_BASE_MASK 0x3F
\r
1747 /****d* IBA Base: Constants/IB_MULTIPATH_REC_BASE_MASK
\r
1749 * IB_MULTIPATH_REC_BASE_MASK
\r
1752 * Mask for the base value field for multipath record MTU, rate,
\r
1753 * and packet lifetime.
\r
1757 #define IB_MULTIPATH_REC_BASE_MASK 0x3F
\r
1760 /****h* IBA Base/Type Definitions
\r
1762 * Type Definitions
\r
1765 * Definitions are from the InfiniBand Architecture Specification v1.2
\r
1769 /****d* IBA Base: Types/ib_net16_t
\r
1774 * Defines the network ordered type for 16-bit values.
\r
1778 typedef uint16_t ib_net16_t;
\r
1781 /****d* IBA Base: Types/ib_net32_t
\r
1786 * Defines the network ordered type for 32-bit values.
\r
1790 typedef uint32_t ib_net32_t;
\r
1793 /****d* IBA Base: Types/ib_net64_t
\r
1798 * Defines the network ordered type for 64-bit values.
\r
1802 typedef uint64_t ib_net64_t;
\r
1805 /****d* IBA Base: Types/ib_gid_prefix_t
\r
1813 typedef ib_net64_t ib_gid_prefix_t;
\r
1816 /****d* IBA Base: Constants/ib_link_states_t
\r
1818 * ib_link_states_t
\r
1821 * Defines the link states of a port.
\r
1825 #define IB_LINK_NO_CHANGE 0
\r
1826 #define IB_LINK_DOWN 1
\r
1827 #define IB_LINK_INIT 2
\r
1828 #define IB_LINK_ARMED 3
\r
1829 #define IB_LINK_ACTIVE 4
\r
1830 #define IB_LINK_ACT_DEFER 5
\r
1833 static const char* const __ib_node_type_str[] =
\r
1836 "Channel Adapter",
\r
1839 "Subnet Management"
\r
1842 /****f* IBA Base: Types/ib_get_node_type_str
\r
1844 * ib_get_node_type_str
\r
1847 * Returns a string for the specified node type.
\r
1851 AL_INLINE const char* AL_API
\r
1852 ib_get_node_type_str(
\r
1853 IN uint8_t node_type )
\r
1855 if( node_type >= IB_NODE_TYPE_ROUTER )
\r
1857 return( __ib_node_type_str[node_type] );
\r
1862 * [in] Encoded node type as returned in the NodeInfo attribute.
\r
1865 * Pointer to the node type string.
\r
1873 static const char* const __ib_port_state_str[] =
\r
1875 "No State Change (NOP)",
\r
1884 /****f* IBA Base: Types/ib_get_port_state_str
\r
1886 * ib_get_port_state_str
\r
1889 * Returns a string for the specified port state.
\r
1893 AL_INLINE const char* AL_API
\r
1894 ib_get_port_state_str(
\r
1895 IN uint8_t port_state )
\r
1897 if( port_state > IB_LINK_ACTIVE )
\r
1898 port_state = IB_LINK_ACTIVE + 1;
\r
1899 return( __ib_port_state_str[port_state] );
\r
1904 * [in] Encoded port state as returned in the PortInfo attribute.
\r
1907 * Pointer to the port state string.
\r
1915 /****f* IBA Base: Types/ib_get_port_state_from_str
\r
1917 * ib_get_port_state_from_str
\r
1920 * Returns a string for the specified port state.
\r
1924 AL_INLINE const uint8_t AL_API
\r
1925 ib_get_port_state_from_str(
\r
1926 IN char* p_port_state_str )
\r
1928 if( !strncmp(p_port_state_str,"No State Change (NOP)",12) )
\r
1930 else if( !strncmp(p_port_state_str, "DOWN",4) )
\r
1932 else if( !strncmp(p_port_state_str, "INIT", 4) )
\r
1934 else if( !strncmp(p_port_state_str,"ARMED", 5) )
\r
1936 else if( !strncmp(p_port_state_str, "ACTIVE", 6) )
\r
1938 else if( !strncmp(p_port_state_str, "ACTDEFER", 8) )
\r
1944 * p_port_state_str
\r
1945 * [in] A string matching one returned by ib_get_port_state_str
\r
1948 * The appropriate code.
\r
1956 /****d* IBA Base: Constants/Join States
\r
1961 * Defines the join state flags for multicast group management.
\r
1965 #define IB_JOIN_STATE_FULL 1
\r
1966 #define IB_JOIN_STATE_NON 2
\r
1967 #define IB_JOIN_STATE_SEND_ONLY 4
\r
1970 /****f* IBA Base: Types/ib_pkey_get_base
\r
1972 * ib_pkey_get_base
\r
1975 * Returns the base P_Key value with the membership bit stripped.
\r
1979 AL_INLINE ib_net16_t AL_API
\r
1981 IN const ib_net16_t pkey )
\r
1983 return( (ib_net16_t)(pkey & IB_PKEY_BASE_MASK) );
\r
1988 * [in] P_Key value
\r
1991 * Returns the base P_Key value with the membership bit stripped.
\r
1998 /****f* IBA Base: Types/ib_pkey_is_full_member
\r
2000 * ib_pkey_is_full_member
\r
2003 * Indicates if the port is a full member of the parition.
\r
2007 AL_INLINE boolean_t AL_API
\r
2008 ib_pkey_is_full_member(
\r
2009 IN const ib_net16_t pkey )
\r
2011 return( (pkey & IB_PKEY_TYPE_MASK) == IB_PKEY_TYPE_MASK );
\r
2016 * [in] P_Key value
\r
2019 * TRUE if the port is a full member of the partition.
\r
2020 * FALSE otherwise.
\r
2025 * ib_pkey_get_base, ib_net16_t
\r
2028 /****f* IBA Base: Types/ib_pkey_is_invalid
\r
2030 * ib_pkey_is_invalid
\r
2033 * Returns TRUE if the given P_Key is an invalid P_Key
\r
2034 * C10-116: the CI shall regard a P_Key as invalid if its low-order
\r
2035 * 15 bits are all zero...
\r
2039 static inline boolean_t
\r
2040 ib_pkey_is_invalid(
\r
2041 IN const ib_net16_t pkey )
\r
2043 if (ib_pkey_get_base(pkey) == 0x0000)
\r
2051 * [in] P_Key value
\r
2054 * Returns the base P_Key value with the membership bit stripped.
\r
2061 /****d* IBA Base: Types/ib_gid_t
\r
2069 #include <complib/cl_packon.h>
\r
2070 typedef union _ib_gid
\r
2073 struct _ib_gid_unicast
\r
2075 ib_gid_prefix_t prefix;
\r
2076 ib_net64_t interface_id;
\r
2078 } PACK_SUFFIX unicast;
\r
2080 struct _ib_gid_multicast
\r
2082 uint8_t header[2];
\r
2083 uint8_t raw_group_id[14];
\r
2085 } PACK_SUFFIX multicast;
\r
2087 } PACK_SUFFIX ib_gid_t;
\r
2088 #include <complib/cl_packoff.h>
\r
2092 * GID represented as an unformated byte array.
\r
2095 * Typical unicast representation with subnet prefix and
\r
2099 * Representation for multicast use.
\r
2104 /****f* IBA Base: Types/ib_gid_is_multicast
\r
2106 * ib_gid_is_multicast
\r
2109 * Returns a boolean indicating whether a GID is a multicast GID.
\r
2113 AL_INLINE boolean_t AL_API
\r
2114 ib_gid_is_multicast(
\r
2115 IN const ib_gid_t* p_gid )
\r
2117 return( p_gid->raw[0] == 0xFF );
\r
2120 /****f* IBA Base: Types/ib_gid_get_scope
\r
2122 * ib_gid_get_scope
\r
2125 * Returns scope of (assumed) multicast GID.
\r
2129 AL_INLINE uint8_t AL_API
\r
2130 ib_mgid_get_scope(
\r
2131 IN const ib_gid_t* p_gid )
\r
2133 return( p_gid->raw[1] & 0x0F );
\r
2136 /****f* IBA Base: Types/ib_gid_set_scope
\r
2138 * ib_gid_set_scope
\r
2141 * Sets scope of (assumed) multicast GID.
\r
2145 AL_INLINE void AL_API
\r
2146 ib_mgid_set_scope(
\r
2147 IN ib_gid_t* const p_gid,
\r
2148 IN const uint8_t scope )
\r
2150 p_gid->raw[1] &= 0xF0;
\r
2151 p_gid->raw[1] |= scope & 0x0F;
\r
2154 /****f* IBA Base: Types/ib_gid_set_default
\r
2156 * ib_gid_set_default
\r
2159 * Sets a GID to the default value.
\r
2163 AL_INLINE void AL_API
\r
2164 ib_gid_set_default(
\r
2165 IN ib_gid_t* const p_gid,
\r
2166 IN const ib_net64_t interface_id )
\r
2168 p_gid->unicast.prefix = IB_DEFAULT_SUBNET_PREFIX;
\r
2169 p_gid->unicast.interface_id = interface_id;
\r
2174 * [in] Pointer to the GID object.
\r
2177 * [in] Manufacturer assigned EUI64 value of a port.
\r
2188 /****f* IBA Base: Types/ib_gid_get_subnet_prefix
\r
2190 * ib_gid_get_subnet_prefix
\r
2193 * Gets the subnet prefix from a GID.
\r
2197 AL_INLINE ib_net64_t AL_API
\r
2198 ib_gid_get_subnet_prefix(
\r
2199 IN const ib_gid_t* const p_gid )
\r
2201 return( p_gid->unicast.prefix );
\r
2206 * [in] Pointer to the GID object.
\r
2209 * 64-bit subnet prefix value.
\r
2217 /****f* IBA Base: Types/ib_gid_is_link_local
\r
2219 * ib_gid_is_link_local
\r
2222 * Returns TRUE if the unicast GID scoping indicates link local,
\r
2223 * FALSE otherwise.
\r
2227 static inline boolean_t
\r
2228 ib_gid_is_link_local(
\r
2229 IN const ib_gid_t* const p_gid )
\r
2231 return( ib_gid_get_subnet_prefix( p_gid ) == IB_DEFAULT_SUBNET_PREFIX );
\r
2236 * [in] Pointer to the GID object.
\r
2239 * Returns TRUE if the unicast GID scoping indicates link local,
\r
2240 * FALSE otherwise.
\r
2248 /****f* IBA Base: Types/ib_gid_is_site_local
\r
2250 * ib_gid_is_site_local
\r
2253 * Returns TRUE if the unicast GID scoping indicates site local,
\r
2254 * FALSE otherwise.
\r
2258 static inline boolean_t
\r
2259 ib_gid_is_site_local(
\r
2260 IN const ib_gid_t* const p_gid )
\r
2262 return( ( ib_gid_get_subnet_prefix( p_gid ) &
\r
2263 CL_HTON64( 0xFFFFFFFFFFFF0000ULL ) ) == CL_HTON64( 0xFEC0000000000000ULL ) );
\r
2268 * [in] Pointer to the GID object.
\r
2271 * Returns TRUE if the unicast GID scoping indicates site local,
\r
2272 * FALSE otherwise.
\r
2280 /****f* IBA Base: Types/ib_gid_get_guid
\r
2285 * Gets the guid from a GID.
\r
2289 AL_INLINE ib_net64_t AL_API
\r
2291 IN const ib_gid_t* const p_gid )
\r
2293 return( p_gid->unicast.interface_id );
\r
2298 * [in] Pointer to the GID object.
\r
2301 * 64-bit GUID value.
\r
2309 /****s* IBA Base: Types/ib_field32_t
\r
2314 * Represents a 32-bit field, and allows access as a 32-bit network byte
\r
2315 * ordered or a 4-byte array.
\r
2319 #include <complib/cl_packon.h>
\r
2320 typedef union _ib_field32_t
\r
2325 } PACK_SUFFIX ib_field32_t;
\r
2326 #include <complib/cl_packoff.h>
\r
2330 * Full field value.
\r
2333 * Byte array representing the field. The byte array provides identical
\r
2334 * access independently from CPU byte-ordering.
\r
2337 /****s* IBA Base: Types/ib_path_rec_t
\r
2342 * Path records encapsulate the properties of a given
\r
2343 * route between two end-points on a subnet.
\r
2347 #include <complib/cl_packon.h>
\r
2348 typedef __declspec(align(8)) struct _ib_path_rec
\r
2350 ib_net64_t service_id;
\r
2355 ib_net32_t hop_flow_raw;
\r
2359 ib_net16_t qos_class_sl;
\r
2363 uint8_t preference;
\r
2367 } PACK_SUFFIX ib_path_rec_t;
\r
2368 #include <complib/cl_packoff.h>
\r
2375 * GID of destination port.
\r
2378 * GID of source port.
\r
2381 * LID of destination port.
\r
2384 * LID of source port.
\r
2387 * Global routing parameters: hop count, flow label and raw bit.
\r
2390 * Another global routing parameter.
\r
2393 * Reversible path - 1 bit to say if path is reversible.
\r
2394 * num_path [6:0] In queries, maximum number of paths to return.
\r
2395 * In responses, undefined.
\r
2398 * Partition key (P_Key) to use on this path.
\r
2404 * Service level to use on this path.
\r
2407 * MTU and MTU selector fields to use on this path
\r
2410 * Rate and rate selector fields to use on this path.
\r
2416 * Indicates the relative merit of this path versus other path
\r
2417 * records returned from the SA. Lower numbers are better.
\r
2427 /* Path Record Component Masks */
\r
2428 #define IB_PR_COMPMASK_SERVICEID_MSB (CL_HTON64(((uint64_t)1)<<0))
\r
2429 #define IB_PR_COMPMASK_SERVICEID_LSB (CL_HTON64(((uint64_t)1)<<1))
\r
2430 #define IB_PR_COMPMASK_DGID (CL_HTON64(((uint64_t)1)<<2))
\r
2431 #define IB_PR_COMPMASK_SGID (CL_HTON64(((uint64_t)1)<<3))
\r
2432 #define IB_PR_COMPMASK_DLID (CL_HTON64(((uint64_t)1)<<4))
\r
2433 #define IB_PR_COMPMASK_SLID (CL_HTON64(((uint64_t)1)<<5))
\r
2434 #define IB_PR_COMPMASK_RAWTRAFFIC (CL_HTON64(((uint64_t)1)<<6))
\r
2435 #define IB_PR_COMPMASK_RESV0 (CL_HTON64(((uint64_t)1)<<7))
\r
2436 #define IB_PR_COMPMASK_FLOWLABEL (CL_HTON64(((uint64_t)1)<<8))
\r
2437 #define IB_PR_COMPMASK_HOPLIMIT (CL_HTON64(((uint64_t)1)<<9))
\r
2438 #define IB_PR_COMPMASK_TCLASS (CL_HTON64(((uint64_t)1)<<10))
\r
2439 #define IB_PR_COMPMASK_REVERSIBLE (CL_HTON64(((uint64_t)1)<<11))
\r
2440 #define IB_PR_COMPMASK_NUMBPATH (CL_HTON64(((uint64_t)1)<<12))
\r
2441 #define IB_PR_COMPMASK_PKEY (CL_HTON64(((uint64_t)1)<<13))
\r
2442 #define IB_PR_COMPMASK_QOS_CLASS (CL_HTON64(((uint64_t)1)<<14))
\r
2443 #define IB_PR_COMPMASK_SL (CL_HTON64(((uint64_t)1)<<15))
\r
2444 #define IB_PR_COMPMASK_MTUSELEC (CL_HTON64(((uint64_t)1)<<16))
\r
2445 #define IB_PR_COMPMASK_MTU (CL_HTON64(((uint64_t)1)<<17))
\r
2446 #define IB_PR_COMPMASK_RATESELEC (CL_HTON64(((uint64_t)1)<<18))
\r
2447 #define IB_PR_COMPMASK_RATE (CL_HTON64(((uint64_t)1)<<19))
\r
2448 #define IB_PR_COMPMASK_PKTLIFETIMESELEC (CL_HTON64(((uint64_t)1)<<20))
\r
2449 #define IB_PR_COMPMASK_PKTLIFETIME (CL_HTON64(((uint64_t)1)<<21))
\r
2451 /* Link Record Component Masks */
\r
2452 #define IB_LR_COMPMASK_FROM_LID (CL_HTON64(((uint64_t)1)<<0))
\r
2453 #define IB_LR_COMPMASK_FROM_PORT (CL_HTON64(((uint64_t)1)<<1))
\r
2454 #define IB_LR_COMPMASK_TO_PORT (CL_HTON64(((uint64_t)1)<<2))
\r
2455 #define IB_LR_COMPMASK_TO_LID (CL_HTON64(((uint64_t)1)<<3))
\r
2457 /* VL Arbitration Record Masks */
\r
2458 #define IB_VLA_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
\r
2459 #define IB_VLA_COMPMASK_OUT_PORT (CL_HTON64(((uint64_t)1)<<1))
\r
2460 #define IB_VLA_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<2))
\r
2462 /* SLtoVL Mapping Record Masks */
\r
2463 #define IB_SLVL_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
\r
2464 #define IB_SLVL_COMPMASK_IN_PORT (CL_HTON64(((uint64_t)1)<<1))
\r
2465 #define IB_SLVL_COMPMASK_OUT_PORT (CL_HTON64(((uint64_t)1)<<2))
\r
2467 /* P_Key Table Record Masks */
\r
2468 #define IB_PKEY_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
\r
2469 #define IB_PKEY_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<1))
\r
2470 #define IB_PKEY_COMPMASK_PORT (CL_HTON64(((uint64_t)1)<<2))
\r
2472 /* Switch Info Record Masks */
\r
2473 #define IB_SWIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
\r
2474 #define IB_SWIR_COMPMASK_RESERVED1 (CL_HTON64(((uint64_t)1)<<1))
\r
2476 /* LFT Record Masks */
\r
2477 #define IB_LFTR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
\r
2478 #define IB_LFTR_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<1))
\r
2480 /* MFT Record Masks */
\r
2481 #define IB_MFTR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
\r
2482 #define IB_MFTR_COMPMASK_POSITION (CL_HTON64(((uint64_t)1)<<1))
\r
2483 #define IB_MFTR_COMPMASK_RESERVED1 (CL_HTON64(((uint64_t)1)<<2))
\r
2484 #define IB_MFTR_COMPMASK_BLOCK (CL_HTON64(((uint64_t)1)<<3))
\r
2485 #define IB_MFTR_COMPMASK_RESERVED2 (CL_HTON64(((uint64_t)1)<<4))
\r
2487 /* NodeInfo Record Masks */
\r
2488 #define IB_NR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
\r
2489 #define IB_NR_COMPMASK_RESERVED1 (CL_HTON64(((uint64_t)1)<<1))
\r
2490 #define IB_NR_COMPMASK_BASEVERSION (CL_HTON64(((uint64_t)1)<<2))
\r
2491 #define IB_NR_COMPMASK_CLASSVERSION (CL_HTON64(((uint64_t)1)<<3))
\r
2492 #define IB_NR_COMPMASK_NODETYPE (CL_HTON64(((uint64_t)1)<<4))
\r
2493 #define IB_NR_COMPMASK_NUMPORTS (CL_HTON64(((uint64_t)1)<<5))
\r
2494 #define IB_NR_COMPMASK_SYSIMAGEGUID (CL_HTON64(((uint64_t)1)<<6))
\r
2495 #define IB_NR_COMPMASK_NODEGUID (CL_HTON64(((uint64_t)1)<<7))
\r
2496 #define IB_NR_COMPMASK_PORTGUID (CL_HTON64(((uint64_t)1)<<8))
\r
2497 #define IB_NR_COMPMASK_PARTCAP (CL_HTON64(((uint64_t)1)<<9))
\r
2498 #define IB_NR_COMPMASK_DEVID (CL_HTON64(((uint64_t)1)<<10))
\r
2499 #define IB_NR_COMPMASK_REV (CL_HTON64(((uint64_t)1)<<11))
\r
2500 #define IB_NR_COMPMASK_PORTNUM (CL_HTON64(((uint64_t)1)<<12))
\r
2501 #define IB_NR_COMPMASK_VENDID (CL_HTON64(((uint64_t)1)<<13))
\r
2502 #define IB_NR_COMPMASK_NODEDESC (CL_HTON64(((uint64_t)1)<<14))
\r
2504 /* Service Record Component Masks Sec 15.2.5.14 Ver 1.1*/
\r
2505 #define IB_SR_COMPMASK_SID (CL_HTON64(((uint64_t)1)<<0))
\r
2506 #define IB_SR_COMPMASK_SGID (CL_HTON64(((uint64_t)1)<<1))
\r
2507 #define IB_SR_COMPMASK_SPKEY (CL_HTON64(((uint64_t)1)<<2))
\r
2508 #define IB_SR_COMPMASK_RES1 (CL_HTON64(((uint64_t)1)<<3))
\r
2509 #define IB_SR_COMPMASK_SLEASE (CL_HTON64(((uint64_t)1)<<4))
\r
2510 #define IB_SR_COMPMASK_SKEY (CL_HTON64(((uint64_t)1)<<5))
\r
2511 #define IB_SR_COMPMASK_SNAME (CL_HTON64(((uint64_t)1)<<6))
\r
2512 #define IB_SR_COMPMASK_SDATA8_0 (CL_HTON64(((uint64_t)1)<<7))
\r
2513 #define IB_SR_COMPMASK_SDATA8_1 (CL_HTON64(((uint64_t)1)<<8))
\r
2514 #define IB_SR_COMPMASK_SDATA8_2 (CL_HTON64(((uint64_t)1)<<9))
\r
2515 #define IB_SR_COMPMASK_SDATA8_3 (CL_HTON64(((uint64_t)1)<<10))
\r
2516 #define IB_SR_COMPMASK_SDATA8_4 (CL_HTON64(((uint64_t)1)<<11))
\r
2517 #define IB_SR_COMPMASK_SDATA8_5 (CL_HTON64(((uint64_t)1)<<12))
\r
2518 #define IB_SR_COMPMASK_SDATA8_6 (CL_HTON64(((uint64_t)1)<<13))
\r
2519 #define IB_SR_COMPMASK_SDATA8_7 (CL_HTON64(((uint64_t)1)<<14))
\r
2520 #define IB_SR_COMPMASK_SDATA8_8 (CL_HTON64(((uint64_t)1)<<15))
\r
2521 #define IB_SR_COMPMASK_SDATA8_9 (CL_HTON64(((uint64_t)1)<<16))
\r
2522 #define IB_SR_COMPMASK_SDATA8_10 (CL_HTON64(((uint64_t)1)<<17))
\r
2523 #define IB_SR_COMPMASK_SDATA8_11 (CL_HTON64(((uint64_t)1)<<18))
\r
2524 #define IB_SR_COMPMASK_SDATA8_12 (CL_HTON64(((uint64_t)1)<<19))
\r
2525 #define IB_SR_COMPMASK_SDATA8_13 (CL_HTON64(((uint64_t)1)<<20))
\r
2526 #define IB_SR_COMPMASK_SDATA8_14 (CL_HTON64(((uint64_t)1)<<21))
\r
2527 #define IB_SR_COMPMASK_SDATA8_15 (CL_HTON64(((uint64_t)1)<<22))
\r
2528 #define IB_SR_COMPMASK_SDATA16_0 (CL_HTON64(((uint64_t)1)<<23))
\r
2529 #define IB_SR_COMPMASK_SDATA16_1 (CL_HTON64(((uint64_t)1)<<24))
\r
2530 #define IB_SR_COMPMASK_SDATA16_2 (CL_HTON64(((uint64_t)1)<<25))
\r
2531 #define IB_SR_COMPMASK_SDATA16_3 (CL_HTON64(((uint64_t)1)<<26))
\r
2532 #define IB_SR_COMPMASK_SDATA16_4 (CL_HTON64(((uint64_t)1)<<27))
\r
2533 #define IB_SR_COMPMASK_SDATA16_5 (CL_HTON64(((uint64_t)1)<<28))
\r
2534 #define IB_SR_COMPMASK_SDATA16_6 (CL_HTON64(((uint64_t)1)<<29))
\r
2535 #define IB_SR_COMPMASK_SDATA16_7 (CL_HTON64(((uint64_t)1)<<30))
\r
2536 #define IB_SR_COMPMASK_SDATA32_0 (CL_HTON64(((uint64_t)1)<<31))
\r
2537 #define IB_SR_COMPMASK_SDATA32_1 (CL_HTON64(((uint64_t)1)<<32))
\r
2538 #define IB_SR_COMPMASK_SDATA32_2 (CL_HTON64(((uint64_t)1)<<33))
\r
2539 #define IB_SR_COMPMASK_SDATA32_3 (CL_HTON64(((uint64_t)1)<<34))
\r
2540 #define IB_SR_COMPMASK_SDATA64_0 (CL_HTON64(((uint64_t)1)<<35))
\r
2541 #define IB_SR_COMPMASK_SDATA64_1 (CL_HTON64(((uint64_t)1)<<36))
\r
2543 /* Port Info Record Component Masks */
\r
2544 #define IB_PIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
\r
2545 #define IB_PIR_COMPMASK_PORTNUM (CL_HTON64(((uint64_t)1)<<1))
\r
2546 #define IB_PIR_COMPMASK_RESV1 (CL_HTON64(((uint64_t)1)<<2))
\r
2547 #define IB_PIR_COMPMASK_MKEY (CL_HTON64(((uint64_t)1)<<3))
\r
2548 #define IB_PIR_COMPMASK_GIDPRE (CL_HTON64(((uint64_t)1)<<4))
\r
2549 #define IB_PIR_COMPMASK_BASELID (CL_HTON64(((uint64_t)1)<<5))
\r
2550 #define IB_PIR_COMPMASK_SMLID (CL_HTON64(((uint64_t)1)<<6))
\r
2551 #define IB_PIR_COMPMASK_CAPMASK (CL_HTON64(((uint64_t)1)<<7))
\r
2552 #define IB_PIR_COMPMASK_DIAGCODE (CL_HTON64(((uint64_t)1)<<8))
\r
2553 #define IB_PIR_COMPMASK_MKEYLEASEPRD (CL_HTON64(((uint64_t)1)<<9))
\r
2554 #define IB_PIR_COMPMASK_LOCALPORTNUM (CL_HTON64(((uint64_t)1)<<10))
\r
2555 #define IB_PIR_COMPMASK_LINKWIDTHENABLED (CL_HTON64(((uint64_t)1)<<11))
\r
2556 #define IB_PIR_COMPMASK_LNKWIDTHSUPPORT (CL_HTON64(((uint64_t)1)<<12))
\r
2557 #define IB_PIR_COMPMASK_LNKWIDTHACTIVE (CL_HTON64(((uint64_t)1)<<13))
\r
2558 #define IB_PIR_COMPMASK_LNKSPEEDSUPPORT (CL_HTON64(((uint64_t)1)<<14))
\r
2559 #define IB_PIR_COMPMASK_PORTSTATE (CL_HTON64(((uint64_t)1)<<15))
\r
2560 #define IB_PIR_COMPMASK_PORTPHYSTATE (CL_HTON64(((uint64_t)1)<<16))
\r
2561 #define IB_PIR_COMPMASK_LINKDWNDFLTSTATE (CL_HTON64(((uint64_t)1)<<17))
\r
2562 #define IB_PIR_COMPMASK_MKEYPROTBITS (CL_HTON64(((uint64_t)1)<<18))
\r
2563 #define IB_PIR_COMPMASK_RESV2 (CL_HTON64(((uint64_t)1)<<19))
\r
2564 #define IB_PIR_COMPMASK_LMC (CL_HTON64(((uint64_t)1)<<20))
\r
2565 #define IB_PIR_COMPMASK_LINKSPEEDACTIVE (CL_HTON64(((uint64_t)1)<<21))
\r
2566 #define IB_PIR_COMPMASK_LINKSPEEDENABLE (CL_HTON64(((uint64_t)1)<<22))
\r
2567 #define IB_PIR_COMPMASK_NEIGHBORMTU (CL_HTON64(((uint64_t)1)<<23))
\r
2568 #define IB_PIR_COMPMASK_MASTERSMSL (CL_HTON64(((uint64_t)1)<<24))
\r
2569 #define IB_PIR_COMPMASK_VLCAP (CL_HTON64(((uint64_t)1)<<25))
\r
2570 #define IB_PIR_COMPMASK_INITTYPE (CL_HTON64(((uint64_t)1)<<26))
\r
2571 #define IB_PIR_COMPMASK_VLHIGHLIMIT (CL_HTON64(((uint64_t)1)<<27))
\r
2572 #define IB_PIR_COMPMASK_VLARBHIGHCAP (CL_HTON64(((uint64_t)1)<<28))
\r
2573 #define IB_PIR_COMPMASK_VLARBLOWCAP (CL_HTON64(((uint64_t)1)<<29))
\r
2574 #define IB_PIR_COMPMASK_INITTYPEREPLY (CL_HTON64(((uint64_t)1)<<30))
\r
2575 #define IB_PIR_COMPMASK_MTUCAP (CL_HTON64(((uint64_t)1)<<31))
\r
2576 #define IB_PIR_COMPMASK_VLSTALLCNT (CL_HTON64(((uint64_t)1)<<32))
\r
2577 #define IB_PIR_COMPMASK_HOQLIFE (CL_HTON64(((uint64_t)1)<<33))
\r
2578 #define IB_PIR_COMPMASK_OPVLS (CL_HTON64(((uint64_t)1)<<34))
\r
2579 #define IB_PIR_COMPMASK_PARENFIN (CL_HTON64(((uint64_t)1)<<35))
\r
2580 #define IB_PIR_COMPMASK_PARENFOUT (CL_HTON64(((uint64_t)1)<<36))
\r
2581 #define IB_PIR_COMPMASK_FILTERRAWIN (CL_HTON64(((uint64_t)1)<<37))
\r
2582 #define IB_PIR_COMPMASK_FILTERRAWOUT (CL_HTON64(((uint64_t)1)<<38))
\r
2583 #define IB_PIR_COMPMASK_MKEYVIO (CL_HTON64(((uint64_t)1)<<39))
\r
2584 #define IB_PIR_COMPMASK_PKEYVIO (CL_HTON64(((uint64_t)1)<<40))
\r
2585 #define IB_PIR_COMPMASK_QKEYVIO (CL_HTON64(((uint64_t)1)<<41))
\r
2586 #define IB_PIR_COMPMASK_GUIDCAP (CL_HTON64(((uint64_t)1)<<42))
\r
2587 #define IB_PIR_COMPMASK_RESV3 (CL_HTON64(((uint64_t)1)<<43))
\r
2588 #define IB_PIR_COMPMASK_SUBNTO (CL_HTON64(((uint64_t)1)<<44))
\r
2589 #define IB_PIR_COMPMASK_RESV4 (CL_HTON64(((uint64_t)1)<<45))
\r
2590 #define IB_PIR_COMPMASK_RESPTIME (CL_HTON64(((uint64_t)1)<<46))
\r
2591 #define IB_PIR_COMPMASK_LOCALPHYERR (CL_HTON64(((uint64_t)1)<<47))
\r
2592 #define IB_PIR_COMPMASK_OVERRUNERR (CL_HTON64(((uint64_t)1)<<48))
\r
2594 /* Multicast Member Record Component Masks */
\r
2595 #define IB_MCR_COMPMASK_GID (CL_HTON64(((uint64_t)1)<<0))
\r
2596 #define IB_MCR_COMPMASK_MGID (CL_HTON64(((uint64_t)1)<<0))
\r
2597 #define IB_MCR_COMPMASK_PORT_GID (CL_HTON64(((uint64_t)1)<<1))
\r
2598 #define IB_MCR_COMPMASK_QKEY (CL_HTON64(((uint64_t)1)<<2))
\r
2599 #define IB_MCR_COMPMASK_MLID (CL_HTON64(((uint64_t)1)<<3))
\r
2600 #define IB_MCR_COMPMASK_MTU_SEL (CL_HTON64(((uint64_t)1)<<4))
\r
2601 #define IB_MCR_COMPMASK_MTU (CL_HTON64(((uint64_t)1)<<5))
\r
2602 #define IB_MCR_COMPMASK_TCLASS (CL_HTON64(((uint64_t)1)<<6))
\r
2603 #define IB_MCR_COMPMASK_PKEY (CL_HTON64(((uint64_t)1)<<7))
\r
2604 #define IB_MCR_COMPMASK_RATE_SEL (CL_HTON64(((uint64_t)1)<<8))
\r
2605 #define IB_MCR_COMPMASK_RATE (CL_HTON64(((uint64_t)1)<<9))
\r
2606 #define IB_MCR_COMPMASK_LIFE_SEL (CL_HTON64(((uint64_t)1)<<10))
\r
2607 #define IB_MCR_COMPMASK_LIFE (CL_HTON64(((uint64_t)1)<<11))
\r
2608 #define IB_MCR_COMPMASK_SL (CL_HTON64(((uint64_t)1)<<12))
\r
2609 #define IB_MCR_COMPMASK_FLOW (CL_HTON64(((uint64_t)1)<<13))
\r
2610 #define IB_MCR_COMPMASK_HOP (CL_HTON64(((uint64_t)1)<<14))
\r
2611 #define IB_MCR_COMPMASK_SCOPE (CL_HTON64(((uint64_t)1)<<15))
\r
2612 #define IB_MCR_COMPMASK_JOIN_STATE (CL_HTON64(((uint64_t)1)<<16))
\r
2613 #define IB_MCR_COMPMASK_PROXY (CL_HTON64(((uint64_t)1)<<17))
\r
2615 /* GUID Info Record Component Masks */
\r
2616 #define IB_GIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
\r
2617 #define IB_GIR_COMPMASK_BLOCKNUM (CL_HTON64(((uint64_t)1)<<1))
\r
2618 #define IB_GIR_COMPMASK_RESV1 (CL_HTON64(((uint64_t)1)<<2))
\r
2619 #define IB_GIR_COMPMASK_RESV2 (CL_HTON64(((uint64_t)1)<<3))
\r
2620 #define IB_GIR_COMPMASK_GID0 (CL_HTON64(((uint64_t)1)<<4))
\r
2621 #define IB_GIR_COMPMASK_GID1 (CL_HTON64(((uint64_t)1)<<5))
\r
2622 #define IB_GIR_COMPMASK_GID2 (CL_HTON64(((uint64_t)1)<<6))
\r
2623 #define IB_GIR_COMPMASK_GID3 (CL_HTON64(((uint64_t)1)<<7))
\r
2624 #define IB_GIR_COMPMASK_GID4 (CL_HTON64(((uint64_t)1)<<8))
\r
2625 #define IB_GIR_COMPMASK_GID5 (CL_HTON64(((uint64_t)1)<<9))
\r
2626 #define IB_GIR_COMPMASK_GID6 (CL_HTON64(((uint64_t)1)<<10))
\r
2627 #define IB_GIR_COMPMASK_GID7 (CL_HTON64(((uint64_t)1)<<11))
\r
2629 /* MultiPath Record Component Masks */
\r
2630 #define IB_MPR_COMPMASK_RAWTRAFFIC (CL_HTON64(((uint64_t)1)<<0))
\r
2631 #define IB_MPR_COMPMASK_RESV0 (CL_HTON64(((uint64_t)1)<<1))
\r
2632 #define IB_MPR_COMPMASK_FLOWLABEL (CL_HTON64(((uint64_t)1)<<2))
\r
2633 #define IB_MPR_COMPMASK_HOPLIMIT (CL_HTON64(((uint64_t)1)<<3))
\r
2634 #define IB_MPR_COMPMASK_TCLASS (CL_HTON64(((uint64_t)1)<<4))
\r
2635 #define IB_MPR_COMPMASK_REVERSIBLE (CL_HTON64(((uint64_t)1)<<5))
\r
2636 #define IB_MPR_COMPMASK_NUMBPATH (CL_HTON64(((uint64_t)1)<<6))
\r
2637 #define IB_MPR_COMPMASK_PKEY (CL_HTON64(((uint64_t)1)<<7))
\r
2638 #define IB_MPR_COMPMASK_QOS_CLASS (CL_HTON64(((uint64_t)1)<<8))
\r
2639 #define IB_MPR_COMPMASK_SL (CL_HTON64(((uint64_t)1)<<9))
\r
2640 #define IB_MPR_COMPMASK_MTUSELEC (CL_HTON64(((uint64_t)1)<<10))
\r
2641 #define IB_MPR_COMPMASK_MTU (CL_HTON64(((uint64_t)1)<<11))
\r
2642 #define IB_MPR_COMPMASK_RATESELEC (CL_HTON64(((uint64_t)1)<<12))
\r
2643 #define IB_MPR_COMPMASK_RATE (CL_HTON64(((uint64_t)1)<<13))
\r
2644 #define IB_MPR_COMPMASK_PKTLIFETIMESELEC (CL_HTON64(((uint64_t)1)<<14))
\r
2645 #define IB_MPR_COMPMASK_PKTLIFETIME (CL_HTON64(((uint64_t)1)<<15))
\r
2646 #define IB_MPR_COMPMASK_RESV2 (CL_HTON64(((uint64_t)1)<<16))
\r
2647 #define IB_MPR_COMPMASK_INDEPSELEC (CL_HTON64(((uint64_t)1)<<17))
\r
2648 #define IB_MPR_COMPMASK_RESV3 (CL_HTON64(((uint64_t)1)<<18))
\r
2649 #define IB_MPR_COMPMASK_SGIDCOUNT (CL_HTON64(((uint64_t)1)<<19))
\r
2650 #define IB_MPR_COMPMASK_DGIDCOUNT (CL_HTON64(((uint64_t)1)<<20))
\r
2651 #define IB_MPR_COMPMASK_RESV4 (CL_HTON64(((uint64_t)1)<<21))
\r
2653 /* SMInfo Record Component Masks */
\r
2654 #define IB_SMIR_COMPMASK_LID (CL_HTON64(((uint64_t)1)<<0))
\r
2655 #define IB_SMIR_COMPMASK_RESV0 (CL_HTON64(((uint64_t)1)<<1))
\r
2656 #define IB_SMIR_COMPMASK_GUID (CL_HTON64(((uint64_t)1)<<2))
\r
2657 #define IB_SMIR_COMPMASK_SMKEY (CL_HTON64(((uint64_t)1)<<3))
\r
2658 #define IB_SMIR_COMPMASK_ACTCOUNT (CL_HTON64(((uint64_t)1)<<4))
\r
2659 #define IB_SMIR_COMPMASK_PRIORITY (CL_HTON64(((uint64_t)1)<<5))
\r
2660 #define IB_SMIR_COMPMASK_SMSTATE (CL_HTON64(((uint64_t)1)<<6))
\r
2662 /* InformInfo Record Component Masks */
\r
2663 #define IB_IIR_COMPMASK_SUBSCRIBERGID (CL_HTON64(((uint64_t)1)<<0))
\r
2664 #define IB_IIR_COMPMASK_ENUM (CL_HTON64(((uint64_t)1)<<1))
\r
2665 #define IB_IIR_COMPMASK_RESV0 (CL_HTON64(((uint64_t)1)<<2))
\r
2666 #define IB_IIR_COMPMASK_GID (CL_HTON64(((uint64_t)1)<<3))
\r
2667 #define IB_IIR_COMPMASK_LIDRANGEBEGIN (CL_HTON64(((uint64_t)1)<<4))
\r
2668 #define IB_IIR_COMPMASK_LIDRANGEEND (CL_HTON64(((uint64_t)1)<<5))
\r
2669 #define IB_IIR_COMPMASK_RESV1 (CL_HTON64(((uint64_t)1)<<6))
\r
2670 #define IB_IIR_COMPMASK_ISGENERIC (CL_HTON64(((uint64_t)1)<<7))
\r
2671 #define IB_IIR_COMPMASK_SUBSCRIBE (CL_HTON64(((uint64_t)1)<<8))
\r
2672 #define IB_IIR_COMPMASK_TYPE (CL_HTON64(((uint64_t)1)<<9))
\r
2673 #define IB_IIR_COMPMASK_TRAPNUMB (CL_HTON64(((uint64_t)1)<<10))
\r
2674 #define IB_IIR_COMPMASK_DEVICEID (CL_HTON64(((uint64_t)1)<<10))
\r
2675 #define IB_IIR_COMPMASK_QPN (CL_HTON64(((uint64_t)1)<<11))
\r
2676 #define IB_IIR_COMPMASK_RESV2 (CL_HTON64(((uint64_t)1)<<12))
\r
2677 #define IB_IIR_COMPMASK_RESPTIME (CL_HTON64(((uint64_t)1)<<13))
\r
2678 #define IB_IIR_COMPMASK_RESV3 (CL_HTON64(((uint64_t)1)<<14))
\r
2679 #define IB_IIR_COMPMASK_PRODTYPE (CL_HTON64(((uint64_t)1)<<15))
\r
2680 #define IB_IIR_COMPMASK_VENDID (CL_HTON64(((uint64_t)1)<<15))
\r
2682 /****f* IBA Base: Types/ib_path_rec_init_local
\r
2684 * ib_path_rec_init_local
\r
2687 * Initializes a subnet local path record.
\r
2691 AL_INLINE void AL_API
\r
2692 ib_path_rec_init_local(
\r
2693 IN ib_path_rec_t* const p_rec,
\r
2694 IN const ib_gid_t* const p_dgid,
\r
2695 IN const ib_gid_t* const p_sgid,
\r
2696 IN const ib_net16_t dlid,
\r
2697 IN const ib_net16_t slid,
\r
2698 IN const uint8_t num_path,
\r
2699 IN const ib_net16_t pkey,
\r
2700 IN const uint8_t sl,
\r
2701 IN const uint16_t qos_class,
\r
2702 IN const uint8_t mtu_selector,
\r
2703 IN const uint8_t mtu,
\r
2704 IN const uint8_t rate_selector,
\r
2705 IN const uint8_t rate,
\r
2706 IN const uint8_t pkt_life_selector,
\r
2707 IN const uint8_t pkt_life,
\r
2708 IN const uint8_t preference )
\r
2710 p_rec->dgid = *p_dgid;
\r
2711 p_rec->sgid = *p_sgid;
\r
2712 p_rec->dlid = dlid;
\r
2713 p_rec->slid = slid;
\r
2714 p_rec->num_path = num_path;
\r
2715 p_rec->pkey = pkey;
\r
2716 p_rec->qos_class_sl = cl_hton16((sl & IB_PATH_REC_SL_MASK) |
\r
2717 (qos_class << 4));
\r
2718 p_rec->mtu = (uint8_t)((mtu & IB_PATH_REC_BASE_MASK) |
\r
2719 (uint8_t)(mtu_selector << 6));
\r
2720 p_rec->rate = (uint8_t)((rate & IB_PATH_REC_BASE_MASK) |
\r
2721 (uint8_t)(rate_selector << 6));
\r
2722 p_rec->pkt_life = (uint8_t)((pkt_life & IB_PATH_REC_BASE_MASK) |
\r
2723 (uint8_t)(pkt_life_selector << 6));
\r
2724 p_rec->preference = preference;
\r
2726 /* Clear global routing fields for local path records */
\r
2727 p_rec->hop_flow_raw = 0;
\r
2728 p_rec->tclass = 0;
\r
2729 p_rec->service_id = 0;
\r
2737 * [in] Pointer to the path record object.
\r
2740 * [in] GID of destination port.
\r
2743 * [in] GID of source port.
\r
2746 * [in] LID of destination port.
\r
2749 * [in] LID of source port.
\r
2752 * [in] Reversible path - 1 bit to say if path is reversible.
\r
2753 * num_path [6:0] In queries, maximum number of paths to return.
\r
2754 * In responses, undefined.
\r
2757 * [in] Partition key (P_Key) to use on this path.
\r
2760 * [in] Service level to use on this path. Lower 4-bits are valid.
\r
2763 * [in] Encoded MTU selector value to use on this path
\r
2766 * [in] Encoded MTU to use on this path
\r
2769 * [in] Encoded rate selector value to use on this path.
\r
2772 * [in] Encoded rate to use on this path.
\r
2774 * pkt_life_selector
\r
2775 * [in] Encoded Packet selector value lifetime for this path.
\r
2778 * [in] Encoded Packet lifetime for this path.
\r
2781 * [in] Indicates the relative merit of this path versus other path
\r
2782 * records returned from the SA. Lower numbers are better.
\r
2793 /****f* IBA Base: Types/ib_path_rec_num_path
\r
2795 * ib_path_rec_num_path
\r
2798 * Get max number of paths to return.
\r
2802 static inline uint8_t
\r
2803 ib_path_rec_num_path(
\r
2804 IN const ib_path_rec_t* const p_rec )
\r
2806 return( p_rec->num_path &0x7F );
\r
2811 * [in] Pointer to the path record object.
\r
2814 * Maximum number of paths to return for each unique SGID_DGID combination.
\r
2822 /****f* IBA Base: Types/ib_path_rec_set_sl
\r
2824 * ib_path_rec_set_sl
\r
2827 * Set path service level.
\r
2831 AL_INLINE void AL_API
\r
2832 ib_path_rec_set_sl(IN ib_path_rec_t * const p_rec, IN const uint8_t sl)
\r
2834 p_rec->qos_class_sl =
\r
2835 (p_rec->qos_class_sl & CL_HTON16(IB_PATH_REC_QOS_CLASS_MASK)) |
\r
2836 cl_hton16(sl & IB_PATH_REC_SL_MASK);
\r
2839 /****f* IBA Base: Types/ib_path_rec_sl
\r
2844 * Get path service level.
\r
2848 AL_INLINE uint8_t AL_API
\r
2850 IN const ib_path_rec_t* const p_rec )
\r
2852 return (uint8_t)(cl_ntoh16(p_rec->qos_class_sl) & IB_PATH_REC_SL_MASK);
\r
2857 * [in] Pointer to the path record object.
\r
2868 /****f* IBA Base: Types/ib_path_rec_set_qos_class
\r
2870 * ib_path_rec_set_qos_class
\r
2873 * Set path QoS class.
\r
2877 AL_INLINE void AL_API
\r
2878 ib_path_rec_set_qos_class(IN ib_path_rec_t * const p_rec,
\r
2879 IN const uint16_t qos_class)
\r
2881 p_rec->qos_class_sl =
\r
2882 (p_rec->qos_class_sl & CL_HTON16(IB_PATH_REC_SL_MASK)) |
\r
2883 cl_hton16(qos_class << 4);
\r
2888 * [in] Pointer to the path record object.
\r
2891 * [in] QoS class to set.
\r
2902 /****f* IBA Base: Types/ib_path_rec_qos_class
\r
2904 * ib_path_rec_qos_class
\r
2911 AL_INLINE uint16_t AL_API
\r
2912 ib_path_rec_qos_class(IN const ib_path_rec_t * const p_rec)
\r
2914 return (cl_ntoh16(p_rec->qos_class_sl) >> 4);
\r
2919 * [in] Pointer to the path record object.
\r
2922 * QoS class of the path record.
\r
2930 /****f* IBA Base: Types/ib_path_rec_mtu
\r
2935 * Get encoded path MTU.
\r
2939 AL_INLINE uint8_t AL_API
\r
2941 IN const ib_path_rec_t* const p_rec )
\r
2943 return( (uint8_t)(p_rec->mtu & IB_PATH_REC_BASE_MASK) );
\r
2948 * [in] Pointer to the path record object.
\r
2951 * Encoded path MTU.
\r
2957 * others: reserved
\r
2965 /****f* IBA Base: Types/ib_path_rec_mtu_sel
\r
2967 * ib_path_rec_mtu_sel
\r
2970 * Get encoded path MTU selector.
\r
2974 AL_INLINE uint8_t AL_API
\r
2975 ib_path_rec_mtu_sel(
\r
2976 IN const ib_path_rec_t* const p_rec )
\r
2978 return( (uint8_t)((p_rec->mtu & IB_PATH_REC_SELECTOR_MASK) >> 6) );
\r
2983 * [in] Pointer to the path record object.
\r
2986 * Encoded path MTU selector value (for queries).
\r
2987 * 0: greater than MTU specified
\r
2988 * 1: less than MTU specified
\r
2989 * 2: exactly the MTU specified
\r
2990 * 3: largest MTU available
\r
2998 /****f* IBA Base: Types/ib_path_rec_rate
\r
3000 * ib_path_rec_rate
\r
3003 * Get encoded path rate.
\r
3007 AL_INLINE uint8_t AL_API
\r
3009 IN const ib_path_rec_t* const p_rec )
\r
3011 return( (uint8_t)(p_rec->rate & IB_PATH_REC_BASE_MASK) );
\r
3016 * [in] Pointer to the path record object.
\r
3019 * Encoded path rate.
\r
3029 * others: reserved
\r
3037 /****f* IBA Base: Types/ib_path_rec_rate_sel
\r
3039 * ib_path_rec_rate_sel
\r
3042 * Get encoded path rate selector.
\r
3046 AL_INLINE uint8_t AL_API
\r
3047 ib_path_rec_rate_sel(
\r
3048 IN const ib_path_rec_t* const p_rec )
\r
3050 return( (uint8_t)((p_rec->rate & IB_PATH_REC_SELECTOR_MASK) >> 6) );
\r
3055 * [in] Pointer to the path record object.
\r
3058 * Encoded path rate selector value (for queries).
\r
3059 * 0: greater than rate specified
\r
3060 * 1: less than rate specified
\r
3061 * 2: exactly the rate specified
\r
3062 * 3: largest rate available
\r
3070 /****f* IBA Base: Types/ib_path_rec_pkt_life
\r
3072 * ib_path_rec_pkt_life
\r
3075 * Get encoded path pkt_life.
\r
3079 AL_INLINE uint8_t AL_API
\r
3080 ib_path_rec_pkt_life(
\r
3081 IN const ib_path_rec_t* const p_rec )
\r
3083 return( (uint8_t)(p_rec->pkt_life & IB_PATH_REC_BASE_MASK) );
\r
3088 * [in] Pointer to the path record object.
\r
3091 * Encoded path pkt_life = 4.096 µsec * 2 ** PacketLifeTime.
\r
3099 /****f* IBA Base: Types/ib_path_rec_pkt_life_sel
\r
3101 * ib_path_rec_pkt_life_sel
\r
3104 * Get encoded path pkt_lifetime selector.
\r
3108 AL_INLINE uint8_t AL_API
\r
3109 ib_path_rec_pkt_life_sel(
\r
3110 IN const ib_path_rec_t* const p_rec )
\r
3112 return( (uint8_t)((p_rec->pkt_life & IB_PATH_REC_SELECTOR_MASK) >> 6 ));
\r
3117 * [in] Pointer to the path record object.
\r
3120 * Encoded path pkt_lifetime selector value (for queries).
\r
3121 * 0: greater than rate specified
\r
3122 * 1: less than rate specified
\r
3123 * 2: exactly the rate specified
\r
3124 * 3: smallest packet lifetime available
\r
3132 /****f* IBA Base: Types/ib_path_rec_flow_lbl
\r
3134 * ib_path_rec_flow_lbl
\r
3141 AL_INLINE net32_t AL_API
\r
3142 ib_path_rec_flow_lbl(
\r
3143 IN const ib_path_rec_t* const p_rec )
\r
3145 return( cl_hton32( (cl_ntoh32(p_rec->hop_flow_raw) >> 8) & 0x000FFFFF ) );
\r
3150 * [in] Pointer to the path record object.
\r
3153 * Flow label of the path record.
\r
3161 /****f* IBA Base: Types/ib_path_rec_hop_limit
\r
3163 * ib_path_rec_hop_limit
\r
3170 AL_INLINE uint8_t AL_API
\r
3171 ib_path_rec_hop_limit(
\r
3172 IN const ib_path_rec_t* const p_rec )
\r
3174 return ((uint8_t) (cl_ntoh32(p_rec->hop_flow_raw) & 0x000000FF));
\r
3179 * [in] Pointer to the path record object.
\r
3182 * Hop limit of the path record.
\r
3190 /****f* IBA Base: Types/ib_path_rec_set_hop_flow_raw
\r
3192 * ib_path_rec_set_hop_flow_raw
\r
3195 * Sets the hop limit, flow label, and raw traffic bits of a path record.
\r
3199 AL_INLINE void AL_API
\r
3200 ib_path_rec_set_hop_flow_raw(
\r
3201 OUT ib_path_rec_t* const p_rec,
\r
3202 IN const uint8_t hop_limit,
\r
3203 IN const net32_t flow_lbl,
\r
3204 IN const boolean_t raw )
\r
3206 p_rec->hop_flow_raw = raw ? 0x80000000 : 0;
\r
3207 p_rec->hop_flow_raw |= (cl_ntoh32( flow_lbl ) & 0x000FFFFF) << 8;
\r
3208 p_rec->hop_flow_raw |= hop_limit;
\r
3209 p_rec->hop_flow_raw = cl_hton32( p_rec->hop_flow_raw );
\r
3214 * Pointer to the path record whose hop limit, flow label, and rab
\r
3215 * traffic fields to set.
\r
3218 * Hop limit to set in the path record.
\r
3221 * Flow label, in network byte order, to set in the path record.
\r
3224 * Boolean flag to indicate whether the path record is for raw traffic.
\r
3231 /****s* IBA Base: Constants/IB_CLASS_CAP_TRAP
\r
3233 * IB_CLASS_CAP_TRAP
\r
3236 * ClassPortInfo CapabilityMask bits. This bit will be set
\r
3237 * if the class supports Trap() MADs (13.4.8.1).
\r
3240 * ib_class_port_info_t, IB_CLASS_CAP_GETSET
\r
3244 #define IB_CLASS_CAP_TRAP 0x0001
\r
3247 /****s* IBA Base: Constants/IB_CLASS_CAP_GETSET
\r
3249 * IB_CLASS_CAP_GETSET
\r
3252 * ClassPortInfo CapabilityMask bits. This bit will be set
\r
3253 * if the class supports Get(Notice) and Set(Notice) MADs (13.4.8.1).
\r
3256 * ib_class_port_info_t, IB_CLASS_CAP_TRAP
\r
3260 #define IB_CLASS_CAP_GETSET 0x0002
\r
3263 /****s* IBA Base: Constants/IB_CLASS_RESP_TIME_MASK
\r
3265 * IB_CLASS_RESP_TIME_MASK
\r
3268 * Mask bits to extract the reponse time value from the
\r
3269 * resp_time_val field of ib_class_port_info_t.
\r
3272 * ib_class_port_info_t
\r
3276 #define IB_CLASS_RESP_TIME_MASK 0x1F
\r
3278 /****s* IBA Base: Types/ib_class_port_info_t
\r
3280 * ib_class_port_info_t
\r
3283 * IBA defined ClassPortInfo attribute (13.4.8.1)
\r
3284 * route between two end-points on a subnet.
\r
3288 #include <complib/cl_packon.h>
\r
3289 typedef struct _ib_class_port_info
\r
3292 uint8_t class_ver;
\r
3293 ib_net16_t cap_mask;
\r
3294 ib_net32_t cap_mask2_resp_time;
\r
3295 ib_gid_t redir_gid;
\r
3296 ib_net32_t redir_tc_sl_fl;
\r
3297 ib_net16_t redir_lid;
\r
3298 ib_net16_t redir_pkey;
\r
3299 ib_net32_t redir_qp;
\r
3300 ib_net32_t redir_qkey;
\r
3301 ib_gid_t trap_gid;
\r
3302 ib_net32_t trap_tc_sl_fl;
\r
3303 ib_net16_t trap_lid;
\r
3304 ib_net16_t trap_pkey;
\r
3305 ib_net32_t trap_hop_qp;
\r
3306 ib_net32_t trap_qkey;
\r
3308 } PACK_SUFFIX ib_class_port_info_t;
\r
3309 #include <complib/cl_packoff.h>
\r
3313 * Maximum supported MAD Base Version.
\r
3316 * Maximum supported management class version.
\r
3319 * Supported capabilities of this management class.
\r
3322 * Maximum expected response time.
\r
3325 * GID to use for redirection, or zero
\r
3328 * Traffic class, service level and flow label the requester
\r
3329 * should use if the service is redirected.
\r
3332 * LID used for redirection, or zero
\r
3335 * P_Key used for redirection
\r
3338 * QP number used for redirection
\r
3341 * Q_Key associated with the redirected QP. This shall be the
\r
3342 * well known Q_Key value.
\r
3345 * GID value used for trap messages from this service.
\r
3348 * Traffic class, service level and flow label used for
\r
3349 * trap messages originated by this service.
\r
3352 * LID used for trap messages, or zero
\r
3355 * P_Key used for trap messages
\r
3358 * Hop limit (upper 8 bits) and QP number used for trap messages
\r
3361 * Q_Key associated with the trap messages QP.
\r
3364 * IB_CLASS_CAP_GETSET, IB_CLASS_CAP_TRAP
\r
3368 /****f* IBA Base: Types/ib_class_set_resp_time_val
\r
3370 * ib_class_set_resp_time_val
\r
3373 * Set maximum expected response time.
\r
3377 AL_INLINE void AL_API
\r
3378 ib_class_set_resp_time_val(IN ib_class_port_info_t * const p_cpi,
\r
3379 IN const uint8_t val)
\r
3381 p_cpi->cap_mask2_resp_time =
\r
3382 (p_cpi->cap_mask2_resp_time & CL_HTON32(~IB_CLASS_RESP_TIME_MASK)) |
\r
3383 cl_hton32(val & IB_CLASS_RESP_TIME_MASK);
\r
3389 * [in] Pointer to the class port info object.
\r
3392 * [in] Response time value to set.
\r
3400 * ib_class_port_info_t
\r
3403 /****f* IBA Base: Types/ib_class_resp_time_val
\r
3405 * ib_class_resp_time_val
\r
3408 * Get response time value.
\r
3412 AL_INLINE uint8_t AL_API
\r
3413 ib_class_resp_time_val(IN ib_class_port_info_t * const p_cpi)
\r
3415 return (uint8_t)(cl_ntoh32(p_cpi->cap_mask2_resp_time) &
\r
3416 IB_CLASS_RESP_TIME_MASK);
\r
3422 * [in] Pointer to the class port info object.
\r
3425 * Response time value.
\r
3430 * ib_class_port_info_t
\r
3433 /****f* IBA Base: Types/ib_class_set_cap_mask2
\r
3435 * ib_class_set_cap_mask2
\r
3438 * Set ClassPortInfo:CapabilityMask2.
\r
3442 AL_INLINE void AL_API
\r
3443 ib_class_set_cap_mask2(IN ib_class_port_info_t * const p_cpi,
\r
3444 IN const uint32_t cap_mask2)
\r
3446 p_cpi->cap_mask2_resp_time = (p_cpi->cap_mask2_resp_time &
\r
3447 CL_HTON32(IB_CLASS_RESP_TIME_MASK)) |
\r
3448 cl_hton32(cap_mask2 << 5);
\r
3454 * [in] Pointer to the class port info object.
\r
3457 * [in] CapabilityMask2 value to set.
\r
3465 * ib_class_port_info_t
\r
3468 /****f* IBA Base: Types/ib_class_cap_mask2
\r
3470 * ib_class_cap_mask2
\r
3473 * Get ClassPortInfo:CapabilityMask2.
\r
3477 AL_INLINE uint32_t AL_API
\r
3478 ib_class_cap_mask2(IN const ib_class_port_info_t * const p_cpi)
\r
3480 return (cl_ntoh32(p_cpi->cap_mask2_resp_time) >> 5);
\r
3486 * [in] Pointer to the class port info object.
\r
3489 * CapabilityMask2 of the ClassPortInfo.
\r
3494 * ib_class_port_info_t
\r
3497 /****s* IBA Base: Types/ib_sm_info_t
\r
3502 * SMInfo structure (14.2.5.13).
\r
3506 #include <complib/cl_packon.h>
\r
3507 typedef struct _ib_sm_info
\r
3510 ib_net64_t sm_key;
\r
3511 ib_net32_t act_count;
\r
3512 uint8_t pri_state;
\r
3514 } PACK_SUFFIX ib_sm_info_t;
\r
3515 #include <complib/cl_packoff.h>
\r
3519 * Port GUID for this SM.
\r
3522 * SM_Key of this SM.
\r
3525 * Activity counter used as a heartbeat.
\r
3528 * Priority and State information
\r
3533 /****f* IBA Base: Types/ib_sminfo_get_priority
\r
3535 * ib_sminfo_get_priority
\r
3538 * Returns the priority value.
\r
3542 AL_INLINE uint8_t AL_API
\r
3543 ib_sminfo_get_priority(
\r
3544 IN const ib_sm_info_t* const p_smi )
\r
3546 return( (uint8_t)((p_smi->pri_state & 0xF0)>>4) );
\r
3551 * [in] Pointer to the SMInfo Attribute.
\r
3554 * Returns the priority value.
\r
3561 /****f* IBA Base: Types/ib_sminfo_get_state
\r
3563 * ib_sminfo_get_state
\r
3566 * Returns the state value.
\r
3570 AL_INLINE uint8_t AL_API
\r
3571 ib_sminfo_get_state(
\r
3572 IN const ib_sm_info_t* const p_smi )
\r
3574 return( (uint8_t)(p_smi->pri_state & 0x0F) );
\r
3579 * [in] Pointer to the SMInfo Attribute.
\r
3582 * Returns the state value.
\r
3589 /****s* IBA Base: Types/ib_mad_t
\r
3594 * IBA defined MAD header (13.4.3)
\r
3598 #include <complib/cl_packon.h>
\r
3599 typedef struct _ib_mad
\r
3602 uint8_t mgmt_class;
\r
3603 uint8_t class_ver;
\r
3605 ib_net16_t status;
\r
3606 ib_net16_t class_spec;
\r
3607 ib_net64_t trans_id;
\r
3608 ib_net16_t attr_id;
\r
3610 ib_net32_t attr_mod;
\r
3611 } PACK_SUFFIX ib_mad_t;
\r
3612 #include <complib/cl_packoff.h>
\r
3616 * MAD base format.
\r
3619 * Class of operation.
\r
3622 * Version of MAD class-specific format.
\r
3625 * Method to perform, including 'R' bit.
\r
3628 * Status of operation.
\r
3631 * Reserved for subnet management.
\r
3643 * Attribute modifier.
\r
3649 /****s* IBA Base: Types/ib_rmpp_mad_t
\r
3654 * IBA defined MAD RMPP header (13.6.2.1)
\r
3658 #include <complib/cl_packon.h>
\r
3659 typedef struct _ib_rmpp_mad
\r
3661 ib_mad_t common_hdr;
\r
3663 uint8_t rmpp_version;
\r
3664 uint8_t rmpp_type;
\r
3665 uint8_t rmpp_flags;
\r
3666 uint8_t rmpp_status;
\r
3668 ib_net32_t seg_num;
\r
3669 ib_net32_t paylen_newwin;
\r
3671 } PACK_SUFFIX ib_rmpp_mad_t;
\r
3672 #include <complib/cl_packoff.h>
\r
3679 /****f* IBA Base: Types/ib_mad_init_new
\r
3684 * Initializes a MAD common header.
\r
3688 AL_INLINE void AL_API
\r
3690 IN ib_mad_t* const p_mad,
\r
3691 IN const uint8_t mgmt_class,
\r
3692 IN const uint8_t class_ver,
\r
3693 IN const uint8_t method,
\r
3694 IN const ib_net64_t trans_id,
\r
3695 IN const ib_net16_t attr_id,
\r
3696 IN const ib_net32_t attr_mod )
\r
3698 CL_ASSERT( p_mad );
\r
3699 p_mad->base_ver = 1;
\r
3700 p_mad->mgmt_class = mgmt_class;
\r
3701 p_mad->class_ver = class_ver;
\r
3702 p_mad->method = method;
\r
3703 p_mad->status = 0;
\r
3704 p_mad->class_spec = 0;
\r
3705 p_mad->trans_id = trans_id;
\r
3706 p_mad->attr_id = attr_id;
\r
3708 p_mad->attr_mod = attr_mod;
\r
3713 * [in] Pointer to the MAD common header.
\r
3716 * [in] Class of operation.
\r
3719 * [in] Version of MAD class-specific format.
\r
3722 * [in] Method to perform, including 'R' bit.
\r
3725 * [in] Transaction ID.
\r
3728 * [in] Attribute ID.
\r
3731 * [in] Attribute modifier.
\r
3742 /****f* IBA Base: Types/ib_mad_init_response
\r
3744 * ib_mad_init_response
\r
3747 * Initializes a MAD common header as a response.
\r
3751 AL_INLINE void AL_API
\r
3752 ib_mad_init_response(
\r
3753 IN const ib_mad_t* const p_req_mad,
\r
3754 IN ib_mad_t* const p_mad,
\r
3755 IN const ib_net16_t status )
\r
3757 CL_ASSERT( p_req_mad );
\r
3758 CL_ASSERT( p_mad );
\r
3759 *p_mad = *p_req_mad;
\r
3760 p_mad->status = status;
\r
3761 if( p_mad->method == IB_MAD_METHOD_SET )
\r
3762 p_mad->method = IB_MAD_METHOD_GET;
\r
3763 p_mad->method |= IB_MAD_METHOD_RESP_MASK;
\r
3768 * [in] Pointer to the MAD common header in the original request MAD.
\r
3771 * [in] Pointer to the MAD common header to initialize.
\r
3774 * [in] MAD Status value to return;
\r
3780 * p_req_mad and p_mad may point to the same MAD.
\r
3786 /****f* IBA Base: Types/ib_mad_is_response
\r
3788 * ib_mad_is_response
\r
3791 * Returns TRUE if the MAD is a response ('R' bit set),
\r
3792 * FALSE otherwise.
\r
3796 AL_INLINE boolean_t AL_API
\r
3797 ib_mad_is_response(
\r
3798 IN const ib_mad_t* const p_mad )
\r
3800 CL_ASSERT( p_mad );
\r
3801 return ((p_mad->method & IB_MAD_METHOD_RESP_MASK) ||
\r
3802 (p_mad->method == IB_MAD_METHOD_TRAP_REPRESS));
\r
3807 * [in] Pointer to the MAD.
\r
3810 * Returns TRUE if the MAD is a response ('R' bit set),
\r
3811 * FALSE otherwise.
\r
3819 #define IB_RMPP_TYPE_DATA 1
\r
3820 #define IB_RMPP_TYPE_ACK 2
\r
3821 #define IB_RMPP_TYPE_STOP 3
\r
3822 #define IB_RMPP_TYPE_ABORT 4
\r
3824 #define IB_RMPP_NO_RESP_TIME 0x1F
\r
3825 #define IB_RMPP_FLAG_ACTIVE 0x01
\r
3826 #define IB_RMPP_FLAG_FIRST 0x02
\r
3827 #define IB_RMPP_FLAG_LAST 0x04
\r
3829 #define IB_RMPP_STATUS_SUCCESS 0
\r
3830 #define IB_RMPP_STATUS_RESX 1 /* resources exhausted */
\r
3831 #define IB_RMPP_STATUS_T2L 118 /* time too long */
\r
3832 #define IB_RMPP_STATUS_BAD_LEN 119 /* incon. last and payload len */
\r
3833 #define IB_RMPP_STATUS_BAD_SEG 120 /* incon. first and segment no */
\r
3834 #define IB_RMPP_STATUS_BADT 121 /* bad rmpp type */
\r
3835 #define IB_RMPP_STATUS_W2S 122 /* newwindowlast too small */
\r
3836 #define IB_RMPP_STATUS_S2B 123 /* segment no too big */
\r
3837 #define IB_RMPP_STATUS_BAD_STATUS 124 /* illegal status */
\r
3838 #define IB_RMPP_STATUS_UNV 125 /* unsupported version */
\r
3839 #define IB_RMPP_STATUS_TMR 126 /* too many retries */
\r
3840 #define IB_RMPP_STATUS_UNSPEC 127 /* unspecified */
\r
3842 /****f* IBA Base: Types/ib_rmpp_is_flag_set
\r
3844 * ib_rmpp_is_flag_set
\r
3847 * Returns TRUE if the MAD has the given RMPP flag set.
\r