Browse Source

qcacld-3.0: Stop SAP and indicate event more earlier after SSR

propagation from qcacld-2.0 to qcacld-3.0

DUT is SAP + STA SBSC mode, it takes very long time to recover after
SSR. There are two problems:

1. It clear STA session and create new after SSR, but just clear SAP
session. With sessionId in SAP context, it wrongly use new STA session
to close SAP when terminate hostapd. This is the reason why host wait
stop_bss_event for 10 seconds in cfg80211 stop ap. Set sessionId to
invalid if adapter is SAP mode.

2. In dual-wifi mode, it will start second WLAN if SSR and
WLAN_SVC_FW_CRASHED_IND late. Send this event more earlier.

Change-Id: I10a3f300ac5621463fcce4d0a5e18b2cf1cb8491
CRs-Fixed: 1054612
Wu Gao 8 years ago
parent
commit
3671743bd5
4 changed files with 40 additions and 3 deletions
  1. 8 0
      core/hdd/src/wlan_hdd_main.c
  2. 3 3
      core/hdd/src/wlan_hdd_power.c
  3. 3 0
      core/sap/inc/sap_api.h
  4. 26 0
      core/sap/src/sap_module.c

+ 8 - 0
core/hdd/src/wlan_hdd_main.c

@@ -3834,6 +3834,14 @@ QDF_STATUS hdd_reset_all_adapters(hdd_context_t *hdd_ctx)
 			clear_bit(WMM_INIT_DONE, &adapter->event_flags);
 		}
 
+		/*
+		 * If adapter is SAP, set session ID to invalid since SAP
+		 * session will be cleanup during SSR.
+		 */
+		if (adapter->device_mode == QDF_SAP_MODE)
+			wlansap_set_invalid_session(
+				WLAN_HDD_GET_SAP_CTX_PTR(adapter));
+
 		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
 		adapterNode = pNext;
 	}

+ 3 - 3
core/hdd/src/wlan_hdd_power.c

@@ -1573,15 +1573,15 @@ QDF_STATUS hdd_wlan_re_init(void)
 
 	hdd_wlan_get_version(pHddCtx, NULL, NULL);
 
+	wlan_hdd_send_svc_nlink_msg(pHddCtx->radio_index,
+				WLAN_SVC_FW_CRASHED_IND, NULL, 0);
+
 	/* Restart all adapters */
 	hdd_start_all_adapters(pHddCtx);
 
 	pHddCtx->hdd_mcastbcast_filter_set = false;
 	pHddCtx->btCoexModeSet = false;
 
-	wlan_hdd_send_svc_nlink_msg(pHddCtx->radio_index,
-				WLAN_SVC_FW_CRASHED_IND, NULL, 0);
-
 	/* Allow the phone to go to sleep */
 	hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT);
 

+ 3 - 0
core/sap/inc/sap_api.h

@@ -970,6 +970,9 @@ uint32_t wlansap_get_chan_width(void *cds_ctx);
 
 QDF_STATUS wlansap_set_tx_leakage_threshold(tHalHandle hal,
 			uint16_t tx_leakage_threshold);
+
+QDF_STATUS wlansap_set_invalid_session(void *cds_ctx);
+
 #ifdef __cplusplus
 }
 #endif

+ 26 - 0
core/sap/src/sap_module.c

@@ -3665,3 +3665,29 @@ QDF_STATUS wlansap_set_tx_leakage_threshold(tHalHandle hal,
 			mac->sap.SapDfsInfo.tx_leakage_threshold);
 	return QDF_STATUS_SUCCESS;
 }
+
+/*
+ * wlansap_set_invalid_session() - set session ID to invalid
+ * @cds_ctx: pointer of global context
+ *
+ * This function sets session ID to invalid
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+wlansap_set_invalid_session(void *cds_ctx)
+{
+	ptSapContext psapctx;
+
+	psapctx = CDS_GET_SAP_CB(cds_ctx);
+	if (NULL == psapctx) {
+		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
+			FL("Invalid SAP pointer from pctx"));
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	psapctx->sessionId = CSR_SESSION_ID_INVALID;
+	psapctx->isSapSessionOpen = eSAP_FALSE;
+
+	return QDF_STATUS_SUCCESS;
+}