FreeBSD/sys/dev/wl/if_wl.c
/*
 * wldiag:
 *
 *	This routine does a 586 op-code number 7, and obtains the
 *	diagnose status for the WaveLAN.
 *
 */
This routine does a 586 op-code number 7, and obtains the
diagnose status for the WaveLAN.
This routine does a 586 op - code number 7 and obtains the diagnose status for the WaveLAN .
static int
wldiag(struct wl_softc *sc)
{
    short	status;
#ifdef WLDEBUG
    if (sc->ifp->if_flags & IFF_DEBUG)
	if_printf(sc->ifp, "entered wldiag()\n");
#endif
    WL_WRITE_2(sc, PIOR0, OFFSET_SCB);
    status = WL_READ_2(sc, PIOP0);
    if (status & SCB_SW_INT) {
	wlack(sc);
    }
    WL_WRITE_2(sc, PIOR1, OFFSET_CU);
    WL_WRITE_2(sc, PIOP1, 0);			
    WL_WRITE_2(sc, PIOP1, AC_DIAGNOSE|AC_CW_EL);
    if (wlcmd(sc, "diag()") == 0)
	return 0;
    WL_WRITE_2(sc, PIOR0, OFFSET_CU);
    if (WL_READ_2(sc, PIOP0) & 0x0800) {
	if_printf(sc->ifp, "i82586 Self Test failed!\n");
	return 0;
    }
    return TRUE;
}
static int wldiag ( struct wl_softc * sc ) { short status ; #ifdef WLDEBUG if ( sc -> ifp -> if_flags & IFF_DEBUG ) if_printf ( sc -> ifp , " \n " ) ; #endif WL_WRITE_2 ( sc , PIOR0 , OFFSET_SCB ) ; status = WL_READ_2 ( sc , PIOP0 ) ; if ( status & SCB_SW_INT ) { wlack ( sc ) ; } WL_WRITE_2 ( sc , PIOR1 , OFFSET_CU ) ; WL_WRITE_2 ( sc , PIOP1 , 0 ) ; WL_WRITE_2 ( sc , PIOP1 , AC_DIAGNOSE | AC_CW_EL ) ; if ( wlcmd ( sc , " " ) == 0 ) return 0 ; WL_WRITE_2 ( sc , PIOR0 , OFFSET_CU ) ; if ( WL_READ_2 ( sc , PIOP0 ) & 0x0800 ) { if_printf ( sc -> ifp , " \n " ) ; return 0 ; } return TRUE ; }
wldiag:
      This routine does a 586 op-code number 7, and obtains the
      diagnose status for the WaveLAN.
wldiag : This routine does a 586 op - code number 7 and obtains the diagnose status for the WaveLAN .
/* state is 2000 which seems ok
		   if_printf(sc->ifp, "diag(): unexpected initial state %\n",
		       WL_READ_2(sc, PIOP0));
		*/ /* ac_status */ /* ac_command */