[ofw] [PATCH] add missing items from OFED ib_types.h - required by OpenSM 3.2.2

Stan C. Smith stan.smith at intel.com
Tue Oct 13 16:52:42 PDT 2009


Let the discussions begin:

1) 'static inline' vs/ AL_INLINE ?
2) New ib_port_info_t fields; additional driver mods.
3) ?

 signed-off-by: stan smith <stan.smith at intel.com>

--- a/inc/iba/ib_types.h	Tue Oct 13 16:26:48 2009
+++ b/inc/iba/ib_types.h	Tue Oct 13 11:39:55 2009
@@ -270,6 +270,32 @@
 #define IB_SUBNET_PATH_HOPS_MAX				64
 /*********/
 
+/****d* IBA Base: Constants/IB_HOPLIMIT_MAX
+* NAME
+*	IB_HOPLIMIT_MAX
+*
+* DESCRIPTION
+*       Maximum number of router hops allowed.
+*
+* SOURCE
+*/
+#define IB_HOPLIMIT_MAX					255
+/*********/
+
+/*********/
+/****d* IBA Base: Constants/IB_MC_SCOPE_*
+* NAME
+*	IB_MC_SCOPE_*
+*
+* DESCRIPTION
+*	Scope component definitions from IBA 1.2.1 (Table 3 p. 148)
+*/
+#define IB_MC_SCOPE_LINK_LOCAL		0x2
+#define IB_MC_SCOPE_SITE_LOCAL		0x5
+#define IB_MC_SCOPE_ORG_LOCAL		0x8
+#define IB_MC_SCOPE_GLOBAL			0xE
+/*********/
+
 /****d* IBA Base: Constants/IB_PKEY_MAX_BLOCKS
 * NAME
 *	IB_PKEY_MAX_BLOCKS
@@ -1577,6 +1603,18 @@
 #define IB_NOTICE_NODE_TYPE_ROUTER			(CL_NTOH32(0x000003))
 /**********/
 
+/****d* IBA Base: Constants/IB_NOTICE_PRODUCER_TYPE_CLASS_MGR
+* NAME
+*	IB_NOTICE_PRODUCER_TYPE_CLASS_MGR
+*
+* DESCRIPTION
+*	Encoded generic producer type used in Notice attribute (13.4.8.2)
+*
+* SOURCE
+*/
+#define IB_NOTICE_PRODUCER_TYPE_CLASS_MGR	(CL_HTON32(0x000004))
+/**********/
+
 /****d* IBA Base: Constants/IB_NOTICE_NODE_TYPE_SUBN_MGMT
 * NAME
 *	IB_NOTICE_NODE_TYPE_SUBN_MGMT
@@ -1695,6 +1733,17 @@
 */
 #define IB_PATH_REC_SL_MASK				0x000F
 
+/****d* IBA Base: Constants/IB_MULTIPATH_REC_SL_MASK
+* NAME
+*	IB_MILTIPATH_REC_SL_MASK
+*
+* DESCRIPTION
+*	Mask for the sl field for MultiPath record
+*
+* SOURCE
+*/
+#define IB_MULTIPATH_REC_SL_MASK			0x000F
+
 /****d* IBA Base: Constants/IB_PATH_REC_QOS_CLASS_MASK
 * NAME
 *	IB_PATH_REC_QOS_CLASS_MASK
@@ -1706,6 +1755,17 @@
 */
 #define IB_PATH_REC_QOS_CLASS_MASK			0xFFF0
 
+/****d* IBA Base: Constants/IB_MULTIPATH_REC_QOS_CLASS_MASK
+* NAME
+*	IB_MULTIPATH_REC_QOS_CLASS_MASK
+*
+* DESCRIPTION
+*	Mask for the QoS class field for MultiPath record
+*
+* SOURCE
+*/
+#define IB_MULTIPATH_REC_QOS_CLASS_MASK			0xFFF0
+
 /****d* IBA Base: Constants/IB_PATH_REC_SELECTOR_MASK
 * NAME
 *	IB_PATH_REC_SELECTOR_MASK
@@ -1870,6 +1930,48 @@
 * ib_node_info_t
 *********/
 
