diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2009-02-12 00:03:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-16 02:13:25 -0500 |
commit | c6cb090ba7cd88aec03718dab76e4dad56862cae (patch) | |
tree | 23ded2c4f4b344cea50e9e53ab1f9840fdcc56c5 /drivers/net | |
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')
-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 8b2ba4245090..90090bb26044 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/ipv6.h> | 34 | #include <linux/ipv6.h> |
35 | #include <net/checksum.h> | 35 | #include <net/checksum.h> |
36 | #include <net/ip6_checksum.h> | 36 | #include <net/ip6_checksum.h> |
37 | #include <linux/net_tstamp.h> | ||
37 | #include <linux/mii.h> | 38 | #include <linux/mii.h> |
38 | #include <linux/ethtool.h> | 39 | #include <linux/ethtool.h> |
39 | #include <linux/if_vlan.h> | 40 | #include <linux/if_vlan.h> |
@@ -4182,6 +4183,34 @@ static int igb_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
4182 | } | 4183 | } |
4183 | 4184 | ||
4184 | /** | 4185 | /** |
4186 | * igb_hwtstamp_ioctl - control hardware time stamping | ||
4187 | * @netdev: | ||
4188 | * @ifreq: | ||
4189 | * @cmd: | ||
4190 | * | ||
4191 | * Currently cannot enable any kind of hardware time stamping, but | ||
4192 | * supports SIOCSHWTSTAMP in general. | ||
4193 | **/ | ||
4194 | static int igb_hwtstamp_ioctl(struct net_device *netdev, | ||
4195 | struct ifreq *ifr, int cmd) | ||
4196 | { | ||
4197 | struct hwtstamp_config config; | ||
4198 | |||
4199 | if (copy_from_user(&config, ifr->ifr_data, sizeof(config))) | ||
4200 | return -EFAULT; | ||
4201 | |||
4202 | /* reserved for future extensions */ | ||
4203 | if (config.flags) | ||
4204 | return -EINVAL; | ||
4205 | |||
4206 | if (config.tx_type == HWTSTAMP_TX_OFF && | ||
4207 | config.rx_filter == HWTSTAMP_FILTER_NONE) | ||
4208 | return 0; | ||
4209 | |||
4210 | return -ERANGE; | ||
4211 | } | ||
4212 | |||
4213 | /** | ||
4185 | * igb_ioctl - | 4214 | * igb_ioctl - |
4186 | * @netdev: | 4215 | * @netdev: |
4187 | * @ifreq: | 4216 | * @ifreq: |
@@ -4194,6 +4223,8 @@ static int igb_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
4194 | case SIOCGMIIREG: | 4223 | case SIOCGMIIREG: |
4195 | case SIOCSMIIREG: | 4224 | case SIOCSMIIREG: |
4196 | return igb_mii_ioctl(netdev, ifr, cmd); | 4225 | return igb_mii_ioctl(netdev, ifr, cmd); |
4226 | case SIOCSHWTSTAMP: | ||
4227 | return igb_hwtstamp_ioctl(netdev, ifr, cmd); | ||
4197 | default: | 4228 | default: |
4198 | return -EOPNOTSUPP; | 4229 | return -EOPNOTSUPP; |
4199 | } | 4230 | } |