FreeBSD/sys/dev/bxe/bxe.c
/* send load requrest to mcp and analyze response */
send load requrest to mcp and analyze response
send load requrest to mcp and analyze response
static int
bxe_nic_load_request(struct bxe_softc *sc,
                     uint32_t         *load_code)
{
    sc->fw_seq =
        (SHMEM_RD(sc, func_mb[SC_FW_MB_IDX(sc)].drv_mb_header) &
         DRV_MSG_SEQ_NUMBER_MASK);
    BLOGD(sc, DBG_LOAD, "initial fw_seq 0x%04x\n", sc->fw_seq);
    sc->fw_drv_pulse_wr_seq =
        (SHMEM_RD(sc, func_mb[SC_FW_MB_IDX(sc)].drv_pulse_mb) &
         DRV_PULSE_SEQ_MASK);
    BLOGD(sc, DBG_LOAD, "initial drv_pulse 0x%04x\n",
          sc->fw_drv_pulse_wr_seq);
    (*load_code) = bxe_fw_command(sc, DRV_MSG_CODE_LOAD_REQ,
                                  DRV_MSG_CODE_LOAD_REQ_WITH_LFA);
    if (!(*load_code)) {
        BLOGE(sc, "MCP response failure!\n");
        return (-1);
    }
    if ((*load_code) == FW_MSG_CODE_DRV_LOAD_REFUSED) {
        BLOGE(sc, "MCP refused load request\n");
        return (-1);
    }
    return (0);
}
static int bxe_nic_load_request ( struct bxe_softc * sc , uint32_t * load_code ) { sc -> fw_seq = ( SHMEM_RD ( sc , func_mb [ SC_FW_MB_IDX ( sc ) ] . drv_mb_header ) & DRV_MSG_SEQ_NUMBER_MASK ) ; BLOGD ( sc , DBG_LOAD , " \n " , sc -> fw_seq ) ; sc -> fw_drv_pulse_wr_seq = ( SHMEM_RD ( sc , func_mb [ SC_FW_MB_IDX ( sc ) ] . drv_pulse_mb ) & DRV_PULSE_SEQ_MASK ) ; BLOGD ( sc , DBG_LOAD , " \n " , sc -> fw_drv_pulse_wr_seq ) ; ( * load_code ) = bxe_fw_command ( sc , DRV_MSG_CODE_LOAD_REQ , DRV_MSG_CODE_LOAD_REQ_WITH_LFA ) ; if ( ! ( * load_code ) ) { BLOGE ( sc , " \n " ) ; return ( -1 ) ; } if ( ( * load_code ) == FW_MSG_CODE_DRV_LOAD_REFUSED ) { BLOGE ( sc , " \n " ) ; return ( -1 ) ; } return ( 0 ) ; }
send load requrest to mcp and analyze response
send load requrest to mcp and analyze response
/* init fw_seq */ /* get the current FW pulse sequence */ /* load request */ /* if the MCP fails to respond we must abort */ /* if MCP refused then must abort */