|
@@ -46,6 +46,10 @@
|
|
#include "hif_napi.h"
|
|
#include "hif_napi.h"
|
|
#include "hif_unit_test_suspend_i.h"
|
|
#include "hif_unit_test_suspend_i.h"
|
|
#include "qdf_module.h"
|
|
#include "qdf_module.h"
|
|
|
|
+#ifdef HIF_CE_LOG_INFO
|
|
|
|
+#include <qdf_notifier.h>
|
|
|
|
+#include <qdf_hang_event_notifier.h>
|
|
|
|
+#endif
|
|
|
|
|
|
void hif_dump(struct hif_opaque_softc *hif_ctx, uint8_t cmd_id, bool start)
|
|
void hif_dump(struct hif_opaque_softc *hif_ctx, uint8_t cmd_id, bool start)
|
|
{
|
|
{
|
|
@@ -429,6 +433,87 @@ void hif_get_cfg_from_psoc(struct hif_softc *scn,
|
|
}
|
|
}
|
|
#endif /* WLAN_CE_INTERRUPT_THRESHOLD_CONFIG */
|
|
#endif /* WLAN_CE_INTERRUPT_THRESHOLD_CONFIG */
|
|
|
|
|
|
|
|
+#ifdef HIF_CE_LOG_INFO
|
|
|
|
+/**
|
|
|
|
+ * hif_recovery_notifier_cb - Recovery notifier callback to log
|
|
|
|
+ * hang event data
|
|
|
|
+ * @block: notifier block
|
|
|
|
+ * @state: state
|
|
|
|
+ * @data: notifier data
|
|
|
|
+ *
|
|
|
|
+ * Return: status
|
|
|
|
+ */
|
|
|
|
+static
|
|
|
|
+int hif_recovery_notifier_cb(struct notifier_block *block, unsigned long state,
|
|
|
|
+ void *data)
|
|
|
|
+{
|
|
|
|
+ struct qdf_notifer_data *notif_data = data;
|
|
|
|
+ qdf_notif_block *notif_block;
|
|
|
|
+ struct hif_softc *hif_handle;
|
|
|
|
+
|
|
|
|
+ if (!data || !block)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ notif_block = qdf_container_of(block, qdf_notif_block, notif_block);
|
|
|
|
+
|
|
|
|
+ hif_handle = notif_block->priv_data;
|
|
|
|
+ if (!hif_handle)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ hif_log_ce_info(hif_handle, notif_data->hang_data,
|
|
|
|
+ ¬if_data->offset);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * hif_register_recovery_notifier - Register hif recovery notifier
|
|
|
|
+ * @hif_handle: hif handle
|
|
|
|
+ *
|
|
|
|
+ * Return: status
|
|
|
|
+ */
|
|
|
|
+static
|
|
|
|
+QDF_STATUS hif_register_recovery_notifier(struct hif_softc *hif_handle)
|
|
|
|
+{
|
|
|
|
+ qdf_notif_block *hif_notifier;
|
|
|
|
+
|
|
|
|
+ if (!hif_handle)
|
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
|
+
|
|
|
|
+ hif_notifier = &hif_handle->hif_recovery_notifier;
|
|
|
|
+
|
|
|
|
+ hif_notifier->notif_block.notifier_call = hif_recovery_notifier_cb;
|
|
|
|
+ hif_notifier->priv_data = hif_handle;
|
|
|
|
+ return qdf_hang_event_register_notifier(hif_notifier);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * hif_unregister_recovery_notifier - Un-register hif recovery notifier
|
|
|
|
+ * @hif_handle: hif handle
|
|
|
|
+ *
|
|
|
|
+ * Return: status
|
|
|
|
+ */
|
|
|
|
+static
|
|
|
|
+QDF_STATUS hif_unregister_recovery_notifier(struct hif_softc *hif_handle)
|
|
|
|
+{
|
|
|
|
+ qdf_notif_block *hif_notifier = &hif_handle->hif_recovery_notifier;
|
|
|
|
+
|
|
|
|
+ return qdf_hang_event_unregister_notifier(hif_notifier);
|
|
|
|
+}
|
|
|
|
+#else
|
|
|
|
+static inline
|
|
|
|
+QDF_STATUS hif_register_recovery_notifier(struct hif_softc *hif_handle)
|
|
|
|
+{
|
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline
|
|
|
|
+QDF_STATUS hif_unregister_recovery_notifier(struct hif_softc *hif_handle)
|
|
|
|
+{
|
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
struct hif_opaque_softc *hif_open(qdf_device_t qdf_ctx,
|
|
struct hif_opaque_softc *hif_open(qdf_device_t qdf_ctx,
|
|
uint32_t mode,
|
|
uint32_t mode,
|
|
enum qdf_bus_type bus_type,
|
|
enum qdf_bus_type bus_type,
|
|
@@ -610,6 +695,7 @@ QDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev,
|
|
}
|
|
}
|
|
|
|
|
|
hif_ut_suspend_init(scn);
|
|
hif_ut_suspend_init(scn);
|
|
|
|
+ hif_register_recovery_notifier(scn);
|
|
|
|
|
|
/*
|
|
/*
|
|
* Flag to avoid potential unallocated memory access from MSI
|
|
* Flag to avoid potential unallocated memory access from MSI
|
|
@@ -639,6 +725,8 @@ void hif_disable(struct hif_opaque_softc *hif_ctx, enum hif_disable_type type)
|
|
if (!scn)
|
|
if (!scn)
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
+ hif_unregister_recovery_notifier(scn);
|
|
|
|
+
|
|
hif_nointrs(scn);
|
|
hif_nointrs(scn);
|
|
if (scn->hif_init_done == false)
|
|
if (scn->hif_init_done == false)
|
|
hif_shutdown_device(hif_ctx);
|
|
hif_shutdown_device(hif_ctx);
|