+static const char *const __ib_producer_type_str[] = {
+	"UNKNOWN",
+	"Channel Adapter",
+	"Switch",
+	"Router",
+	"Class Manager"
+};
+
+/****f* IBA Base: Types/ib_get_producer_type_str
+* NAME
+*	ib_get_producer_type_str
+*
+* DESCRIPTION
+*	Returns a string for the specified producer type
+*	13.4.8.2 Notice
+*	13.4.8.3 InformInfo
+*
+* SYNOPSIS
+*/
+static inline const char *AL_API
+ib_get_producer_type_str(IN ib_net32_t producer_type)
+{
+	if (cl_ntoh32(producer_type) >
+	    CL_NTOH32(IB_NOTICE_PRODUCER_TYPE_CLASS_MGR))
+		producer_type = 0;
+	return (__ib_producer_type_str[cl_ntoh32(producer_type)]);
+}
+
+/*
+* PARAMETERS
+*	producer_type
+*		[in] Encoded producer type from the Notice attribute
+
+* RETURN VALUES
+*	Pointer to the producer type string.
+*
+* NOTES
+*
+* SEE ALSO
+* ib_notice_get_prod_type
+*********/
+
 static const char* const __ib_port_state_str[] =
 {
 	"No State Change (NOP)",
@@ -2643,12 +2745,12 @@
 #define IB_MPR_COMPMASK_RATE		(CL_HTON64(((uint64_t)1)<<13))
 #define IB_MPR_COMPMASK_PKTLIFETIMESELEC (CL_HTON64(((uint64_t)1)<<14))
 #define IB_MPR_COMPMASK_PKTLIFETIME	(CL_HTON64(((uint64_t)1)<<15))
-#define IB_MPR_COMPMASK_RESV2		(CL_HTON64(((uint64_t)1)<<16))
+#define IB_MPR_COMPMASK_SERVICEID_MSB	(CL_HTON64(((uint64_t)1)<<16))
 #define IB_MPR_COMPMASK_INDEPSELEC	(CL_HTON64(((uint64_t)1)<<17))
 #define IB_MPR_COMPMASK_RESV3		(CL_HTON64(((uint64_t)1)<<18))
 #define IB_MPR_COMPMASK_SGIDCOUNT	(CL_HTON64(((uint64_t)1)<<19))
 #define IB_MPR_COMPMASK_DGIDCOUNT	(CL_HTON64(((uint64_t)1)<<20))
-#define IB_MPR_COMPMASK_RESV4		(CL_HTON64(((uint64_t)1)<<21))
+#define IB_MPR_COMPMASK_SERVICEID_LSB	(CL_HTON64(((uint64_t)1)<<21))
 
 /* SMInfo Record Component Masks */
 #define IB_SMIR_COMPMASK_LID		(CL_HTON64(((uint64_t)1)<<0))
@@ -4476,6 +4578,8 @@
 2b), timeout(5b) */
 	uint8_t				resp_time_value;
 	uint8_t				error_threshold;
+	ib_net16_t			max_credit_hint;
+	ib_net32_t			link_rt_latency; /* reserv(8b), link round trip lat(24b) */
 
 }	PACK_SUFFIX ib_port_info_t;
 #include <complib/cl_packoff.h>
@@ -4528,12 +4632,12 @@
 #define IB_PORT_CAP_HAS_BM			(CL_NTOH32(0x00800000))
 #define IB_PORT_CAP_HAS_LINK_RT_LATENCY (CL_NTOH32(0x01000000))
 #define IB_PORT_CAP_HAS_CLIENT_REREG (CL_NTOH32(0x02000000))
