summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2012-02-28 17:49:50 +0100
committerRoland Dreier <roland@purestorage.com>2012-03-05 18:25:16 +0100
commit2e96691c31ecf749f48aa94ea837b95dd656f5c2 (patch)
tree5e2bfaf522d66bc23c1ec0490fb3364c09aad4f2 /drivers/infiniband/hw/mlx4
parentIB/core: Fix SDR rates in sysfs (diff)
downloadlinux-2e96691c31ecf749f48aa94ea837b95dd656f5c2.tar.xz
linux-2e96691c31ecf749f48aa94ea837b95dd656f5c2.zip
IB: Use central enum for speed instead of hard-coded values
The kernel IB stack uses one enumeration for IB speed, which wasn't explicitly specified in the verbs header file. Add that enum, and use it all over the code. The IB speed/width notation is also used by iWARP and IBoE HW drivers, which use the convention of rate = speed * width to advertise their port link rate. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4')
-rw-r--r--drivers/infiniband/hw/mlx4/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 7b445df6a667..6ff6bdf28a3a 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -215,16 +215,16 @@ static int ib_link_query_port(struct ib_device *ibdev, u8 port,
switch (ext_active_speed) {
case 1:
- props->active_speed = 16; /* FDR */
+ props->active_speed = IB_SPEED_FDR;
break;
case 2:
- props->active_speed = 32; /* EDR */
+ props->active_speed = IB_SPEED_EDR;
break;
}
}
/* If reported active speed is QDR, check if is FDR-10 */
- if (props->active_speed == 4) {
+ if (props->active_speed == IB_SPEED_QDR) {
if (to_mdev(ibdev)->dev->caps.ext_port_cap[port] &
MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO) {
init_query_mad(in_mad);
@@ -238,7 +238,7 @@ static int ib_link_query_port(struct ib_device *ibdev, u8 port,
/* Checking LinkSpeedActive for FDR-10 */
if (out_mad->data[15] & 0x1)
- props->active_speed = 8;
+ props->active_speed = IB_SPEED_FDR10;
}
}
@@ -259,7 +259,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
enum ib_mtu tmp;
props->active_width = IB_WIDTH_1X;
- props->active_speed = 4;
+ props->active_speed = IB_SPEED_QDR;
props->port_cap_flags = IB_PORT_CM_SUP;
props->gid_tbl_len = to_mdev(ibdev)->dev->caps.gid_table_len[port];
props->max_msg_sz = to_mdev(ibdev)->dev->caps.max_msg_sz;