diff --git a/drivers/net/ethernet/nvidia/nvethernet/Makefile b/drivers/net/ethernet/nvidia/nvethernet/Makefile index 9f8dc79c..049755c2 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/Makefile +++ b/drivers/net/ethernet/nvidia/nvethernet/Makefile @@ -7,6 +7,12 @@ OSI_DMA := nvethernetrm/osi/dma obj-m += nvethernet.o +# If CONFIG_TEGRA_NVPPS is not set, enable by default +CONFIG_TEGRA_NVPPS ?= y +ifeq ($(CONFIG_TEGRA_NVPPS),y) +ccflags-y += -DCONFIG_TEGRA_NVPPS +endif + # These CFLAGS must not be shared/used in OSI. These are local to Linux ccflags-y += -DLINUX_OS -DNET30 -DNVPKCS_MACSEC -DLINUX_IVC -mno-outline-atomics \ -I$(srctree.nvidia-oot)/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include \ @@ -48,4 +54,4 @@ nvethernet-objs:= ether_linux.o \ include $(srctree.nvidia-oot)/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include/config.tmk # Undefine HSI_SUPPORT if CONFIG_TEGRA_EPL is not defined. -ccflags-y += $(if $(CONFIG_TEGRA_EPL),,-UHSI_SUPPORT) \ No newline at end of file +ccflags-y += $(if $(CONFIG_TEGRA_EPL),,-UHSI_SUPPORT) diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c index ce825851..7838fe97 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c @@ -2912,8 +2912,10 @@ static int ether_close(struct net_device *ndev) /* TODO: purge the queues */ #endif +#if CONFIG_TEGRA_NVPPS /* Unregister broadcasting MAC timestamp to clients */ tegra_unregister_hwtime_source(ndev); +#endif /* Stop workqueue to get further scheduled */ ether_stats_work_queue_stop(pdata); diff --git a/drivers/net/ethernet/nvidia/nvethernet/ptp.c b/drivers/net/ethernet/nvidia/nvethernet/ptp.c index 70bb81ec..762a1ba7 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ptp.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ptp.c @@ -395,7 +395,9 @@ int ether_handle_hwtstamp_ioctl(struct ether_priv_data *pdata, { struct osi_core_priv_data *osi_core = pdata->osi_core; struct osi_dma_priv_data *osi_dma = pdata->osi_dma; +#if CONFIG_TEGRA_NVPPS struct net_device *ndev = pdata->ndev; +#endif struct osi_ioctl ioctl_data = {}; struct hwtstamp_config config; unsigned int hwts_rx_en = 1; @@ -596,8 +598,10 @@ int ether_handle_hwtstamp_ioctl(struct ether_priv_data *pdata, dev_err(pdata->dev, "Failure to enable CONFIG_PTP\n"); return -EFAULT; } +#if CONFIG_TEGRA_NVPPS /* Register broadcasting MAC timestamp to clients */ tegra_register_hwtime_source(ether_get_hw_time, ndev); +#endif #ifndef OSI_STRIPPED_LIB ether_config_slot_function(pdata, OSI_ENABLE); #endif /* !OSI_STRIPPED_LIB */