-#define IB_PORT_CAP_RESV26			(CL_NTOH32(0x04000000))
-#define IB_PORT_CAP_RESV27			(CL_NTOH32(0x08000000))
-#define IB_PORT_CAP_RESV28			(CL_NTOH32(0x10000000))
-#define IB_PORT_CAP_RESV29			(CL_NTOH32(0x20000000))
-#define IB_PORT_CAP_RESV30			(CL_NTOH32(0x40000000))
-#define IB_PORT_CAP_RESV31			(CL_NTOH32(0x80000000))
+#define IB_PORT_CAP_HAS_OTHER_LOCAL_CHANGES_NTC (CL_HTON32(0x04000000))
+#define IB_PORT_CAP_HAS_LINK_SPEED_WIDTH_PAIRS_TBL (CL_HTON32(0x08000000))
+#define IB_PORT_CAP_HAS_VEND_MADS	(CL_HTON32(0x10000000))
+#define IB_PORT_CAP_HAS_MCAST_PKEY_TRAP_SUPPRESS (CL_HTON32(0x20000000))
+#define IB_PORT_CAP_HAS_MCAST_FDB_TOP (CL_HTON32(0x40000000))
+#define IB_PORT_CAP_HAS_HIER_INFO	(CL_HTON32(0x80000000))
 
 /****f* IBA Base: Types/ib_port_info_get_port_state
 * NAME
@@ -4964,6 +5068,7 @@
 
 #define IB_LINK_WIDTH_ACTIVE_1X			1
 #define IB_LINK_WIDTH_ACTIVE_4X			2
+#define IB_LINK_WIDTH_ACTIVE_8X			4
 #define IB_LINK_WIDTH_ACTIVE_12X		8
 #define IB_LINK_SPEED_ACTIVE_2_5		1
 #define IB_LINK_SPEED_ACTIVE_5			2
@@ -5241,6 +5346,66 @@
 * SEE ALSO
 *********/
 
+/****f* IBA Base: Types/ib_port_info_get_master_smsl
+* NAME
+*	ib_port_info_get_master_smsl
+*
+* DESCRIPTION
+*	Returns the encoded value for the Master SMSL at this port.
+*
+* SYNOPSIS
+*/
+static inline uint8_t AL_API
+ib_port_info_get_master_smsl(IN const ib_port_info_t * const p_pi)
+{
+	return (uint8_t) (p_pi->mtu_smsl & 0x0F);
+}
+
+/*
+* PARAMETERS
+*	p_pi
+*		[in] Pointer to a PortInfo attribute.
+*
+* RETURN VALUES
+*	Returns the encoded value for the Master SMSL at this port.
+*
+* NOTES
+*
+* SEE ALSO
+*********/
+
+/****f* IBA Base: Types/ib_port_info_set_master_smsl
+* NAME
+*	ib_port_info_set_master_smsl
+*
+* DESCRIPTION
+*	Sets the Master SMSL value in the PortInfo attribute.
+*
+* SYNOPSIS
+*/
+static inline void AL_API
+ib_port_info_set_master_smsl(IN ib_port_info_t * const p_pi,
+			     IN const uint8_t smsl)
+{
+	p_pi->mtu_smsl = (uint8_t) ((p_pi->mtu_smsl & 0xF0) | smsl);
+}
+
+/*
+* PARAMETERS
+*	p_pi
+*		[in] Pointer to a PortInfo attribute.
+*
+*	mtu
+*		[in] Encoded Master SMSL value to set
+*
+* RETURN VALUES
+*	None.
+*
+* NOTES
+*
+* SEE ALSO
+*********/
+
 
 /****f* IBA Base: Types/ib_port_info_get_sm_sl
 * NAME
@@ -5950,6 +6115,8 @@
 	ib_net16_t			lids_per_port;
 	ib_net16_t			enforce_cap;
 	uint8_t				flags;
+	uint8_t				resvd;
+	ib_net16_t			mcast_top;
 
 }	PACK_SUFFIX ib_switch_info_t;
 #include <complib/cl_packoff.h>
@@ -6094,16 +6261,15 @@
 	uint8_t			tclass;
 	uint8_t			num_path;
 	ib_net16_t		pkey;
-	uint8_t			resv0;
-	uint8_t			sl;
+	ib_net16_t		qos_class_sl;
 	uint8_t			mtu;
 	uint8_t			rate;
 	uint8_t			pkt_life;
-	uint8_t			resv1;
+	uint8_t			service_id_8msb;
 	uint8_t			independence;	/* formerly resv2 */
 	uint8_t			sgid_count;
 	uint8_t			dgid_count;
