Forráskód Böngészése

qcacld-3.0: Fix layering violation in hdd_update_tgt_services

Fix layering violation in hdd_update_tgt_services by not accessing
pMac structure directly from HDD.

New SME API - sme_update_tgt_services() introducted to configure the
parameters in pMAC structure.

Change-Id: I7310e51001c5e17ed63730d7a86445548aa3d246
CRs-Fixed: 915267
Krishna Kumaar Natarajan 9 éve
szülő
commit
052c6e6b30
3 módosított fájl, 21 hozzáadás és 3 törlés
  1. 1 3
      core/hdd/src/wlan_hdd_main.c
  2. 2 0
      core/sme/inc/sme_api.h
  3. 18 0
      core/sme/src/common/sme_api.c

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

@@ -668,7 +668,6 @@ static void hdd_update_tgt_services(hdd_context_t *hdd_ctx,
 				    struct wma_tgt_services *cfg)
 {
 	struct hdd_config *config = hdd_ctx->config;
-	tpAniSirGlobal pMac = PMAC_STRUCT(hdd_ctx->hHal);
 
 	/* Set up UAPSD */
 	config->apUapsdEnabled &= cfg->uapsd;
@@ -690,7 +689,6 @@ static void hdd_update_tgt_services(hdd_context_t *hdd_ctx,
 	if (cfg->pno_offload)
 		config->PnoOffload = true;
 #endif
-	pMac->lteCoexAntShare = cfg->lte_coex_ant_share;
 #ifdef FEATURE_WLAN_TDLS
 	config->fEnableTDLSSupport &= cfg->en_tdls;
 	config->fEnableTDLSOffChannel &= cfg->en_tdls_offchan;
@@ -701,10 +699,10 @@ static void hdd_update_tgt_services(hdd_context_t *hdd_ctx,
 		config->fEnableTDLSSleepSta = false;
 	}
 #endif
-	pMac->beacon_offload = cfg->beacon_offload;
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 	config->isRoamOffloadEnabled &= cfg->en_roam_offload;
 #endif
+	sme_update_tgt_services(hdd_ctx->hHal, cfg);
 
 }
 

+ 2 - 0
core/sme/inc/sme_api.h

@@ -46,6 +46,7 @@
 #include "p2p_api.h"
 #include "cds_regdomain.h"
 #include "sme_internal.h"
+#include "wma_tgt_cfg.h"
 
 #ifdef FEATURE_OEM_DATA_SUPPORT
 #include "oem_data_api.h"
@@ -1045,4 +1046,5 @@ CDF_STATUS sme_register_for_dcc_stats_event(tHalHandle hHal, void *context,
 void sme_add_set_thermal_level_callback(tHalHandle hal,
 		sme_set_thermal_level_callback callback);
 
+void sme_update_tgt_services(tHalHandle hal, struct wma_tgt_services *cfg);
 #endif /* #if !defined( __SME_API_H ) */

+ 18 - 0
core/sme/src/common/sme_api.c

@@ -14705,3 +14705,21 @@ CDF_STATUS sme_update_roam_scan_hi_rssi_scan_params(tHalHandle hal_handle,
 	return status;
 }
 
+/**
+ * sme_update_tgt_services() - update the target services config.
+ * @hal: HAL pointer.
+ * @cfg: wma_tgt_services parameters.
+ *
+ * update the target services config.
+ *
+ * Return: None.
+ */
+void sme_update_tgt_services(tHalHandle hal, struct wma_tgt_services *cfg)
+{
+	tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+
+	mac_ctx->lteCoexAntShare = cfg->lte_coex_ant_share;
+	mac_ctx->beacon_offload = cfg->beacon_offload;
+
+	return;
+}