@@ -915,6 +915,52 @@ static int nrf_wifi_util_trigger_rpu_recovery(const struct shell *sh,
915915 k_mutex_unlock (& ctx -> rpu_lock );
916916 return ret ;
917917}
918+
919+ static int nrf_wifi_util_rpu_recovery_info (const struct shell * sh ,
920+ size_t argc ,
921+ const char * argv [])
922+ {
923+ struct nrf_wifi_fmac_dev_ctx * fmac_dev_ctx = NULL ;
924+ struct nrf_wifi_hal_dev_ctx * hal_dev_ctx = NULL ;
925+ unsigned long current_time_ms = nrf_wifi_osal_time_get_curr_ms ();
926+ int ret ;
927+
928+ k_mutex_lock (& ctx -> rpu_lock , K_FOREVER );
929+ if (!ctx || !ctx -> rpu_ctx ) {
930+ shell_fprintf (sh ,
931+ SHELL_ERROR ,
932+ "RPU context not initialized\n" );
933+ ret = - ENOEXEC ;
934+ goto unlock ;
935+ }
936+
937+ fmac_dev_ctx = ctx -> rpu_ctx ;
938+ hal_dev_ctx = fmac_dev_ctx -> hal_dev_ctx ;
939+
940+ shell_fprintf (sh ,
941+ SHELL_INFO ,
942+ "wdt_irq_received: %d\n"
943+ "wdt_irq_ignored: %d\n"
944+ "last_wakeup_now_asserted_time_ms: %lu milliseconds\n"
945+ "last_wakeup_now_deasserted_time_ms: %lu milliseconds\n"
946+ "last_rpu_sleep_opp_time_ms: %lu milliseconds\n"
947+ "current time: %lu milliseconds\n"
948+ "rpu_recovery_success: %d\n"
949+ "rpu_recovery_failure: %d\n\n" ,
950+ hal_dev_ctx -> wdt_irq_received ,
951+ hal_dev_ctx -> wdt_irq_ignored ,
952+ hal_dev_ctx -> last_wakeup_now_asserted_time_ms ,
953+ hal_dev_ctx -> last_wakeup_now_deasserted_time_ms ,
954+ hal_dev_ctx -> last_rpu_sleep_opp_time_ms ,
955+ current_time_ms ,
956+ ctx -> rpu_recovery_success ,
957+ ctx -> rpu_recovery_failure );
958+
959+ ret = 0 ;
960+ unlock :
961+ k_mutex_unlock (& ctx -> rpu_lock );
962+ return ret ;
963+ }
918964#endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */
919965
920966SHELL_STATIC_SUBCMD_SET_CREATE (
@@ -1013,6 +1059,12 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
10131059 nrf_wifi_util_trigger_rpu_recovery ,
10141060 1 ,
10151061 0 ),
1062+ SHELL_CMD_ARG (rpu_recovery_info ,
1063+ NULL ,
1064+ "Dump RPU recovery information" ,
1065+ nrf_wifi_util_rpu_recovery_info ,
1066+ 1 ,
1067+ 0 ),
10161068#endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */
10171069 SHELL_SUBCMD_SET_END );
10181070
0 commit comments