-	uint8_t			resv3[7];
+	uint8_t			service_id_56lsb[7];
 	ib_gid_t		gids[IB_MULTIPATH_MAX_GIDS];
 }	PACK_SUFFIX ib_multipath_rec_t;
 #include <complib/cl_packoff.h>
@@ -6170,6 +6336,41 @@
 *       ib_multipath_rec_t
 *********/
 
+/****f* IBA Base: Types/ib_multipath_rec_set_sl
+* NAME
+*	ib_multipath_rec_set_sl
+*
+* DESCRIPTION
+*	Set path service level.
+*
+* SYNOPSIS
+*/
+static inline void AL_API
+ib_multipath_rec_set_sl(
+	IN ib_multipath_rec_t* const p_rec,
+	IN const uint8_t sl )
+{
+	p_rec->qos_class_sl =
+		(p_rec->qos_class_sl & CL_HTON16(IB_MULTIPATH_REC_QOS_CLASS_MASK)) |
+			cl_hton16(sl & IB_MULTIPATH_REC_SL_MASK);
+}
+/*
+* PARAMETERS
+*	p_rec
+*		[in] Pointer to the MultiPath record object.
+*
+*	sl
+*		[in] Service level to set.
+*
+* RETURN VALUES
+*	None
+*
+* NOTES
+*
+* SEE ALSO
+*	ib_multipath_rec_t
+*********/
+
 /****f* IBA Base: Types/ib_multipath_rec_sl
 * NAME
 *       ib_multipath_rec_sl
@@ -6183,7 +6384,7 @@
 ib_multipath_rec_sl(
 	IN	const   ib_multipath_rec_t* const	p_rec )
 {
-        return( (uint8_t)((cl_ntoh16( p_rec->sl )) & 0xF) );
+	return ((uint8_t) ((cl_ntoh16(p_rec->qos_class_sl)) & IB_MULTIPATH_REC_SL_MASK));	
 }
 /*
 * PARAMETERS
@@ -6199,6 +6400,70 @@
 *       ib_multipath_rec_t
 *********/
 
+/****f* IBA Base: Types/ib_multipath_rec_set_qos_class
+* NAME
+*	ib_multipath_rec_set_qos_class
+*
+* DESCRIPTION
+*	Set path QoS class.
+*
+* SYNOPSIS
+*/
+static inline void	AL_API
+ib_multipath_rec_set_qos_class(
+	IN ib_multipath_rec_t* const p_rec,
+	IN const uint16_t qos_class )
+{
+	p_rec->qos_class_sl =
+		(p_rec->qos_class_sl & CL_HTON16(IB_MULTIPATH_REC_SL_MASK)) |
+			cl_hton16(qos_class << 4);
+}
+/*
+* PARAMETERS
+*	p_rec
+*		[in] Pointer to the MultiPath record object.
+*
+*	qos_class
+*		[in] QoS class to set.
+*
+* RETURN VALUES
+*	None
+*
+* NOTES
+*
+* SEE ALSO
+*	ib_multipath_rec_t
+*********/
+
+/****f* IBA Base: Types/ib_multipath_rec_qos_class
+* NAME
+*	ib_multipath_rec_qos_class
+*
+* DESCRIPTION
+*	Get QoS class.
+*
+* SYNOPSIS
+*/
+static inline uint16_t	AL_API
+ib_multipath_rec_qos_class(
+	IN	const	ib_multipath_rec_t* const	p_rec )
+{
+	return (cl_ntoh16( p_rec->qos_class_sl ) >> 4);
+}
+/*
+* PARAMETERS
+*	p_rec
+*		[in] Pointer to the MultiPath record object.
+*
+* RETURN VALUES
+*	QoS class of the MultiPath record.
+*
+* NOTES
+*
+* SEE ALSO
+*	ib_multipath_rec_t
+*********/
+
 /****f* IBA Base: Types/ib_multipath_rec_mtu
 * NAME
 *       ib_multipath_rec_mtu
@@ -6395,6 +6660,41 @@
 *       ib_multipath_rec_t
 *********/
 
