Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298960
b: refs/heads/master
c: 0559d8d
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier committed Apr 2, 2012
1 parent 4fd3812 commit 5043604
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d2ef406866620f0450ad0b4c7fb5c2796c7bf245
refs/heads/master: 0559d8dc13a1cd68b5e64c0b61659f36c7b5c89f
9 changes: 5 additions & 4 deletions trunk/drivers/infiniband/core/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,14 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused,
{
struct ib_port_attr attr;
char *speed = "";
int rate = -1; /* in deci-Gb/sec */
int rate; /* in deci-Gb/sec */
ssize_t ret;

ret = ib_query_port(p->ibdev, p->port_num, &attr);
if (ret)
return ret;

switch (attr.active_speed) {
case IB_SPEED_SDR:
rate = 25;
break;
case IB_SPEED_DDR:
speed = " DDR";
rate = 50;
Expand All @@ -210,6 +207,10 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused,
speed = " EDR";
rate = 250;
break;
case IB_SPEED_SDR:
default: /* default to SDR for invalid rates */
rate = 25;
break;
}

rate *= ib_width_enum_to_int(attr.active_width);
Expand Down

0 comments on commit 5043604

Please sign in to comment.