提交 c6cb090b 编写于 作者: P Patrick Ohly 提交者: David S. Miller

igb: stub support for SIOCSHWTSTAMP

Signed-off-by: NJohn Ronciak <john.ronciak@intel.com>
Signed-off-by: NPatrick Ohly <patrick.ohly@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 38c845c7
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/ipv6.h> #include <linux/ipv6.h>
#include <net/checksum.h> #include <net/checksum.h>
#include <net/ip6_checksum.h> #include <net/ip6_checksum.h>
#include <linux/net_tstamp.h>
#include <linux/mii.h> #include <linux/mii.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
...@@ -4181,6 +4182,34 @@ static int igb_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) ...@@ -4181,6 +4182,34 @@ static int igb_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
return 0; return 0;
} }
/**
* 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 - * igb_ioctl -
* @netdev: * @netdev:
...@@ -4194,6 +4223,8 @@ static int igb_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) ...@@ -4194,6 +4223,8 @@ static int igb_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
case SIOCGMIIREG: case SIOCGMIIREG:
case SIOCSMIIREG: case SIOCSMIIREG:
return igb_mii_ioctl(netdev, ifr, cmd); return igb_mii_ioctl(netdev, ifr, cmd);
case SIOCSHWTSTAMP:
return igb_hwtstamp_ioctl(netdev, ifr, cmd);
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册