diff options
Diffstat (limited to 'drivers/net/bnx2x/bnx2x_ethtool.c')
-rw-r--r-- | drivers/net/bnx2x/bnx2x_ethtool.c | 48 |
1 files changed, 41 insertions, 7 deletions
diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c index 221863059dae..cf3e47914dd7 100644 --- a/drivers/net/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/bnx2x/bnx2x_ethtool.c | |||
@@ -363,13 +363,50 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
363 | } | 363 | } |
364 | 364 | ||
365 | /* advertise the requested speed and duplex if supported */ | 365 | /* advertise the requested speed and duplex if supported */ |
366 | cmd->advertising &= bp->port.supported[cfg_idx]; | 366 | if (cmd->advertising & ~(bp->port.supported[cfg_idx])) { |
367 | DP(NETIF_MSG_LINK, "Advertisement parameters " | ||
368 | "are not supported\n"); | ||
369 | return -EINVAL; | ||
370 | } | ||
367 | 371 | ||
368 | bp->link_params.req_line_speed[cfg_idx] = SPEED_AUTO_NEG; | 372 | bp->link_params.req_line_speed[cfg_idx] = SPEED_AUTO_NEG; |
369 | bp->link_params.req_duplex[cfg_idx] = DUPLEX_FULL; | 373 | bp->link_params.req_duplex[cfg_idx] = cmd->duplex; |
370 | bp->port.advertising[cfg_idx] |= (ADVERTISED_Autoneg | | 374 | bp->port.advertising[cfg_idx] = (ADVERTISED_Autoneg | |
371 | cmd->advertising); | 375 | cmd->advertising); |
376 | if (cmd->advertising) { | ||
377 | |||
378 | bp->link_params.speed_cap_mask[cfg_idx] = 0; | ||
379 | if (cmd->advertising & ADVERTISED_10baseT_Half) { | ||
380 | bp->link_params.speed_cap_mask[cfg_idx] |= | ||
381 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF; | ||
382 | } | ||
383 | if (cmd->advertising & ADVERTISED_10baseT_Full) | ||
384 | bp->link_params.speed_cap_mask[cfg_idx] |= | ||
385 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL; | ||
372 | 386 | ||
387 | if (cmd->advertising & ADVERTISED_100baseT_Full) | ||
388 | bp->link_params.speed_cap_mask[cfg_idx] |= | ||
389 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL; | ||
390 | |||
391 | if (cmd->advertising & ADVERTISED_100baseT_Half) { | ||
392 | bp->link_params.speed_cap_mask[cfg_idx] |= | ||
393 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF; | ||
394 | } | ||
395 | if (cmd->advertising & ADVERTISED_1000baseT_Half) { | ||
396 | bp->link_params.speed_cap_mask[cfg_idx] |= | ||
397 | PORT_HW_CFG_SPEED_CAPABILITY_D0_1G; | ||
398 | } | ||
399 | if (cmd->advertising & (ADVERTISED_1000baseT_Full | | ||
400 | ADVERTISED_1000baseKX_Full)) | ||
401 | bp->link_params.speed_cap_mask[cfg_idx] |= | ||
402 | PORT_HW_CFG_SPEED_CAPABILITY_D0_1G; | ||
403 | |||
404 | if (cmd->advertising & (ADVERTISED_10000baseT_Full | | ||
405 | ADVERTISED_10000baseKX4_Full | | ||
406 | ADVERTISED_10000baseKR_Full)) | ||
407 | bp->link_params.speed_cap_mask[cfg_idx] |= | ||
408 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10G; | ||
409 | } | ||
373 | } else { /* forced speed */ | 410 | } else { /* forced speed */ |
374 | /* advertise the requested speed and duplex if supported */ | 411 | /* advertise the requested speed and duplex if supported */ |
375 | switch (speed) { | 412 | switch (speed) { |
@@ -1310,10 +1347,7 @@ static void bnx2x_get_ringparam(struct net_device *dev, | |||
1310 | if (bp->rx_ring_size) | 1347 | if (bp->rx_ring_size) |
1311 | ering->rx_pending = bp->rx_ring_size; | 1348 | ering->rx_pending = bp->rx_ring_size; |
1312 | else | 1349 | else |
1313 | if (bp->state == BNX2X_STATE_OPEN && bp->num_queues) | 1350 | ering->rx_pending = MAX_RX_AVAIL; |
1314 | ering->rx_pending = MAX_RX_AVAIL/bp->num_queues; | ||
1315 | else | ||
1316 | ering->rx_pending = MAX_RX_AVAIL; | ||
1317 | 1351 | ||
1318 | ering->rx_mini_pending = 0; | 1352 | ering->rx_mini_pending = 0; |
1319 | ering->rx_jumbo_pending = 0; | 1353 | ering->rx_jumbo_pending = 0; |