src/dpdk/drivers/net/bnx2x/bnx2x.c
static int bnx2x_init_shmem(struct bnx2x_softc *sc)
{
	int cnt = 0;
	uint32_t val = 0;

	do {
		sc->devinfo.shmem_base =
		    sc->link_params.shmem_base =
		    REG_RD(sc, MISC_REG_SHARED_MEM_ADDR);

		if (sc->devinfo.shmem_base) {
			val = SHMEM_RD(sc, validity_map[SC_PORT(sc)]);
			if (val & SHR_MEM_VALIDITY_MB)
				return 0;
		}

		bnx2x_mcp_wait_one(sc);

	} while (cnt++ < (MCP_TIMEOUT / MCP_ONE_TIMEOUT));

	PMD_DRV_LOG(NOTICE, sc, "BAD MCP validity signature");

	return -1;
}
/* initialize shmem_base and waits for validity signature to appear */
initialize shmem_base and waits for validity signature to appear
initialize shmem_base and waits for validity signature to appear
static int bnx2x_init_shmem(struct bnx2x_softc *sc)
{
	int cnt = 0;
	uint32_t val = 0;
	do {
		sc->devinfo.shmem_base =
		    sc->link_params.shmem_base =
		    REG_RD(sc, MISC_REG_SHARED_MEM_ADDR);
		if (sc->devinfo.shmem_base) {
			val = SHMEM_RD(sc, validity_map[SC_PORT(sc)]);
			if (val & SHR_MEM_VALIDITY_MB)
				return 0;
		}
		bnx2x_mcp_wait_one(sc);
	} while (cnt++ < (MCP_TIMEOUT / MCP_ONE_TIMEOUT));
	PMD_DRV_LOG(NOTICE, sc, "BAD MCP validity signature");
	return -1;
}
static int bnx2x_init_shmem ( struct bnx2x_softc * sc ) { int cnt = 0 ; uint32_t val = 0 ; do { sc -> devinfo . shmem_base = sc -> link_params . shmem_base = REG_RD ( sc , MISC_REG_SHARED_MEM_ADDR ) ; if ( sc -> devinfo . shmem_base ) { val = SHMEM_RD ( sc , validity_map [ SC_PORT ( sc ) ] ) ; if ( val & SHR_MEM_VALIDITY_MB ) return 0 ; } bnx2x_mcp_wait_one ( sc ) ; } while ( cnt ++ < ( MCP_TIMEOUT / MCP_ONE_TIMEOUT ) ) ; PMD_DRV_LOG ( NOTICE , sc , " " ) ; return -1 ; }
initialize shmem_base and waits for validity signature to appear
initialize shmem_base and waits for validity signature to appear