+/****f* IBA Base: Types/ib_multipath_rec_service_id
+* NAME
+*	ib_multipath_rec_service_id
+*
+* DESCRIPTION
+*	Get multipath service id.
+*
+* SYNOPSIS
+*/
+static inline ib_net64_t AL_API
+ib_multipath_rec_service_id(IN const ib_multipath_rec_t * const p_rec)
+{
+	union {
+		ib_net64_t sid;
+		uint8_t sid_arr[8];
+	} sid_union;
+	sid_union.sid_arr[0] = p_rec->service_id_8msb;
+	memcpy(&sid_union.sid_arr[1], p_rec->service_id_56lsb, 7);
+	return sid_union.sid;
+}
+
+/*
+* PARAMETERS
+*	p_rec
+*		[in] Pointer to the multipath record object.
+*
+* RETURN VALUES
+*	Service ID
+*
+* NOTES
+*
+* SEE ALSO
+*	ib_multipath_rec_t
+*********/
+
 #define IB_NUM_PKEY_ELEMENTS_IN_BLOCK		32
 /****s* IBA Base: Types/ib_pkey_table_t
 * NAME
@@ -6452,7 +6752,7 @@
 #include <complib/cl_packon.h>
 typedef struct _ib_slvl_table
 {
-	uint8_t		vl_table[IB_MAX_NUM_VLS/2];
+	uint8_t		raw_vl_by_sl[IB_MAX_NUM_VLS/2];
 
 }	PACK_SUFFIX ib_slvl_table_t;
 #include <complib/cl_packoff.h>
@@ -6499,15 +6799,17 @@
 	CL_ASSERT(vl <= 15);
 	CL_ASSERT(sl_index <= 15);
 
-	if (sl_index%2)
+	if (sl_index % 2)
 	{
 	/* this is an odd sl. Need to update the ls bits */
-		p_slvl_tbl->vl_table[idx] = ( p_slvl_tbl->vl_table[idx] & 0xF0 ) | vl ;
+		p_slvl_tbl->raw_vl_by_sl[idx] =
+			( p_slvl_tbl->raw_vl_by_sl[idx] & 0xF0 ) | vl ;
 	}
 	else
 	{
 	/* this is an even sl. Need to update the ms bits */
-		p_slvl_tbl->vl_table[idx] = ( vl << 4 ) | ( p_slvl_tbl->vl_table[idx] & 0x0F );
+		p_slvl_tbl->raw_vl_by_sl[idx] =
+			( vl << 4 ) | ( p_slvl_tbl->raw_vl_by_sl[idx] & 0x0F );
 	}
 }
 /*
@@ -6547,15 +6849,15 @@
 	uint8_t idx = sl_index/2;
 	CL_ASSERT(sl_index <= 15);
 
-	if (sl_index%2)
+	if (sl_index % 2)
 	{
 		/* this is an odd sl. Need to return the ls bits. */
