if (priv->sarc_type)
stmmac_set_desc_sarc(priv, first_desc, priv->sarc_type);
+ /* STMMAC_TBS_EN can only be set if STMMAC_TBS_AVAIL has already
+ * been set, which means the underlying type of the descriptors
+ * will be struct stmmac_edesc. Therefore, it is safe to convert
+ * the basic descriptor to the enhanced descriptor here.
+ */
if (tx_q->tbs & STMMAC_TBS_EN) {
struct timespec64 ts = ns_to_timespec64(skb->tstamp);
- tbs_desc = &tx_q->dma_entx[first_entry];
+ tbs_desc = dma_desc_to_edesc(first_desc);
stmmac_set_desc_tbs(priv, tbs_desc, ts.tv_sec, ts.tv_nsec);
}