diff options
author | Hariprasad Shenai <hariprasad@chelsio.com> | 2015-10-01 11:18:48 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-05 13:48:41 +0300 |
commit | 85412255ef4fcccf52e0408d61cf8a75828a6800 (patch) | |
tree | 1c5290a7247d45c3e7b94878bdd4d7c567c37e06 /drivers/net/ethernet/chelsio | |
parent | da4976e17bff3bb7538090c36750b9875da67b5e (diff) | |
download | linux-85412255ef4fcccf52e0408d61cf8a75828a6800.tar.xz |
cxgb4: Report correct link speed for unsupported ones
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>
Diffstat (limited to 'drivers/net/ethernet/chelsio')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 0b7570ddbe1a..9f1f5b2aacf7 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -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) { @@ -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, |