aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2013-11-18 18:07:16 -0500
committerBen Hutchings <bhutchings@solarflare.com>2013-11-21 12:17:39 -0500
commit4e8cff6480932f3ebe865614a1f2274e1983d08c (patch)
tree1627506ec04794343be53f8e40dcbdf9e3750efd
parentca0c88c2897581fa70227d408c43fb4efb7b7631 (diff)
e1000e: Implement the SIOCGHWTSTAMP ioctl
Compile-tested only. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index f02816575369..03e6af736de4 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -5790,7 +5790,7 @@ static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
5790 * specified. Matching the kind of event packet is not supported, with the 5790 * specified. Matching the kind of event packet is not supported, with the
5791 * exception of "all V2 events regardless of level 2 or 4". 5791 * exception of "all V2 events regardless of level 2 or 4".
5792 **/ 5792 **/
5793static int e1000e_hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr) 5793static int e1000e_hwtstamp_set(struct net_device *netdev, struct ifreq *ifr)
5794{ 5794{
5795 struct e1000_adapter *adapter = netdev_priv(netdev); 5795 struct e1000_adapter *adapter = netdev_priv(netdev);
5796 struct hwtstamp_config config; 5796 struct hwtstamp_config config;
@@ -5825,6 +5825,14 @@ static int e1000e_hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr)
5825 sizeof(config)) ? -EFAULT : 0; 5825 sizeof(config)) ? -EFAULT : 0;
5826} 5826}
5827 5827
5828static int e1000e_hwtstamp_get(struct net_device *netdev, struct ifreq *ifr)
5829{
5830 struct e1000_adapter *adapter = netdev_priv(netdev);
5831
5832 return copy_to_user(ifr->ifr_data, &adapter->hwtstamp_config,
5833 sizeof(adapter->hwtstamp_config)) ? -EFAULT : 0;
5834}
5835
5828static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) 5836static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
5829{ 5837{
5830 switch (cmd) { 5838 switch (cmd) {
@@ -5833,7 +5841,9 @@ static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
5833 case SIOCSMIIREG: 5841 case SIOCSMIIREG:
5834 return e1000_mii_ioctl(netdev, ifr, cmd); 5842 return e1000_mii_ioctl(netdev, ifr, cmd);
5835 case SIOCSHWTSTAMP: 5843 case SIOCSHWTSTAMP:
5836 return e1000e_hwtstamp_ioctl(netdev, ifr); 5844 return e1000e_hwtstamp_set(netdev, ifr);
5845 case SIOCGHWTSTAMP:
5846 return e1000e_hwtstamp_get(netdev, ifr);
5837 default: 5847 default:
5838 return -EOPNOTSUPP; 5848 return -EOPNOTSUPP;
5839 } 5849 }