Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/cxgbe/t4_main.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 9,997 Lines • ▼ Show 20 Lines | load_fw(struct adapter *sc, struct t4_data *fw) | ||||
*/ | */ | ||||
if (sc->flags & FULL_INIT_DONE && | if (sc->flags & FULL_INIT_DONE && | ||||
(sc->debug_flags & DF_LOAD_FW_ANYTIME) == 0) { | (sc->debug_flags & DF_LOAD_FW_ANYTIME) == 0) { | ||||
rc = EBUSY; | rc = EBUSY; | ||||
goto done; | goto done; | ||||
} | } | ||||
fw_data = malloc(fw->len, M_CXGBE, M_WAITOK); | fw_data = malloc(fw->len, M_CXGBE, M_WAITOK); | ||||
if (fw_data == NULL) { | |||||
rc = ENOMEM; | |||||
goto done; | |||||
} | |||||
rc = copyin(fw->data, fw_data, fw->len); | rc = copyin(fw->data, fw_data, fw->len); | ||||
if (rc == 0) | if (rc == 0) | ||||
rc = -t4_load_fw(sc, fw_data, fw->len); | rc = -t4_load_fw(sc, fw_data, fw->len); | ||||
free(fw_data, M_CXGBE); | free(fw_data, M_CXGBE); | ||||
done: | done: | ||||
end_synchronized_op(sc, 0); | end_synchronized_op(sc, 0); | ||||
Show All 12 Lines | load_cfg(struct adapter *sc, struct t4_data *cfg) | ||||
if (cfg->len == 0) { | if (cfg->len == 0) { | ||||
/* clear */ | /* clear */ | ||||
rc = -t4_load_cfg(sc, NULL, 0); | rc = -t4_load_cfg(sc, NULL, 0); | ||||
goto done; | goto done; | ||||
} | } | ||||
cfg_data = malloc(cfg->len, M_CXGBE, M_WAITOK); | cfg_data = malloc(cfg->len, M_CXGBE, M_WAITOK); | ||||
if (cfg_data == NULL) { | |||||
rc = ENOMEM; | |||||
goto done; | |||||
} | |||||
rc = copyin(cfg->data, cfg_data, cfg->len); | rc = copyin(cfg->data, cfg_data, cfg->len); | ||||
if (rc == 0) | if (rc == 0) | ||||
rc = -t4_load_cfg(sc, cfg_data, cfg->len); | rc = -t4_load_cfg(sc, cfg_data, cfg->len); | ||||
free(cfg_data, M_CXGBE); | free(cfg_data, M_CXGBE); | ||||
done: | done: | ||||
end_synchronized_op(sc, 0); | end_synchronized_op(sc, 0); | ||||
Show All 29 Lines | load_boot(struct adapter *sc, struct t4_bootrom *br) | ||||
if (br->len == 0) { | if (br->len == 0) { | ||||
/* clear */ | /* clear */ | ||||
rc = -t4_load_boot(sc, NULL, offset, 0); | rc = -t4_load_boot(sc, NULL, offset, 0); | ||||
goto done; | goto done; | ||||
} | } | ||||
br_data = malloc(br->len, M_CXGBE, M_WAITOK); | br_data = malloc(br->len, M_CXGBE, M_WAITOK); | ||||
if (br_data == NULL) { | |||||
rc = ENOMEM; | |||||
goto done; | |||||
} | |||||
rc = copyin(br->data, br_data, br->len); | rc = copyin(br->data, br_data, br->len); | ||||
if (rc == 0) | if (rc == 0) | ||||
rc = -t4_load_boot(sc, br_data, offset, br->len); | rc = -t4_load_boot(sc, br_data, offset, br->len); | ||||
free(br_data, M_CXGBE); | free(br_data, M_CXGBE); | ||||
done: | done: | ||||
end_synchronized_op(sc, 0); | end_synchronized_op(sc, 0); | ||||
Show All 12 Lines | load_bootcfg(struct adapter *sc, struct t4_data *bc) | ||||
if (bc->len == 0) { | if (bc->len == 0) { | ||||
/* clear */ | /* clear */ | ||||
rc = -t4_load_bootcfg(sc, NULL, 0); | rc = -t4_load_bootcfg(sc, NULL, 0); | ||||
goto done; | goto done; | ||||
} | } | ||||
bc_data = malloc(bc->len, M_CXGBE, M_WAITOK); | bc_data = malloc(bc->len, M_CXGBE, M_WAITOK); | ||||
if (bc_data == NULL) { | |||||
rc = ENOMEM; | |||||
goto done; | |||||
} | |||||
rc = copyin(bc->data, bc_data, bc->len); | rc = copyin(bc->data, bc_data, bc->len); | ||||
if (rc == 0) | if (rc == 0) | ||||
rc = -t4_load_bootcfg(sc, bc_data, bc->len); | rc = -t4_load_bootcfg(sc, bc_data, bc->len); | ||||
free(bc_data, M_CXGBE); | free(bc_data, M_CXGBE); | ||||
done: | done: | ||||
end_synchronized_op(sc, 0); | end_synchronized_op(sc, 0); | ||||
▲ Show 20 Lines • Show All 1,237 Lines • Show Last 20 Lines |