Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/mpr/mpr_user.c
Show First 20 Lines • Show All 1,522 Lines • ▼ Show 20 Lines | mpr_dprint(sc, MPR_ERROR, | ||||
"Cannot allocate FW diag buffer memory\n"); | "Cannot allocate FW diag buffer memory\n"); | ||||
*return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; | *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; | ||||
status = MPR_DIAG_FAILURE; | status = MPR_DIAG_FAILURE; | ||||
goto bailout; | goto bailout; | ||||
} | } | ||||
bzero(sc->fw_diag_buffer, buffer_size); | bzero(sc->fw_diag_buffer, buffer_size); | ||||
ctx = malloc(sizeof(*ctx), M_MPR, M_WAITOK | M_ZERO); | ctx = malloc(sizeof(*ctx), M_MPR, M_WAITOK | M_ZERO); | ||||
if (ctx == NULL) { | |||||
device_printf(sc->mpr_dev, "%s: context malloc failed\n", | |||||
__func__); | |||||
*return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; | |||||
status = MPR_DIAG_FAILURE; | |||||
goto bailout; | |||||
} | |||||
ctx->addr = &sc->fw_diag_busaddr; | ctx->addr = &sc->fw_diag_busaddr; | ||||
ctx->buffer_dmat = sc->fw_diag_dmat; | ctx->buffer_dmat = sc->fw_diag_dmat; | ||||
ctx->buffer_dmamap = sc->fw_diag_map; | ctx->buffer_dmamap = sc->fw_diag_map; | ||||
ctx->softc = sc; | ctx->softc = sc; | ||||
error = bus_dmamap_load(sc->fw_diag_dmat, sc->fw_diag_map, | error = bus_dmamap_load(sc->fw_diag_dmat, sc->fw_diag_map, | ||||
sc->fw_diag_buffer, buffer_size, mpr_memaddr_wait_cb, | sc->fw_diag_buffer, buffer_size, mpr_memaddr_wait_cb, | ||||
ctx, 0); | ctx, 0); | ||||
if (error == EINPROGRESS) { | if (error == EINPROGRESS) { | ||||
▲ Show 20 Lines • Show All 1,068 Lines • Show Last 20 Lines |