mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 02:01:36 +03:00
nvethernet: add interface to configure debug interrupt
Add ioctl ETHER_DEBUG_INTR_CONFIG to enable and disable debug related interrupt at runtime Bug 3600647 Change-Id: Ie22a7decc1bd2feb90126841a8d8a0eaafa7dc66 Signed-off-by: Om Prakash Singh <omp@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2703340 Reviewed-by: Bhadram Varka <vbhadram@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Narayan Reddy <narayanr@nvidia.com> Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Revanth Kumar Uppala
parent
ef1378ba02
commit
fc25e06026
@@ -1157,6 +1157,44 @@ static int ether_config_fpe(struct net_device *dev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef OSI_DEBUG
|
||||
/**
|
||||
* @brief handle ETHER_DEBUG_INTR_CONFIG ioctl
|
||||
*
|
||||
* Algorithm:
|
||||
* - Call OSI_DMA_DEBUG_INTR_CONFIG to enable/disable debug interrupt
|
||||
* - Call OSI_CMD_DEBUG_INTR_CONFIG to enable/disable debug interrupt
|
||||
*
|
||||
* @param[in] ndev: network device structure
|
||||
* @param[in] ifdata: interface private data structure
|
||||
*
|
||||
* @note Ethernet interface need to be up.
|
||||
*
|
||||
* @retval 0 on Success
|
||||
* @retval "nagative value" on Failure
|
||||
*/
|
||||
static int ether_debug_intr_config(struct net_device *ndev,
|
||||
struct ether_ifr_data *ifdata)
|
||||
{
|
||||
struct ether_priv_data *pdata = netdev_priv(ndev);
|
||||
struct osi_core_priv_data *osi_core = pdata->osi_core;
|
||||
struct osi_ioctl ioctl_data = {};
|
||||
struct osi_dma_priv_data *osi_dma = pdata->osi_dma;
|
||||
unsigned int enable = ifdata->if_flags;
|
||||
int ret = -1;
|
||||
|
||||
osi_dma->ioctl_data.cmd = OSI_DMA_IOCTL_CMD_DEBUG_INTR_CONFIG;
|
||||
osi_dma->ioctl_data.arg_u32 = enable;
|
||||
ret = osi_dma_ioctl(osi_dma);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ioctl_data.cmd = OSI_CMD_DEBUG_INTR_CONFIG;
|
||||
ioctl_data.arg1_u32 = enable;
|
||||
return osi_handle_ioctl(osi_core, &ioctl_data);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief ether_priv_ioctl - Handle private IOCTLs
|
||||
*
|
||||
@@ -1347,6 +1385,9 @@ int ether_handle_priv_ioctl(struct net_device *ndev,
|
||||
ioctl_data.cmd = OSI_CMD_STRUCTS_DUMP;
|
||||
ret = osi_handle_ioctl(pdata->osi_core, &ioctl_data);
|
||||
break;
|
||||
case ETHER_DEBUG_INTR_CONFIG:
|
||||
ret = ether_debug_intr_config(ndev, &ifdata);
|
||||
break;
|
||||
#endif
|
||||
case ETHER_CAP_TSC_PTP:
|
||||
ret = ether_get_tsc_ptp_cap(ndev, &ifdata);
|
||||
|
||||
Reference in New Issue
Block a user