Skip to content

Commit 8541225

Browse files
Hariprasad Shenaidavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent da4976e commit 8541225

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static void link_report(struct net_device *dev)
275275
else {
276276
static const char *fc[] = { "no", "Rx", "Tx", "Tx/Rx" };
277277

278-
const char *s = "10Mbps";
278+
const char *s;
279279
const struct port_info *p = netdev_priv(dev);
280280

281281
switch (p->link_cfg.speed) {
@@ -291,6 +291,10 @@ static void link_report(struct net_device *dev)
291291
case 40000:
292292
s = "40Gbps";
293293
break;
294+
default:
295+
pr_info("%s: unsupported speed: %d\n",
296+
dev->name, p->link_cfg.speed);
297+
return;
294298
}
295299

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

0 commit comments

Comments
 (0)