Skip to content

Commit

Permalink
cxgb4: Report correct link speed for unsupported ones
Browse files Browse the repository at this point in the history
When we get garbage from the firmware with weird Port Speeds,
etc. we should emit a warning regarding unsupported speeds rather than
use the bogus default of "10Mbps" which isn't even an option in the
firmware Port Information message

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hariprasad Shenai authored and David S. Miller committed Oct 5, 2015
1 parent da4976e commit 8541225
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ static void link_report(struct net_device *dev)
else {
static const char *fc[] = { "no", "Rx", "Tx", "Tx/Rx" };

const char *s = "10Mbps";
const char *s;
const struct port_info *p = netdev_priv(dev);

switch (p->link_cfg.speed) {
Expand All @@ -291,6 +291,10 @@ static void link_report(struct net_device *dev)
case 40000:
s = "40Gbps";
break;
default:
pr_info("%s: unsupported speed: %d\n",
dev->name, p->link_cfg.speed);
return;
}

netdev_info(dev, "link up, %s, full-duplex, %s PAUSE\n", s,
Expand Down

0 comments on commit 8541225

Please sign in to comment.