FreeBSD/sys/dev/bxe/bxe.c
/* 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
bxe_init_shmem(struct bxe_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);
        }
        bxe_mcp_wait_one(sc);
    } while (cnt++ < (MCP_TIMEOUT / MCP_ONE_TIMEOUT));
    BLOGE(sc, "BAD MCP validity signature\n");
    return (-1);
}
static int bxe_init_shmem ( struct bxe_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 ) ; } bxe_mcp_wait_one ( sc ) ; } while ( cnt ++ < ( MCP_TIMEOUT / MCP_ONE_TIMEOUT ) ) ; BLOGE ( sc , " \n " ) ; return ( -1 ) ; }
initialize shmem_base and waits for validity signature to appear
initialize shmem_base and waits for validity signature to appear