-		return ( p_slvl_tbl->vl_table[idx] & 0x0F );
+		return ( p_slvl_tbl->raw_vl_by_sl[idx] & 0x0F );
 	}
 	else
 	{
 		/* this is an even sl. Need to return the ms bits. */
-		return ( (p_slvl_tbl->vl_table[idx] & 0xF0) >> 4 );
+		return ( (p_slvl_tbl->raw_vl_by_sl[idx] & 0xF0) >> 4 );
 	}
 }
 /*
@@ -7314,22 +7616,32 @@
 		 ib_gid_t      gid2;                   // 16
 	  } PACK_SUFFIX ntc_257_258;
 
-	  struct _ntc_259 // p/q_key violation with sw info 53
+	  struct _ntc_259 // p/q_key violation from switch 51
 	  {
 		 ib_net16_t    data_valid;   // 2
 		 ib_net16_t    lid1;         // 2
 		 ib_net16_t    lid2;         // 2
-		 ib_net32_t    key;          // 4
-		 uint8_t       sl;           // 1
-		 ib_net32_t    qp1;          // 4
-		 uint8_t       qp2_msb;      // 1
-		 ib_net16_t    qp2_lsb;      // 2
+		 ib_net16_t    pkey;         // 2
+		 ib_net32_t    sl_qp1;       // 4b sl, 4b pad, 24b qp1
+		 ib_net32_t    qp2;          // 8b pad, 24b qp2
 		 ib_gid_t      gid1;         // 16
 		 ib_gid_t      gid2;         // 16
 		 ib_net16_t    sw_lid;       // 2
 		 uint8_t       port_no;      // 1
 	  } PACK_SUFFIX ntc_259;
 
+	  struct _ntc_bkey_259	// bkey violation
+	  {
+		 ib_net16_t lidaddr;
+		 uint8_t method;
+		 uint8_t reserved;
+		 ib_net16_t attribute_id;
+		 ib_net32_t attribute_modifier;
+		 ib_net32_t qp;		// qp is low 24 bits
+		 ib_net64_t bkey;
+		 ib_gid_t gid;
+	  } PACK_SUFFIX ntc_bkey_259;
+
 	} data_details;
 
   ib_gid_t			issuer_gid;    // 16          80
@@ -7352,6 +7664,258 @@
 #define TRAP_144_MASK_LINK_WIDTH_ENABLE_CHANGE (CL_HTON16(0x0002))
 #define TRAP_144_MASK_NODE_DESCRIPTION_CHANGE  (CL_HTON16(0x0001))
 
+/****f* IBA Base: Types/ib_notice_is_generic
+* NAME
+*	ib_notice_is_generic
+*
+* DESCRIPTION
+*	Check if the notice is generic
+*
+* SYNOPSIS
+*/
+static inline boolean_t AL_API
+ib_notice_is_generic(IN const ib_mad_notice_attr_t * p_ntc)
+{
+	return (p_ntc->generic_type & 0x80);
+}
+
+/*
+* PARAMETERS
+*	p_ntc
+*		[in] Pointer to  the notice MAD attribute
+*
+* RETURN VALUES
+*	TRUE if mad is generic
+*
+* SEE ALSO
+*	ib_mad_notice_attr_t
+*********/
+
+/****f* IBA Base: Types/ib_notice_get_type
+* NAME
+*	ib_notice_get_type
+*
+* DESCRIPTION
+*	Get the notice type
+*
+* SYNOPSIS
+*/
+static inline uint8_t AL_API
+ib_notice_get_type(IN const ib_mad_notice_attr_t * p_ntc)
+{
+	return p_ntc->generic_type & 0x7f;
+}
+
+/*
+* PARAMETERS
+*	p_ntc
+*		[in] Pointer to  the notice MAD attribute
+*
+* RETURN VALUES
+*	TRUE if mad is generic
+*
+* SEE ALSO
+*	ib_mad_notice_attr_t
+*********/
+
+/****f* IBA Base: Types/ib_notice_get_prod_type
+* NAME
+*	ib_notice_get_prod_type
+*
+* DESCRIPTION
+*	Get the notice Producer Type of Generic Notice
+*
+* SYNOPSIS
+*/
+static inline ib_net32_t AL_API
+ib_notice_get_prod_type(IN const ib_mad_notice_attr_t * p_ntc)
+{
+	uint32_t pt;
+
+	pt = cl_ntoh16(p_ntc->g_or_v.generic.prod_type_lsb) |
+	    (p_ntc->g_or_v.generic.prod_type_msb << 16);
+	return cl_hton32(pt);
+}
+
+/*
+* PARAMETERS
+*	p_ntc
+*		[in] Pointer to the notice MAD attribute
+*
+* RETURN VALUES
+*	The producer type
+*
+* SEE ALSO
+*	ib_mad_notice_attr_t
+*********/
+
+/****f* IBA Base: Types/ib_notice_set_prod_type
+* NAME
+*	ib_notice_set_prod_type
+*
+* DESCRIPTION
+*	Set the notice Producer Type of Generic Notice
+*
+* SYNOPSIS
+*/
+static inline void AL_API
+ib_notice_set_prod_type(IN ib_mad_notice_attr_t * p_ntc,
+			IN ib_net32_t prod_type_val)
+{
+	uint32_t ptv = cl_ntoh32(prod_type_val);
+	p_ntc->g_or_v.generic.prod_type_lsb =
+	    cl_hton16((uint16_t) (ptv & 0x0000ffff));
+	p_ntc->g_or_v.generic.prod_type_msb =
+	    (uint8_t) ((ptv & 0x00ff0000) >> 16);
+}
+
+/*
+* PARAMETERS
+*	p_ntc
+*		[in] Pointer to the notice MAD attribute
+*
+*  prod_type
+*     [in] The producer Type code
+*
+* RETURN VALUES
+*	None
+*
+* SEE ALSO
+*	ib_mad_notice_attr_t
+*********/
+
+/****f* IBA Base: Types/ib_notice_set_prod_type_ho
+* NAME
+*	ib_notice_set_prod_type_ho
+*
+* DESCRIPTION
+*	Set the notice Producer Type of Generic Notice given Host Order
+*
+* SYNOPSIS
+*/
+static inline void AL_API
+ib_notice_set_prod_type_ho(IN ib_mad_notice_attr_t * p_ntc,
+			   IN uint32_t prod_type_val_ho)
+{
+	p_ntc->g_or_v.generic.prod_type_lsb =
+	    cl_hton16((uint16_t) (prod_type_val_ho & 0x0000ffff));
+	p_ntc->g_or_v.generic.prod_type_msb =
+	    (uint8_t) ((prod_type_val_ho & 0x00ff0000) >> 16);
+}
+
+/*
+* PARAMETERS
+*	p_ntc
+*		[in] Pointer to the notice MAD attribute
+*
+*	prod_type
+*		[in] The producer Type code in host order
+*
+* RETURN VALUES
+*	None
+*
+* SEE ALSO
+*	ib_mad_notice_attr_t
+*********/
+
+/****f* IBA Base: Types/ib_notice_get_vend_id
+* NAME
+*	ib_notice_get_vend_id
+*
+* DESCRIPTION
+*	Get the Vendor Id of Vendor type Notice
+*
+* SYNOPSIS
+*/
+static inline ib_net32_t AL_API
+ib_notice_get_vend_id(IN const ib_mad_notice_attr_t * p_ntc)
+{
+	uint32_t vi;
+
+	vi = cl_ntoh16(p_ntc->g_or_v.vend.vend_id_lsb) |
+	    (p_ntc->g_or_v.vend.vend_id_msb << 16);
+	return cl_hton32(vi);
+}
+
+/*
+* PARAMETERS
+*	p_ntc
+*		[in] Pointer to the notice MAD attribute
+*
+* RETURN VALUES
+*	The Vendor Id of Vendor type Notice
+*
+* SEE ALSO
+*	ib_mad_notice_attr_t
+*********/
+
+/****f* IBA Base: Types/ib_notice_set_vend_id
+* NAME
+*	ib_notice_set_vend_id
+*
+* DESCRIPTION
+*	Set the notice Producer Type of Generic Notice
+*
+* SYNOPSIS
+*/
+static inline void AL_API
+ib_notice_set_vend_id(IN ib_mad_notice_attr_t * p_ntc, IN ib_net32_t vend_id)
+{
+	uint32_t vi = cl_ntoh32(vend_id);
+	p_ntc->g_or_v.vend.vend_id_lsb =
+	    cl_hton16((uint16_t) (vi & 0x0000ffff));
+	p_ntc->g_or_v.vend.vend_id_msb = (uint8_t) ((vi & 0x00ff0000) >> 16);
+}
+
+/*
+* PARAMETERS
+*	p_ntc
+*		[in] Pointer to the notice MAD attribute
+*
+*	vend_id
+*		[in] The producer Type code
+*
+* RETURN VALUES
+*	None
+*
+* SEE ALSO
+*	ib_mad_notice_attr_t
+*********/
+
+/****f* IBA Base: Types/ib_notice_set_vend_id_ho
+* NAME
+*	ib_notice_set_vend_id_ho
+*
+* DESCRIPTION
+*	Set the notice Producer Type of Generic Notice given a host order value
+*
+* SYNOPSIS
+*/
+static inline void AL_API
+ib_notice_set_vend_id_ho(IN ib_mad_notice_attr_t * p_ntc,
+			 IN uint32_t vend_id_ho)
+{
+	p_ntc->g_or_v.vend.vend_id_lsb =
+	    cl_hton16((uint16_t) (vend_id_ho & 0x0000ffff));
+	p_ntc->g_or_v.vend.vend_id_msb =
+	    (uint8_t) ((vend_id_ho & 0x00ff0000) >> 16);
+}
+
+/*
+* PARAMETERS
+*	p_ntc
+*		[in] Pointer to the notice MAD attribute
+*
+*	vend_id_ho
+*		[in] The producer Type code in host order
+*
+* RETURN VALUES
+*	None
+*
+* SEE ALSO
+*	ib_mad_notice_attr_t
+*********/
+
 #include <complib/cl_packon.h>
 typedef struct _ib_inform_info
 {
@@ -7537,6 +8101,40 @@
 }	PACK_SUFFIX ib_inform_info_record_t;
 #include <complib/cl_packoff.h>
 /********/
