FreeBSD/sys/dev/wl/if_wl.c
/*
 * wlcmd:
 *
 * Set channel attention bit and busy wait until command has
 * completed. Then acknowledge the command completion.
 */
Set channel attention bit and busy wait until command has
completed. Then acknowledge the command completion.
Set channel attention bit and busy wait until command has completed . Then acknowledge the command completion .
static int
wlcmd(struct wl_softc *sc, char *str)
{
    int i;
    WL_WRITE_2(sc, PIOR0, OFFSET_SCB + 2);	
    WL_WRITE_2(sc, PIOP0, SCB_CU_STRT);
    SET_CHAN_ATTN(sc);
    WL_WRITE_2(sc, PIOR0, OFFSET_CU);
    for (i = 0; i < 0xffff; i++)
	if (WL_READ_2(sc, PIOP0) & AC_SW_C)
	    break;
    if (i == 0xffff || !(WL_READ_2(sc, PIOP0) & AC_SW_OK)) {
	if_printf(sc->ifp, "%s failed; status = %d, inw = %x, outw = %x\n",
	    str, WL_READ_2(sc, PIOP0) & AC_SW_OK, WL_READ_2(sc, PIOP0),
	    WL_READ_2(sc, PIOR0));
	WL_WRITE_2(sc, PIOR0, OFFSET_SCB);
	printf("scb_status %x\n", WL_READ_2(sc, PIOP0));
	WL_WRITE_2(sc, PIOR0, OFFSET_SCB+2);
	printf("scb_command %x\n", WL_READ_2(sc, PIOP0));
	WL_WRITE_2(sc, PIOR0, OFFSET_SCB+4);
	printf("scb_cbl %x\n", WL_READ_2(sc, PIOP0));
	WL_WRITE_2(sc, PIOR0, OFFSET_CU+2);
	printf("cu_cmd %x\n", WL_READ_2(sc, PIOP0));
	return(0);
    }
    WL_WRITE_2(sc, PIOR0, OFFSET_SCB);
    if ((WL_READ_2(sc, PIOP0) & SCB_SW_INT) &&
	(WL_READ_2(sc, PIOP0) != SCB_SW_CNA)) {
    }
    wlack(sc);
    return(TRUE);
}
static int wlcmd ( struct wl_softc * sc , char * str ) { int i ; WL_WRITE_2 ( sc , PIOR0 , OFFSET_SCB + 2 ) ; WL_WRITE_2 ( sc , PIOP0 , SCB_CU_STRT ) ; SET_CHAN_ATTN ( sc ) ; WL_WRITE_2 ( sc , PIOR0 , OFFSET_CU ) ; for ( i = 0 ; i < 0xffff ; i ++ ) if ( WL_READ_2 ( sc , PIOP0 ) & AC_SW_C ) break ; if ( i == 0xffff || ! ( WL_READ_2 ( sc , PIOP0 ) & AC_SW_OK ) ) { if_printf ( sc -> ifp , " \n " , str , WL_READ_2 ( sc , PIOP0 ) & AC_SW_OK , WL_READ_2 ( sc , PIOP0 ) , WL_READ_2 ( sc , PIOR0 ) ) ; WL_WRITE_2 ( sc , PIOR0 , OFFSET_SCB ) ; printf ( " \n " , WL_READ_2 ( sc , PIOP0 ) ) ; WL_WRITE_2 ( sc , PIOR0 , OFFSET_SCB + 2 ) ; printf ( " \n " , WL_READ_2 ( sc , PIOP0 ) ) ; WL_WRITE_2 ( sc , PIOR0 , OFFSET_SCB + 4 ) ; printf ( " \n " , WL_READ_2 ( sc , PIOP0 ) ) ; WL_WRITE_2 ( sc , PIOR0 , OFFSET_CU + 2 ) ; printf ( " \n " , WL_READ_2 ( sc , PIOP0 ) ) ; return ( 0 ) ; } WL_WRITE_2 ( sc , PIOR0 , OFFSET_SCB ) ; if ( ( WL_READ_2 ( sc , PIOP0 ) & SCB_SW_INT ) && ( WL_READ_2 ( sc , PIOP0 ) != SCB_SW_CNA ) ) { } wlack ( sc ) ; return ( TRUE ) ; }
wlcmd:
 Set channel attention bit and busy wait until command has
 completed.
wlcmd : Set channel attention bit and busy wait until command has completed .
/* address of scb_command */ /*
	  if_printf(sc->ifp, "%s: unexpected final state %x\n",
	      str, WL_READ_2(sc, PIOP0));
	  */