[IBAL] Add support for getting link speed (to support DDR and beyond)
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 19 Dec 2005 19:09:18 +0000 (19:09 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 19 Dec 2005 19:09:18 +0000 (19:09 +0000)
Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@211 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

inc/iba/ib_types.h

index 3bbbd90..832e3a7 100644 (file)
@@ -3837,7 +3837,8 @@ typedef struct _ib_port_info
 #define IB_PORT_MPB_SHIFT                                                      6\r
 #define IB_PORT_LINK_SPEED_SHIFT                                       4\r
 #define IB_PORT_LINK_SPEED_SUPPORTED_MASK                      0xF0\r
-\r
+#define IB_PORT_LINK_SPEED_ACTIVE_MASK                         0xF0\r
+#define IB_PORT_LINK_SPEED_ENABLED_MASK                                0x0F\r
 \r
 #define IB_PORT_CAP_RESV0                      (CL_NTOH32(0x00000001))\r
 #define IB_PORT_CAP_IS_SM                      (CL_NTOH32(0x00000002))\r
@@ -4110,14 +4111,49 @@ ib_port_info_set_link_speed_sup(
 * SEE ALSO\r
 *********/\r
 \r
+/****f* IBA Base: Types/ib_port_info_get_link_speed_active\r
+* NAME\r
+*      ib_port_info_get_link_speed_active\r
+*\r
+* DESCRIPTION\r
+*      Returns the Link Speed Active value assigned to this port.\r
+*\r
+* SYNOPSIS\r
+*/\r
+AL_INLINE uint8_t AL_API\r
+ib_port_info_get_link_speed_active(\r
+       IN              const   ib_port_info_t* const           p_pi )\r
+{\r
+       return( (uint8_t)((p_pi->link_speed & IB_PORT_LINK_SPEED_ACTIVE_MASK) >>\r
+               IB_PORT_LINK_SPEED_SHIFT) );\r
+}\r
+/*\r
+* PARAMETERS\r
+*      p_pi\r
+*              [in] Pointer to a PortInfo attribute.\r
+*\r
+* RETURN VALUES\r
+*      Returns the link speed active value assigned to this port.\r
+*\r
+* NOTES\r
+*\r
+* SEE ALSO\r
+*********/\r
+\r
+\r
 #define IB_LINK_WIDTH_ACTIVE_1X                        1\r
 #define IB_LINK_WIDTH_ACTIVE_4X                        2\r
 #define IB_LINK_WIDTH_ACTIVE_12X               8\r
 \r
+#define IB_LINK_SPEED_ACTIVE_2_5               1\r
+#define IB_LINK_SPEED_ACTIVE_5                 2\r
+#define IB_LINK_SPEED_ACTIVE_10                        4\r
+\r
 #define IB_PATH_RECORD_RATE_2_5_GBS            2\r
 #define IB_PATH_RECORD_RATE_10_GBS             3\r
 #define IB_PATH_RECORD_RATE_30_GBS             4\r
 \r
+\r
 /****f* IBA Base: Types/ib_port_info_compute_rate\r
 * NAME\r
 *      ib_port_info_compute_rate\r