From patchwork Fri Oct 14 20:54:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Carlson X-Patchwork-Id: 119917 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4AE35B70B2 for ; Sat, 15 Oct 2011 07:54:19 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756733Ab1JNUyN (ORCPT ); Fri, 14 Oct 2011 16:54:13 -0400 Received: from mms1.broadcom.com ([216.31.210.17]:3473 "EHLO mms1.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754191Ab1JNUyL (ORCPT ); Fri, 14 Oct 2011 16:54:11 -0400 Received: from [10.9.200.133] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Fri, 14 Oct 2011 14:01:03 -0700 X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A Received: from mail-irva-13.broadcom.com (10.11.16.103) by IRVEXCHHUB02.corp.ad.broadcom.com (10.9.200.133) with Microsoft SMTP Server id 8.2.247.2; Fri, 14 Oct 2011 13:53:29 -0700 Received: from mcarlson (mcarlson [10.12.148.101]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id E7124BC397; Fri, 14 Oct 2011 13:53:53 -0700 (PDT) From: "Matt Carlson" To: davem@davemloft.net cc: netdev@vger.kernel.org, mcarlson@broadcom.com, bhutchings@solarflare.com Subject: [PATCH RFC 2/2] tg3: Convert to get_pauseparamext Date: Fri, 14 Oct 2011 13:54:02 -0700 Message-ID: <1318625642-9668-3-git-send-email-mcarlson@broadcom.com> X-Mailer: git-send-email 1.7.3.4 MIME-Version: 1.0 X-WSS-ID: 62867C853JW5536927-01-01 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch converts the tg3 driver to the get_pauseparamext ethtool command. Signed-off-by: Matt Carlson --- drivers/net/ethernet/broadcom/tg3.c | 28 ++++++++++++++++++++-------- 1 files changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index fe712f9..a7b7ddd 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -10576,24 +10576,36 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e return err; } -static void tg3_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause) +static void tg3_get_pauseparamext(struct net_device *dev, + struct ethtool_pauseparamext *epause) { struct tg3 *tp = netdev_priv(dev); - epause->autoneg = !!tg3_flag(tp, PAUSE_AUTONEG); + epause->cfg.autoneg = !!tg3_flag(tp, PAUSE_AUTONEG); + + if (tp->link_config.flowctrl & FLOW_CTRL_RX) + epause->cfg.rx_pause = 1; + else + epause->cfg.rx_pause = 0; + + if (tp->link_config.flowctrl & FLOW_CTRL_TX) + epause->cfg.tx_pause = 1; + else + epause->cfg.tx_pause = 0; if (tp->link_config.active_flowctrl & FLOW_CTRL_RX) - epause->rx_pause = 1; + epause->rx_pause_status = 1; else - epause->rx_pause = 0; + epause->rx_pause_status = 0; if (tp->link_config.active_flowctrl & FLOW_CTRL_TX) - epause->tx_pause = 1; + epause->tx_pause_status = 1; else - epause->tx_pause = 0; + epause->tx_pause_status = 0; } -static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause) +static int tg3_set_pauseparam(struct net_device *dev, + struct ethtool_pauseparam *epause) { struct tg3 *tp = netdev_priv(dev); int err = 0; @@ -11926,7 +11938,7 @@ static const struct ethtool_ops tg3_ethtool_ops = { .set_eeprom = tg3_set_eeprom, .get_ringparam = tg3_get_ringparam, .set_ringparam = tg3_set_ringparam, - .get_pauseparam = tg3_get_pauseparam, + .get_pauseparamext = tg3_get_pauseparamext, .set_pauseparam = tg3_set_pauseparam, .self_test = tg3_self_test, .get_strings = tg3_get_strings,