Ver código fonte

qcacld-3.0: Refactor HDD LPASS "start" logic

Previously "qcacld-3.0: Refactor WLAN_FEATURE_LPSS" refactored some of
the HDD LPASS logic.  Continue that process by refactoring the "start"
logic such that the actual implementation is in the lpass feature
file.

Change-Id: Idc7ed03abd35616d2a7bfa4a74aaec9898f9dc8e
CRs-Fixed: 1070700
Jeff Johnson 8 anos atrás
pai
commit
9afc501027

+ 20 - 2
core/hdd/src/wlan_hdd_lpass.c

@@ -196,8 +196,9 @@ void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter,
  *
  * Return: none
  */
-void wlan_hdd_send_version_pkg(uint32_t fw_version,
-			       uint32_t chip_id, const char *chip_name)
+static void wlan_hdd_send_version_pkg(uint32_t fw_version,
+				      uint32_t chip_id,
+				      const char *chip_name)
 {
 	int ret = 0;
 	struct wlan_version_data data;
@@ -259,3 +260,20 @@ void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx)
 	if (!scan_intf_found)
 		wlan_hdd_send_status_pkg(adapter, NULL, 1, 0);
 }
+
+/**
+ * hdd_lpass_notify_start() - Notify LPASS of driver start
+ * @hdd_ctx: The global HDD context
+ *
+ * This function is used to notify the LPASS feature that the wlan
+ * driver has (re-)started.
+ *
+ * Return: none
+ */
+void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx)
+{
+	wlan_hdd_send_all_scan_intf_info(hdd_ctx);
+	wlan_hdd_send_version_pkg(hdd_ctx->target_fw_version,
+				  hdd_ctx->target_hw_version,
+				  hdd_ctx->target_hw_name);
+}

+ 14 - 9
core/hdd/src/wlan_hdd_lpass.h

@@ -28,13 +28,24 @@
 #if !defined(WLAN_HDD_LPASS_H)
 #define WLAN_HDD_LPASS_H
 
+struct hdd_context_s;
+
 #ifdef WLAN_FEATURE_LPSS
 void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter,
 			      hdd_station_ctx_t *sta_ctx,
 			      uint8_t is_on, uint8_t is_connected);
-void wlan_hdd_send_version_pkg(uint32_t fw_version,
-			       uint32_t chip_id, const char *chip_name);
 void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx);
+
+/**
+ * hdd_lpass_notify_start() - Notify LPASS of driver start
+ * @hdd_ctx: The global HDD context
+ *
+ * This function is used to notify the LPASS feature that the wlan
+ * driver has (re-)started.
+ *
+ * Return: none
+ */
+void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx);
 #else
 static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter,
 					    hdd_station_ctx_t *sta_ctx,
@@ -43,17 +54,11 @@ static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter,
 	return;
 }
 
-static inline void wlan_hdd_send_version_pkg(uint32_t fw_version,
-					     uint32_t chip_id,
-					     const char *chip_name)
-{
-	return;
-}
-
 static inline void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx)
 {
 	return;
 }
+static inline void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx) { }
 #endif
 
 #endif /* WLAN_HDD_LPASS_H */

+ 1 - 4
core/hdd/src/wlan_hdd_main.c

@@ -7738,10 +7738,7 @@ int hdd_wlan_startup(struct device *dev)
 			  hdd_bus_bw_compute_cbk, (void *)hdd_ctx);
 #endif
 
-	wlan_hdd_send_all_scan_intf_info(hdd_ctx);
-	wlan_hdd_send_version_pkg(hdd_ctx->target_fw_version,
-				  hdd_ctx->target_hw_version,
-				  hdd_ctx->target_hw_name);
+	hdd_lpass_notify_start(hdd_ctx);
 
 	if (hdd_ctx->rps)
 		hdd_set_rps_cpu_mask(hdd_ctx);

+ 1 - 4
core/hdd/src/wlan_hdd_power.c

@@ -1555,10 +1555,7 @@ QDF_STATUS hdd_wlan_re_init(void)
 		goto err_cds_disable;
 	}
 
-	wlan_hdd_send_all_scan_intf_info(pHddCtx);
-	wlan_hdd_send_version_pkg(pHddCtx->target_fw_version,
-				  pHddCtx->target_hw_version,
-				  pHddCtx->target_hw_name);
+	hdd_lpass_notify_start(pHddCtx);
 	qdf_status = wlansap_global_init();
 	if (QDF_IS_STATUS_ERROR(qdf_status))
 		goto err_cds_disable;