+
+/****s* IBA Base: Types/ib_perfmgt_mad_t
+* NAME
+*	ib_perfmgt_mad_t
+*
+* DESCRIPTION
+*	IBA defined Perf Management MAD (16.3.1)
+*
+* SYNOPSIS
+*/
+#include <complib/cl_packon.h>
+typedef struct _ib_perfmgt_mad {
+	ib_mad_t header;
+	uint8_t resv[40];
+#define	IB_PM_DATA_SIZE		192
+	uint8_t data[IB_PM_DATA_SIZE];
+} PACK_SUFFIX ib_perfmgt_mad_t;
+#include <complib/cl_packoff.h>
+/*
+* FIELDS
+*	header
+*		Common MAD header.
+*
+*	resv
+*		Reserved.
+*
+*	data
+*		Performance Management payload.  The structure and content of this field
+*		depends upon the method, attr_id, and attr_mod fields in the header.
+*
+* SEE ALSO
+* ib_mad_t
+*********/
+
 /****d* IBA Base: Types/DM_SVC_NAME
 * NAME
 *	DM_SVC_NAME
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ib_types.h
Type: application/octet-stream
Size: 248668 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20091013/3484172e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ib_types.h.patch
Type: application/octet-stream
Size: 18940 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20091013/3484172e/attachment-0001.obj>


More information about the ofw mailing list