nvethernet: add SIOCGHWTSTAMP support

issue: facing an unsupported ioctl error while
launching the ptp4l, since get timestamp configuration
support is not there.

fix: add get timestamp configuration ioctl support

Bug 5274698
Bug 5287071

Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Change-Id: I9254b041d4d3b9dc2cddebc14dc6100ed1b76807
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3366858
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
This commit is contained in:
Narayan Reddy
2025-05-19 19:07:13 +00:00
committed by Jon Hunter
parent 25d24fca15
commit 38227b2177
2 changed files with 6 additions and 1 deletions

View File

@@ -473,6 +473,7 @@ irqreturn_t ether_vm_isr(int irq, void *data);
* - SIOCGMIIREG: read register from the specified PHY.
* - SIOCSMIIREG: set a register on the specified PHY.
* - SIOCSHWTSTAMP: Configure hardware time stamping.
* - SIOCGHWTSTAMP: Get hardware time stamp configuration.
*
* @usage
* - Allowed context for the API call

View File

@@ -4369,6 +4369,7 @@ int ether_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
int ret = -EOPNOTSUPP;
struct ether_priv_data *pdata;
struct mii_ioctl_data *mii_data;
struct hwtstamp_config *config;
if (!dev || !rq) {
pr_err("%s: Invalid arg\n", __func__);
@@ -4452,7 +4453,10 @@ int ether_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
case SIOCSHWTSTAMP:
ret = ether_handle_hwtstamp_ioctl(pdata, rq);
break;
case SIOCGHWTSTAMP:
config = &pdata->ptp_config;
ret = copy_to_user(rq->ifr_data, config, sizeof(*config)) ? -EFAULT : 0;
break;
default:
netdev_err(dev, "%s: Unsupported ioctl %d\n",
__func__, cmd);