|
@@ -473,19 +473,18 @@ static void stmmac_get_rx_hwtstamp(struct stmmac_priv *priv, struct dma_desc *p,
|
|
|
struct dma_desc *np, struct sk_buff *skb)
|
|
|
{
|
|
|
struct skb_shared_hwtstamps *shhwtstamp = NULL;
|
|
|
+ struct dma_desc *desc = p;
|
|
|
u64 ns;
|
|
|
|
|
|
if (!priv->hwts_rx_en)
|
|
|
return;
|
|
|
+ /* For GMAC4, the valid timestamp is from CTX next desc. */
|
|
|
+ if (priv->plat->has_gmac4)
|
|
|
+ desc = np;
|
|
|
|
|
|
/* Check if timestamp is available */
|
|
|
- if (priv->hw->desc->get_rx_timestamp_status(p, priv->adv_ts)) {
|
|
|
- /* For GMAC4, the valid timestamp is from CTX next desc. */
|
|
|
- if (priv->plat->has_gmac4)
|
|
|
- ns = priv->hw->desc->get_timestamp(np, priv->adv_ts);
|
|
|
- else
|
|
|
- ns = priv->hw->desc->get_timestamp(p, priv->adv_ts);
|
|
|
-
|
|
|
+ if (priv->hw->desc->get_rx_timestamp_status(desc, priv->adv_ts)) {
|
|
|
+ ns = priv->hw->desc->get_timestamp(desc, priv->adv_ts);
|
|
|
netdev_dbg(priv->dev, "get valid RX hw timestamp %llu\n", ns);
|
|
|
shhwtstamp = skb_hwtstamps(skb);
|
|
|
memset(shhwtstamp, 0, sizeof(struct skb_shared_hwtstamps));
|