mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
nvethernet: remove ETHER_PRV_TS_IOCTL support
remove ETHER_PRV_TS_IOCTL since it is not longer used. Bug 5265084 Signed-off-by: Narayan Reddy <narayanr@nvidia.com> Change-Id: If3fd6d82b67812e25c9146569d2ff2f0e8dab5f4 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3367197 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: Bhadram Varka <vbhadram@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
This commit is contained in:
committed by
Jon Hunter
parent
459e781d79
commit
29ee31019b
@@ -531,7 +531,6 @@ int ether_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
||||
* @param[in] cmd:
|
||||
* - Net device IOCTL command, valid values:
|
||||
* - SIOCDEVPRIVATE: For Net device private IOCTLs
|
||||
* - NVETHERNET_LINUX_PIF$ETHER_PRV_TS_IOCTL
|
||||
* - NVETHERNET_LINUX_PIF$ETHER_PRV_RMDIO_IOCTL
|
||||
* - NVETHERNET_LINUX_PIF$ETHER_PRV_WMDIO_IOCTL
|
||||
*
|
||||
@@ -562,7 +561,6 @@ int ether_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
||||
* with the NVETHERNET_LINUX_PIF$ether_exported_ifr_data.ifcmd in the "rd" input parameter.
|
||||
* - Return values of NVETHERNETRM_PIF#osi_read_phy_reg for the cmd value ETHER_PRV_RMDIO_IOCTL.
|
||||
* - Return values of NVETHERNETRM_PIF#osi_write_phy_reg for the cmd value ETHER_PRV_WMDIO_IOCTL.
|
||||
* - Return values of NVETHERNETRM_PIF#osi_dma_get_systime_from_mac for the cmd value ETHER_PRV_TS_IOCTL.
|
||||
*
|
||||
* @dir
|
||||
* - forward
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
* SIOCDEVPRIVATE custom ioctl command.
|
||||
* @{
|
||||
*/
|
||||
/** Net device private IOCTL number for time stamp */
|
||||
#define ETHER_PRV_TS_IOCTL (SIOCDEVPRIVATE + 1)
|
||||
/** Private IOCTL number for reading MDIO in the network device. */
|
||||
#define ETHER_PRV_RMDIO_IOCTL (SIOCDEVPRIVATE + 2)
|
||||
/** Private IOCTL number for writing MDIO in the network device. */
|
||||
@@ -119,21 +117,6 @@ struct ptp_offload_param {
|
||||
int mc_uc;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief struct ifr_data_timestamp_struct - common data structure between
|
||||
* driver and application for sharing info through private TS ioctl
|
||||
*/
|
||||
struct ifr_data_timestamp_struct {
|
||||
/** Clock ID
|
||||
* - Expected values are CLOCK_REALTIME or CLOCK_MONOTONIC */
|
||||
clockid_t clockid;
|
||||
/** Store kernel time */
|
||||
struct timespec64 kernel_ts;
|
||||
/** Store HW time */
|
||||
struct timespec64 hw_ptp_ts;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief Structure for L2 filters NVETHERNET_LINUX_PIF$ETHER_L2_ADDR command
|
||||
*/
|
||||
|
||||
@@ -4448,10 +4448,6 @@ int ether_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
||||
case ETHER_PRV_WMDIO_IOCTL:
|
||||
ret = ether_handle_priv_wmdio_ioctl(pdata, rq);
|
||||
break;
|
||||
|
||||
case ETHER_PRV_TS_IOCTL:
|
||||
ret = ether_handle_priv_ts_ioctl(pdata, rq);
|
||||
break;
|
||||
#endif
|
||||
case SIOCSHWTSTAMP:
|
||||
ret = ether_handle_hwtstamp_ioctl(pdata, rq);
|
||||
@@ -4515,10 +4511,6 @@ int ether_siocdevprivate(struct net_device *dev, struct ifreq *rq,
|
||||
ret = ether_handle_priv_wmdio_ioctl(pdata, rq);
|
||||
break;
|
||||
|
||||
case ETHER_PRV_TS_IOCTL:
|
||||
ret = ether_handle_priv_ts_ioctl(pdata, rq);
|
||||
break;
|
||||
|
||||
default:
|
||||
netdev_err(dev, "%s: Unsupported ioctl %d\n",
|
||||
__func__, cmd);
|
||||
|
||||
@@ -826,8 +826,6 @@ void ether_ptp_remove(struct ether_priv_data *pdata);
|
||||
*/
|
||||
int ether_handle_hwtstamp_ioctl(struct ether_priv_data *pdata,
|
||||
struct ifreq *ifr);
|
||||
int ether_handle_priv_ts_ioctl(struct ether_priv_data *pdata,
|
||||
struct ifreq *ifr);
|
||||
#ifndef OSI_STRIPPED_LIB
|
||||
int ether_conf_eee(struct ether_priv_data *pdata, unsigned int tx_lpi_enable);
|
||||
#endif /* !OSI_STRIPPED_LIB */
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
#include "ether_linux.h"
|
||||
|
||||
/**
|
||||
* @brief DEFINE_RAW_SPINLOCK: raw spinlock to get HW PTP time and kernel time atomically
|
||||
*
|
||||
*/
|
||||
static DEFINE_RAW_SPINLOCK(ether_ts_lock);
|
||||
|
||||
/**
|
||||
* @brief Function used to get PTP time
|
||||
* @param[in] data: OSI core private data structure
|
||||
@@ -555,78 +549,3 @@ skip:
|
||||
return (copy_to_user(ifr->ifr_data, &config,
|
||||
sizeof(struct hwtstamp_config))) ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function to handle PTP private IOCTL
|
||||
*
|
||||
* Algorithm: This function is used to query hardware time and
|
||||
* the kernel time simultaneously.
|
||||
*
|
||||
* @param [in] pdata: Pointer to private data structure.
|
||||
* @param [in] ifr: Interface request structure used for socket ioctl
|
||||
*
|
||||
* @note PTP clock driver need to be successfully registered during
|
||||
* initialization and HW need to support PTP functionality.
|
||||
*
|
||||
* @retval 0 on success.
|
||||
* @retval "negative value" on failure.
|
||||
*/
|
||||
|
||||
int ether_handle_priv_ts_ioctl(struct ether_priv_data *pdata,
|
||||
struct ifreq *ifr)
|
||||
{
|
||||
struct ifr_data_timestamp_struct req;
|
||||
struct osi_dma_priv_data *osi_dma = pdata->osi_dma;
|
||||
unsigned long flags;
|
||||
unsigned int sec, nsec;
|
||||
int ret = -1;
|
||||
|
||||
if (ifr->ifr_data == NULL) {
|
||||
dev_err(pdata->dev, "%s: Invalid data for priv ioctl\n",
|
||||
__func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
if (copy_from_user(&req, ifr->ifr_data, sizeof(req))) {
|
||||
dev_err(pdata->dev, "%s: Data copy from user failed\n",
|
||||
__func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
raw_spin_lock_irqsave(ðer_ts_lock, flags);
|
||||
switch (req.clockid) {
|
||||
case CLOCK_REALTIME:
|
||||
ktime_get_real_ts64(&req.kernel_ts);
|
||||
break;
|
||||
|
||||
case CLOCK_MONOTONIC:
|
||||
ktime_get_ts64(&req.kernel_ts);
|
||||
break;
|
||||
|
||||
default:
|
||||
dev_err(pdata->dev, "Unsupported clockid\n");
|
||||
}
|
||||
|
||||
ret = osi_dma_get_systime_from_mac(osi_dma, &sec, &nsec);
|
||||
if (ret != 0) {
|
||||
dev_err(pdata->dev, "%s: Failed to read systime from MAC %d\n",
|
||||
__func__, ret);
|
||||
raw_spin_unlock_irqrestore(ðer_ts_lock, flags);
|
||||
return ret;
|
||||
}
|
||||
req.hw_ptp_ts.tv_sec = sec;
|
||||
req.hw_ptp_ts.tv_nsec = nsec;
|
||||
|
||||
raw_spin_unlock_irqrestore(ðer_ts_lock, flags);
|
||||
|
||||
dev_dbg(pdata->dev, "tv_sec = %lld, tv_nsec = %ld\n",
|
||||
req.hw_ptp_ts.tv_sec, req.hw_ptp_ts.tv_nsec);
|
||||
|
||||
if (copy_to_user(ifr->ifr_data, &req, sizeof(req))) {
|
||||
dev_err(pdata->dev, "%s: Data copy to user failed\n",
|
||||
__func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user