FreeBSD/sys/dev/rt/if_rt.c
/*
 * rt_rt5350_intr - main ISR for Ralink 5350 SoC
 */
main ISR for Ralink 5350 SoC
main ISR for Ralink 5350 SoC
static void
rt_rt5350_intr(void *arg)
{
	struct rt_softc *sc;
	struct ifnet *ifp;
	uint32_t status;
	sc = arg;
	ifp = sc->ifp;
	status = RT_READ(sc, sc->fe_int_status);
	RT_WRITE(sc, sc->fe_int_status, status);
	RT_DPRINTF(sc, RT_DEBUG_INTR, "interrupt: status=0x%08x\n", status);
	if (status == 0xffffffff ||     
		status == 0)            
		return;
	sc->interrupts++;
	if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
	        return;
	if (status & RT5350_INT_TX_COHERENT)
		rt_tx_coherent_intr(sc);
	if (status & RT5350_INT_RX_COHERENT)
		rt_rx_coherent_intr(sc);
	if (status & RT5350_RX_DLY_INT)
	        rt_rx_delay_intr(sc);
	if (status & RT5350_TX_DLY_INT)
	        rt_tx_delay_intr(sc);
	if (status & RT5350_INT_RXQ1_DONE)
		rt_rx_intr(sc, 1);	
	if (status & RT5350_INT_RXQ0_DONE)
		rt_rx_intr(sc, 0);	
	if (status & RT5350_INT_TXQ3_DONE)
		rt_tx_intr(sc, 3);
	if (status & RT5350_INT_TXQ2_DONE)
		rt_tx_intr(sc, 2);
	if (status & RT5350_INT_TXQ1_DONE)
		rt_tx_intr(sc, 1);
	if (status & RT5350_INT_TXQ0_DONE)
		rt_tx_intr(sc, 0);
}
static void rt_rt5350_intr ( void * arg ) { struct rt_softc * sc ; struct ifnet * ifp ; uint32_t status ; sc = arg ; ifp = sc -> ifp ; status = RT_READ ( sc , sc -> fe_int_status ) ; RT_WRITE ( sc , sc -> fe_int_status , status ) ; RT_DPRINTF ( sc , RT_DEBUG_INTR , " \n " , status ) ; if ( status == 0xffffffff || status == 0 ) return ; sc -> interrupts ++ ; if ( ! ( ifp -> if_drv_flags & IFF_DRV_RUNNING ) ) return ; if ( status & RT5350_INT_TX_COHERENT ) rt_tx_coherent_intr ( sc ) ; if ( status & RT5350_INT_RX_COHERENT ) rt_rx_coherent_intr ( sc ) ; if ( status & RT5350_RX_DLY_INT ) rt_rx_delay_intr ( sc ) ; if ( status & RT5350_TX_DLY_INT ) rt_tx_delay_intr ( sc ) ; if ( status & RT5350_INT_RXQ1_DONE ) rt_rx_intr ( sc , 1 ) ; if ( status & RT5350_INT_RXQ0_DONE ) rt_rx_intr ( sc , 0 ) ; if ( status & RT5350_INT_TXQ3_DONE ) rt_tx_intr ( sc , 3 ) ; if ( status & RT5350_INT_TXQ2_DONE ) rt_tx_intr ( sc , 2 ) ; if ( status & RT5350_INT_TXQ1_DONE ) rt_tx_intr ( sc , 1 ) ; if ( status & RT5350_INT_TXQ0_DONE ) rt_tx_intr ( sc , 0 ) ; }
rt_rt5350_intr - main ISR for Ralink 5350 SoC
rt_rt5350_intr - main ISR for Ralink 5350 SoC
/* acknowledge interrupts */ /* device likely went away */ /* not for us */