[IBAL] Update ib_port_info_compute_rate to handle DDR and QDR rates.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 28 Feb 2006 01:11:47 +0000 (01:11 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 28 Feb 2006 01:11:47 +0000 (01:11 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@220 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

inc/iba/ib_types.h

index 8dd2302..1d6b456 100644 (file)
@@ -4169,27 +4169,41 @@ ib_port_info_get_link_speed_active(
 *\r
 * SYNOPSIS\r
 */\r
-\r
 AL_INLINE uint8_t AL_API\r
 ib_port_info_compute_rate(\r
        IN              const   ib_port_info_t* const           p_pi )\r
 {\r
-       switch(p_pi->link_width_active)\r
+       switch( p_pi->link_width_active * p_pi->link_width_active *\r
+               ib_port_info_get_link_speed_active( p_pi ) )\r
        {\r
-               case IB_LINK_WIDTH_ACTIVE_1X:\r
-                        return IB_PATH_RECORD_RATE_2_5_GBS;\r
+       case 1:\r
+               return IB_PATH_RECORD_RATE_2_5_GBS;\r
 \r
-               case IB_LINK_WIDTH_ACTIVE_4X:\r
-                       return IB_PATH_RECORD_RATE_10_GBS;\r
+       case 2:\r
+               return IB_PATH_RECORD_RATE_5_GBS;\r
 \r
-               case IB_LINK_WIDTH_ACTIVE_12X:\r
-                       return IB_PATH_RECORD_RATE_30_GBS;\r
+       case 4:\r
+               return IB_PATH_RECORD_RATE_10_GBS;\r
 \r
-               default:\r
-                       return IB_PATH_RECORD_RATE_2_5_GBS;\r
+       case 8:\r
+               return IB_PATH_RECORD_RATE_20_GBS;\r
+\r
+       case 16:\r
+               return IB_PATH_RECORD_RATE_40_GBS;\r
+\r
+       case 64:\r
+               return IB_PATH_RECORD_RATE_30_GBS;\r
+\r
+       case 128:\r
+               return IB_PATH_RECORD_RATE_60_GBS;\r
+\r
+       case 256:\r
+               return IB_PATH_RECORD_RATE_120_GBS;\r
+\r
+       default:\r
+               return IB_PATH_RECORD_RATE_2_5_GBS;\r
        }\r
 }\r
-\r
 /*\r
 * PARAMETERS\r
 *      p_pi\r