From: ftillier Date: Mon, 19 Dec 2005 19:09:18 +0000 (+0000) Subject: [IBAL] Add support for getting link speed (to support DDR and beyond) X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=3e15509ab23d8fff7b4914393dfebab05afba5ab;p=~shefty%2Frdma-win.git [IBAL] Add support for getting link speed (to support DDR and beyond) Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il) git-svn-id: svn://openib.tc.cornell.edu/gen1@211 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/inc/iba/ib_types.h b/trunk/inc/iba/ib_types.h index 3bbbd90c..832e3a7c 100644 --- a/trunk/inc/iba/ib_types.h +++ b/trunk/inc/iba/ib_types.h @@ -3837,7 +3837,8 @@ typedef struct _ib_port_info #define IB_PORT_MPB_SHIFT 6 #define IB_PORT_LINK_SPEED_SHIFT 4 #define IB_PORT_LINK_SPEED_SUPPORTED_MASK 0xF0 - +#define IB_PORT_LINK_SPEED_ACTIVE_MASK 0xF0 +#define IB_PORT_LINK_SPEED_ENABLED_MASK 0x0F #define IB_PORT_CAP_RESV0 (CL_NTOH32(0x00000001)) #define IB_PORT_CAP_IS_SM (CL_NTOH32(0x00000002)) @@ -4110,14 +4111,49 @@ ib_port_info_set_link_speed_sup( * SEE ALSO *********/ +/****f* IBA Base: Types/ib_port_info_get_link_speed_active +* NAME +* ib_port_info_get_link_speed_active +* +* DESCRIPTION +* Returns the Link Speed Active value assigned to this port. +* +* SYNOPSIS +*/ +AL_INLINE uint8_t AL_API +ib_port_info_get_link_speed_active( + IN const ib_port_info_t* const p_pi ) +{ + return( (uint8_t)((p_pi->link_speed & IB_PORT_LINK_SPEED_ACTIVE_MASK) >> + IB_PORT_LINK_SPEED_SHIFT) ); +} +/* +* PARAMETERS +* p_pi +* [in] Pointer to a PortInfo attribute. +* +* RETURN VALUES +* Returns the link speed active value assigned to this port. +* +* NOTES +* +* SEE ALSO +*********/ + + #define IB_LINK_WIDTH_ACTIVE_1X 1 #define IB_LINK_WIDTH_ACTIVE_4X 2 #define IB_LINK_WIDTH_ACTIVE_12X 8 +#define IB_LINK_SPEED_ACTIVE_2_5 1 +#define IB_LINK_SPEED_ACTIVE_5 2 +#define IB_LINK_SPEED_ACTIVE_10 4 + #define IB_PATH_RECORD_RATE_2_5_GBS 2 #define IB_PATH_RECORD_RATE_10_GBS 3 #define IB_PATH_RECORD_RATE_30_GBS 4 + /****f* IBA Base: Types/ib_port_info_compute_rate * NAME * ib_port_info_compute_rate