FreeBSD/sys/dev/bxe/bxe.c
/* wait for the outstanding SP commands */
wait for the outstanding SP commands
wait for the outstanding SP commands
static inline uint8_t
bxe_wait_sp_comp(struct bxe_softc *sc,
                 unsigned long    mask)
{
    unsigned long tmp;
    int tout = 5000; 
    while (tout--) {
        mb();
        if (!(atomic_load_acq_long(&sc->sp_state) & mask)) {
            return (TRUE);
        }
        DELAY(1000);
    }
    mb();
    tmp = atomic_load_acq_long(&sc->sp_state);
    if (tmp & mask) {
        BLOGE(sc, "Filtering completion timed out: "
                  "sp_state 0x%lx, mask 0x%lx\n",
              tmp, mask);
        return (FALSE);
    }
    return (FALSE);
}
static inline uint8_t bxe_wait_sp_comp ( struct bxe_softc * sc , unsigned long mask ) { unsigned long tmp ; int tout = 5000 ; while ( tout -- ) { mb ( ) ; if ( ! ( atomic_load_acq_long ( & sc -> sp_state ) & mask ) ) { return ( TRUE ) ; } DELAY ( 1000 ) ; } mb ( ) ; tmp = atomic_load_acq_long ( & sc -> sp_state ) ; if ( tmp & mask ) { BLOGE ( sc , " " " \n " , tmp , mask ) ; return ( FALSE ) ; } return ( FALSE ) ; }
wait for the outstanding SP commands
wait for the outstanding SP commands
/* wait for 5 secs tops */