FreeBSD/sys/dev/bxe/bxe.c
/* clear pf load mark */
/* XXX needs to be under rtnl lock */
clear pf load mark
XXX needs to be under rtnl lock
clear pf load mark XXX needs to be under rtnl lock
static uint8_t
bxe_clear_pf_load(struct bxe_softc *sc)
{
    uint32_t val1, val;
    uint32_t mask = SC_PATH(sc) ? BXE_PATH1_LOAD_CNT_MASK :
                                  BXE_PATH0_LOAD_CNT_MASK;
    uint32_t shift = SC_PATH(sc) ? BXE_PATH1_LOAD_CNT_SHIFT :
                                   BXE_PATH0_LOAD_CNT_SHIFT;
    bxe_acquire_hw_lock(sc, HW_LOCK_RESOURCE_RECOVERY_REG);
    val = REG_RD(sc, BXE_RECOVERY_GLOB_REG);
    BLOGD(sc, DBG_LOAD, "Old GEN_REG_VAL=0x%08x\n", val);
    val1 = (val & mask) >> shift;
    val1 &= ~(1 << SC_ABS_FUNC(sc));
    val &= ~mask;
    val |= ((val1 << shift) & mask);
    REG_WR(sc, BXE_RECOVERY_GLOB_REG, val);
    bxe_release_hw_lock(sc, HW_LOCK_RESOURCE_RECOVERY_REG);
    return (val1 != 0);
}
static uint8_t bxe_clear_pf_load ( struct bxe_softc * sc ) { uint32_t val1 , val ; uint32_t mask = SC_PATH ( sc ) ? BXE_PATH1_LOAD_CNT_MASK : BXE_PATH0_LOAD_CNT_MASK ; uint32_t shift = SC_PATH ( sc ) ? BXE_PATH1_LOAD_CNT_SHIFT : BXE_PATH0_LOAD_CNT_SHIFT ; bxe_acquire_hw_lock ( sc , HW_LOCK_RESOURCE_RECOVERY_REG ) ; val = REG_RD ( sc , BXE_RECOVERY_GLOB_REG ) ; BLOGD ( sc , DBG_LOAD , " \n " , val ) ; val1 = ( val & mask ) >> shift ; val1 &= ~ ( 1 << SC_ABS_FUNC ( sc ) ) ; val &= ~ mask ; val |= ( ( val1 << shift ) & mask ) ; REG_WR ( sc , BXE_RECOVERY_GLOB_REG , val ) ; bxe_release_hw_lock ( sc , HW_LOCK_RESOURCE_RECOVERY_REG ) ; return ( val1 != 0 ) ; }
clear pf load mark
XXX needs to be under rtnl lock
clear pf load mark XXX needs to be under rtnl lock
/* get the current counter value */ /* clear bit of that PF */ /* clear the old value */ /* set the new one */