From patchwork Fri Oct 31 12:21:20 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Ohly X-Patchwork-Id: 8146 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 2596C474C2 for ; Wed, 12 Nov 2008 01:57:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756196AbYKKO5W (ORCPT ); Tue, 11 Nov 2008 09:57:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756104AbYKKO5V (ORCPT ); Tue, 11 Nov 2008 09:57:21 -0500 Received: from mga11.intel.com ([192.55.52.93]:44153 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756171AbYKKO5P (ORCPT ); Tue, 11 Nov 2008 09:57:15 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 11 Nov 2008 06:51:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.33,584,1220252400"; d="scan'208";a="402316179" Received: from ecld0pohly.ikn.intel.com (HELO [172.28.75.199]) ([172.28.75.199]) by fmsmga002.fm.intel.com with ESMTP; 11 Nov 2008 06:53:12 -0800 In-Reply-To: <1226414697.17450.852.camel@ecld0pohly> References: <1226414697.17450.852.camel@ecld0pohly> From: Patrick Ohly Date: Fri, 31 Oct 2008 13:21:20 +0100 Subject: [RFC PATCH 08/13] igb: stub support for SIOCSHWTSTAMP To: netdev@vger.kernel.org Cc: Octavian Purdila , Stephen Hemminger , Ingo Oeser , Andi Kleen , John Ronciak , Eric Dumazet , Oliver Hartkopp X-Mailer: Evolution 2.22.2 Message-Id: <1226415434.31699.7.camel@ecld0pohly> Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Patrick Ohly --- drivers/net/igb/igb_main.c | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 634c4c9..becf8d6 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -4103,6 +4104,35 @@ static int igb_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) } /** + * igb_hwtstamp_ioctl - control hardware time stamping + * @netdev: + * @ifreq: + * @cmd: + * + * Currently cannot enable any kind of hardware time stamping, but + * supports SIOCSHWTSTAMP in general. + **/ +static int igb_hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) +{ + struct hwtstamp_config config; + + printk("igb_hwtstamp_ioctl\n"); + + if (copy_from_user(&config, ifr->ifr_data, sizeof(config))) + return -EFAULT; + + /* reserved for future extensions */ + if (config.flags) + return -EINVAL; + + if (config.tx_type == HWTSTAMP_TX_OFF && + config.rx_filter_type == HWTSTAMP_FILTER_NONE) + return 0; + + return -ERANGE; +} + +/** * igb_ioctl - * @netdev: * @ifreq: @@ -4115,6 +4145,8 @@ static int igb_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) case SIOCGMIIREG: case SIOCSMIIREG: return igb_mii_ioctl(netdev, ifr, cmd); + case SIOCSHWTSTAMP: + return igb_hwtstamp_ioctl(netdev, ifr, cmd); default: return -EOPNOTSUPP; }