switch (state) { case 0:
pr_debug("- TX (Stopped): Reset or Stop command\n"); break; case 1:
pr_debug("- TX (Running): Fetching the Tx desc\n"); break; case 2:
pr_debug("- TX (Running): Waiting for end of tx\n"); break; case 3:
pr_debug("- TX (Running): Reading the data " "and queuing the data into the Tx buf\n"); break; case 6:
pr_debug("- TX (Suspended): Tx Buff Underflow " "or an unavailable Transmit descriptor\n"); break; case 7:
pr_debug("- TX (Running): Closing Tx descriptor\n"); break; default: break;
}
}
switch (state) { case 0:
pr_debug("- RX (Stopped): Reset or Stop command\n"); break; case 1:
pr_debug("- RX (Running): Fetching the Rx desc\n"); break; case 2:
pr_debug("- RX (Running): Checking for end of pkt\n"); break; case 3:
pr_debug("- RX (Running): Waiting for Rx pkt\n"); break; case 4:
pr_debug("- RX (Suspended): Unavailable Rx buf\n"); break; case 5:
pr_debug("- RX (Running): Closing Rx descriptor\n"); break; case 6:
pr_debug("- RX(Running): Flushing the current frame" " from the Rx buf\n"); break; case 7:
pr_debug("- RX (Running): Queuing the Rx frame" " from the Rx buf into memory\n"); break; default: break;
}
} #endif
int dwmac_dma_interrupt(struct stmmac_priv *priv, void __iomem *ioaddr, struct stmmac_extra_stats *x, u32 chan, u32 dir)
{ struct stmmac_pcpu_stats *stats = this_cpu_ptr(priv->xstats.pcpu_stats); int ret = 0; /* read the status register (CSR5) */
u32 intr_status = readl(ioaddr + DMA_CHAN_STATUS(chan));
#ifdef DWMAC_DMA_DEBUG /* Enable it to monitor DMA rx/tx status in case of critical problems */
pr_debug("%s: [CSR5: 0x%08x]\n", __func__, intr_status);
show_tx_process_state(intr_status);
show_rx_process_state(intr_status); #endif
/* ABNORMAL interrupts */ if (unlikely(intr_status & DMA_STATUS_AIS)) { if (unlikely(intr_status & DMA_STATUS_UNF)) {
ret = tx_hard_error_bump_tc;
x->tx_undeflow_irq++;
} if (unlikely(intr_status & DMA_STATUS_TJT))
x->tx_jabber_irq++;
if (unlikely(intr_status & DMA_STATUS_OVF))
x->rx_overflow_irq++;
if (unlikely(intr_status & DMA_STATUS_RU))
x->rx_buf_unav_irq++; if (unlikely(intr_status & DMA_STATUS_RPS))
x->rx_process_stopped_irq++; if (unlikely(intr_status & DMA_STATUS_RWT))
x->rx_watchdog_irq++; if (unlikely(intr_status & DMA_STATUS_ETI))
x->tx_early_irq++; if (unlikely(intr_status & DMA_STATUS_TPS)) {
x->tx_process_stopped_irq++;
ret = tx_hard_error;
} if (unlikely(intr_status & DMA_STATUS_FBI)) {
x->fatal_bus_error_irq++;
ret = tx_hard_error;
}
} /* TX/RX NORMAL interrupts */ if (likely(intr_status & DMA_STATUS_NIS)) { if (likely(intr_status & DMA_STATUS_RI)) {
u32 value = readl(ioaddr + DMA_INTR_ENA); /* to schedule NAPI on real RIE event. */ if (likely(value & DMA_INTR_ENA_RIE)) {
u64_stats_update_begin(&stats->syncp);
u64_stats_inc(&stats->rx_normal_irq_n[chan]);
u64_stats_update_end(&stats->syncp);
ret |= handle_rx;
}
} if (likely(intr_status & DMA_STATUS_TI)) {
u64_stats_update_begin(&stats->syncp);
u64_stats_inc(&stats->tx_normal_irq_n[chan]);
u64_stats_update_end(&stats->syncp);
ret |= handle_tx;
} if (unlikely(intr_status & DMA_STATUS_ERI))
x->rx_early_irq++;
} /* Optional hardware blocks, interrupts should be disabled */ if (unlikely(intr_status &
(DMA_STATUS_GPI | DMA_STATUS_GMI | DMA_STATUS_GLI)))
pr_warn("%s: unexpected status %08x\n", __func__, intr_status);
/* Clear the interrupt by writing a logic 1 to the CSR5[15-0] */
writel((intr_status & 0x1ffff), ioaddr + DMA_STATUS);
data = (addr[5] << 8) | addr[4]; /* For MAC Addr registers we have to set the Address Enable (AE) * bit that has no effect on the High Reg 0 where the bit 31 (MO) * is RO.
*/
writel(data | GMAC_HI_REG_AE, ioaddr + high);
data = (addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) | addr[0];
writel(data, ioaddr + low);
}
EXPORT_SYMBOL_GPL(stmmac_set_mac_addr);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.