From patchwork Wed Oct 29 19:53:43 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 6303 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 57888DDDEA for ; Thu, 30 Oct 2008 06:59:34 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752943AbYJ2T7c (ORCPT ); Wed, 29 Oct 2008 15:59:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752875AbYJ2T7b (ORCPT ); Wed, 29 Oct 2008 15:59:31 -0400 Received: from mail.vyatta.com ([76.74.103.46]:53078 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752618AbYJ2T7b (ORCPT ); Wed, 29 Oct 2008 15:59:31 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.vyatta.com (Postfix) with ESMTP id 3E3484F4193; Wed, 29 Oct 2008 12:59:32 -0700 (PDT) X-Virus-Scanned: amavisd-new at Received: from mail.vyatta.com ([127.0.0.1]) by localhost (mail.vyatta.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MdrH6o5Osni3; Wed, 29 Oct 2008 12:59:31 -0700 (PDT) Received: from extreme (unknown [96.225.231.79]) by mail.vyatta.com (Postfix) with ESMTP id 787C74F418E; Wed, 29 Oct 2008 12:59:30 -0700 (PDT) Date: Wed, 29 Oct 2008 12:53:43 -0700 From: Stephen Hemminger To: Patrick McHardy Cc: netdev@vger.kernel.org Subject: [PATCH 1/2] macvlan: add support for ethtool get settings Message-ID: <20081029125343.695eeb3c@extreme> Organization: Vyatta X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.9; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If macvlan's are used, it is useful to propgate speed and other settings from underlying device up for application usage. Signed-off-by: Stephen Hemminger Acked-by: Patrick McHardy --- 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 --- a/drivers/net/macvlan.c 2008-10-29 09:42:06.000000000 -0700 +++ b/drivers/net/macvlan.c 2008-10-29 09:52:11.000000000 -0700 @@ -333,10 +333,34 @@ static u32 macvlan_ethtool_get_rx_csum(s return lowerdev->ethtool_ops->get_rx_csum(lowerdev); } +static int macvlan_ethtool_get_settings(struct net_device *dev, + struct ethtool_cmd *cmd) +{ + const struct macvlan_dev *vlan = netdev_priv(dev); + struct net_device *lowerdev = vlan->lowerdev; + + if (!lowerdev->ethtool_ops->get_settings) + return -EOPNOTSUPP; + + return lowerdev->ethtool_ops->get_settings(lowerdev, cmd); +} + +static u32 macvlan_ethtool_get_flags(struct net_device *dev) +{ + const struct macvlan_dev *vlan = netdev_priv(dev); + struct net_device *lowerdev = vlan->lowerdev; + + if (!lowerdev->ethtool_ops->get_flags) + return 0; + return lowerdev->ethtool_ops->get_flags(lowerdev); +} + static const struct ethtool_ops macvlan_ethtool_ops = { .get_link = ethtool_op_get_link, + .get_settings = macvlan_ethtool_get_settings, .get_rx_csum = macvlan_ethtool_get_rx_csum, .get_drvinfo = macvlan_ethtool_get_drvinfo, + .get_flags = macvlan_ethtool_get_flags, }; static void macvlan_setup(struct net_device *dev)