src/dpdk/drivers/net/bnx2x/bnx2x.c
static int bnx2x_nic_load_request(struct bnx2x_softc *sc, uint32_t * load_code)
{
	PMD_INIT_FUNC_TRACE(sc);

	/* init fw_seq */
	sc->fw_seq =
	    (SHMEM_RD(sc, func_mb[SC_FW_MB_IDX(sc)].drv_mb_header) &
	     DRV_MSG_SEQ_NUMBER_MASK);

	PMD_DRV_LOG(DEBUG, sc, "initial fw_seq 0x%04x", sc->fw_seq);

#ifdef BNX2X_PULSE
	/* get the current FW pulse sequence */
	sc->fw_drv_pulse_wr_seq =
	    (SHMEM_RD(sc, func_mb[SC_FW_MB_IDX(sc)].drv_pulse_mb) &
	     DRV_PULSE_SEQ_MASK);
#else
	/* set ALWAYS_ALIVE bit in shmem */
	sc->fw_drv_pulse_wr_seq |= DRV_PULSE_ALWAYS_ALIVE;
	bnx2x_drv_pulse(sc);
#endif

	/* load request */
	(*load_code) = bnx2x_fw_command(sc, DRV_MSG_CODE_LOAD_REQ,
				      DRV_MSG_CODE_LOAD_REQ_WITH_LFA);

	/* if the MCP fails to respond we must abort */
	if (!(*load_code)) {
		PMD_DRV_LOG(NOTICE, sc, "MCP response failure!");
		return -1;
	}

	/* if MCP refused then must abort */
	if ((*load_code) == FW_MSG_CODE_DRV_LOAD_REFUSED) {
		PMD_DRV_LOG(NOTICE, sc, "MCP refused load request");
		return -1;
	}

	return 0;
}
/* 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 bnx2x_nic_load_request(struct bnx2x_softc *sc, uint32_t * load_code)
{
	PMD_INIT_FUNC_TRACE(sc);
	sc->fw_seq =
	    (SHMEM_RD(sc, func_mb[SC_FW_MB_IDX(sc)].drv_mb_header) &
	     DRV_MSG_SEQ_NUMBER_MASK);
	PMD_DRV_LOG(DEBUG, sc, "initial fw_seq 0x%04x", sc->fw_seq);
#ifdef BNX2X_PULSE
	sc->fw_drv_pulse_wr_seq =
	    (SHMEM_RD(sc, func_mb[SC_FW_MB_IDX(sc)].drv_pulse_mb) &
	     DRV_PULSE_SEQ_MASK);
#else
	sc->fw_drv_pulse_wr_seq |= DRV_PULSE_ALWAYS_ALIVE;
	bnx2x_drv_pulse(sc);
#endif
	(*load_code) = bnx2x_fw_command(sc, DRV_MSG_CODE_LOAD_REQ,
				      DRV_MSG_CODE_LOAD_REQ_WITH_LFA);
	if (!(*load_code)) {
		PMD_DRV_LOG(NOTICE, sc, "MCP response failure!");
		return -1;
	}
	if ((*load_code) == FW_MSG_CODE_DRV_LOAD_REFUSED) {
		PMD_DRV_LOG(NOTICE, sc, "MCP refused load request");
		return -1;
	}
	return 0;
}
static int bnx2x_nic_load_request ( struct bnx2x_softc * sc , uint32_t * load_code ) { PMD_INIT_FUNC_TRACE ( sc ) ; sc -> fw_seq = ( SHMEM_RD ( sc , func_mb [ SC_FW_MB_IDX ( sc ) ] . drv_mb_header ) & DRV_MSG_SEQ_NUMBER_MASK ) ; PMD_DRV_LOG ( DEBUG , sc , " " , sc -> fw_seq ) ; #ifdef BNX2X_PULSE sc -> fw_drv_pulse_wr_seq = ( SHMEM_RD ( sc , func_mb [ SC_FW_MB_IDX ( sc ) ] . drv_pulse_mb ) & DRV_PULSE_SEQ_MASK ) ; #else sc -> fw_drv_pulse_wr_seq |= DRV_PULSE_ALWAYS_ALIVE ; bnx2x_drv_pulse ( sc ) ; #endif ( * load_code ) = bnx2x_fw_command ( sc , DRV_MSG_CODE_LOAD_REQ , DRV_MSG_CODE_LOAD_REQ_WITH_LFA ) ; if ( ! ( * load_code ) ) { PMD_DRV_LOG ( NOTICE , sc , " " ) ; return -1 ; } if ( ( * load_code ) == FW_MSG_CODE_DRV_LOAD_REFUSED ) { PMD_DRV_LOG ( NOTICE , sc , " " ) ; 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 */ /* set ALWAYS_ALIVE bit in shmem */ /* load request */ /* if the MCP fails to respond we must abort */ /* if MCP refused then must abort */