diff options
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index ebf40cd7aa10..c65295dded39 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -905,6 +905,7 @@ static int bnx2x_nway_reset(struct net_device *dev) | |||
905 | 905 | ||
906 | if (netif_running(dev)) { | 906 | if (netif_running(dev)) { |
907 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); | 907 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); |
908 | bnx2x_force_link_reset(bp); | ||
908 | bnx2x_link_set(bp); | 909 | bnx2x_link_set(bp); |
909 | } | 910 | } |
910 | 911 | ||
@@ -1606,7 +1607,7 @@ static int bnx2x_set_pauseparam(struct net_device *dev, | |||
1606 | return 0; | 1607 | return 0; |
1607 | } | 1608 | } |
1608 | 1609 | ||
1609 | static char *bnx2x_tests_str_arr[BNX2X_NUM_TESTS_SF] = { | 1610 | static const char bnx2x_tests_str_arr[BNX2X_NUM_TESTS_SF][ETH_GSTRING_LEN] = { |
1610 | "register_test (offline) ", | 1611 | "register_test (offline) ", |
1611 | "memory_test (offline) ", | 1612 | "memory_test (offline) ", |
1612 | "int_loopback_test (offline)", | 1613 | "int_loopback_test (offline)", |
@@ -1653,7 +1654,7 @@ static int bnx2x_get_eee(struct net_device *dev, struct ethtool_eee *edata) | |||
1653 | return -EOPNOTSUPP; | 1654 | return -EOPNOTSUPP; |
1654 | } | 1655 | } |
1655 | 1656 | ||
1656 | eee_cfg = SHMEM2_RD(bp, eee_status[BP_PORT(bp)]); | 1657 | eee_cfg = bp->link_vars.eee_status; |
1657 | 1658 | ||
1658 | edata->supported = | 1659 | edata->supported = |
1659 | bnx2x_eee_to_adv((eee_cfg & SHMEM_EEE_SUPPORTED_MASK) >> | 1660 | bnx2x_eee_to_adv((eee_cfg & SHMEM_EEE_SUPPORTED_MASK) >> |
@@ -1690,7 +1691,7 @@ static int bnx2x_set_eee(struct net_device *dev, struct ethtool_eee *edata) | |||
1690 | return -EOPNOTSUPP; | 1691 | return -EOPNOTSUPP; |
1691 | } | 1692 | } |
1692 | 1693 | ||
1693 | eee_cfg = SHMEM2_RD(bp, eee_status[BP_PORT(bp)]); | 1694 | eee_cfg = bp->link_vars.eee_status; |
1694 | 1695 | ||
1695 | if (!(eee_cfg & SHMEM_EEE_SUPPORTED_MASK)) { | 1696 | if (!(eee_cfg & SHMEM_EEE_SUPPORTED_MASK)) { |
1696 | DP(BNX2X_MSG_ETHTOOL, "Board does not support EEE!\n"); | 1697 | DP(BNX2X_MSG_ETHTOOL, "Board does not support EEE!\n"); |
@@ -1739,6 +1740,7 @@ static int bnx2x_set_eee(struct net_device *dev, struct ethtool_eee *edata) | |||
1739 | /* Restart link to propogate changes */ | 1740 | /* Restart link to propogate changes */ |
1740 | if (netif_running(dev)) { | 1741 | if (netif_running(dev)) { |
1741 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); | 1742 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); |
1743 | bnx2x_force_link_reset(bp); | ||
1742 | bnx2x_link_set(bp); | 1744 | bnx2x_link_set(bp); |
1743 | } | 1745 | } |
1744 | 1746 | ||
@@ -2038,8 +2040,6 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode) | |||
2038 | u16 pkt_prod, bd_prod; | 2040 | u16 pkt_prod, bd_prod; |
2039 | struct sw_tx_bd *tx_buf; | 2041 | struct sw_tx_bd *tx_buf; |
2040 | struct eth_tx_start_bd *tx_start_bd; | 2042 | struct eth_tx_start_bd *tx_start_bd; |
2041 | struct eth_tx_parse_bd_e1x *pbd_e1x = NULL; | ||
2042 | struct eth_tx_parse_bd_e2 *pbd_e2 = NULL; | ||
2043 | dma_addr_t mapping; | 2043 | dma_addr_t mapping; |
2044 | union eth_rx_cqe *cqe; | 2044 | union eth_rx_cqe *cqe; |
2045 | u8 cqe_fp_flags, cqe_fp_type; | 2045 | u8 cqe_fp_flags, cqe_fp_type; |
@@ -2131,21 +2131,32 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode) | |||
2131 | tx_start_bd->vlan_or_ethertype = cpu_to_le16(pkt_prod); | 2131 | tx_start_bd->vlan_or_ethertype = cpu_to_le16(pkt_prod); |
2132 | tx_start_bd->bd_flags.as_bitfield = ETH_TX_BD_FLAGS_START_BD; | 2132 | tx_start_bd->bd_flags.as_bitfield = ETH_TX_BD_FLAGS_START_BD; |
2133 | SET_FLAG(tx_start_bd->general_data, | 2133 | SET_FLAG(tx_start_bd->general_data, |
2134 | ETH_TX_START_BD_ETH_ADDR_TYPE, | ||
2135 | UNICAST_ADDRESS); | ||
2136 | SET_FLAG(tx_start_bd->general_data, | ||
2137 | ETH_TX_START_BD_HDR_NBDS, | 2134 | ETH_TX_START_BD_HDR_NBDS, |
2138 | 1); | 2135 | 1); |
2136 | SET_FLAG(tx_start_bd->general_data, | ||
2137 | ETH_TX_START_BD_PARSE_NBDS, | ||
2138 | 0); | ||
2139 | 2139 | ||
2140 | /* turn on parsing and get a BD */ | 2140 | /* turn on parsing and get a BD */ |
2141 | bd_prod = TX_BD(NEXT_TX_IDX(bd_prod)); | 2141 | bd_prod = TX_BD(NEXT_TX_IDX(bd_prod)); |
2142 | 2142 | ||
2143 | pbd_e1x = &txdata->tx_desc_ring[bd_prod].parse_bd_e1x; | 2143 | if (CHIP_IS_E1x(bp)) { |
2144 | pbd_e2 = &txdata->tx_desc_ring[bd_prod].parse_bd_e2; | 2144 | u16 global_data = 0; |
2145 | 2145 | struct eth_tx_parse_bd_e1x *pbd_e1x = | |
2146 | memset(pbd_e2, 0, sizeof(struct eth_tx_parse_bd_e2)); | 2146 | &txdata->tx_desc_ring[bd_prod].parse_bd_e1x; |
2147 | memset(pbd_e1x, 0, sizeof(struct eth_tx_parse_bd_e1x)); | 2147 | memset(pbd_e1x, 0, sizeof(struct eth_tx_parse_bd_e1x)); |
2148 | 2148 | SET_FLAG(global_data, | |
2149 | ETH_TX_PARSE_BD_E1X_ETH_ADDR_TYPE, UNICAST_ADDRESS); | ||
2150 | pbd_e1x->global_data = cpu_to_le16(global_data); | ||
2151 | } else { | ||
2152 | u32 parsing_data = 0; | ||
2153 | struct eth_tx_parse_bd_e2 *pbd_e2 = | ||
2154 | &txdata->tx_desc_ring[bd_prod].parse_bd_e2; | ||
2155 | memset(pbd_e2, 0, sizeof(struct eth_tx_parse_bd_e2)); | ||
2156 | SET_FLAG(parsing_data, | ||
2157 | ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE, UNICAST_ADDRESS); | ||
2158 | pbd_e2->parsing_data = cpu_to_le32(parsing_data); | ||
2159 | } | ||
2149 | wmb(); | 2160 | wmb(); |
2150 | 2161 | ||
2151 | txdata->tx_db.data.prod += 2; | 2162 | txdata->tx_db.data.prod += 2; |
@@ -2263,7 +2274,7 @@ static int bnx2x_test_ext_loopback(struct bnx2x *bp) | |||
2263 | if (!netif_running(bp->dev)) | 2274 | if (!netif_running(bp->dev)) |
2264 | return BNX2X_EXT_LOOPBACK_FAILED; | 2275 | return BNX2X_EXT_LOOPBACK_FAILED; |
2265 | 2276 | ||
2266 | bnx2x_nic_unload(bp, UNLOAD_NORMAL); | 2277 | bnx2x_nic_unload(bp, UNLOAD_NORMAL, false); |
2267 | rc = bnx2x_nic_load(bp, LOAD_LOOPBACK_EXT); | 2278 | rc = bnx2x_nic_load(bp, LOAD_LOOPBACK_EXT); |
2268 | if (rc) { | 2279 | if (rc) { |
2269 | DP(BNX2X_MSG_ETHTOOL, | 2280 | DP(BNX2X_MSG_ETHTOOL, |
@@ -2414,7 +2425,7 @@ static void bnx2x_self_test(struct net_device *dev, | |||
2414 | 2425 | ||
2415 | link_up = bp->link_vars.link_up; | 2426 | link_up = bp->link_vars.link_up; |
2416 | 2427 | ||
2417 | bnx2x_nic_unload(bp, UNLOAD_NORMAL); | 2428 | bnx2x_nic_unload(bp, UNLOAD_NORMAL, false); |
2418 | rc = bnx2x_nic_load(bp, LOAD_DIAG); | 2429 | rc = bnx2x_nic_load(bp, LOAD_DIAG); |
2419 | if (rc) { | 2430 | if (rc) { |
2420 | etest->flags |= ETH_TEST_FL_FAILED; | 2431 | etest->flags |= ETH_TEST_FL_FAILED; |
@@ -2446,7 +2457,7 @@ static void bnx2x_self_test(struct net_device *dev, | |||
2446 | etest->flags |= ETH_TEST_FL_EXTERNAL_LB_DONE; | 2457 | etest->flags |= ETH_TEST_FL_EXTERNAL_LB_DONE; |
2447 | } | 2458 | } |
2448 | 2459 | ||
2449 | bnx2x_nic_unload(bp, UNLOAD_NORMAL); | 2460 | bnx2x_nic_unload(bp, UNLOAD_NORMAL, false); |
2450 | 2461 | ||
2451 | /* restore input for TX port IF */ | 2462 | /* restore input for TX port IF */ |
2452 | REG_WR(bp, NIG_REG_EGRESS_UMP0_IN_EN + port*4, val); | 2463 | REG_WR(bp, NIG_REG_EGRESS_UMP0_IN_EN + port*4, val); |
@@ -2534,7 +2545,7 @@ static int bnx2x_get_sset_count(struct net_device *dev, int stringset) | |||
2534 | static void bnx2x_get_strings(struct net_device *dev, u32 stringset, u8 *buf) | 2545 | static void bnx2x_get_strings(struct net_device *dev, u32 stringset, u8 *buf) |
2535 | { | 2546 | { |
2536 | struct bnx2x *bp = netdev_priv(dev); | 2547 | struct bnx2x *bp = netdev_priv(dev); |
2537 | int i, j, k, offset, start; | 2548 | int i, j, k, start; |
2538 | char queue_name[MAX_QUEUE_NAME_LEN+1]; | 2549 | char queue_name[MAX_QUEUE_NAME_LEN+1]; |
2539 | 2550 | ||
2540 | switch (stringset) { | 2551 | switch (stringset) { |
@@ -2570,13 +2581,8 @@ static void bnx2x_get_strings(struct net_device *dev, u32 stringset, u8 *buf) | |||
2570 | start = 0; | 2581 | start = 0; |
2571 | else | 2582 | else |
2572 | start = 4; | 2583 | start = 4; |
2573 | for (i = 0, j = start; j < (start + BNX2X_NUM_TESTS(bp)); | 2584 | memcpy(buf, bnx2x_tests_str_arr + start, |
2574 | i++, j++) { | 2585 | ETH_GSTRING_LEN * BNX2X_NUM_TESTS(bp)); |
2575 | offset = sprintf(buf+32*i, "%s", | ||
2576 | bnx2x_tests_str_arr[j]); | ||
2577 | *(buf+offset) = '\0'; | ||
2578 | } | ||
2579 | break; | ||
2580 | } | 2586 | } |
2581 | } | 2587 | } |
2582 | 2588 | ||
@@ -2940,7 +2946,7 @@ static int bnx2x_set_channels(struct net_device *dev, | |||
2940 | bnx2x_change_num_queues(bp, channels->combined_count); | 2946 | bnx2x_change_num_queues(bp, channels->combined_count); |
2941 | return 0; | 2947 | return 0; |
2942 | } | 2948 | } |
2943 | bnx2x_nic_unload(bp, UNLOAD_NORMAL); | 2949 | bnx2x_nic_unload(bp, UNLOAD_NORMAL, true); |
2944 | bnx2x_change_num_queues(bp, channels->combined_count); | 2950 | bnx2x_change_num_queues(bp, channels->combined_count); |
2945 | return bnx2x_nic_load(bp, LOAD_NORMAL); | 2951 | return bnx2x_nic_load(bp, LOAD_NORMAL); |
2946 | } | 2952 | } |