From patchwork Wed Oct 5 18:08:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rick Jones X-Patchwork-Id: 117904 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 E6170B7010 for ; Thu, 6 Oct 2011 05:09:01 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932958Ab1JESI4 (ORCPT ); Wed, 5 Oct 2011 14:08:56 -0400 Received: from g4t0016.houston.hp.com ([15.201.24.19]:4591 "EHLO g4t0016.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932812Ab1JESIz (ORCPT ); Wed, 5 Oct 2011 14:08:55 -0400 Received: from g4t0009.houston.hp.com (g4t0009.houston.hp.com [16.234.32.26]) by g4t0016.houston.hp.com (Postfix) with ESMTP id E3EFD143E4 for ; Wed, 5 Oct 2011 18:08:54 +0000 (UTC) Received: from tardy (tardy.cup.hp.com [16.89.244.213]) by g4t0009.houston.hp.com (Postfix) with ESMTP id C07C8C19C for ; Wed, 5 Oct 2011 18:08:54 +0000 (UTC) Received: by tardy (Postfix, from userid 1000) id 3D68129003A8; Wed, 5 Oct 2011 11:08:54 -0700 (PDT) Subject: [PATCH net-next] Add ethtool -g support to 8139cp To: X-Mailer: mail (GNU Mailutils 2.1) Message-Id: <20111005180854.3D68129003A8@tardy> Date: Wed, 5 Oct 2011 11:08:54 -0700 (PDT) From: raj@tardy.cup.hp.com (Rick Jones) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Rick Jones Add support for reporting ring sizes via ethtool -g to the 8139cp driver. Signed-off-by: Rick Jones --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c index c77d5af..1dcfe57 100644 --- a/drivers/net/ethernet/realtek/8139cp.c +++ b/drivers/net/ethernet/realtek/8139cp.c @@ -1324,6 +1324,19 @@ static void cp_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info strcpy (info->bus_info, pci_name(cp->pdev)); } +static void cp_get_ringparam(struct net_device *dev, + struct ethtool_ringparam *ring) +{ + ring->rx_max_pending = CP_RX_RING_SIZE; + ring->tx_max_pending = CP_TX_RING_SIZE; + ring->rx_mini_max_pending = 0; + ring->rx_jumbo_max_pending = 0; + ring->rx_pending = CP_RX_RING_SIZE; + ring->tx_pending = CP_TX_RING_SIZE; + ring->rx_mini_pending = 0; + ring->rx_jumbo_pending = 0; +} + static int cp_get_regs_len(struct net_device *dev) { return CP_REGS_SIZE; @@ -1525,6 +1538,7 @@ static const struct ethtool_ops cp_ethtool_ops = { .get_eeprom_len = cp_get_eeprom_len, .get_eeprom = cp_get_eeprom, .set_eeprom = cp_set_eeprom, + .get_ringparam = cp_get_ringparam, }; static int cp_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)