diff --git a/drivers/ethernet/eth_nxp_enet.c b/drivers/ethernet/eth_nxp_enet.c index e85edf46b8..244867dddf 100644 --- a/drivers/ethernet/eth_nxp_enet.c +++ b/drivers/ethernet/eth_nxp_enet.c @@ -39,6 +39,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include #include #include +#include #if defined(CONFIG_NET_DSA) #include #endif @@ -351,7 +352,7 @@ static int eth_nxp_enet_rx(const struct device *dev) uint16_t vlan_tag = NET_VLAN_TAG_UNSPEC; uint32_t frame_length = 0U; struct net_if *iface; - struct net_pkt *pkt; + struct net_pkt *pkt = NULL; status_t status; uint32_t ts; @@ -420,7 +421,7 @@ static int eth_nxp_enet_rx(const struct device *dev) if (eth_get_ptp_data(get_iface(data, vlan_tag), pkt)) { struct net_ptp_time ptp_time; - ptp_clock_nxp_enet_get(config->ptp_clock, &ptp_time); + ptp_clock_get(config->ptp_clock, &ptp_time); /* If latest timestamp reloads after getting from Rx BD, * then second - 1 to make sure the actual Rx timestamp is accurate @@ -453,7 +454,9 @@ flush: 0, RING_ID, NULL); __ASSERT_NO_MSG(status == kStatus_Success); error: - net_pkt_unref(pkt); + if (pkt) { + net_pkt_unref(pkt); + } eth_stats_update_errors_rx(get_iface(data, vlan_tag)); return -EIO; } diff --git a/drivers/ptp_clock/ptp_clock_nxp_enet.c b/drivers/ptp_clock/ptp_clock_nxp_enet.c index 821557cf79..943ff6ca4e 100644 --- a/drivers/ptp_clock/ptp_clock_nxp_enet.c +++ b/drivers/ptp_clock/ptp_clock_nxp_enet.c @@ -153,7 +153,7 @@ static int ptp_clock_nxp_enet_rate_adjust(const struct device *dev, void nxp_enet_ptp_clock_callback(const struct device *dev, enum nxp_enet_callback_reason event, - void *data) + void *cb_data) { const struct ptp_clock_nxp_enet_config *config = dev->config; struct ptp_clock_nxp_enet_data *data = dev->data; @@ -181,9 +181,9 @@ void nxp_enet_ptp_clock_callback(const struct device *dev, &ptp_config); } - if (data != NULL) { + if (cb_data != NULL) { /* Share the mutex with mac driver */ - *(struct k_mutex *)data = &data->ptp_mutex; + *(uintptr_t *)cb_data = (uintptr_t)&data->ptp_mutex; } } diff --git a/samples/net/gptp/sample.yaml b/samples/net/gptp/sample.yaml index a668d6325a..e65327ef47 100644 --- a/samples/net/gptp/sample.yaml +++ b/samples/net/gptp/sample.yaml @@ -21,3 +21,10 @@ tests: depends_on: netif integration_platforms: - frdm_k64f + sample.net.gpt.nxp_enet_experimental: + extra_args: EXTRA_DTC_OVERLAY_FILE="nxp,enet-experimental.overlay" + platform_allow: + - mimxrt1050_evk + - mimxrt1060_evk + - mimxrt1064_evk + - mimxrt1024_evk