Эх сурвалжийг харах

qcacld-3.0: Change TDLS API to provide abstraction to other modules

TDLS timer related API is directly exposed to
other modules, and it induces code portability
and compilation problem.
Change the API implementation and provide only
abstraction to other modules.

Change-Id: I8cec34558366ab500a66d4c9f4d36e042490a6bf
CRs-Fixed: 2006815
Kabilan Kannan 8 жил өмнө
parent
commit
6ca9848fe7

+ 28 - 4
core/hdd/inc/wlan_hdd_tdls.h

@@ -51,6 +51,16 @@ typedef enum {
 	eTDLS_SUPPORT_EXTERNAL_CONTROL,
 } eTDLSSupportMode;
 
+/**
+ * enum tdls_concerned_external_events - External events that affect TDLS
+ * @P2P_ROC_START: P2P remain on channel starts
+ * @P2P_ROC_END: P2P remain on channel ends
+ */
+enum tdls_concerned_external_events {
+	P2P_ROC_START,
+	P2P_ROC_END,
+};
+
 #ifdef FEATURE_WLAN_TDLS
 
 /*
@@ -754,8 +764,22 @@ void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter,
  */
 void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter, bool lfr_roam);
 void wlan_hdd_change_tdls_mode(void *hdd_ctx);
-void hdd_restart_tdls_source_timer(hdd_context_t *pHddCtx,
-				      eTDLSSupportMode tdls_mode);
+
+/**
+ * hdd_tdls_notify_p2p_roc() - Notify p2p roc event to TDLS
+ * @hdd_ctx: ptr to hdd context.
+ * @event: P2P roc event that affect TDLS
+ *
+ * P2P roc events notified to TDLS to avoid overlap between P2P listen
+ * and TDLS operation.
+ * Based on P2P remain on channel event, TDLS mode will be
+ * updated and TDLS source timer started with timer period
+ * equivalent to P2P ROC interval to revert the TDLS mode.
+ *
+ * Return: None
+ */
+void hdd_tdls_notify_p2p_roc(hdd_context_t *hdd_ctx,
+			    enum tdls_concerned_external_events event);
 
 /**
  * wlan_hdd_cfg80211_configure_tdls_mode() - configure tdls mode
@@ -826,8 +850,8 @@ static inline void wlan_hdd_change_tdls_mode(void *hdd_ctx)
 {
 }
 static inline void
-hdd_restart_tdls_source_timer(hdd_context_t *pHddCtx,
-			      eTDLSSupportMode tdls_mode)
+hdd_tdls_notify_p2p_roc(hdd_context_t *hdd_ctx,
+			enum tdls_concerned_external_events event)
 {
 }
 #endif /* End of FEATURE_WLAN_TDLS */

+ 2 - 2
core/hdd/src/wlan_hdd_p2p.c

@@ -535,7 +535,7 @@ static void wlan_hdd_remain_on_chan_timeout(void *data)
 			roc_scan_id);
 	}
 
-	hdd_restart_tdls_source_timer(hdd_ctx, hdd_ctx->tdls_mode_last);
+	hdd_tdls_notify_p2p_roc(hdd_ctx, P2P_ROC_END);
 	qdf_runtime_pm_allow_suspend(hdd_ctx->runtime_context.roc);
 	hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
 }
@@ -697,7 +697,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
 		}
 
 	}
-	hdd_restart_tdls_source_timer(pHddCtx, eTDLS_SUPPORT_DISABLED);
+	hdd_tdls_notify_p2p_roc(pHddCtx, P2P_ROC_START);
 	return 0;
 }
 

+ 11 - 20
core/hdd/src/wlan_hdd_tdls.c

@@ -6056,31 +6056,22 @@ void wlan_hdd_change_tdls_mode(void *data)
 			       HDD_SET_TDLS_MODE_SOURCE_P2P);
 }
 
-/**
- * hdd_restart_tdls_source_timer - Restart TDLS source timer
- * @pHddCtx: ptr to hdd context.
- * @tdls_mode: value for TDLS support mode.
- *
- * This timer is the handler for avoiding overlapping for P2P listen
- * and TDLS operation. This handler will start the source timer for
- * the duration of tdls_enable_defer_time after P2P listen ends and
- * before enabling TDLS again.
- *
- * Return: None
- */
-void hdd_restart_tdls_source_timer(hdd_context_t *pHddCtx,
-				eTDLSSupportMode tdls_mode)
+void hdd_tdls_notify_p2p_roc(hdd_context_t *hdd_ctx,
+				enum tdls_concerned_external_events event)
 {
-	qdf_mc_timer_stop(&pHddCtx->tdls_source_timer);
+	eTDLSSupportMode tdls_mode;
+
+	qdf_mc_timer_stop(&hdd_ctx->tdls_source_timer);
 
-	if (tdls_mode == eTDLS_SUPPORT_DISABLED) {
-		wlan_hdd_tdls_set_mode(pHddCtx, tdls_mode, false,
+	if (event == P2P_ROC_START) {
+		tdls_mode = eTDLS_SUPPORT_DISABLED;
+		wlan_hdd_tdls_set_mode(hdd_ctx, tdls_mode, false,
 				HDD_SET_TDLS_MODE_SOURCE_P2P);
-		wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx);
+		wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_ctx);
 	}
 
-	qdf_mc_timer_start(&pHddCtx->tdls_source_timer,
-			   pHddCtx->config->tdls_enable_defer_time);
+	qdf_mc_timer_start(&hdd_ctx->tdls_source_timer,
+			   hdd_ctx->config->tdls_enable_defer_time);
 
 	return;
 }