Browse Source

qcacld-3.0: Add cac and phyerr processing offload support

In case of dfs offload, do not run cac timer, as cac will also be
offloaded in that case. Decide the same based of service bit info.

Change-Id: If4dd62628270ff0ba8632a9cd644a9d7ed6f31a4
CRs-Fixed: 2021357
Arif Hussain 8 years ago
parent
commit
759a023602

+ 1 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -1602,6 +1602,7 @@ struct hdd_context_s {
 	uint8_t last_scan_reject_session_id;
 	enum scan_reject_states last_scan_reject_reason;
 	unsigned long last_scan_reject_timestamp;
+	bool dfs_cac_offload;
 };
 
 /**

+ 1 - 0
core/hdd/src/wlan_hdd_hostapd.c

@@ -7421,6 +7421,7 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
 	pMgmt_frame = (struct ieee80211_mgmt *)pBeacon->head;
 
 	pConfig->beacon_int = pMgmt_frame->u.beacon.beacon_int;
+	pConfig->dfs_cac_offload = pHddCtx->dfs_cac_offload;
 
 	pConfig->disableDFSChSwitch = iniConfig->disableDFSChSwitch;
 

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

@@ -1519,6 +1519,7 @@ void hdd_update_tgt_cfg(void *context, void *param)
 
 	/* Configure NAN datapath features */
 	hdd_nan_datapath_target_config(hdd_ctx, cfg);
+	hdd_ctx->dfs_cac_offload = cfg->dfs_cac_offload;
 }
 
 /**

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

@@ -608,6 +608,7 @@ typedef struct sap_Config {
 	tSirMacRateSet extended_rates;
 	enum sap_acs_dfs_mode acs_dfs_mode;
 	struct hdd_channel_info *channel_info;
+	bool dfs_cac_offload;
 } tsap_Config_t;
 
 #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE

+ 10 - 1
core/sap/src/sap_fsm.c

@@ -5116,7 +5116,9 @@ void sap_dfs_cac_timer_callback(void *data)
 	 * destroy timer here.
 	 */
 	if (pMac->sap.SapDfsInfo.is_dfs_cac_timer_running == true) {
-		qdf_mc_timer_destroy(&pMac->sap.SapDfsInfo.sap_dfs_cac_timer);
+		if (!sapContext->dfs_cac_offload)
+			qdf_mc_timer_destroy(
+				&pMac->sap.SapDfsInfo.sap_dfs_cac_timer);
 		pMac->sap.SapDfsInfo.is_dfs_cac_timer_running = false;
 	}
 
@@ -5193,6 +5195,13 @@ int sap_start_dfs_cac_timer(ptSapContext sap_ctx)
 	}
 
 	mac = PMAC_STRUCT(hal);
+	if (sap_ctx->dfs_cac_offload) {
+		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG,
+			  "%s: cac timer offloaded to firmware", __func__);
+		mac->sap.SapDfsInfo.is_dfs_cac_timer_running = true;
+		return 1;
+	}
+
 	sap_get_cac_dur_dfs_region(sap_ctx, &cac_dur, &dfs_region);
 	if (0 == cac_dur)
 		return 0;

+ 1 - 0
core/sap/src/sap_internal.h

@@ -280,6 +280,7 @@ typedef struct sSapContext {
 	wlan_scan_requester req_id;
 	uint8_t sap_acs_pre_start_bss;
 	uint8_t sap_sta_id;
+	bool dfs_cac_offload;
 } *ptSapContext;
 
 /*----------------------------------------------------------------------------

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

@@ -910,6 +910,7 @@ QDF_STATUS wlansap_start_bss(void *pCtx,     /* pwextCtx */
 	pSapCtx->pUsrContext = pUsrContext;
 	pSapCtx->enableOverLapCh = pConfig->enOverLapCh;
 	pSapCtx->acs_cfg = &pConfig->acs_cfg;
+	pSapCtx->dfs_cac_offload = pConfig->dfs_cac_offload;
 	/* Set the BSSID to your "self MAC Addr" read the mac address
 		from Configuation ITEM received from HDD */
 	pSapCtx->csr_roamProfile.BSSIDs.numOfBSSIDs = 1;

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

@@ -1347,6 +1347,7 @@ struct hw_mode_idx_to_mac_cap_idx {
  * @wmi_cmd_rsp_wake_lock: wmi command response wake lock
  * @wmi_cmd_rsp_runtime_lock: wmi command response bus lock
  * @saved_chan: saved channel list sent as part of WMI_SCAN_CHAN_LIST_CMDID
+ * @dfs_cac_offload: dfs and cac timer offload
  */
 typedef struct {
 	void *wmi_handle;
@@ -1525,6 +1526,7 @@ typedef struct {
 					   struct scheduler_msg *msg);
 	bool fw_timeout_crash;
 	bool sub_20_support;
+	bool dfs_cac_offload;
 	tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb;
 	tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb;
 	tSirLLStatsResults *link_stats_results;

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

@@ -152,6 +152,7 @@ struct wma_dfs_radar_ind {
  * @nan_datapath_enabled: nan data path support
  * @bool is_ra_rate_limit_enabled: RA filter support
  * @he_cap: HE capability received from FW
+ * @dfs_cac_offload: dfs and cac timer offloaded
  */
 struct wma_tgt_cfg {
 	uint32_t target_fw_version;
@@ -184,5 +185,6 @@ struct wma_tgt_cfg {
 #ifdef WLAN_FEATURE_11AX
 	tDot11fIEvendor_he_cap he_cap;
 #endif
+	bool dfs_cac_offload;
 };
 #endif /* WMA_TGT_CFG_H */

+ 4 - 1
core/wma/src/wma_main.c

@@ -4363,6 +4363,7 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle)
 #endif /* WLAN_FEATURE_LPSS */
 	tgt_cfg.ap_arpns_support = wma_handle->ap_arpns_support;
 	tgt_cfg.bpf_enabled = wma_handle->bpf_enabled;
+	tgt_cfg.dfs_cac_offload = wma_handle->dfs_cac_offload;
 	wma_update_ra_rate_limit(wma_handle, &tgt_cfg);
 	tgt_cfg.fine_time_measurement_cap =
 		wma_handle->fine_time_measurement_cap;
@@ -4774,7 +4775,9 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info,
 	cdp_mark_first_wakeup_packet(soc,
 		WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
 			WMI_SERVICE_MARK_FIRST_WAKEUP_PACKET));
-
+	wma_handle->dfs_cac_offload =
+		WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
+			WMI_SERVICE_DFS_PHYERR_OFFLOAD);
 	wma_handle->nan_datapath_enabled =
 		WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
 			WMI_SERVICE_NAN_DATA);