Skip to content

Commit

Permalink
igb: stub support for SIOCSHWTSTAMP
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Patrick Ohly authored and David S. Miller committed Feb 16, 2009
1 parent 38c845c commit c6cb090
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <linux/ipv6.h>
#include <net/checksum.h>
#include <net/ip6_checksum.h>
#include <linux/net_tstamp.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/if_vlan.h>
Expand Down Expand Up @@ -4181,6 +4182,34 @@ static int igb_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
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 -
* @netdev:
Expand All @@ -4194,6 +4223,8 @@ 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 SIOCSHWTSTAMP:
return igb_hwtstamp_ioctl(netdev, ifr, cmd);
default:
return -EOPNOTSUPP;
}
Expand Down

0 comments on commit c6cb090

Please sign in to comment.