summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKomal Seelam <kseelam@codeaurora.org>2016-08-18 15:25:24 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-09-26 04:49:39 -0700
commit78ff65a8c6462e12e8513ae0ac7d40eacd2dd88f (patch)
treeee23dd0c616ec32c0a3b3cbaad104704e379ac51
parente492bfefbf0065f2c4ddd1bcb4f1439f8a0a764a (diff)
qcacld-3.0: Add NL event to indicate SSR shutdown is triggered
propagation from qcacld-2.0 to qcacld-3.0. On Dual-WiFi Platforms, Radio Device 1 (R1 - SDIO interface) should be functional only if Radio Device 0 (R0 - PCIe interface) is active. If SSR is indentified on R0, indicate userspace application to unload R1 on this event and Reload R1 once R0 SSR and reload is complete. CRs-Fixed: 1046397 Change-Id: I8a06b569fe536bb93dbb37bdb289295bfce62f6e
-rw-r--r--core/bmi/src/ol_fw.c2
-rw-r--r--core/cds/inc/cds_api.h2
-rw-r--r--core/cds/src/cds_api.c11
-rw-r--r--core/hdd/inc/wlan_hdd_main.h2
-rw-r--r--core/hdd/src/wlan_hdd_main.c1
-rw-r--r--core/hdd/src/wlan_hdd_power.c24
-rw-r--r--core/utils/nlink/inc/wlan_nlink_common.h1
7 files changed, 41 insertions, 2 deletions
diff --git a/core/bmi/src/ol_fw.c b/core/bmi/src/ol_fw.c
index 429ae5f848d1..e6178a43d3ee 100644
--- a/core/bmi/src/ol_fw.c
+++ b/core/bmi/src/ol_fw.c
@@ -593,6 +593,7 @@ void ol_target_failure(void *instance, QDF_STATUS status)
struct hif_opaque_softc *scn = ol_ctx->scn;
tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
struct ol_config_info *ini_cfg = ol_get_ini_handle(ol_ctx);
+ qdf_device_t qdf_dev = ol_ctx->qdf_dev;
int ret;
enum hif_target_status target_status = hif_get_target_status(scn);
@@ -640,6 +641,7 @@ void ol_target_failure(void *instance, QDF_STATUS status)
BMI_ERR("XXX TARGET ASSERTED XXX");
+ cds_svc_fw_shutdown_ind(qdf_dev->dev);
/* Collect the RAM dump through a workqueue */
if (ini_cfg->enable_ramdump_collection)
qdf_sched_work(0, &ol_ctx->ramdump_work);
diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h
index 8bfddf882dc7..5f5487711488 100644
--- a/core/cds/inc/cds_api.h
+++ b/core/cds/inc/cds_api.h
@@ -264,7 +264,7 @@ QDF_STATUS cds_flush_logs(uint32_t is_fatal,
bool dump_mac_trace,
bool recovery_needed);
void cds_logging_set_fw_flush_complete(void);
-
+void cds_svc_fw_shutdown_ind(struct device *dev);
#ifdef FEATURE_WLAN_DIAG_SUPPORT
void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx,
uint8_t type, uint8_t sub_type, uint8_t *peer_mac);
diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c
index ffbdefa50134..e37e9c729f25 100644
--- a/core/cds/src/cds_api.c
+++ b/core/cds/src/cds_api.c
@@ -2323,3 +2323,14 @@ bool cds_is_sub_20_mhz_enabled(void)
return false;
}
+/**
+ * cds_svc_fw_shutdown_ind() - API to send userspace about FW crash
+ *
+ * @dev: Device Pointer
+ *
+ * Return: None
+ */
+void cds_svc_fw_shutdown_ind(struct device *dev)
+{
+ hdd_svc_fw_shutdown_ind(dev);
+}
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index b8d1524e1c96..e0dfae71a240 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -1819,7 +1819,7 @@ QDF_STATUS hdd_sme_close_session_callback(void *pContext);
int hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid,
const uint8_t channel, const handoff_src src);
-
+void hdd_svc_fw_shutdown_ind(struct device *dev);
int hdd_register_cb(hdd_context_t *hdd_ctx);
void hdd_deregister_cb(hdd_context_t *hdd_ctx);
int hdd_start_station_adapter(hdd_adapter_t *adapter);
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 6375349c36ab..211603a66366 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -8168,6 +8168,7 @@ void wlan_hdd_send_svc_nlink_msg(int radio, int type, void *data, int len)
switch (type) {
case WLAN_SVC_FW_CRASHED_IND:
+ case WLAN_SVC_FW_SHUTDOWN_IND:
case WLAN_SVC_LTE_COEX_IND:
case WLAN_SVC_WLAN_AUTO_SHUTDOWN_IND:
case WLAN_SVC_WLAN_AUTO_SHUTDOWN_CANCEL_IND:
diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c
index 975ab449d96a..9e5826085f7b 100644
--- a/core/hdd/src/wlan_hdd_power.c
+++ b/core/hdd/src/wlan_hdd_power.c
@@ -1385,6 +1385,30 @@ static void hdd_ssr_timer_start(int msec)
}
/**
+ * hdd_svc_fw_shutdown_ind() - API to send FW SHUTDOWN IND to Userspace
+ *
+ * @dev: Device Pointer
+ *
+ * Return: None
+ */
+void hdd_svc_fw_shutdown_ind(struct device *dev)
+{
+ hdd_context_t *hdd_ctx;
+ v_CONTEXT_t g_context;
+
+ g_context = cds_get_global_context();
+
+ if (!g_context)
+ return;
+
+ hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+
+ hdd_ctx ? wlan_hdd_send_svc_nlink_msg(hdd_ctx->radio_index,
+ WLAN_SVC_FW_SHUTDOWN_IND,
+ NULL, 0) : 0;
+}
+
+/**
* hdd_wlan_shutdown() - HDD SSR shutdown function
*
* This function is called by the HIF to shutdown the driver during SSR.
diff --git a/core/utils/nlink/inc/wlan_nlink_common.h b/core/utils/nlink/inc/wlan_nlink_common.h
index a23456dedb6e..7259990b0e21 100644
--- a/core/utils/nlink/inc/wlan_nlink_common.h
+++ b/core/utils/nlink/inc/wlan_nlink_common.h
@@ -85,6 +85,7 @@
#define WLAN_SVC_WLAN_TP_TX_IND 0x10B
#define WLAN_SVC_WLAN_AUTO_SHUTDOWN_CANCEL_IND 0x10C
#define WLAN_SVC_WLAN_RADIO_INDEX 0x10D
+#define WLAN_SVC_FW_SHUTDOWN_IND 0x10E
#define WLAN_SVC_MAX_SSID_LEN 32
#define WLAN_SVC_MAX_BSSID_LEN 6
#define WLAN_SVC_MAX_STR_LEN 16