diff options
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 08efb4635007..f67652de5a63 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |||
@@ -131,12 +131,13 @@ static const char qlcnic_83xx_rx_stats_strings[][ETH_GSTRING_LEN] = { | |||
131 | "ctx_lro_pkt_cnt", | 131 | "ctx_lro_pkt_cnt", |
132 | "ctx_ip_csum_error", | 132 | "ctx_ip_csum_error", |
133 | "ctx_rx_pkts_wo_ctx", | 133 | "ctx_rx_pkts_wo_ctx", |
134 | "ctx_rx_pkts_dropped_wo_sts", | 134 | "ctx_rx_pkts_drop_wo_sds_on_card", |
135 | "ctx_rx_pkts_drop_wo_sds_on_host", | ||
135 | "ctx_rx_osized_pkts", | 136 | "ctx_rx_osized_pkts", |
136 | "ctx_rx_pkts_dropped_wo_rds", | 137 | "ctx_rx_pkts_dropped_wo_rds", |
137 | "ctx_rx_unexpected_mcast_pkts", | 138 | "ctx_rx_unexpected_mcast_pkts", |
138 | "ctx_invalid_mac_address", | 139 | "ctx_invalid_mac_address", |
139 | "ctx_rx_rds_ring_prim_attemoted", | 140 | "ctx_rx_rds_ring_prim_attempted", |
140 | "ctx_rx_rds_ring_prim_success", | 141 | "ctx_rx_rds_ring_prim_success", |
141 | "ctx_num_lro_flows_added", | 142 | "ctx_num_lro_flows_added", |
142 | "ctx_num_lro_flows_removed", | 143 | "ctx_num_lro_flows_removed", |
@@ -251,6 +252,18 @@ static int | |||
251 | qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | 252 | qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) |
252 | { | 253 | { |
253 | struct qlcnic_adapter *adapter = netdev_priv(dev); | 254 | struct qlcnic_adapter *adapter = netdev_priv(dev); |
255 | |||
256 | if (qlcnic_82xx_check(adapter)) | ||
257 | return qlcnic_82xx_get_settings(adapter, ecmd); | ||
258 | else if (qlcnic_83xx_check(adapter)) | ||
259 | return qlcnic_83xx_get_settings(adapter, ecmd); | ||
260 | |||
261 | return -EIO; | ||
262 | } | ||
263 | |||
264 | int qlcnic_82xx_get_settings(struct qlcnic_adapter *adapter, | ||
265 | struct ethtool_cmd *ecmd) | ||
266 | { | ||
254 | struct qlcnic_hardware_context *ahw = adapter->ahw; | 267 | struct qlcnic_hardware_context *ahw = adapter->ahw; |
255 | u32 speed, reg; | 268 | u32 speed, reg; |
256 | int check_sfp_module = 0; | 269 | int check_sfp_module = 0; |
@@ -276,10 +289,7 @@ qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
276 | 289 | ||
277 | } else if (adapter->ahw->port_type == QLCNIC_XGBE) { | 290 | } else if (adapter->ahw->port_type == QLCNIC_XGBE) { |
278 | u32 val = 0; | 291 | u32 val = 0; |
279 | if (qlcnic_83xx_check(adapter)) | 292 | val = QLCRD32(adapter, QLCNIC_PORT_MODE_ADDR); |
280 | qlcnic_83xx_get_settings(adapter); | ||
281 | else | ||
282 | val = QLCRD32(adapter, QLCNIC_PORT_MODE_ADDR); | ||
283 | 293 | ||
284 | if (val == QLCNIC_PORT_MODE_802_3_AP) { | 294 | if (val == QLCNIC_PORT_MODE_802_3_AP) { |
285 | ecmd->supported = SUPPORTED_1000baseT_Full; | 295 | ecmd->supported = SUPPORTED_1000baseT_Full; |
@@ -289,16 +299,13 @@ qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
289 | ecmd->advertising = ADVERTISED_10000baseT_Full; | 299 | ecmd->advertising = ADVERTISED_10000baseT_Full; |
290 | } | 300 | } |
291 | 301 | ||
292 | if (netif_running(dev) && adapter->ahw->has_link_events) { | 302 | if (netif_running(adapter->netdev) && ahw->has_link_events) { |
293 | if (qlcnic_82xx_check(adapter)) { | 303 | reg = QLCRD32(adapter, P3P_LINK_SPEED_REG(pcifn)); |
294 | reg = QLCRD32(adapter, | 304 | speed = P3P_LINK_SPEED_VAL(pcifn, reg); |
295 | P3P_LINK_SPEED_REG(pcifn)); | 305 | ahw->link_speed = speed * P3P_LINK_SPEED_MHZ; |
296 | speed = P3P_LINK_SPEED_VAL(pcifn, reg); | 306 | ethtool_cmd_speed_set(ecmd, ahw->link_speed); |
297 | ahw->link_speed = speed * P3P_LINK_SPEED_MHZ; | 307 | ecmd->autoneg = ahw->link_autoneg; |
298 | } | 308 | ecmd->duplex = ahw->link_duplex; |
299 | ethtool_cmd_speed_set(ecmd, adapter->ahw->link_speed); | ||
300 | ecmd->autoneg = adapter->ahw->link_autoneg; | ||
301 | ecmd->duplex = adapter->ahw->link_duplex; | ||
302 | goto skip; | 309 | goto skip; |
303 | } | 310 | } |
304 | 311 | ||
@@ -340,8 +347,8 @@ skip: | |||
340 | case QLCNIC_BRDTYPE_P3P_10G_SFP_QT: | 347 | case QLCNIC_BRDTYPE_P3P_10G_SFP_QT: |
341 | ecmd->advertising |= ADVERTISED_TP; | 348 | ecmd->advertising |= ADVERTISED_TP; |
342 | ecmd->supported |= SUPPORTED_TP; | 349 | ecmd->supported |= SUPPORTED_TP; |
343 | check_sfp_module = netif_running(dev) && | 350 | check_sfp_module = netif_running(adapter->netdev) && |
344 | adapter->ahw->has_link_events; | 351 | ahw->has_link_events; |
345 | case QLCNIC_BRDTYPE_P3P_10G_XFP: | 352 | case QLCNIC_BRDTYPE_P3P_10G_XFP: |
346 | ecmd->supported |= SUPPORTED_FIBRE; | 353 | ecmd->supported |= SUPPORTED_FIBRE; |
347 | ecmd->advertising |= ADVERTISED_FIBRE; | 354 | ecmd->advertising |= ADVERTISED_FIBRE; |
@@ -355,8 +362,8 @@ skip: | |||
355 | ecmd->advertising |= | 362 | ecmd->advertising |= |
356 | (ADVERTISED_FIBRE | ADVERTISED_TP); | 363 | (ADVERTISED_FIBRE | ADVERTISED_TP); |
357 | ecmd->port = PORT_FIBRE; | 364 | ecmd->port = PORT_FIBRE; |
358 | check_sfp_module = netif_running(dev) && | 365 | check_sfp_module = netif_running(adapter->netdev) && |
359 | adapter->ahw->has_link_events; | 366 | ahw->has_link_events; |
360 | } else { | 367 | } else { |
361 | ecmd->autoneg = AUTONEG_ENABLE; | 368 | ecmd->autoneg = AUTONEG_ENABLE; |
362 | ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg); | 369 | ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg); |
@@ -365,13 +372,6 @@ skip: | |||
365 | ecmd->port = PORT_TP; | 372 | ecmd->port = PORT_TP; |
366 | } | 373 | } |
367 | break; | 374 | break; |
368 | case QLCNIC_BRDTYPE_83XX_10G: | ||
369 | ecmd->autoneg = AUTONEG_DISABLE; | ||
370 | ecmd->supported |= (SUPPORTED_FIBRE | SUPPORTED_TP); | ||
371 | ecmd->advertising |= (ADVERTISED_FIBRE | ADVERTISED_TP); | ||
372 | ecmd->port = PORT_FIBRE; | ||
373 | check_sfp_module = netif_running(dev) && ahw->has_link_events; | ||
374 | break; | ||
375 | default: | 375 | default: |
376 | dev_err(&adapter->pdev->dev, "Unsupported board model %d\n", | 376 | dev_err(&adapter->pdev->dev, "Unsupported board model %d\n", |
377 | adapter->ahw->board_type); | 377 | adapter->ahw->board_type); |