aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e1000e
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-12-05 19:45:14 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-05 19:45:14 -0500
commit426e1fa31e0d8e982891e801c80b84b74f209f10 (patch)
treebc53409418ffa918fb3f175639bc5c9245c4219f /drivers/net/ethernet/intel/e1000e
parente1ca87bb1b64b044163e686ff3bb71405156c561 (diff)
parenta4bcc795e9cc84902b86edbfbb755ecb38d11f91 (diff)
Merge branch 'siocghwtstamp' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next
Ben Hutchings says: ==================== SIOCGHWTSTAMP ioctl 1. Add the SIOCGHWTSTAMP ioctl and update the timestamping documentation. 2. Implement SIOCGHWTSTAMP in most drivers that support SIOCSHWTSTAMP. 3. Add a test program to exercise SIOC{G,S}HWTSTAMP. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e')
-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 8d3945ab7334..051d1583e211 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 }