FreeBSD/sys/dev/bxe/bxe.c
/*
 * Check whether another PF has already loaded FW to chip. In virtualized
 * environments a pf from anoth VM may have already initialized the device
 * including loading FW.
 */
Check whether another PF has already loaded FW to chip. In virtualized
environments a pf from anoth VM may have already initialized the device
including loading FW.
Check whether another PF has already loaded FW to chip . In virtualized environments a pf from anoth VM may have already initialized the device including loading FW .
static int
bxe_nic_load_analyze_req(struct bxe_softc *sc,
                         uint32_t         load_code)
{
    uint32_t my_fw, loaded_fw;
    if ((load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP) &&
        (load_code != FW_MSG_CODE_DRV_LOAD_COMMON)) {
        my_fw = (BCM_5710_FW_MAJOR_VERSION +
                 (BCM_5710_FW_MINOR_VERSION << 8 ) +
                 (BCM_5710_FW_REVISION_VERSION << 16) +
                 (BCM_5710_FW_ENGINEERING_VERSION << 24));
        loaded_fw = REG_RD(sc, XSEM_REG_PRAM);
        BLOGD(sc, DBG_LOAD, "loaded FW 0x%08x / my FW 0x%08x\n",
              loaded_fw, my_fw);
        if (my_fw != loaded_fw) {
            BLOGE(sc, "FW 0x%08x already loaded (mine is 0x%08x)",
                  loaded_fw, my_fw);
            return (-1);
        }
    }
    return (0);
}
static int bxe_nic_load_analyze_req ( struct bxe_softc * sc , uint32_t load_code ) { uint32_t my_fw , loaded_fw ; if ( ( load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP ) && ( load_code != FW_MSG_CODE_DRV_LOAD_COMMON ) ) { my_fw = ( BCM_5710_FW_MAJOR_VERSION + ( BCM_5710_FW_MINOR_VERSION << 8 ) + ( BCM_5710_FW_REVISION_VERSION << 16 ) + ( BCM_5710_FW_ENGINEERING_VERSION << 24 ) ) ; loaded_fw = REG_RD ( sc , XSEM_REG_PRAM ) ; BLOGD ( sc , DBG_LOAD , " \n " , loaded_fw , my_fw ) ; if ( my_fw != loaded_fw ) { BLOGE ( sc , " " , loaded_fw , my_fw ) ; return ( -1 ) ; } } return ( 0 ) ; }
Check whether another PF has already loaded FW to chip.
Check whether another PF has already loaded FW to chip .
/* is another pf loaded on this engine? */ /* build my FW version dword */ /* read loaded FW from chip */ /* abort nic load if version mismatch */