Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134521
b: refs/heads/master
c: c6cb090
h: refs/heads/master
i:
  134519: cf5ac22
v: v3
  • Loading branch information
Patrick Ohly authored and David S. Miller committed Feb 16, 2009
1 parent 8cf3723 commit f84a93d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38c845c7648ee354fd1d2fb8a7fbc352f2d3dcc3
refs/heads/master: c6cb090ba7cd88aec03718dab76e4dad56862cae
31 changes: 31 additions & 0 deletions trunk/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 f84a93d

Please sign in to comment.