diff options
author | Evan Lojewski <github@meklort.com> | 2020-11-24 21:45:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-24 21:45:59 -0700 |
commit | e748bb2049be7151efa2369a3bc0c50d13e4aa82 (patch) | |
tree | ba443ffdd15e5b66a3d2dfb0ebdad4835427f13e | |
parent | fcb3fecb2d7ed14baa67c39fb998055c7ac14aa5 (diff) | |
download | bcm5719-ortega-e748bb2049be7151efa2369a3bc0c50d13e4aa82.tar.gz bcm5719-ortega-e748bb2049be7151efa2369a3bc0c50d13e4aa82.zip |
ape: Cleanup reset logic. (#181)
-rw-r--r-- | ape/main.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -304,33 +304,35 @@ void __attribute__((noreturn)) loaderLoop(void) if (host_state != SHM.HostDriverState.bits.State) { + reload_type_t type; host_state = SHM.HostDriverState.bits.State; + if (SHM_HOST_DRIVER_STATE_STATE_START == host_state) { + type = NEVER_RESET; printf("host started\n"); - wait_for_all_rx(); - RMU_init(); - NCSI_reload(NEVER_RESET); reset_allowed = true; } else { - wait_for_all_rx(); - RMU_init(); if (SHM_HOST_DRIVER_STATE_STATE_UNLOAD == host_state) { printf("host unloaded.\n"); - NCSI_reload(ALWAYS_RESET); + type = ALWAYS_RESET; } else { printf("wol?\n"); - NCSI_reload(AS_NEEDED); + type = AS_NEEDED; } reset_allowed = false; } + + wait_for_all_rx(); + RMU_init(); + NCSI_reload(type); } else if (reset_allowed && !Network_checkEnableState(gPort)) { |