瀏覽代碼

qcacld-3.0: Featurize P2P Listen Offload

P2P Listen offload is not a requirement for Genoa, hence featurize
P2P listen offload code to save memory foot-print for Genoa.

Change-Id: If50c784bb4cd6daac513a0654364e78cd636c9d3
CRs-Fixed: 2304554
Rachit Kankane 6 年之前
父節點
當前提交
026e77a99d

+ 4 - 0
Kbuild

@@ -2225,7 +2225,11 @@ cppflags-$(CONFIG_FEATURE_ACTIVE_TOS) += -DFEATURE_ACTIVE_TOS
 cppflags-$(CONFIG_FEATURE_SAR_LIMITS) += -DFEATURE_SAR_LIMITS
 cppflags-$(CONFIG_FEATURE_CONCURRENCY_MATRIX) += -DFEATURE_CONCURRENCY_MATRIX
 cppflags-$(CONFIG_FEATURE_SAP_COND_CHAN_SWITCH) += -DFEATURE_SAP_COND_CHAN_SWITCH
+
+#if converged p2p is enabled
+ifeq ($(CONFIG_CONVERGED_P2P_ENABLE), y)
 cppflags-$(CONFIG_FEATURE_P2P_LISTEN_OFFLOAD) += -DFEATURE_P2P_LISTEN_OFFLOAD
+endif
 
 # Dummy flag for WIN/MCL converged data path compilation
 cppflags-y += -DDP_PRINT_ENABLE=0

+ 1 - 1
configs/genoa.common

@@ -130,7 +130,7 @@ CONFIG_FEATURE_ACTIVE_TOS := n
 CONFIG_FEATURE_SAR_LIMITS := y
 CONFIG_FEATURE_CONCURRENCY_MATRIX := n
 CONFIG_FEATURE_SAP_COND_CHAN_SWITCH := n
-CONFIG_FEATURE_P2P_LISTEN_OFFLOAD := n
+CONFIG_FEATURE_P2P_LISTEN_OFFLOAD := y
 
 ifeq ($(CONFIG_ARCH_SDM845), y)
 ifeq ($(CONFIG_IPA_OFFLOAD), y)

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

@@ -10200,6 +10200,7 @@ out:
 	return ret;
 }
 
