diff options
author | Richard Cochran <richardcochran@gmail.com> | 2010-07-17 10:49:36 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-19 04:15:26 +0200 |
commit | c1f19b51d1d87f3e3bb7e6648f43f7d57ed2da6b (patch) | |
tree | d9525359409e3493b48e8676717cc11ed69b640a /drivers/net/phy/phy.c | |
parent | net: added a BPF to help drivers detect PTP packets. (diff) | |
download | linux-c1f19b51d1d87f3e3bb7e6648f43f7d57ed2da6b.tar.xz linux-c1f19b51d1d87f3e3bb7e6648f43f7d57ed2da6b.zip |
net: support time stamping in phy devices.
This patch adds a new networking option to allow hardware time stamps
from PHY devices. When enabled, likely candidates among incoming and
outgoing network packets are offered to the PHY driver for possible
time stamping. When accepted by the PHY driver, incoming packets are
deferred for later delivery by the driver.
The patch also adds phylib driver methods for the SIOCSHWTSTAMP ioctl
and callbacks for transmit and receive time stamping. Drivers may
optionally implement these functions.
Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index bd88d818f082..5130db8f5c4e 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -361,6 +361,11 @@ int phy_mii_ioctl(struct phy_device *phydev, } break; + case SIOCSHWTSTAMP: + if (phydev->drv->hwtstamp) + return phydev->drv->hwtstamp(phydev, ifr); + /* fall through */ + default: return -EOPNOTSUPP; } |