diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2009-02-12 05:03:42 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-15 23:13:25 -0800 |
commit | c6cb090ba7cd88aec03718dab76e4dad56862cae (patch) | |
tree | 23ded2c4f4b344cea50e9e53ab1f9840fdcc56c5 /drivers/net/igb/igb_main.c | |
parent | 38c845c7648ee354fd1d2fb8a7fbc352f2d3dcc3 (diff) |
igb: stub support for SIOCSHWTSTAMP
Signed-off-by: John Ronciak <john.ronciak@intel.com>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r-- | drivers/net/igb/igb_main.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 8b2ba424509..90090bb2604 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c @@ -34,6 +34,7 @@ #include <linux/ipv6.h> #include <net/checksum.h> #include <net/ip6_checksum.h> +#include <linux/net_tstamp.h> #include <linux/mii.h> #include <linux/ethtool.h> #include <linux/if_vlan.h> @@ -4182,6 +4183,34 @@ 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; + + 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 == HWTSTAMP_FILTER_NONE) + return 0; + + return -ERANGE; +} + +/** * igb_ioctl - * @netdev: * @ifreq: @@ -4194,6 +4223,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; } |