diff options
author | Jacob Keller <jacob.e.keller@intel.com> | 2014-01-11 07:20:06 +0000 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-03-21 02:51:24 -0700 |
commit | 6ab5f7b2981e842e318ff48c708aaaa2a5a6a43e (patch) | |
tree | 85d6d497fa2a0eebd9ba2f9af55eec3a528ec133 /drivers/net/ethernet/intel/igb/igb_main.c | |
parent | 26597802b47c5b92e3a1e6d5bd7cceef9e611431 (diff) | |
download | linux-6ab5f7b2981e842e318ff48c708aaaa2a5a6a43e.tar.gz linux-6ab5f7b2981e842e318ff48c708aaaa2a5a6a43e.tar.bz2 linux-6ab5f7b2981e842e318ff48c708aaaa2a5a6a43e.zip |
igb: implement SIOCGHWTSTAMP ioctl
This patch adds support for the SIOCGHWTSTAMP ioctl which enables user
processes to read the current hwtstamp_config settings
non-destructively. Previously a process had to be privileged and could
only set values, it couldn't return what is currently set without
possibly overwriting the value.
This patch adds support for this new operation into igb by keeping a
shadow copy of the config in the adapter structure, which is returned
upon request.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igb/igb_main.c')
-rw-r--r-- | drivers/net/ethernet/intel/igb/igb_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 17feea0ea2b0..f623e6ce28c9 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -7162,8 +7162,10 @@ 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 SIOCGHWTSTAMP: + return igb_ptp_get_ts_config(netdev, ifr); case SIOCSHWTSTAMP: - return igb_ptp_hwtstamp_ioctl(netdev, ifr, cmd); + return igb_ptp_set_ts_config(netdev, ifr); default: return -EOPNOTSUPP; } |