summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/neterion
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2013-11-18 23:16:23 +0000
committerBen Hutchings <bhutchings@solarflare.com>2013-11-21 17:17:41 +0000
commit450e55e996e714250baee79e334e879ee659bd11 (patch)
tree389889b8be672075cc6cd2714ce9fd95037138b9 /drivers/net/ethernet/neterion
parent100dbda8e40bf4b537332d909660ddf9945196ff (diff)
downloadop-kernel-dev-450e55e996e714250baee79e334e879ee659bd11.zip
op-kernel-dev-450e55e996e714250baee79e334e879ee659bd11.tar.gz
vxge: Implement the SIOCGHWTSTAMP ioctl
Compile-tested only. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/neterion')
-rw-r--r--drivers/net/ethernet/neterion/vxge/vxge-main.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c
index 8614eeb..33f98ec 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
@@ -3185,7 +3185,7 @@ static enum vxge_hw_status vxge_timestamp_config(struct __vxge_hw_device *devh)
return status;
}
-static int vxge_hwtstamp_ioctl(struct vxgedev *vdev, void __user *data)
+static int vxge_hwtstamp_set(struct vxgedev *vdev, void __user *data)
{
struct hwtstamp_config config;
int i;
@@ -3246,6 +3246,21 @@ static int vxge_hwtstamp_ioctl(struct vxgedev *vdev, void __user *data)
return 0;
}
+static int vxge_hwtstamp_get(struct vxgedev *vdev, void __user *data)
+{
+ struct hwtstamp_config config;
+
+ config.flags = 0;
+ config.tx_type = HWTSTAMP_TX_OFF;
+ config.rx_filter = (vdev->rx_hwts ?
+ HWTSTAMP_FILTER_ALL : HWTSTAMP_FILTER_NONE);
+
+ if (copy_to_user(data, &config, sizeof(config)))
+ return -EFAULT;
+
+ return 0;
+}
+
/**
* vxge_ioctl
* @dev: Device pointer.
@@ -3259,19 +3274,15 @@ static int vxge_hwtstamp_ioctl(struct vxgedev *vdev, void __user *data)
static int vxge_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct vxgedev *vdev = netdev_priv(dev);
- int ret;
switch (cmd) {
case SIOCSHWTSTAMP:
- ret = vxge_hwtstamp_ioctl(vdev, rq->ifr_data);
- if (ret)
- return ret;
- break;
+ return vxge_hwtstamp_set(vdev, rq->ifr_data);
+ case SIOCGHWTSTAMP:
+ return vxge_hwtstamp_get(vdev, rq->ifr_data);
default:
return -EOPNOTSUPP;
}
-
- return 0;
}
/**
OpenPOWER on IntegriCloud