FreeBSD/sys/dev/rt/if_rt.c
/*
 * rt_watchdog - reinit device on watchdog event.
 */
reinit device on watchdog event.
reinit device on watchdog event .
static void
rt_watchdog(struct rt_softc *sc)
{
	uint32_t tmp;
#ifdef notyet
	int ntries;
#endif
	if(sc->rt_chipid != RT_CHIPID_RT5350 &&
	   sc->rt_chipid != RT_CHIPID_MT7620 &&
	   sc->rt_chipid != RT_CHIPID_MT7621) {
		tmp = RT_READ(sc, PSE_BASE + CDMA_OQ_STA);
		RT_DPRINTF(sc, RT_DEBUG_WATCHDOG,
			   "watchdog: PSE_IQ_STA=0x%08x\n", tmp);
	}
#ifdef notyet
	if (((tmp >> P0_IQ_PCNT_SHIFT) & 0xff) != 0) {
		sc->tx_queue_not_empty[0]++;
		for (ntries = 0; ntries < 10; ntries++) {
			tmp = RT_READ(sc, PSE_BASE + PSE_IQ_STA);
			if (((tmp >> P0_IQ_PCNT_SHIFT) & 0xff) == 0)
				break;
			DELAY(1);
		}
	}
	if (((tmp >> P1_IQ_PCNT_SHIFT) & 0xff) != 0) {
		sc->tx_queue_not_empty[1]++;
		for (ntries = 0; ntries < 10; ntries++) {
			tmp = RT_READ(sc, PSE_BASE + PSE_IQ_STA);
			if (((tmp >> P1_IQ_PCNT_SHIFT) & 0xff) == 0)
				break;
			DELAY(1);
		}
	}
#endif
}
static void rt_watchdog ( struct rt_softc * sc ) { uint32_t tmp ; #ifdef notyet int ntries ; #endif if ( sc -> rt_chipid != RT_CHIPID_RT5350 && sc -> rt_chipid != RT_CHIPID_MT7620 && sc -> rt_chipid != RT_CHIPID_MT7621 ) { tmp = RT_READ ( sc , PSE_BASE + CDMA_OQ_STA ) ; RT_DPRINTF ( sc , RT_DEBUG_WATCHDOG , " \n " , tmp ) ; } #ifdef notyet if ( ( ( tmp >> P0_IQ_PCNT_SHIFT ) & 0xff ) != 0 ) { sc -> tx_queue_not_empty [ 0 ] ++ ; for ( ntries = 0 ; ntries < 10 ; ntries ++ ) { tmp = RT_READ ( sc , PSE_BASE + PSE_IQ_STA ) ; if ( ( ( tmp >> P0_IQ_PCNT_SHIFT ) & 0xff ) == 0 ) break ; DELAY ( 1 ) ; } } if ( ( ( tmp >> P1_IQ_PCNT_SHIFT ) & 0xff ) != 0 ) { sc -> tx_queue_not_empty [ 1 ] ++ ; for ( ntries = 0 ; ntries < 10 ; ntries ++ ) { tmp = RT_READ ( sc , PSE_BASE + PSE_IQ_STA ) ; if ( ( ( tmp >> P1_IQ_PCNT_SHIFT ) & 0xff ) == 0 ) break ; DELAY ( 1 ) ; } } #endif }
rt_watchdog - reinit device on watchdog event.
rt_watchdog - reinit device on watchdog event .
/* XXX: do not reset */