summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorYuval Mintz <Yuval.Mintz@qlogic.com>2015-06-25 08:19:22 -0400
committerDavid S. Miller <davem@davemloft.net>2015-06-25 09:30:33 -0400
commit5d67c1c593d005653357d638569d85ede4a365a3 (patch)
tree315c169c9615308f2c227e87dbde23c2be498ad4 /drivers/net
parent1359d73c1d6fa737545d946f9bcb4b9a6b13a6ea (diff)
bnx2x: Correct speed from baseT into KR.
ethtool shows KR supported/advertised speeds incorrectly as baseT in cases the board is in fact KR-base. Signed-off-by: Yaniv Rosner <Yaniv.Rosner@qlogic.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c55
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c10
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c13
3 files changed, 59 insertions, 19 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 48ed005ba73f..733b0fc59cd7 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -257,14 +257,15 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
257{ 257{
258 struct bnx2x *bp = netdev_priv(dev); 258 struct bnx2x *bp = netdev_priv(dev);
259 int cfg_idx = bnx2x_get_link_cfg_idx(bp); 259 int cfg_idx = bnx2x_get_link_cfg_idx(bp);
260 u32 media_type;
260 261
261 /* Dual Media boards present all available port types */ 262 /* Dual Media boards present all available port types */
262 cmd->supported = bp->port.supported[cfg_idx] | 263 cmd->supported = bp->port.supported[cfg_idx] |
263 (bp->port.supported[cfg_idx ^ 1] & 264 (bp->port.supported[cfg_idx ^ 1] &
264 (SUPPORTED_TP | SUPPORTED_FIBRE)); 265 (SUPPORTED_TP | SUPPORTED_FIBRE));
265 cmd->advertising = bp->port.advertising[cfg_idx]; 266 cmd->advertising = bp->port.advertising[cfg_idx];
266 if (bp->link_params.phy[bnx2x_get_cur_phy_idx(bp)].media_type == 267 media_type = bp->link_params.phy[bnx2x_get_cur_phy_idx(bp)].media_type;
267 ETH_PHY_SFP_1G_FIBER) { 268 if (media_type == ETH_PHY_SFP_1G_FIBER) {
268 cmd->supported &= ~(SUPPORTED_10000baseT_Full); 269 cmd->supported &= ~(SUPPORTED_10000baseT_Full);
269 cmd->advertising &= ~(ADVERTISED_10000baseT_Full); 270 cmd->advertising &= ~(ADVERTISED_10000baseT_Full);
270 } 271 }
@@ -312,12 +313,26 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
312 cmd->lp_advertising |= ADVERTISED_100baseT_Full; 313 cmd->lp_advertising |= ADVERTISED_100baseT_Full;
313 if (status & LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE) 314 if (status & LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE)
314 cmd->lp_advertising |= ADVERTISED_1000baseT_Half; 315 cmd->lp_advertising |= ADVERTISED_1000baseT_Half;
315 if (status & LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE) 316 if (status & LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE) {
316 cmd->lp_advertising |= ADVERTISED_1000baseT_Full; 317 if (media_type == ETH_PHY_KR) {
318 cmd->lp_advertising |=
319 ADVERTISED_1000baseKX_Full;
320 } else {
321 cmd->lp_advertising |=
322 ADVERTISED_1000baseT_Full;
323 }
324 }
317 if (status & LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE) 325 if (status & LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE)
318 cmd->lp_advertising |= ADVERTISED_2500baseX_Full; 326 cmd->lp_advertising |= ADVERTISED_2500baseX_Full;
319 if (status & LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE) 327 if (status & LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE) {
320 cmd->lp_advertising |= ADVERTISED_10000baseT_Full; 328 if (media_type == ETH_PHY_KR) {
329 cmd->lp_advertising |=
330 ADVERTISED_10000baseKR_Full;
331 } else {
332 cmd->lp_advertising |=
333 ADVERTISED_10000baseT_Full;
334 }
335 }
321 if (status & LINK_STATUS_LINK_PARTNER_20GXFD_CAPABLE) 336 if (status & LINK_STATUS_LINK_PARTNER_20GXFD_CAPABLE)
322 cmd->lp_advertising |= ADVERTISED_20000baseKR2_Full; 337 cmd->lp_advertising |= ADVERTISED_20000baseKR2_Full;
323 } 338 }
@@ -564,15 +579,20 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
564 return -EINVAL; 579 return -EINVAL;
565 } 580 }
566 581
567 if (!(bp->port.supported[cfg_idx] & 582 if (bp->port.supported[cfg_idx] &
568 SUPPORTED_1000baseT_Full)) { 583 SUPPORTED_1000baseT_Full) {
584 advertising = (ADVERTISED_1000baseT_Full |
585 ADVERTISED_TP);
586
587 } else if (bp->port.supported[cfg_idx] &
588 SUPPORTED_1000baseKX_Full) {
589 advertising = ADVERTISED_1000baseKX_Full;
590 } else {
569 DP(BNX2X_MSG_ETHTOOL, 591 DP(BNX2X_MSG_ETHTOOL,
570 "1G full not supported\n"); 592 "1G full not supported\n");
571 return -EINVAL; 593 return -EINVAL;
572 } 594 }
573 595
574 advertising = (ADVERTISED_1000baseT_Full |
575 ADVERTISED_TP);
576 break; 596 break;
577 597
578 case SPEED_2500: 598 case SPEED_2500:
@@ -600,17 +620,22 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
600 return -EINVAL; 620 return -EINVAL;
601 } 621 }
602 phy_idx = bnx2x_get_cur_phy_idx(bp); 622 phy_idx = bnx2x_get_cur_phy_idx(bp);
603 if (!(bp->port.supported[cfg_idx] 623 if ((bp->port.supported[cfg_idx] &
604 & SUPPORTED_10000baseT_Full) || 624 SUPPORTED_10000baseT_Full) &&
605 (bp->link_params.phy[phy_idx].media_type == 625 (bp->link_params.phy[phy_idx].media_type !=
606 ETH_PHY_SFP_1G_FIBER)) { 626 ETH_PHY_SFP_1G_FIBER)) {
627 advertising = (ADVERTISED_10000baseT_Full |
628 ADVERTISED_FIBRE);
629 } else if (bp->port.supported[cfg_idx] &
630 SUPPORTED_10000baseKR_Full) {
631 advertising = (ADVERTISED_10000baseKR_Full |
632 ADVERTISED_FIBRE);
633 } else {
607 DP(BNX2X_MSG_ETHTOOL, 634 DP(BNX2X_MSG_ETHTOOL,
608 "10G full not supported\n"); 635 "10G full not supported\n");
609 return -EINVAL; 636 return -EINVAL;
610 } 637 }
611 638
612 advertising = (ADVERTISED_10000baseT_Full |
613 ADVERTISED_FIBRE);
614 break; 639 break;
615 640
616 default: 641 default:
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index b287fc8d3c80..a0b03c27e0a3 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -11493,7 +11493,9 @@ static const struct bnx2x_phy phy_warpcore = {
11493 SUPPORTED_100baseT_Half | 11493 SUPPORTED_100baseT_Half |
11494 SUPPORTED_100baseT_Full | 11494 SUPPORTED_100baseT_Full |
11495 SUPPORTED_1000baseT_Full | 11495 SUPPORTED_1000baseT_Full |
11496 SUPPORTED_1000baseKX_Full |
11496 SUPPORTED_10000baseT_Full | 11497 SUPPORTED_10000baseT_Full |
11498 SUPPORTED_10000baseKR_Full |
11497 SUPPORTED_20000baseKR2_Full | 11499 SUPPORTED_20000baseKR2_Full |
11498 SUPPORTED_20000baseMLD2_Full | 11500 SUPPORTED_20000baseMLD2_Full |
11499 SUPPORTED_FIBRE | 11501 SUPPORTED_FIBRE |
@@ -11999,8 +12001,8 @@ static int bnx2x_populate_int_phy(struct bnx2x *bp, u32 shmem_base, u8 port,
11999 break; 12001 break;
12000 case PORT_HW_CFG_NET_SERDES_IF_KR: 12002 case PORT_HW_CFG_NET_SERDES_IF_KR:
12001 phy->media_type = ETH_PHY_KR; 12003 phy->media_type = ETH_PHY_KR;
12002 phy->supported &= (SUPPORTED_1000baseT_Full | 12004 phy->supported &= (SUPPORTED_1000baseKX_Full |
12003 SUPPORTED_10000baseT_Full | 12005 SUPPORTED_10000baseKR_Full |
12004 SUPPORTED_FIBRE | 12006 SUPPORTED_FIBRE |
12005 SUPPORTED_Autoneg | 12007 SUPPORTED_Autoneg |
12006 SUPPORTED_Pause | 12008 SUPPORTED_Pause |
@@ -12018,8 +12020,8 @@ static int bnx2x_populate_int_phy(struct bnx2x *bp, u32 shmem_base, u8 port,
12018 phy->media_type = ETH_PHY_KR; 12020 phy->media_type = ETH_PHY_KR;
12019 phy->flags |= FLAGS_WC_DUAL_MODE; 12021 phy->flags |= FLAGS_WC_DUAL_MODE;
12020 phy->supported &= (SUPPORTED_20000baseKR2_Full | 12022 phy->supported &= (SUPPORTED_20000baseKR2_Full |
12021 SUPPORTED_10000baseT_Full | 12023 SUPPORTED_10000baseKR_Full |
12022 SUPPORTED_1000baseT_Full | 12024 SUPPORTED_1000baseKX_Full |
12023 SUPPORTED_Autoneg | 12025 SUPPORTED_Autoneg |
12024 SUPPORTED_FIBRE | 12026 SUPPORTED_FIBRE |
12025 SUPPORTED_Pause | 12027 SUPPORTED_Pause |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index a03a9f25f8bb..bf5f5df2de44 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -11143,6 +11143,12 @@ static void bnx2x_link_settings_requested(struct bnx2x *bp)
11143 bp->port.advertising[idx] |= 11143 bp->port.advertising[idx] |=
11144 (ADVERTISED_1000baseT_Full | 11144 (ADVERTISED_1000baseT_Full |
11145 ADVERTISED_TP); 11145 ADVERTISED_TP);
11146 } else if (bp->port.supported[idx] &
11147 SUPPORTED_1000baseKX_Full) {
11148 bp->link_params.req_line_speed[idx] =
11149 SPEED_1000;
11150 bp->port.advertising[idx] |=
11151 ADVERTISED_1000baseKX_Full;
11146 } else { 11152 } else {
11147 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", 11153 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n",
11148 link_config, 11154 link_config,
@@ -11175,6 +11181,13 @@ static void bnx2x_link_settings_requested(struct bnx2x *bp)
11175 bp->port.advertising[idx] |= 11181 bp->port.advertising[idx] |=
11176 (ADVERTISED_10000baseT_Full | 11182 (ADVERTISED_10000baseT_Full |
11177 ADVERTISED_FIBRE); 11183 ADVERTISED_FIBRE);
11184 } else if (bp->port.supported[idx] &
11185 SUPPORTED_10000baseKR_Full) {
11186 bp->link_params.req_line_speed[idx] =
11187 SPEED_10000;
11188 bp->port.advertising[idx] |=
11189 (ADVERTISED_10000baseKR_Full |
11190 ADVERTISED_FIBRE);
11178 } else { 11191 } else {
11179 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", 11192 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n",
11180 link_config, 11193 link_config,