[openib-general] [PATCH1/2] OpenSM/ib_types.h: Add ib_mgid_get/set_scope routines

Hal Rosenstock halr at voltaire.com
Fri Jan 5 05:37:32 PST 2007


OpenSM/ib_types.h: Add ib_mgid_get/set_scope routines

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

diff --git a/osm/include/iba/ib_types.h b/osm/include/iba/ib_types.h
index 5dd4753..acf9141 100644
--- a/osm/include/iba/ib_types.h
+++ b/osm/include/iba/ib_types.h
@@ -2100,6 +2100,40 @@ ib_gid_is_multicast(
 	return( p_gid->raw[0] == 0xFF );
 }
 
+/****f* IBA Base: Types/ib_gid_get_scope
+* NAME
+*	ib_gid_get_scope
+*
+* DESCRIPTION
+*	Returns scope of (assumed) multicast GID.
+*
+* SYNOPSIS
+*/
+static inline uint8_t OSM_API
+ib_mgid_get_scope(
+	IN	const	ib_gid_t*		p_gid )
+{
+	return( p_gid->raw[1] & 0x0F );
+}
+
+/****f* IBA Base: Types/ib_gid_set_scope
+* NAME
+*	ib_gid_set_scope
+*
+* DESCRIPTION
+*	Sets scope of (assumed) multicast GID.
+*
+* SYNOPSIS
+*/
+static inline void OSM_API
+ib_mgid_set_scope(
+        IN      	ib_gid_t*               p_gid,
+	IN	const	uint8_t			scope )
+{
+	p_gid->raw[1] &= 0xF0;
+	p_gid->raw[1] |= scope & 0x0F;
+}
+
 /****f* IBA Base: Types/ib_gid_set_default
 * NAME
 *	ib_gid_set_default







More information about the general mailing list