+#ifdef FEATURE_P2P_LISTEN_OFFLOAD
 /**
  * wlan_hdd_p2p_lo_event_callback - P2P listen offload stop event handler
  * @context: context registered with sme_register_p2p_lo_event(). HDD
@@ -10255,6 +10256,12 @@ static void wlan_hdd_p2p_lo_event_callback(void *context,
 	hdd_debug("Sent P2P_LISTEN_OFFLOAD_STOP event for vdev_id = %d",
 			evt->vdev_id);
 }
+#else
+static void wlan_hdd_p2p_lo_event_callback(void *context,
+					   struct sir_p2p_lo_event *evt)
+{
+}
+#endif
 
 #ifdef FEATURE_WLAN_DYNAMIC_CVM
 static inline int hdd_set_vc_mode_config(struct hdd_context *hdd_ctx)

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

@@ -1577,8 +1577,16 @@ void sme_set_pdev_ht_vht_ies(tHalHandle hHal, bool enable2x2);
 void sme_update_vdev_type_nss(tHalHandle hal, uint8_t max_supp_nss,
 		uint32_t vdev_type_nss, enum band_info band);
 void sme_update_hw_dbs_capable(tHalHandle hal, uint8_t hw_dbs_capable);
+#ifdef FEATURE_P2P_LISTEN_OFFLOAD
 void sme_register_p2p_lo_event(tHalHandle hHal, void *context,
 					p2p_lo_callback callback);
+#else
+static inline void sme_register_p2p_lo_event(tHalHandle hHal,
+					     void *context,
+					     p2p_lo_callback callback)
+{
+}
+#endif
 
 QDF_STATUS sme_remove_bssid_from_scan_list(tHalHandle hal,
 	tSirMacAddr bssid);

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

@@ -331,8 +331,10 @@ typedef struct tagSmeStruct {
 	ocb_callback dcc_stats_event_callback;
 	sme_set_thermal_level_callback set_thermal_level_cb;
 	void *apf_get_offload_context;
+#ifdef FEATURE_P2P_LISTEN_OFFLOAD
 	p2p_lo_callback p2p_lo_event_callback;
 	void *p2p_lo_event_context;
+#endif
 #ifdef FEATURE_OEM_DATA_SUPPORT
 	sme_send_oem_data_rsp_msg oem_data_rsp_callback;
 #endif

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

@@ -14364,6 +14364,7 @@ void sme_update_hw_dbs_capable(tHalHandle hal, uint8_t hw_dbs_capable)
 	mac_ctx->hw_dbs_capable = hw_dbs_capable;
 }
 
+#ifdef FEATURE_P2P_LISTEN_OFFLOAD
 /**
  * sme_register_p2p_lo_event() - Register for the p2p lo event
  * @hHal: reference to the HAL
@@ -14386,6 +14387,7 @@ void sme_register_p2p_lo_event(tHalHandle hHal, void *context,
 	pMac->sme.p2p_lo_event_context = context;
 	sme_release_global_lock(&pMac->sme);
 }
+#endif
 
 /**
  * sme_process_mac_pwr_dbg_cmd() - enable mac pwr debugging

+ 8 - 1
core/wma/inc/wma_api.h

@@ -238,10 +238,17 @@ QDF_STATUS wma_set_tx_power_scale(uint8_t vdev_id, int value);
 QDF_STATUS wma_set_tx_power_scale_decr_db(uint8_t vdev_id, int value);
 
 bool wma_is_csa_offload_enabled(void);
+#ifdef FEATURE_P2P_LISTEN_OFFLOAD
 bool wma_is_p2p_lo_capable(void);
-bool wma_capability_enhanced_mcast_filter(void);
 QDF_STATUS wma_p2p_lo_start(struct sir_p2p_lo_start *params);
 QDF_STATUS wma_p2p_lo_stop(u_int32_t vdev_id);
+#else
+static inline bool wma_is_p2p_lo_capable(void)
+{
+	return 0;
+}
+#endif
+bool wma_capability_enhanced_mcast_filter(void);
 #ifndef QCA_SUPPORT_CP_STATS
 QDF_STATUS wma_get_wakelock_stats(struct sir_wake_lock_stats *wake_lock_stats);
 #endif

+ 2 - 0
core/wma/inc/wma_internal.h

@@ -1155,8 +1155,10 @@ int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info,
 				uint32_t len);
 void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
 			    uint8_t type);
+#ifdef FEATURE_P2P_LISTEN_OFFLOAD
 int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
 				uint32_t len);
+#endif
 
 QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
 				       struct sir_mac_pwr_dbg_cmd *

+ 2 - 0
core/wma/src/wma_features.c

@@ -4940,6 +4940,7 @@ QDF_STATUS wma_set_sw_retry_threshold(
 	return QDF_STATUS_SUCCESS;
 }
 
+#ifdef FEATURE_P2P_LISTEN_OFFLOAD
 /**
  *  wma_p2p_lo_start() - P2P listen offload start
  *  @params: p2p listen offload parameters
@@ -5135,6 +5136,7 @@ int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
 
 	return 0;
 }
+#endif /* FEATURE_P2P_LISTEN_OFFLOAD */
 
 #ifndef QCA_SUPPORT_CP_STATS
 /**

+ 2 - 1
core/wma/src/wma_utils.c

@@ -4277,7 +4277,7 @@ wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
 	return wmi_unified_dbglog_cmd_send(wmi_handle, &dbg_param);
 }
 #endif
-
+#ifdef FEATURE_P2P_LISTEN_OFFLOAD
 /**
  * wma_is_p2p_lo_capable() - if driver is capable of p2p listen offload
  *
@@ -4299,6 +4299,7 @@ bool wma_is_p2p_lo_capable(void)
 
 	return 0;
 }
+#endif
 
 bool wma_capability_enhanced_mcast_filter(void)
 {