diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-10-21 07:07:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-22 00:45:39 -0400 |
commit | 1d30df24ec85477368e6e38fe1b4d1b67b3be9d4 (patch) | |
tree | 6c549356c759b821d6a984c1db6219fae597ce5f /drivers/net | |
parent | a4ee3ce3293dc931fab19beb472a8bde1295aebe (diff) |
qlge: Add ethtool get/set pause parameter.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/qlge/qlge.h | 2 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_ethtool.c | 33 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_mpi.c | 4 |
3 files changed, 37 insertions, 2 deletions
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index bc7a2e43c62e..6118f50b00a2 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -1645,6 +1645,8 @@ int ql_mb_about_fw(struct ql_adapter *qdev); | |||
1645 | void ql_link_on(struct ql_adapter *qdev); | 1645 | void ql_link_on(struct ql_adapter *qdev); |
1646 | void ql_link_off(struct ql_adapter *qdev); | 1646 | void ql_link_off(struct ql_adapter *qdev); |
1647 | int ql_mb_set_mgmnt_traffic_ctl(struct ql_adapter *qdev, u32 control); | 1647 | int ql_mb_set_mgmnt_traffic_ctl(struct ql_adapter *qdev, u32 control); |
1648 | int ql_mb_get_port_cfg(struct ql_adapter *qdev); | ||
1649 | int ql_mb_set_port_cfg(struct ql_adapter *qdev); | ||
1648 | int ql_wait_fifo_empty(struct ql_adapter *qdev); | 1650 | int ql_wait_fifo_empty(struct ql_adapter *qdev); |
1649 | 1651 | ||
1650 | #if 1 | 1652 | #if 1 |
diff --git a/drivers/net/qlge/qlge_ethtool.c b/drivers/net/qlge/qlge_ethtool.c index aac6c6f19a21..dfb5c800cea2 100644 --- a/drivers/net/qlge/qlge_ethtool.c +++ b/drivers/net/qlge/qlge_ethtool.c | |||
@@ -424,6 +424,37 @@ static int ql_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *c) | |||
424 | return ql_update_ring_coalescing(qdev); | 424 | return ql_update_ring_coalescing(qdev); |
425 | } | 425 | } |
426 | 426 | ||
427 | static void ql_get_pauseparam(struct net_device *netdev, | ||
428 | struct ethtool_pauseparam *pause) | ||
429 | { | ||
430 | struct ql_adapter *qdev = netdev_priv(netdev); | ||
431 | |||
432 | ql_mb_get_port_cfg(qdev); | ||
433 | if (qdev->link_config & CFG_PAUSE_STD) { | ||
434 | pause->rx_pause = 1; | ||
435 | pause->tx_pause = 1; | ||
436 | } | ||
437 | } | ||
438 | |||
439 | static int ql_set_pauseparam(struct net_device *netdev, | ||
440 | struct ethtool_pauseparam *pause) | ||
441 | { | ||
442 | struct ql_adapter *qdev = netdev_priv(netdev); | ||
443 | int status = 0; | ||
444 | |||
445 | if ((pause->rx_pause) && (pause->tx_pause)) | ||
446 | qdev->link_config |= CFG_PAUSE_STD; | ||
447 | else if (!pause->rx_pause && !pause->tx_pause) | ||
448 | qdev->link_config &= ~CFG_PAUSE_STD; | ||
449 | else | ||
450 | return -EINVAL; | ||
451 | |||
452 | status = ql_mb_set_port_cfg(qdev); | ||
453 | if (status) | ||
454 | return status; | ||
455 | return status; | ||
456 | } | ||
457 | |||
427 | static u32 ql_get_rx_csum(struct net_device *netdev) | 458 | static u32 ql_get_rx_csum(struct net_device *netdev) |
428 | { | 459 | { |
429 | struct ql_adapter *qdev = netdev_priv(netdev); | 460 | struct ql_adapter *qdev = netdev_priv(netdev); |
@@ -468,6 +499,8 @@ const struct ethtool_ops qlge_ethtool_ops = { | |||
468 | .get_msglevel = ql_get_msglevel, | 499 | .get_msglevel = ql_get_msglevel, |
469 | .set_msglevel = ql_set_msglevel, | 500 | .set_msglevel = ql_set_msglevel, |
470 | .get_link = ethtool_op_get_link, | 501 | .get_link = ethtool_op_get_link, |
502 | .get_pauseparam = ql_get_pauseparam, | ||
503 | .set_pauseparam = ql_set_pauseparam, | ||
471 | .get_rx_csum = ql_get_rx_csum, | 504 | .get_rx_csum = ql_get_rx_csum, |
472 | .set_rx_csum = ql_set_rx_csum, | 505 | .set_rx_csum = ql_set_rx_csum, |
473 | .get_tx_csum = ethtool_op_get_tx_csum, | 506 | .get_tx_csum = ethtool_op_get_tx_csum, |
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c index e497eac5eb45..81a8489fe21a 100644 --- a/drivers/net/qlge/qlge_mpi.c +++ b/drivers/net/qlge/qlge_mpi.c | |||
@@ -637,7 +637,7 @@ int ql_mb_idc_ack(struct ql_adapter *qdev) | |||
637 | * for the current port. | 637 | * for the current port. |
638 | * Most likely will block. | 638 | * Most likely will block. |
639 | */ | 639 | */ |
640 | static int ql_mb_set_port_cfg(struct ql_adapter *qdev) | 640 | int ql_mb_set_port_cfg(struct ql_adapter *qdev) |
641 | { | 641 | { |
642 | struct mbox_params mbc; | 642 | struct mbox_params mbc; |
643 | struct mbox_params *mbcp = &mbc; | 643 | struct mbox_params *mbcp = &mbc; |
@@ -672,7 +672,7 @@ static int ql_mb_set_port_cfg(struct ql_adapter *qdev) | |||
672 | * for the current port. | 672 | * for the current port. |
673 | * Most likely will block. | 673 | * Most likely will block. |
674 | */ | 674 | */ |
675 | static int ql_mb_get_port_cfg(struct ql_adapter *qdev) | 675 | int ql_mb_get_port_cfg(struct ql_adapter *qdev) |
676 | { | 676 | { |
677 | struct mbox_params mbc; | 677 | struct mbox_params mbc; |
678 | struct mbox_params *mbcp = &mbc; | 678 | struct mbox_params *mbcp = &mbc; |