Przeglądaj źródła

qcacld-3.0: Use dfs component support

Remove legacy dfs api’s and use dfs component.

Change-Id: Ia0fa016b174ef4b50e2cc339e4e476ec65642dbf
CRs-Fixed: 2021357
Arif Hussain 8 lat temu
rodzic
commit
cd1516322d

+ 0 - 1
core/cds/inc/cds_regdomain.h

@@ -538,6 +538,5 @@ struct reg_dmn_tables {
 int32_t cds_fill_some_regulatory_info(struct regulatory *reg);
 int32_t cds_get_country_from_alpha2(uint8_t *alpha2);
 void cds_fill_and_send_ctl_to_fw(struct regulatory *reg);
-void cds_set_wma_dfs_region(uint8_t dfs_region);
 
 #endif /* __CDS_REGDOMAIN_H */

+ 1 - 2
core/cds/src/cds_api.c

@@ -494,8 +494,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
 
 	/*Open the WMA module */
 	qdf_status = wma_open(psoc, gp_cds_context,
-			      hdd_update_tgt_cfg,
-			      hdd_dfs_indicate_radar, cds_cfg);
+			      hdd_update_tgt_cfg, cds_cfg);
 
 	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
 		/* Critical Error ...  Cannot proceed further */

+ 0 - 23
core/cds/src/cds_regdomain.c

@@ -656,26 +656,3 @@ void cds_fill_and_send_ctl_to_fw(struct regulatory *reg)
 	wma_send_regdomain_info_to_fw(reg->reg_domain, regpair->reg_dmn_2ghz,
 				      regpair->reg_dmn_5ghz, ctl_2g, ctl_5g);
 }
-
-/**
- * cds_set_wma_dfs_region() - to set the dfs region to wma
- * @reg: the regulatory handle
- *
- * Return: none
- */
-void cds_set_wma_dfs_region(uint8_t dfs_region)
-{
-	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
-
-	if (!wma) {
-		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
-			  "unable to get WMA handle");
-		return;
-	}
-
-	QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
-		  "dfs_region: %d", dfs_region);
-
-	wma_set_dfs_region(wma, dfs_region);
-}
-

+ 15 - 1
core/hdd/inc/wlan_hdd_cfg.h

@@ -10751,7 +10751,6 @@ bool hdd_is_okc_mode_enabled(hdd_context_t *pHddCtx);
 QDF_STATUS hdd_set_idle_ps_config(hdd_context_t *pHddCtx, uint32_t val);
 
 void hdd_update_tgt_cfg(void *context, void *param);
-bool hdd_dfs_indicate_radar(void *context, void *param);
 
 QDF_STATUS hdd_string_to_u8_array(char *str, uint8_t *intArray, uint8_t *len,
 				  uint8_t intArrayMaxLen);
@@ -10761,4 +10760,19 @@ QDF_STATUS hdd_hex_string_to_u16_array(char *str, uint16_t *int_array,
 void hdd_cfg_print(hdd_context_t *pHddCtx);
 
 QDF_STATUS hdd_update_nss(hdd_context_t *hdd_ctx, uint8_t nss);
+
+/**
+ * hdd_dfs_indicate_radar() - Block tx as radar found on the channel
+ * @hdd_ctxt: HDD context pointer
+ *
+ * This function is invoked in atomic context when a radar
+ * is found on the SAP current operating channel and Data Tx
+ * from netif has to be stopped to honor the DFS regulations.
+ * Actions: Stop the netif Tx queues,Indicate Radar present
+ * in HDD context for future usage.
+ *
+ * Return: true on success, else false
+ */
+bool hdd_dfs_indicate_radar(hdd_context_t *hdd_ctx);
+
 #endif

+ 29 - 18
core/hdd/src/wlan_hdd_hostapd.c

@@ -83,6 +83,7 @@
 #include <cds_api.h>
 #include <cdp_txrx_stats.h>
 #include "wlan_hdd_he.h"
+#include "wlan_dfs_tgt_api.h"
 
 #define    IS_UP(_dev) \
 	(((_dev)->flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP))
@@ -1413,6 +1414,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 		}
 		break;
 	case eSAP_DFS_RADAR_DETECT:
+		hdd_dfs_indicate_radar(pHddCtx);
 		wlan_hdd_send_svc_nlink_msg(pHddCtx->radio_index,
 					WLAN_SVC_DFS_RADAR_DETECT_IND,
 					    &dfs_info,
@@ -3220,28 +3222,26 @@ static __iw_softap_setparam(struct net_device *dev,
 
 	case QCASAP_SET_RADAR_CMD:
 	{
-		hdd_context_t *pHddCtx =
-			WLAN_HDD_GET_CTX(pHostapdAdapter);
-		uint8_t ch =
-			(WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->
-			operatingChannel;
-		bool isDfsch;
-		int32_t dfs_radar_found;
-
-		isDfsch = (CHANNEL_STATE_DFS ==
-			   wlan_reg_get_channel_state(pHddCtx->hdd_pdev, ch));
+		hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
+		uint8_t ch = (WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->
+				operatingChannel;
+		struct wlan_objmgr_pdev *pdev;
+		struct radar_found_info radar;
 
 		hdd_debug("Set QCASAP_SET_RADAR_CMD val %d", set_value);
 
-		dfs_radar_found = qdf_atomic_read(&pHddCtx->dfs_radar_found);
-		if (!dfs_radar_found && isDfsch) {
-			ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-						  WMA_VDEV_DFS_CONTROL_CMDID,
-						  set_value, VDEV_CMD);
-		} else {
-			hdd_err("Ignore, radar_found: %d,  dfs_channel: %d",
-				dfs_radar_found, isDfsch);
+		pdev = hdd_ctx->hdd_pdev;
+		if (!pdev) {
+			hdd_err("null pdev");
+			return -EINVAL;
 		}
+
+		qdf_mem_zero(&radar, sizeof(radar));
+		if (wlan_reg_is_dfs_ch(pdev, ch))
+			tgt_dfs_process_radar_ind(pdev, &radar);
+		else
+			hdd_err("Ignore set radar, op ch(%d) is not dfs", ch);
+
 		break;
 	}
 	case QCASAP_TX_CHAINMASK_CMD:
@@ -3599,9 +3599,20 @@ static __iw_softap_getparam(struct net_device *dev,
 
 	case QCASAP_GET_DFS_NOL:
 	{
+		hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
+		struct wlan_objmgr_pdev *pdev;
+
 		wlansap_get_dfs_nol(
 			WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter),
 			nol, &nol_len);
+
+		pdev = hdd_ctx->hdd_pdev;
+		if (!pdev) {
+			hdd_err("null pdev");
+			return -EINVAL;
+		}
+
+		dfs_print_nol_channels(pdev);
 	}
 	break;
 

+ 20 - 47
core/hdd/src/wlan_hdd_main.c

@@ -1520,62 +1520,35 @@ void hdd_update_tgt_cfg(void *context, void *param)
 	hdd_ctx->dfs_cac_offload = cfg->dfs_cac_offload;
 }
 
-/**
- * hdd_dfs_indicate_radar() - handle radar detection on current SAP channel
- * @context:	HDD context pointer
- * @param:	HDD radar indication pointer
- *
- * This function is invoked in atomic context when a radar
- * is found on the SAP current operating channel and Data Tx
- * from netif has to be stopped to honor the DFS regulations.
- * Actions: Stop the netif Tx queues,Indicate Radar present
- * in HDD context for future usage.
- *
- * Return: true to allow radar indication to host else false
- */
-bool hdd_dfs_indicate_radar(void *context, void *param)
+bool hdd_dfs_indicate_radar(hdd_context_t *hdd_ctx)
 {
-	hdd_context_t *hdd_ctx = (hdd_context_t *) context;
-	struct wma_dfs_radar_ind *hdd_radar_event =
-		(struct wma_dfs_radar_ind *)param;
 	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
 	hdd_adapter_t *adapter;
 	QDF_STATUS status;
 	hdd_ap_ctx_t *ap_ctx;
 
-	if (!hdd_ctx || !hdd_radar_event ||
-		 hdd_ctx->config->disableDFSChSwitch)
+	if (!hdd_ctx || hdd_ctx->config->disableDFSChSwitch) {
+		hdd_info("skip tx block hdd_ctx=%p, disableDFSChSwitch=%d",
+			 hdd_ctx, hdd_ctx->config->disableDFSChSwitch);
 		return true;
+	}
 
-	if (true == hdd_radar_event->dfs_radar_status) {
-		if (qdf_atomic_inc_return(&hdd_ctx->dfs_radar_found) > 1) {
-			/*
-			 * Application already triggered channel switch
-			 * on current channel, so return here.
-			 */
-			return false;
-		}
-
-		status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-		while (NULL != adapterNode && QDF_STATUS_SUCCESS == status) {
-			adapter = adapterNode->pAdapter;
-			ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(adapter);
-			if ((QDF_SAP_MODE == adapter->device_mode ||
-			     QDF_P2P_GO_MODE == adapter->device_mode) &&
-			     (CHANNEL_STATE_DFS ==
-			     wlan_reg_get_channel_state(hdd_ctx->hdd_pdev,
-				     ap_ctx->operatingChannel))) {
-				WLAN_HDD_GET_AP_CTX_PTR(adapter)->
-				dfs_cac_block_tx = true;
-				hdd_debug("tx blocked for session:%d",
-					 adapter->sessionId);
-			}
-
-			status = hdd_get_next_adapter(hdd_ctx,
-						      adapterNode,
-						      &pNext);
-			adapterNode = pNext;
+	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
+	while (NULL != adapterNode && QDF_STATUS_SUCCESS == status) {
+		adapter = adapterNode->pAdapter;
+		ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(adapter);
+
+		if ((QDF_SAP_MODE == adapter->device_mode ||
+		    QDF_P2P_GO_MODE == adapter->device_mode) &&
+		    (wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev,
+		     ap_ctx->operatingChannel))) {
+			WLAN_HDD_GET_AP_CTX_PTR(adapter)->dfs_cac_block_tx =
+				true;
+			hdd_info("tx blocked for session: %d",
+				adapter->sessionId);
 		}
+		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
+		adapterNode = pNext;
 	}
 
 	return true;

+ 0 - 6
core/hdd/src/wlan_hdd_regulatory.c

@@ -538,7 +538,6 @@ static int hdd_regulatory_init_no_offload(hdd_context_t *hdd_ctx,
 
 	hdd_set_dfs_region(hdd_ctx, DFS_FCC_REG);
 	wlan_reg_get_dfs_region(hdd_ctx->hdd_psoc, &dfs_reg);
-	cds_set_wma_dfs_region(dfs_reg);
 
 	reg_program_config_vars(hdd_ctx, &config_vars);
 	ucfg_reg_set_config_vars(hdd_ctx->hdd_psoc, config_vars);
@@ -736,7 +735,6 @@ void hdd_reg_notifier(struct wiphy *wiphy,
 
 		hdd_set_dfs_region(hdd_ctx, request->dfs_region);
 		wlan_reg_get_dfs_region(hdd_ctx->hdd_psoc, &dfs_reg);
-		cds_set_wma_dfs_region(dfs_reg);
 
 		reg_program_config_vars(hdd_ctx, &config_vars);
 		ucfg_reg_set_config_vars(hdd_ctx->hdd_psoc, config_vars);
@@ -843,7 +841,6 @@ static int hdd_regulatory_init_offload(hdd_context_t *hdd_ctx,
 int hdd_regulatory_init(hdd_context_t *hdd_ctx, struct wiphy *wiphy)
 {
 	bool offload_enabled;
-	enum dfs_reg dfs_region;
 
 	offload_enabled = ucfg_reg_is_regdb_offloaded(hdd_ctx->hdd_psoc);
 
@@ -852,9 +849,6 @@ int hdd_regulatory_init(hdd_context_t *hdd_ctx, struct wiphy *wiphy)
 		wiphy->reg_notifier = NULL;
 		wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED;
 		hdd_regulatory_init_offload(hdd_ctx, wiphy);
-
-		wlan_reg_get_dfs_region(hdd_ctx->hdd_psoc, &dfs_region);
-		cds_set_wma_dfs_region(dfs_region);
 	} else {
 		hdd_ctx->reg_offload = false;
 		wiphy->reg_notifier = hdd_reg_notifier;

+ 1 - 0
core/mac/inc/wni_api.h

@@ -258,6 +258,7 @@ enum eWniMsgTypes {
 	eWNI_SME_DEL_ALL_TDLS_PEERS,
 	eWNI_SME_RSO_CMD_STATUS_IND,
 	eWMI_SME_LL_STATS_IND,
+	eWNI_SME_DFS_CAC_COMPLETE,
 	eWNI_SME_MSG_TYPES_END
 };
 

+ 0 - 5
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -1797,11 +1797,6 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx,
 		qdf_mem_free((void *)(msg->bodyptr));
 		msg->bodyptr = NULL;
 		break;
-	case WMA_DFS_RADAR_IND:
-		lim_send_sme_dfs_event_notify(mac_ctx, msg->type,
-				(void *)msg->bodyptr);
-		/* msg->bodyptr will be freed up by SME/CSR */
-		break;
 	case WMA_DFS_BEACON_TX_SUCCESS_IND:
 		lim_process_beacon_tx_success_ind(mac_ctx, msg->type,
 				(void *)msg->bodyptr);

+ 0 - 24
core/mac/src/pe/lim/lim_send_sme_rsp_messages.c

@@ -2453,30 +2453,6 @@ void lim_send_sme_max_assoc_exceeded_ntf(tpAniSirGlobal pMac, tSirMacAddr peerMa
 	return;
 }
 
-/** -----------------------------------------------------------------
-   \brief lim_send_sme_dfs_event_notify() - sends
-   eWNI_SME_DFS_RADAR_FOUND
-   After receiving WMI_PHYERR_EVENTID indication frame from FW, this
-   function sends a eWNI_SME_DFS_RADAR_FOUND to SME to notify
-   that a RADAR is found on current operating channel and SAP-
-   has to move to a new channel.
-   \param pMac - global mac structure
-   \param msgType - message type received from lower layer
-   \param event - event data received from lower layer
-   \return none
-   \sa
-   ----------------------------------------------------------------- */
-void
-lim_send_sme_dfs_event_notify(tpAniSirGlobal pMac, uint16_t msgType, void *event)
-{
-	struct scheduler_msg mmhMsg = {0};
-	mmhMsg.type = eWNI_SME_DFS_RADAR_FOUND;
-	mmhMsg.bodyptr = event;
-	mmhMsg.bodyval = 0;
-	lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
-	return;
-}
-
 /*--------------------------------------------------------------------------
    \brief lim_send_dfs_chan_sw_ie_update()
    This timer handler updates the channel switch IE in beacon template

+ 0 - 3
core/mac/src/pe/lim/lim_send_sme_rsp_messages.h

@@ -108,9 +108,6 @@ void lim_send_sme_tdls_link_establish_req_rsp(tpAniSirGlobal pMac, uint8_t sessi
 void lim_send_sme_tdls_event_notify(tpAniSirGlobal pMac, uint16_t msgType,
 				    void *events);
 #endif
-
-void lim_send_sme_dfs_event_notify(tpAniSirGlobal pMac, uint16_t msgType,
-				   void *event);
 void lim_send_sme_ap_channel_switch_resp(tpAniSirGlobal pMac,
 					 tpPESession psessionEntry,
 					 tpSwitchChannelParams pChnlParams);

+ 0 - 1
core/mac/src/sys/legacy/src/utils/src/mac_trace.c

@@ -662,7 +662,6 @@ uint8_t *mac_trace_get_wma_msg_string(uint16_t wma_msg)
 		CASE_RETURN_STRING
 			(WMA_TDLS_CONNECTION_TRACKER_NOTIFICATION_CMD);
 #endif
-		CASE_RETURN_STRING(WMA_DFS_RADAR_IND);
 		CASE_RETURN_STRING(WMA_DFS_BEACON_TX_SUCCESS_IND);
 		CASE_RETURN_STRING(WMA_DISASSOC_TX_COMP);
 		CASE_RETURN_STRING(WMA_DEAUTH_TX_COMP);

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

@@ -1005,7 +1005,15 @@ void wlansap_extend_to_acs_range(tHalHandle hal, uint8_t *startChannelNum,
 		uint8_t *endChannelNum, uint8_t *bandStartChannel,
 		uint8_t *bandEndChannel);
 QDF_STATUS wlansap_get_dfs_nol(void *pSapCtx, uint8_t *nol, uint32_t *nol_len);
-QDF_STATUS wlansap_set_dfs_nol(void *pSapCtx, eSapDfsNolType conf);
+
+/**
+ * wlansap_set_dfs_nol() - Set dfs nol
+ * @sap_ctx: SAP context
+ * @conf: set type
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wlansap_set_dfs_nol(void *sap_ctx, eSapDfsNolType conf);
 
 /**
  * wlan_sap_set_vendor_acs() - Set vendor specific acs in sap context
@@ -1031,6 +1039,16 @@ QDF_STATUS wlansap_set_tx_leakage_threshold(tHalHandle hal,
 
 QDF_STATUS wlansap_set_invalid_session(void *cds_ctx);
 
+/**
+ * sap_dfs_set_current_channel() - Set current channel params in dfs component
+ * @sap_ctx: sap context
+ *
+ * Set current channel params in dfs component, this info will be used to mark
+ * the channels in nol when radar is detected.
+ *
+ * Return: None
+ */
+void sap_dfs_set_current_channel(void *sap_ctx);
 #ifdef __cplusplus
 }
 #endif

+ 18 - 8
core/sap/src/sap_api_link_cntl.c

@@ -715,8 +715,12 @@ wlansap_roam_process_dfs_radar_found(tpAniSirGlobal mac_ctx,
 		 * and destroy the CAC timer and post a
 		 * eSAP_DFS_CHANNEL_CAC_RADAR_FOUND  to sapFsm.
 		 */
-		qdf_mc_timer_stop(&mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer);
-		qdf_mc_timer_destroy(&mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer);
+		if (!sap_ctx->dfs_cac_offload) {
+			qdf_mc_timer_stop(&mac_ctx->
+					sap.SapDfsInfo.sap_dfs_cac_timer);
+			qdf_mc_timer_destroy(&mac_ctx->
+					sap.SapDfsInfo.sap_dfs_cac_timer);
+		}
 		mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running = false;
 
 		/*
@@ -1020,10 +1024,12 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
 			QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED,
 				FL("sapdfs: Radar detect on pre cac:%d"),
 				sap_ctx->sessionId);
-			qdf_mc_timer_stop(
+			if (!sap_ctx->dfs_cac_offload) {
+				qdf_mc_timer_stop(
 				&mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer);
-			qdf_mc_timer_destroy(
+				qdf_mc_timer_destroy(
 				&mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer);
+			}
 			mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running =
 				false;
 			sap_signal_hdd_event(sap_ctx, NULL,
@@ -1036,11 +1042,8 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
 			  FL("sapdfs: Indicate eSAP_DFS_RADAR_DETECT to HDD"));
 		sap_signal_hdd_event(sap_ctx, NULL, eSAP_DFS_RADAR_DETECT,
 				     (void *) eSAP_STATUS_SUCCESS);
-		/* sync to latest DFS-NOL */
-		sap_signal_hdd_event(sap_ctx, NULL, eSAP_DFS_NOL_GET,
-				    (void *) eSAP_STATUS_SUCCESS);
 		mac_ctx->sap.SapDfsInfo.target_channel =
-		    sap_indicate_radar(sap_ctx, &csr_roam_info->dfs_event);
+			sap_indicate_radar(sap_ctx);
 		/* if there is an assigned next channel hopping */
 		if (0 < mac_ctx->sap.SapDfsInfo.user_provided_target_channel) {
 			mac_ctx->sap.SapDfsInfo.target_channel =
@@ -1090,6 +1093,10 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
 			  FL("Received set channel response"));
 		break;
+	case eCSR_ROAM_CAC_COMPLETE_IND:
+		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
+			  FL("Received cac complete indication"));
+		break;
 	case eCSR_ROAM_EXT_CHG_CHNL_IND:
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
 				FL("Received set channel Indication"));
@@ -1287,6 +1294,9 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId,
 		wlansap_roam_process_dfs_chansw_update(hal, sap_ctx,
 				&qdf_ret_status);
 		break;
+	case eCSR_ROAM_RESULT_CAC_END_IND:
+		sap_dfs_cac_timer_callback(hal);
+		break;
 	case eCSR_ROAM_RESULT_CHANNEL_CHANGE_SUCCESS:
 		wlansap_roam_process_ch_change_success(mac_ctx, sap_ctx,
 						csr_roam_info, &qdf_ret_status);

Plik diff jest za duży
+ 137 - 852
core/sap/src/sap_fsm.c


+ 10 - 4
core/sap/src/sap_internal.h

@@ -380,10 +380,6 @@ QDF_STATUS sap_release_global_lock(ptSapContext pSapCtx);
 void sap_update_unsafe_channel_list(tHalHandle hal, ptSapContext pSapCtx);
 #endif /* FEATURE_WLAN_CH_AVOID */
 
-uint8_t
-sap_indicate_radar(ptSapContext sapContext,
-		 tSirSmeDfsEventInd *dfs_event);
-
 QDF_STATUS sap_init_dfs_channel_nol_list(ptSapContext sapContext);
 
 bool sap_dfs_is_channel_in_nol_list(ptSapContext sapContext,
@@ -485,6 +481,16 @@ sap_mark_leaking_ch(ptSapContext sap_ctx,
 void sap_scan_event_callback(struct wlan_objmgr_vdev *vdev,
 			struct scan_event *event, void *arg);
 
+/**
+ * sap_indicate_radar() - Process radar indication
+ * @sap_ctx: pointer to sap context
+ *
+ * process radar indication.
+ *
+ * Return: channel to which sap wishes to switch.
+ */
+uint8_t sap_indicate_radar(ptSapContext sap_ctx);
+
 #ifdef __cplusplus
 }
 #endif

+ 21 - 86
core/sap/src/sap_module.c

@@ -57,6 +57,7 @@
 #include "wlan_policy_mgr_api.h"
 #include <wlan_scan_ucfg_api.h>
 #include "wlan_reg_services_api.h"
+#include <wlan_dfs_utils_api.h>
 
 /*----------------------------------------------------------------------------
  * Preprocessor Definitions and Constants
@@ -2710,6 +2711,7 @@ wlansap_channel_change_request(void *pSapCtx, uint8_t target_channel)
 						ch_params->center_freq_seg1;
 	sapContext->csr_roamProfile.supported_rates.numRates = 0;
 	sapContext->csr_roamProfile.extended_rates.numRates = 0;
+	sap_dfs_set_current_channel(sapContext);
 
 	qdf_ret_status = sme_roam_channel_change_req(hHal, sapContext->bssid,
 				ch_params, &sapContext->csr_roamProfile);
@@ -3445,123 +3447,56 @@ QDF_STATUS wlansap_get_dfs_nol(void *pSapCtx, uint8_t *nol, uint32_t *nol_len)
 	return QDF_STATUS_SUCCESS;
 }
 
-/*==========================================================================
-   FUNCTION    wlansap_set_dfs_nol
-
-   DESCRIPTION
-   This API is used to set the dfs nol
-   DEPENDENCIES
-   NA.
-
-   PARAMETERS
-   IN
-   sapContext: Pointer to cds global context structure
-   conf: set type
-
-   RETURN VALUE
-   The QDF_STATUS code associated with performing the operation
-
-   QDF_STATUS_SUCCESS:  Success
-
-   SIDE EFFECTS
-   ============================================================================*/
-QDF_STATUS wlansap_set_dfs_nol(void *pSapCtx, eSapDfsNolType conf)
+QDF_STATUS wlansap_set_dfs_nol(void *psap_ctx, eSapDfsNolType conf)
 {
-	int i = 0;
-	ptSapContext sapContext = (ptSapContext) pSapCtx;
-	void *hHal = NULL;
-	tpAniSirGlobal pMac = NULL;
+	ptSapContext sap_ctx = (ptSapContext) psap_ctx;
+	void *hal = NULL;
+	tpAniSirGlobal mac = NULL;
 
-	if (NULL == sapContext) {
+	if (!sap_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
 			  "%s: Invalid SAP pointer from p_cds_gctx", __func__);
 		return QDF_STATUS_E_FAULT;
 	}
-	hHal = CDS_GET_HAL_CB(sapContext->p_cds_gctx);
-	if (NULL == hHal) {
+
+	hal = CDS_GET_HAL_CB(sap_ctx->p_cds_gctx);
+	if (!hal) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
 			  "%s: Invalid HAL pointer from p_cds_gctx", __func__);
 		return QDF_STATUS_E_FAULT;
 	}
-	pMac = PMAC_STRUCT(hHal);
 
-	if (!pMac->sap.SapDfsInfo.numCurrentRegDomainDfsChannels) {
+	mac = PMAC_STRUCT(hal);
+	if (!mac->sap.SapDfsInfo.numCurrentRegDomainDfsChannels) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
 			  "%s: DFS NOL is empty", __func__);
 		return QDF_STATUS_SUCCESS;
 	}
 
 	if (conf == eSAP_DFS_NOL_CLEAR) {
+		struct wlan_objmgr_pdev *pdev;
+
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
 			  "%s: clear the DFS NOL", __func__);
 
-		for (i = 0;
-		     i < pMac->sap.SapDfsInfo.numCurrentRegDomainDfsChannels;
-		     i++) {
-			if (!pMac->sap.SapDfsInfo.
-			    sapDfsChannelNolList[i].dfs_channel_number)
-				continue;
-
-			pMac->sap.SapDfsInfo.
-			sapDfsChannelNolList[i].radar_status_flag =
-				eSAP_DFS_CHANNEL_AVAILABLE;
-			pMac->sap.SapDfsInfo.
-			sapDfsChannelNolList[i].radar_found_timestamp = 0;
+		pdev = mac->pdev;
+		if (!pdev) {
+			QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
+				  "%s: null pdev", __func__);
+			return QDF_STATUS_E_FAULT;
 		}
+		dfs_clear_nol_channels(pdev);
 	} else if (conf == eSAP_DFS_NOL_RANDOMIZE) {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
 			  "%s: Randomize the DFS NOL", __func__);
 
-		/* random 1/0 to decide to put the channel into NOL */
-		for (i = 0;
-		     i < pMac->sap.SapDfsInfo.numCurrentRegDomainDfsChannels;
-		     i++) {
-			uint32_t random_bytes = 0;
-			get_random_bytes(&random_bytes, 1);
-
-			if (!pMac->sap.SapDfsInfo.
-			    sapDfsChannelNolList[i].dfs_channel_number)
-				continue;
-
-			if ((random_bytes + jiffies) % 2) {
-				/* mark the channel unavailable */
-				pMac->sap.SapDfsInfo.sapDfsChannelNolList[i]
-				.radar_status_flag =
-					eSAP_DFS_CHANNEL_UNAVAILABLE;
-
-				/* mark the timestamp */
-				pMac->sap.SapDfsInfo.sapDfsChannelNolList[i]
-				.radar_found_timestamp =
-					cds_get_monotonic_boottime();
-			} else {
-				/* mark the channel available */
-				pMac->sap.SapDfsInfo.
-				sapDfsChannelNolList[i].radar_status_flag =
-					eSAP_DFS_CHANNEL_AVAILABLE;
-
-				/* clear the timestamp */
-				pMac->sap.SapDfsInfo.
-				sapDfsChannelNolList
-				[i].radar_found_timestamp = 0;
-			}
-
-			QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
-				  "%s: Set channel[%d] %s",
-				  __func__,
-				  pMac->sap.SapDfsInfo.sapDfsChannelNolList[i]
-				  .dfs_channel_number,
-				  (pMac->sap.SapDfsInfo.
-				   sapDfsChannelNolList[i].radar_status_flag >
-				   eSAP_DFS_CHANNEL_AVAILABLE) ? "UNAVAILABLE" :
-				  "AVAILABLE");
-		}
 	} else {
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
 			  "%s: unsupport type %d", __func__, conf);
 	}
 
 	/* set DFS-NOL back to keep it update-to-date in CNSS */
-	sap_signal_hdd_event(sapContext, NULL, eSAP_DFS_NOL_SET,
+	sap_signal_hdd_event(sap_ctx, NULL, eSAP_DFS_NOL_SET,
 			  (void *) eSAP_STATUS_SUCCESS);
 
 	return QDF_STATUS_SUCCESS;

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

@@ -515,6 +515,7 @@ typedef enum {
 	eCSR_ROAM_ABORT,
 	eCSR_ROAM_NAPI_OFF,
 	eCSR_ROAM_CHANNEL_COMPLETE_IND,
+	eCSR_ROAM_CAC_COMPLETE_IND,
 } eRoamCmdStatus;
 
 /* comment inside indicates what roaming callback gets */
@@ -623,6 +624,7 @@ typedef enum {
 	eCSR_ROAM_RESULT_NDP_END_RSP,
 	eCSR_ROAM_RESULT_NDP_PEER_DEPARTED_IND,
 	eCSR_ROAM_RESULT_NDP_END_IND,
+	eCSR_ROAM_RESULT_CAC_END_IND,
 	/* If Scan for SSID failed to found proper BSS */
 	eCSR_ROAM_RESULT_SCAN_FOR_SSID_FAILURE,
 } eCsrRoamResult;

+ 63 - 79
core/sme/src/common/sme_api.c

@@ -88,10 +88,6 @@ QDF_STATUS sme_unprotected_mgmt_frm_ind(tHalHandle hHal,
 					tpSirSmeUnprotMgmtFrameInd pSmeMgmtFrm);
 #endif
 
-/* Message processor for events from DFS */
-QDF_STATUS dfs_msg_processor(tpAniSirGlobal pMac,
-			     uint16_t msg_type, void *pMsgBuf);
-
 /* Channel Change Response Indication Handler */
 QDF_STATUS sme_process_channel_change_resp(tpAniSirGlobal pMac,
 					   uint16_t msg_type, void *pMsgBuf);
@@ -1427,6 +1423,67 @@ static QDF_STATUS sme_handle_roc_req(tHalHandle hal,
 	return status;
 }
 
+static QDF_STATUS dfs_msg_processor(tpAniSirGlobal mac,
+		struct scheduler_msg *msg)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	tCsrRoamInfo roam_info = { 0 };
+	tSirSmeCSAIeTxCompleteRsp *csa_ie_tx_complete_rsp;
+	uint32_t session_id = 0;
+	eRoamCmdStatus roam_status;
+	eCsrRoamResult roam_result;
+
+	switch (msg->type) {
+	case eWNI_SME_DFS_RADAR_FOUND:
+	{
+		session_id = msg->bodyval;
+		roam_status = eCSR_ROAM_DFS_RADAR_IND;
+		roam_result = eCSR_ROAM_RESULT_DFS_RADAR_FOUND_IND;
+		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO_MED,
+			  "sapdfs: Radar indication event occurred");
+		break;
+	}
+	case eWNI_SME_DFS_CSAIE_TX_COMPLETE_IND:
+	{
+		csa_ie_tx_complete_rsp =
+			(tSirSmeCSAIeTxCompleteRsp *) msg->bodyptr;
+		if (!csa_ie_tx_complete_rsp) {
+			sme_err("eWNI_SME_DFS_CSAIE_TX_COMPLETE_IND null msg");
+			return QDF_STATUS_E_FAILURE;
+		}
+		session_id = csa_ie_tx_complete_rsp->sessionId;
+		roam_status = eCSR_ROAM_DFS_CHAN_SW_NOTIFY;
+		roam_result = eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS;
+		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO_MED,
+			  "eWNI_SME_DFS_CSAIE_TX_COMPLETE_IND session=%d",
+			  session_id);
+		break;
+	}
+	case eWNI_SME_DFS_CAC_COMPLETE:
+	{
+		session_id = msg->bodyval;
+		roam_status = eCSR_ROAM_CAC_COMPLETE_IND;
+		roam_result = eCSR_ROAM_RESULT_CAC_END_IND;
+		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO_MED,
+			  "sapdfs: Received eWNI_SME_DFS_CAC_COMPLETE vdevid%d",
+			  session_id);
+		break;
+	}
+	default:
+	{
+		sme_err("Invalid DFS message: 0x%x", msg->type);
+		status = QDF_STATUS_E_FAILURE;
+		return status;
+	}
+	}
+
+	/* Indicate Radar Event to SAP */
+	csr_roam_call_callback(mac, session_id, &roam_info, 0,
+			       roam_status, roam_result);
+	return status;
+}
+
+
 #ifdef WLAN_FEATURE_11W
 /*------------------------------------------------------------------
  *
@@ -1455,80 +1512,6 @@ QDF_STATUS sme_unprotected_mgmt_frm_ind(tHalHandle hHal,
 }
 #endif
 
-/*------------------------------------------------------------------
- *
- * Handle the DFS Radar Event and indicate it to the SAP
- *
- *------------------------------------------------------------------*/
-QDF_STATUS dfs_msg_processor(tpAniSirGlobal pMac, uint16_t msgType, void *pMsgBuf)
-{
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
-	tCsrRoamInfo roamInfo = { 0 };
-	tSirSmeDfsEventInd *dfs_event;
-	tSirSmeCSAIeTxCompleteRsp *csaIeTxCompleteRsp;
-	uint32_t sessionId = 0;
-	eRoamCmdStatus roamStatus;
-	eCsrRoamResult roamResult;
-	int i;
-
-	switch (msgType) {
-	case eWNI_SME_DFS_RADAR_FOUND:
-	{
-		/* Radar found !! */
-		dfs_event = (tSirSmeDfsEventInd *) pMsgBuf;
-		if (NULL == dfs_event) {
-			sme_err("dfs_event is NULL");
-			return QDF_STATUS_E_FAILURE;
-		}
-		sessionId = dfs_event->sessionId;
-		roamInfo.dfs_event.sessionId = sessionId;
-		roamInfo.dfs_event.chan_list.nchannels =
-			dfs_event->chan_list.nchannels;
-		for (i = 0; i < dfs_event->chan_list.nchannels; i++) {
-			roamInfo.dfs_event.chan_list.channels[i] =
-				dfs_event->chan_list.channels[i];
-		}
-
-		roamInfo.dfs_event.dfs_radar_status =
-			dfs_event->dfs_radar_status;
-		roamInfo.dfs_event.use_nol = dfs_event->use_nol;
-
-		roamStatus = eCSR_ROAM_DFS_RADAR_IND;
-		roamResult = eCSR_ROAM_RESULT_DFS_RADAR_FOUND_IND;
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO_MED,
-			  "sapdfs: Radar indication event occurred");
-		break;
-	}
-	case eWNI_SME_DFS_CSAIE_TX_COMPLETE_IND:
-	{
-		csaIeTxCompleteRsp =
-			(tSirSmeCSAIeTxCompleteRsp *) pMsgBuf;
-		if (NULL == csaIeTxCompleteRsp) {
-			sme_err("pMsg is NULL for eWNI_SME_DFS_CSAIE_TX_COMPLETE_IND");
-			return QDF_STATUS_E_FAILURE;
-		}
-		sessionId = csaIeTxCompleteRsp->sessionId;
-		roamStatus = eCSR_ROAM_DFS_CHAN_SW_NOTIFY;
-		roamResult = eCSR_ROAM_RESULT_DFS_CHANSW_UPDATE_SUCCESS;
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO_MED,
-			  "sapdfs: Received eWNI_SME_DFS_CSAIE_TX_COMPLETE_IND for session id [%d]",
-			  sessionId);
-		break;
-	}
-	default:
-	{
-		sme_err("Invalid DFS message: 0x%x", msgType);
-		status = QDF_STATUS_E_FAILURE;
-		return status;
-	}
-	}
-
-	/* Indicate Radar Event to SAP */
-	csr_roam_call_callback(pMac, sessionId, &roamInfo, 0,
-			       roamStatus, roamResult);
-	return status;
-}
-
 QDF_STATUS sme_update_new_channel_event(tHalHandle hal, uint8_t session_id)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
@@ -2387,8 +2370,9 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, struct scheduler_msg *pMsg)
 		break;
 #endif
 	case eWNI_SME_DFS_RADAR_FOUND:
+	case eWNI_SME_DFS_CAC_COMPLETE:
 	case eWNI_SME_DFS_CSAIE_TX_COMPLETE_IND:
-		status = dfs_msg_processor(pMac, pMsg->type, pMsg->bodyptr);
+		status = dfs_msg_processor(pMac, pMsg);
 		qdf_mem_free(pMsg->bodyptr);
 		break;
 	case eWNI_SME_CHANNEL_CHANGE_RSP:

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

@@ -222,7 +222,6 @@ enum ds_mode {
 #define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT_P2P (45)
 
 #define WMA_INVALID_KEY_IDX     0xff
-#define WMA_DFS_RADAR_FOUND   1
 
 #define WMA_MAX_RF_CHAINS(x)    ((1 << x) - 1)
 #define WMA_MIN_RF_CHAINS               (1)
@@ -385,11 +384,6 @@ enum ds_mode {
 #define WMA_VHT_PPS_GID_MATCH 2
 #define WMA_VHT_PPS_DELIM_CRC_FAIL 3
 
-#define WMA_DFS_MAX_20M_SUB_CH 8
-#define WMA_80MHZ_START_CENTER_CH_DIFF 6
-#define WMA_160MHZ_START_CENTER_CH_DIFF 14
-#define WMA_NEXT_20MHZ_START_CH_DIFF 4
-
 #define WMA_DEFAULT_HW_MODE_INDEX 0xFFFF
 #define TWO_THIRD (2/3)
 
@@ -1242,7 +1236,6 @@ struct hw_mode_idx_to_mac_cap_idx {
  * @num_mem_chunks: number of memory chunk
  * @mem_chunks: memory chunks
  * @tgt_cfg_update_cb: configuration update callback
- * @dfs_radar_indication_cb: Callback to indicate radar to HDD
  * @reg_cap: regulatory capablities
  * @scan_id: scan id
  * @interfaces: txrx nodes(per vdev)
@@ -1269,7 +1262,6 @@ struct hw_mode_idx_to_mac_cap_idx {
  * @enable_mc_list : To Check if Multicast list filtering is enabled in FW
  * @ibss_started: is IBSS started or not
  * @ibsskey_info: IBSS key info
- * @dfs_ic: DFS umac interface information
  * @hddTxFailCb: tx fail indication callback
  * @pno_wake_lock: PNO wake lock
  * @extscan_wake_lock: extscan wake lock
@@ -1278,7 +1270,6 @@ struct hw_mode_idx_to_mac_cap_idx {
  * @ap_client_cnt: ap client count
  * @is_wow_bus_suspended: is wow bus suspended flag
  * @wma_scan_comp_timer: scan completion timer
- * @dfs_phyerr_filter_offload: dfs phy error filter is offloaded or not
  * @suitable_ap_hb_failure: better ap found
  * @suitable_ap_hb_failure_rssi: record the RSSI when suitable_ap_hb_failure
  * for later usage to report RSSI at beacon miss scenario
@@ -1292,7 +1283,6 @@ struct hw_mode_idx_to_mac_cap_idx {
  * @staDynamicDtim: station dynamic DTIM
  * @enable_mhf_offload: is MHF offload enable/disable
  * @last_mhf_entries_timestamp: timestamp when last entries where set
- * @dfs_pri_multiplier: DFS multiplier
  * @hw_bd_id: hardware board id
  * @hw_bd_info: hardware board info
  * @in_d0wow: D0WOW is enable/disable
@@ -1392,7 +1382,6 @@ typedef struct {
 	uint32_t num_mem_chunks;
 	struct wmi_host_mem_chunk mem_chunks[MAX_MEM_CHUNKS];
 	wma_tgt_cfg_cb tgt_cfg_update_cb;
-	wma_dfs_radar_indication_cb dfs_radar_indication_cb;
 	HAL_REG_CAPABILITIES reg_cap;
 	uint32_t scan_id;
 	struct wma_txrx_node *interfaces;
@@ -1433,7 +1422,6 @@ typedef struct {
 	bool enable_mc_list;
 	uint8_t ibss_started;
 	tSetBssKeyParams ibsskey_info;
-	struct ieee80211com *dfs_ic;
 	txFailIndCallback hddTxFailCb;
 #ifdef FEATURE_WLAN_EXTSCAN
 	qdf_wake_lock_t extscan_wake_lock;
@@ -1442,7 +1430,6 @@ typedef struct {
 	int wow_nack;
 	qdf_atomic_t is_wow_bus_suspended;
 	qdf_mc_timer_t wma_scan_comp_timer;
-	uint8_t dfs_phyerr_filter_offload;
 	bool suitable_ap_hb_failure;
 	uint32_t suitable_ap_hb_failure_rssi;
 	ibss_power_save_params wma_ibss_power_save_params;
@@ -1461,7 +1448,6 @@ typedef struct {
 	uint8_t staDynamicDtim;
 	uint8_t enable_mhf_offload;
 	unsigned long last_mhf_entries_timestamp;
-	int32_t dfs_pri_multiplier;
 	uint32_t hw_bd_id;
 	uint32_t hw_bd_info[HW_BD_INFO_SIZE];
 	uint32_t miracast_value;
@@ -1647,7 +1633,6 @@ struct wma_target_req {
  * @pmf_enabled: is pmf enabled or not
  * @vht_capable: VHT capabality
  * @ht_capable: HT capabality
- * @dfs_pri_multiplier: DFS multiplier
  * @dot11_mode: 802.11 mode
  * @is_half_rate: is the channel operating at 10MHz
  * @is_quarter_rate: is the channel operating at 5MHz
@@ -1676,7 +1661,6 @@ struct wma_vdev_start_req {
 	uint8_t ch_center_freq_seg0;
 	uint8_t ch_center_freq_seg1;
 	uint8_t ht_capable;
-	int32_t dfs_pri_multiplier;
 	uint8_t dot11_mode;
 	bool is_half_rate;
 	bool is_quarter_rate;
@@ -1742,7 +1726,6 @@ typedef struct {
  * @WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME: set IBSS TXSP
  * @WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS: set IBSS power save warmup time
  * @WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW: set IBSS power save ATIM
- * @WMA_VDEV_DFS_CONTROL_CMDID: DFS control command
  * @WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID: get IPA microcontroller fw stats
  * @WMA_VDEV_TXRX_GET_IPA_UC_SHARING_STATS_CMDID: get IPA uC wifi-sharing stats
  * @WMA_VDEV_TXRX_SET_IPA_UC_QUOTA_CMDID: set IPA uC quota limit
@@ -1763,7 +1746,6 @@ enum wma_cfg_cmd_id {
 	WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME,
 	WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS,
 	WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW,
-	WMA_VDEV_DFS_CONTROL_CMDID,
 	WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID,
 	WMA_VDEV_TXRX_GET_IPA_UC_SHARING_STATS_CMDID,
 	WMA_VDEV_TXRX_SET_IPA_UC_QUOTA_CMDID,
@@ -1997,31 +1979,6 @@ typedef struct {
 
 #endif /* FEATURE_WLAN_TDLS */
 
-/**
- * struct wma_dfs_radar_channel_list - dfs radar channel list
- * @nchannels: nuber of channels
- * @channels: Channel number including bonded channels on which
- *            radar is present
- */
-struct wma_dfs_radar_channel_list {
-	A_UINT32 nchannels;
-	uint8_t channels[WMA_DFS_MAX_20M_SUB_CH];
-};
-
-/**
- * struct wma_dfs_radar_indication - Structure to indicate RADAR
- * @vdev_id: vdev id
- * @chan_list: Channel list on which RADAR is detected
- * @dfs_radar_status: Flag to Indicate RADAR presence on the current channel
- * @use_nol: Flag to indicate use NOL
- */
-struct wma_dfs_radar_indication {
-	A_UINT32 vdev_id;
-	struct wma_dfs_radar_channel_list chan_list;
-	uint32_t dfs_radar_status;
-	int use_nol;
-};
-
 /**
  * enum uapsd_ac - U-APSD Access Categories
  * @UAPSD_BE: best effort
@@ -2108,26 +2065,6 @@ A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
 					 eCsrEncryptionType encr);
 A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
 
-/*
- * WMA-DFS Hooks
- */
-int ol_if_dfs_attach(struct ieee80211com *ic, void *ptr, void *radar_info);
-uint64_t ol_if_get_tsf64(struct ieee80211com *ic);
-int ol_if_dfs_disable(struct ieee80211com *ic);
-struct dfs_ieee80211_channel *ieee80211_find_channel(struct ieee80211com *ic,
-						 int freq, uint32_t flags);
-int ol_if_dfs_enable(struct ieee80211com *ic, int *is_fastclk, void *pe);
-uint32_t ieee80211_ieee2mhz(uint32_t chan, uint32_t flags);
-int ol_if_dfs_get_ext_busy(struct ieee80211com *ic);
-int ol_if_dfs_get_mib_cycle_counts_pct(struct ieee80211com *ic,
-				       uint32_t *rxc_pcnt, uint32_t *rxf_pcnt,
-				       uint32_t *txf_pcnt);
-uint16_t ol_if_dfs_usenol(struct ieee80211com *ic);
-void ieee80211_mark_dfs(struct ieee80211com *ic,
-			struct dfs_ieee80211_channel *ichan);
-int wma_dfs_indicate_radar(struct ieee80211com *ic,
-			   struct dfs_ieee80211_channel *ichan);
-
 QDF_STATUS wma_trigger_uapsd_params(tp_wma_handle wma_handle, uint32_t vdev_id,
 				    tp_wma_trigger_uapsd_params
 				    trigger_uapsd_params);
@@ -2179,7 +2116,6 @@ int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
 				   uint32_t len);
 int wma_mgmt_tx_bundle_completion_handler(void *handle,
 	uint8_t *cmpl_event_params, uint32_t len);
-void wma_set_dfs_region(tp_wma_handle wma, enum dfs_reg dfs_region);
 uint32_t wma_get_vht_ch_width(void);
 QDF_STATUS
 wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,

+ 0 - 292
core/wma/inc/wma_dfs_interface.h

@@ -1,292 +0,0 @@
-/*
- * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
- *
- * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
- *
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * This file was originally distributed by Qualcomm Atheros, Inc.
- * under proprietary terms before Copyright ownership was assigned
- * to the Linux Foundation.
- */
-
-#include "ath_dfs_structs.h"
-#include <qdf_lock.h>
-#include "cds_regdomain.h"
-#include "cds_ieee80211_common.h"
-#include "wlan_reg_services_api.h"
-
-#define IEEE80211_CHAN_MAX      255
-
-/* channel attributes */
-
-/* Turbo channel */
-#define IEEE80211_CHAN_TURBO            0x00000010
-/* CCK channel */
-#define IEEE80211_CHAN_CCK              0x00000020
-/* OFDM channel */
-#define IEEE80211_CHAN_OFDM             0x00000040
-/* 2 GHz spectrum channel. */
-#define IEEE80211_CHAN_2GHZ             0x00000080
-/* 5 GHz spectrum channel */
-#define IEEE80211_CHAN_5GHZ             0x00000100
-/* Only passive scan allowed */
-#define IEEE80211_CHAN_PASSIVE          0x00000200
-/* Dynamic CCK-OFDM channel */
-#define IEEE80211_CHAN_DYN              0x00000400
-/* GFSK channel (FHSS PHY) */
-#define IEEE80211_CHAN_GFSK             0x00000800
-/* 11a static turbo channel only */
-#define IEEE80211_CHAN_STURBO           0x00002000
-/* Half rate channel */
-#define IEEE80211_CHAN_HALF             0x00004000
-/* Quarter rate channel */
-#define IEEE80211_CHAN_QUARTER          0x00008000
-/* HT 20 channel */
-#define IEEE80211_CHAN_HT20             0x00010000
-/* HT 40 with extension channel above */
-#define IEEE80211_CHAN_HT40PLUS         0x00020000
-/* HT 40 with extension channel below */
-#define IEEE80211_CHAN_HT40MINUS        0x00040000
-/* HT 40 Intolerant */
-#define IEEE80211_CHAN_HT40INTOL        0x00080000
-/* VHT 20 channel */
-#define IEEE80211_CHAN_VHT20            0x00100000
-/* VHT 40 with extension channel above */
-#define IEEE80211_CHAN_VHT40PLUS        0x00200000
-/* VHT 40 with extension channel below */
-#define IEEE80211_CHAN_VHT40MINUS       0x00400000
-/* VHT 80 channel */
-#define IEEE80211_CHAN_VHT80            0x00800000
-/* HT 40 Intolerant mark bit for ACS use */
-#define IEEE80211_CHAN_HT40INTOLMARK    0x01000000
-/* channel temporarily blocked due to noise */
-#define IEEE80211_CHAN_BLOCKED          0x02000000
-/* VHT 160 Channel */
-#define IEEE80211_CHAN_VHT160           0x04000000
-/* VHT 80+80 Channel */
-#define IEEE80211_CHAN_VHT80P80         0x08000000
-
-/* token for ``any channel'' */
-#define DFS_IEEE80211_CHAN_ANY      (-1)
-#define DFS_IEEE80211_CHAN_ANYC \
-	((struct dfs_ieee80211_channel *) DFS_IEEE80211_CHAN_ANY)
-
-#define IEEE80211_IS_CHAN_11N_HT40MINUS(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_HT40MINUS) != 0)
-#define IEEE80211_IS_CHAN_11N_HT40PLUS(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_HT40PLUS) != 0)
-#define IEEE80211_CHAN_11AC_VHT80 \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT80)
-
-#define IEEE80211_IS_CHAN_11AC_VHT80(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_11AC_VHT80) == \
-	 IEEE80211_CHAN_11AC_VHT80)
-#define IEEE80211_IS_CHAN_11AC_VHT80P80(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_VHT80P80) == \
-	IEEE80211_CHAN_VHT80P80)
-#define IEEE80211_IS_CHAN_11AC_VHT160(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_VHT160) == \
-	IEEE80211_CHAN_VHT160)
-#define CHANNEL_108G \
-	(IEEE80211_CHAN_2GHZ|IEEE80211_CHAN_OFDM|IEEE80211_CHAN_TURBO)
-
-/*
- * Software use: channel interference
- * used for as AR as well as RADAR
- * interference detection
- */
-#define CHANNEL_INTERFERENCE    0x01
-/* In case of VHT160, we can have 8 20Mhz channels */
-#define IEE80211_MAX_20M_SUB_CH 8
-
-#define WMA_DFS2_PHYERROR_CODE    0x5
-#define WMA_DFS2_FALSE_RADAR_EXT  0x24
-
-/**
- * struct dfs_ieee80211_channel - channel info
- * @ic_freq: frequency in MHz
- * @ic_flags: channel flags
- * @ic_flagext: flags extension
- * @ic_ieee: IEEE channel number
- * @ic_maxregpower: max regulatory power in dbm
- * @ic_maxpower: max tx power in dbm
- * @ic_minpower: min tx power in dbm
- * @ic_regClassId: reg class id of this channel
- * @ic_antennamax: max antenna gain from regulatory
- * @ic_vhtop_ch_freq_seg1: channel center frequency
- * @ic_vhtop_ch_freq_seg2: Channel Center frequency applicable
- * @ic_pri_freq_center_freq_mhz_separation: separation b/w pri and center freq
- * @ic_80p80_both_dfs: Flag indicating if both 80p80 segments are dfs
- * @ic_radar_found_segid: Indicates seg ID on which radar is found in 80p80 mode
- */
-struct dfs_ieee80211_channel {
-	uint32_t ic_freq;
-	uint32_t ic_freq_ext;
-	uint32_t ic_flags;
-	uint8_t ic_flagext;
-	uint8_t ic_ieee;
-	uint8_t ic_ieee_ext;
-	int8_t ic_maxregpower;
-	int8_t ic_maxpower;
-	int8_t ic_minpower;
-	uint8_t ic_regClassId;
-	uint8_t ic_antennamax;
-	uint32_t ic_vhtop_ch_freq_seg1;
-	uint32_t ic_vhtop_ch_freq_seg2;
-	int ic_pri_freq_center_freq_mhz_separation;
-	bool ic_80p80_both_dfs;
-	int ic_radar_found_segid;
-};
-
-/**
- * struct ieee80211_channel_list - channel list
- * @cl_nchans: number of channels
- * @cl_channels: channel info
- */
-struct ieee80211_channel_list {
-	int cl_nchans;
-	struct dfs_ieee80211_channel *cl_channels[IEE80211_MAX_20M_SUB_CH];
-};
-
-/**
- * struct ieee80211_dfs_state - dfs state
- * @nol_event: nol event list
- * @nol_timer: nol list processing
- * @cac_timer: cac timer
- * @cureps: current events/second
- * @lastchan: chan w/ last radar event
- * @newchan: chan selected next
- * @cac_timeout_override: overridden cac timeout
- * @flags: dfs flags
- */
-struct ieee80211_dfs_state {
-	int nol_event[IEEE80211_CHAN_MAX];
-	os_timer_t nol_timer;
-	os_timer_t cac_timer;
-	int cureps;
-	const struct dfs_ieee80211_channel *lastchan;
-	struct dfs_ieee80211_channel *newchan;
-	int cac_timeout_override;
-	uint8_t enable:1, cac_timer_running:1, ignore_dfs:1, ignore_cac:1;
-};
-
-/**
- * enum DFS_HWBD_ID - Board ID to differentiate between DFS-2 and DFS-3
- * @DFS_HWBD_NONE: No hw board information/currently used for adreastea FPGA
- * @DFS_HWBD_QCA6174: Rome(AR6320)
- * @DFS_HWBD_QCA2582: Killer 1525
- */
-typedef enum {
-	DFS_HWBD_NONE = 0,
-	DFS_HWBD_QCA6174 = 1,
-	DFS_HWBD_QCA2582 = 2,
-} DFS_HWBD_ID;
-
-
-/**
- * struct ieee80211com - per device structure
- * @ic_opmode: operation mode
- * @ic_channels: ieee80211 channel list
- * @ic_nchans: number of channels
- * @ic_curchan: current channel
- * @ic_isdfsregdomain: is opearting in dfs region
- * @current_dfs_regdomain: current dfs regulatory domain
- * @vdev_id: vdev id
- * @last_radar_found_chan: last radar found channel
- * @dfs_pri_multiplier: dfs multiplier
- */
-typedef struct ieee80211com {
-	void (*ic_start_csa)(struct ieee80211com *ic, uint8_t ieeeChan);
-	void (*ic_get_ext_chan_info)(struct ieee80211com *ic,
-				     struct ieee80211_channel_list *chan);
-	enum ieee80211_opmode ic_opmode;
-	struct dfs_ieee80211_channel *(*ic_find_channel)
-			(struct ieee80211com *ic, int freq, uint32_t flags);
-	uint64_t (*ic_get_TSF64)(struct ieee80211com *ic);
-	unsigned int (*ic_ieee2mhz)(u_int chan, u_int flags);
-	struct dfs_ieee80211_channel ic_channels[IEEE80211_CHAN_MAX + 1];
-	int ic_nchans;
-	struct dfs_ieee80211_channel *ic_curchan;
-	uint8_t ic_isdfsregdomain;
-	int (*ic_get_dfsdomain)(struct ieee80211com *);
-	uint16_t (*ic_dfs_usenol)(struct ieee80211com *ic);
-	uint16_t (*ic_dfs_isdfsregdomain)(struct ieee80211com *ic);
-	int (*ic_dfs_attached)(struct ieee80211com *ic);
-	void *ic_dfs;
-	struct ieee80211_dfs_state ic_dfs_state;
-	int (*ic_dfs_attach)(struct ieee80211com *ic,
-			     void *pCap, void *radar_info);
-	int (*ic_dfs_detach)(struct ieee80211com *ic);
-	int (*ic_dfs_enable)(struct ieee80211com *ic, int *is_fastclk,
-			     void *);
-	int (*ic_dfs_disable)(struct ieee80211com *ic);
-	int (*ic_get_ext_busy)(struct ieee80211com *ic);
-	int (*ic_get_mib_cycle_counts_pct)(struct ieee80211com *ic,
-					   uint32_t *rxc_pcnt,
-					   uint32_t *rxf_pcnt,
-					   uint32_t *txf_pcnt);
-	int (*ic_dfs_get_thresholds)(struct ieee80211com *ic, void *pe);
-
-	int (*ic_dfs_debug)(struct ieee80211com *ic, int type, void *data);
-	/*
-	 * Update the channel list with the current set of DFS
-	 * NOL entries.
-	 *
-	 * + 'cmd' indicates what to do; for now it should just
-	 *   be DFS_NOL_CLIST_CMD_UPDATE which will update all
-	 *   channels, given the _entire_ NOL. (Rather than
-	 *   the earlier behaviour with clist_update, which
-	 *   was to either add or remove a set of channel
-	 *   entries.)
-	 */
-	void (*ic_dfs_clist_update)(struct ieee80211com *ic, int cmd,
-				    struct dfs_nol_chan_entry *, int nentries);
-	void (*ic_dfs_notify_radar)(struct ieee80211com *ic,
-				    struct dfs_ieee80211_channel *chan);
-	void (*ic_dfs_unmark_radar)(struct ieee80211com *ic,
-				    struct dfs_ieee80211_channel *chan);
-	int (*ic_dfs_control)(struct ieee80211com *ic,
-			      u_int id, void *indata, uint32_t insize,
-			      void *outdata, uint32_t *outsize);
-	enum dfs_reg current_dfs_regdomain;
-	uint8_t vdev_id;
-	uint8_t last_radar_found_chan;
-	int32_t dfs_pri_multiplier;
-	qdf_spinlock_t chan_lock;
-	bool disable_phy_err_processing;
-	DFS_HWBD_ID dfs_hw_bd_id;
-} IEEE80211COM, *PIEEE80211COM;
-
-/**
- * ieee80211_chan2freq() - Convert channel to frequency value.
- * @ic: ieee80211com ptr
- * @c: ieee80211 channel
- *
- * Return: freqency in MHz
- */
-static inline u_int
-ieee80211_chan2freq(struct ieee80211com *ic,
-			const struct dfs_ieee80211_channel *c)
-{
-	if (c == NULL) {
-		return 0;
-	}
-	return (c == DFS_IEEE80211_CHAN_ANYC) ?
-			DFS_IEEE80211_CHAN_ANY : c->ic_freq;
-}

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

@@ -83,16 +83,6 @@
 #define MKK       0x40
 #define ETSI      0x30
 
-/* Maximum Buffer length allowed for DFS-2 phyerrors */
-#define DFS_MAX_BUF_LENGTH 4096
-
-/*
- * Maximum Buffer length allowed for DFS-3 phyerrors
- * When 160MHz is supported the Max length of phyerrors
- * is larger than the legacy phyerrors.
- */
-#define DFS3_MAX_BUF_LENGTH 4436
-
 #define WMI_DEFAULT_NOISE_FLOOR_DBM (-96)
 
 #define WMI_MCC_MIN_CHANNEL_QUOTA             20
@@ -933,11 +923,6 @@ int wma_oem_data_response_handler(void *handle, uint8_t *datap,
 				  uint32_t len);
 #endif
 
-void wma_register_dfs_event_handler(tp_wma_handle wma_handle);
-
-int
-wma_unified_dfs_phyerr_filter_offload_enable(tp_wma_handle wma_handle);
-
 #if !defined(REMOVE_PKT_LOG)
 QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle,
 				   struct ath_pktlog_wmi_params *params);
@@ -1112,18 +1097,6 @@ QDF_STATUS wma_set_tdls_offchan_mode(WMA_HANDLE wma_handle,
 			      tdls_chan_switch_params *chan_switch_params);
 #endif
 
-struct ieee80211com *wma_dfs_attach(struct ieee80211com *dfs_ic);
-
-void wma_dfs_detach(struct ieee80211com *dfs_ic);
-
-void wma_dfs_configure(struct ieee80211com *ic);
-
-struct dfs_ieee80211_channel *wma_dfs_configure_channel(
-						struct ieee80211com *dfs_ic,
-						uint32_t band_center_freq1,
-						uint32_t band_center_freq2,
-						struct wma_vdev_start_req
-						*req);
 void wma_set_vdev_mgmt_rate(tp_wma_handle wma, uint8_t vdev_id);
 void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
 

+ 1 - 13
core/wma/inc/wma_types.h

@@ -374,9 +374,6 @@
 #endif
 #define WMA_SET_SAP_INTRABSS_DIS          SIR_HAL_SET_SAP_INTRABSS_DIS
 
-/* Message to Indicate Radar Presence on SAP Channel */
-#define WMA_DFS_RADAR_IND           SIR_HAL_DFS_RADAR_IND
-
 /* Message to indicate beacon tx completion after beacon template update
  * beacon offload case
  */
@@ -631,13 +628,6 @@ typedef void (*wma_txFailIndCallback)(uint8_t *, uint8_t);
 /* generic callback for updating parameters from target to UMAC */
 typedef void (*wma_tgt_cfg_cb)(void *context, void *param);
 
-/*
- * callback for Indicating Radar to HDD and disable Tx Queues
- * to stop accepting data Tx packets from netif as radar is
- * found on the current operating channel
- */
-typedef bool (*wma_dfs_radar_indication_cb)(void *context, void *param);
-
 /**
  * struct wma_cli_set_cmd_t - set command parameters
  * @param_id: parameter id
@@ -719,9 +709,7 @@ QDF_STATUS wma_tx_packet(void *pWMA,
 			 uint16_t channel_freq);
 
 QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, void *p_cds_context,
-		    wma_tgt_cfg_cb pTgtUpdCB,
-		    wma_dfs_radar_indication_cb radar_ind_cb,
-		    struct cds_config_info *cds_cfg);
+		    wma_tgt_cfg_cb pTgtUpdCB, struct cds_config_info *cds_cfg);
 
 QDF_STATUS wma_register_mgmt_frm_client(void);
 

+ 0 - 1
core/wma/src/wma_data.c

@@ -66,7 +66,6 @@
 #include "csr_api.h"
 #include "ol_fw.h"
 
-#include "dfs.h"
 #include "wma_internal.h"
 #include "cdp_txrx_flow_ctrl_legacy.h"
 #include "cdp_txrx_cmn.h"

+ 4 - 69
core/wma/src/wma_dev_if.c

@@ -60,7 +60,6 @@
 #include "dbglog_host.h"
 #include "csr_api.h"
 
-#include "dfs.h"
 #include "wma_internal.h"
 
 #include "wma_ocb.h"
@@ -851,12 +850,6 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
 		return -EINVAL;
 	}
 
-	if (wma_is_vdev_in_ap_mode(wma, resp_event->vdev_id)) {
-		qdf_spin_lock_bh(&wma->dfs_ic->chan_lock);
-		wma->dfs_ic->disable_phy_err_processing = false;
-		qdf_spin_unlock_bh(&wma->dfs_ic->chan_lock);
-	}
-
 	if (resp_event->status == QDF_STATUS_SUCCESS) {
 		wma->interfaces[resp_event->vdev_id].tx_streams =
 			resp_event->cfgd_tx_streams;
@@ -1909,7 +1902,6 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
 	wmi_vdev_start_request_cmd_fixed_param *cmd;
 	struct wma_txrx_node *intr = wma->interfaces;
 	tpAniSirGlobal mac_ctx = NULL;
-	struct ath_dfs *dfs;
 	uint32_t temp_ssid_len = 0;
 	uint32_t temp_flags = 0;
 	uint32_t temp_chan_info = 0;
@@ -1923,8 +1915,6 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	dfs = (struct ath_dfs *)wma->dfs_ic->ic_dfs;
-
 	WMA_LOGD("%s: Enter isRestart=%d vdev=%d", __func__, isRestart,
 		 req->vdev_id);
 	params.vdev_id = req->vdev_id;
@@ -1998,67 +1988,20 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
 	 * enable the firmware flag here.
 	 */
 
-	/*
-	 * If the Channel is DFS,
-	 * set the WMI_CHAN_FLAG_DFS flag
-	 */
 	params.is_dfs = req->is_dfs;
 	params.is_restart = isRestart;
 	params.cac_duration_ms = req->cac_duration_ms;
 	params.regdomain = req->dfs_regdomain;
 	if ((QDF_GLOBAL_MONITOR_MODE != cds_get_conparam()) && req->is_dfs) {
-		params.flag_dfs = WMI_CHAN_FLAG_DFS;
 		temp_chan_info |=  (1 << WMI_CHAN_FLAG_DFS);
 		params.dis_hw_ack = true;
-		req->dfs_pri_multiplier = wma->dfs_pri_multiplier;
 
 		/*
-		 * Configure the current operating channel
-		 * to DFS module only if the device operating
-		 * mode is AP.
-		 * Enable/Disable Phyerr filtering offload
-		 * depending on dfs_phyerr_filter_offload
-		 * flag status as set in ini for SAP mode.
-		 * Currently, only AP supports DFS master
-		 * mode operation on DFS channels, P2P-GO
-		 * does not support operation on DFS Channels.
+		 * If channel is DFS and operating in AP mode,
+		 * set the WMI_CHAN_FLAG_DFS flag.
 		 */
-		if (wma_is_vdev_in_ap_mode(wma, params.vdev_id) == true) {
-			/*
-			 * If DFS regulatory domain is invalid,
-			 * then, DFS radar filters intialization
-			 * will fail. So, do not configure the
-			 * channel in to DFS modlue, do not
-			 * indicate if phyerror filtering offload
-			 * is enabled or not to the firmware, simply
-			 * fail the VDEV start on the DFS channel
-			 * early on, to protect the DFS module from
-			 * processing phyerrors without being intialized.
-			 */
-			if (DFS_UNINIT_REG ==
-			    wma->dfs_ic->current_dfs_regdomain) {
-				WMA_LOGE("%s[%d]:DFS Configured with Invalid regdomain"
-					" Failed to send VDEV START command",
-					__func__, __LINE__);
-
-				return QDF_STATUS_E_FAILURE;
-			}
-
-			qdf_spin_lock_bh(&wma->dfs_ic->chan_lock);
-			if (isRestart)
-				wma->dfs_ic->disable_phy_err_processing = true;
-
-			/* provide the current channel to DFS */
-			wma->dfs_ic->ic_curchan =
-				wma_dfs_configure_channel(wma->dfs_ic,
-						params.band_center_freq1,
-						params.band_center_freq2, req);
-			qdf_spin_unlock_bh(&wma->dfs_ic->chan_lock);
-
-			wma_unified_dfs_phyerr_filter_offload_enable(wma);
-			dfs->disable_dfs_ch_switch =
-				mac_ctx->sap.SapDfsInfo.disable_dfs_ch_switch;
-		}
+		if (wma_is_vdev_in_ap_mode(wma, params.vdev_id) == true)
+			params.flag_dfs = WMI_CHAN_FLAG_DFS;
 	}
 
 	params.beacon_intval = req->beacon_intval;
@@ -3496,14 +3439,6 @@ void wma_add_bss(tp_wma_handle wma, tpAddBssParams params)
 
 	case QDF_SAP_MODE:
 	case QDF_P2P_GO_MODE:
-		/*If current bring up SAP/P2P channel matches the previous
-		 *radar found channel then reset the last_radar_found_chan
-		 *variable to avoid race conditions.
-		 */
-		if (params->currentOperChannel ==
-			wma->dfs_ic->last_radar_found_chan)
-			wma->dfs_ic->last_radar_found_chan = 0;
-
 		wma_add_bss_ap_mode(wma, params);
 		break;
 

+ 0 - 246
core/wma/src/wma_dfs_interface.c

@@ -1,246 +0,0 @@
-/*
- * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
- *
- * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
- *
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * This file was originally distributed by Qualcomm Atheros, Inc.
- * under proprietary terms before Copyright ownership was assigned
- * to the Linux Foundation.
- */
-
-/**
- * DOC: wma_dfs_interface.c
- *
- * Source code borrowed from QCA_MAIN DFS module
- */
-
-#include "wma.h"
-#include "ath_dfs_structs.h"
-#include "wma_dfs_interface.h"
-#include "dfs_interface.h"
-
-#ifndef ATH_SUPPORT_DFS
-#define ATH_SUPPORT_DFS 1
-#endif
-
-/**
- * ol_if_dfs_attach() - dfs attach
- * @ic: ieee80211com ptr
- * @ptr: ath_dfs_caps ptr
- * @radar_info: radar info
- *
- * Return: 0 for success or error code
- */
-int ol_if_dfs_attach(struct ieee80211com *ic, void *ptr, void *radar_info)
-{
-	struct ath_dfs_caps *pCap = (struct ath_dfs_caps *)ptr;
-
-	qdf_print("%s: called; ptr=%p, radar_info=%p\n",
-		  __func__, ptr, radar_info);
-
-	pCap->ath_chip_is_bb_tlv = 1;
-	pCap->ath_dfs_combined_rssi_ok = 0;
-	pCap->ath_dfs_ext_chan_ok = 0;
-	pCap->ath_dfs_use_enhancement = 0;
-	pCap->ath_strong_signal_diversiry = 0;
-	pCap->ath_fastdiv_val = 0;
-
-	return 0;
-}
-
-/**
- * ol_if_get_tsf64() - Place Holder API
- * @ic: ieee80211com ptr
- *
- * We get the tsf from Firmware.
- *
- * Return: always return success(0)
- */
-uint64_t ol_if_get_tsf64(struct ieee80211com *ic)
-{
-	return 0;
-}
-
-/**
- * ol_if_dfs_disable() - Place Holder API
- * @ic: ieee80211com ptr
- *
- * ic_dfs_disable is just a place holder
- * function since firmware takes care of
- * disabling the dfs phyerrors disabling.
- *
- * Return: always return success(0)
- */
-int ol_if_dfs_disable(struct ieee80211com *ic)
-{
-	return 0;
-}
-
-/**
- * ieee80211_find_channel() - find ieee80211 channel
- * @ic: ieee80211com ptr
- * @freq: frequency
- * @flags: flags
- *
- * Locate a channel given a frequency+flags. We cache
- * the previous lookup to optimize swithing between
- * two channels--as happens with dynamic turbo.
- * This verifies that found channels have not been
- * excluded because of 11d.
- *
- * Return: returns dfs_ieee80211_channel or NULL for error
- */
-struct dfs_ieee80211_channel *ieee80211_find_channel(struct ieee80211com *ic,
-						 int freq, uint32_t flags)
-{
-	struct dfs_ieee80211_channel *c;
-	int i;
-
-	flags &= IEEE80211_CHAN_ALLTURBO;
-	/* brute force search */
-	for (i = 0; i < ic->ic_nchans; i++) {
-		c = &ic->ic_channels[i];
-
-		if ((!IEEE80211_IS_CHAN_11D_EXCLUDED(c)) &&
-		    (c->ic_freq == freq) &&
-		    ((c->ic_flags & IEEE80211_CHAN_ALLTURBO) == flags)) {
-			return c;
-		}
-	}
-
-	return NULL;
-}
-
-/**
- * ic_dfs_enable() - enable DFS
- * @ic: ieee80211com ptr
- * @is_fastclk: is fastclock
- *
- * For offload solutions, radar PHY errors will be enabled
- * by the target firmware when DFS is requested for the
- * current channel.
- *
- * Return: Always returns success
- */
-int ol_if_dfs_enable(struct ieee80211com *ic, int *is_fastclk, void *pe)
-{
-	/*
-	 * For peregrine, treat fastclk as the "oversampling" mode.
-	 * It's on by default.  This may change at some point, so
-	 * we should really query the firmware to find out what
-	 * the current configuration is.
-	 */
-	(*is_fastclk) = 1;
-
-	return 0;
-}
-
-/**
- * ieee80211_ieee2mhz() - Convert IEEE channel number to MHz frequency.
- * @chan: channel number
- * @flags: flags
- *
- * Return: frequency in MHz
- */
-uint32_t ieee80211_ieee2mhz(uint32_t chan, uint32_t flags)
-{
-	if (flags & IEEE80211_CHAN_2GHZ) {
-		/* 2GHz band */
-		if (chan == 14)
-			return 2484;
-		if (chan < 14)
-			return 2407 + chan * 5;
-		else
-			return 2512 + ((chan - 15) * 20);
-	} else if (flags & IEEE80211_CHAN_5GHZ) {
-		/* 5Ghz band */
-		return 5000 + (chan * 5);
-	} else {
-		/* either, guess */
-		if (chan == 14)
-			return 2484;
-		if (chan < 14)  /* 0-13 */
-			return 2407 + chan * 5;
-		if (chan < 27)  /* 15-26 */
-			return 2512 + ((chan - 15) * 20);
-		return 5000 + (chan * 5);
-	}
-}
-
-/**
- * ol_if_dfs_get_ext_busy() - Place holder function ic_get_ext_busy
- * @ic: ieee80211com ptr
- *
- * Return: Always return success (0)
- */
-int ol_if_dfs_get_ext_busy(struct ieee80211com *ic)
-{
-	return 0;
-}
-
-/**
- * ol_if_dfs_get_mib_cycle_counts_pct() - Place holder function
- * @ic: ieee80211com ptr
- *
- * Return: Always return success (0)
- */
-int
-ol_if_dfs_get_mib_cycle_counts_pct(struct ieee80211com *ic,
-				   uint32_t *rxc_pcnt, uint32_t *rxf_pcnt,
-				   uint32_t *txf_pcnt)
-{
-	return 0;
-}
-
-/**
- * ol_if_dfs_usenol() - dfs usenol call
- * @ic: ieee80211com ptr
- *
- * Return: 0 fo success or error code
- */
-uint16_t ol_if_dfs_usenol(struct ieee80211com *ic)
-{
-#if ATH_SUPPORT_DFS
-	return dfs_usenol(ic);
-#else
-	return 0;
-#endif /* ATH_SUPPORT_DFS */
-	return 0;
-}
-
-/**
- * ieee80211_mark_dfs() - indicate radar on current operating freq
- * @ic: ieee80211com ptr
- * @ichan: channel
- *
- * Function to indicate Radar on the current
- * SAP operating channel.This indication will
- * be posted to SAP to select a new channel
- * randomly and issue a vdev restart to
- * operate on the new channel.
- *
- * Return: none
- */
-void
-ieee80211_mark_dfs(struct ieee80211com *ic, struct dfs_ieee80211_channel *ichan)
-{
-	int status;
-	status = wma_dfs_indicate_radar(ic, ichan);
-}

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

@@ -65,8 +65,6 @@
 #include "csr_api.h"
 #include "ol_fw.h"
 
-#include "dfs.h"
-#include "radar_filters.h"
 #include "wma_internal.h"
 #include "wma_nan_datapath.h"
 #include <cdp_txrx_handle.h>
@@ -1312,474 +1310,6 @@ QDF_STATUS wma_start_oem_data_req(tp_wma_handle wma_handle,
 }
 #endif /* FEATURE_OEM_DATA_SUPPORT */
 
-
-/**
- * wma_unified_dfs_radar_rx_event_handler() - dfs radar rx event handler
- * @handle: wma handle
- * @data: data buffer
- * @datalen: data length
- *
- * WMI handler for WMI_DFS_RADAR_EVENTID
- * This handler is registered for handling
- * filtered DFS Phyerror. This handler is
- * will be invoked only when DFS Phyerr
- * filtering offload is enabled.
- *
- * Return: 1 for Success and 0 for error
- */
-static int wma_unified_dfs_radar_rx_event_handler(void *handle,
-						  uint8_t *data,
-						  uint32_t datalen)
-{
-	tp_wma_handle wma = (tp_wma_handle) handle;
-	struct ieee80211com *ic;
-	struct ath_dfs *dfs;
-	struct dfs_event *event;
-	struct dfs_ieee80211_channel *chan;
-	int empty;
-	int do_check_chirp = 0;
-	int is_hw_chirp = 0;
-	int is_sw_chirp = 0;
-	int is_pri = 0;
-	bool is_ch_dfs = false;
-
-	WMI_DFS_RADAR_EVENTID_param_tlvs *param_tlvs;
-	wmi_dfs_radar_event_fixed_param *radar_event;
-
-	ic = wma->dfs_ic;
-	if (NULL == ic) {
-		WMA_LOGE("%s: dfs_ic is  NULL ", __func__);
-		return 0;
-	}
-
-	dfs = (struct ath_dfs *)ic->ic_dfs;
-	param_tlvs = (WMI_DFS_RADAR_EVENTID_param_tlvs *) data;
-
-	if (NULL == dfs) {
-		WMA_LOGE("%s: dfs is  NULL ", __func__);
-		return 0;
-	}
-	/*
-	 * This parameter holds the number
-	 * of phyerror interrupts to the host
-	 * after the phyerrors have passed through
-	 * false detect filters in the firmware.
-	 */
-	dfs->dfs_phyerr_count++;
-
-	if (!param_tlvs) {
-		WMA_LOGE("%s: Received NULL data from FW", __func__);
-		return 0;
-	}
-
-	radar_event = param_tlvs->fixed_param;
-
-	qdf_spin_lock_bh(&ic->chan_lock);
-	chan = ic->ic_curchan;
-	if (ic->disable_phy_err_processing) {
-		WMA_LOGD("%s: radar indication done,drop phyerror event",
-			__func__);
-		qdf_spin_unlock_bh(&ic->chan_lock);
-		return 0;
-	}
-
-	if (IEEE80211_IS_CHAN_11AC_VHT160(chan)) {
-		is_ch_dfs = true;
-	} else if (IEEE80211_IS_CHAN_11AC_VHT80P80(chan)) {
-		if (wlan_reg_get_channel_state(wma->pdev, chan->ic_ieee) ==
-				CHANNEL_STATE_DFS ||
-		    wlan_reg_get_channel_state(wma->pdev, chan->ic_ieee_ext -
-					  WMA_80MHZ_START_CENTER_CH_DIFF) ==
-							CHANNEL_STATE_DFS)
-			is_ch_dfs = true;
-	} else {
-		if (wlan_reg_get_channel_state(wma->pdev, chan->ic_ieee) ==
-				CHANNEL_STATE_DFS)
-			is_ch_dfs = true;
-	}
-	if (!is_ch_dfs) {
-		WMA_LOGE
-			("%s: Invalid DFS Phyerror event. Channel=%d is Non-DFS",
-			__func__, chan->ic_ieee);
-		qdf_spin_unlock_bh(&ic->chan_lock);
-		return 0;
-	}
-
-	qdf_spin_unlock_bh(&ic->chan_lock);
-	dfs->ath_dfs_stats.total_phy_errors++;
-
-	if (dfs->dfs_caps.ath_chip_is_bb_tlv) {
-		do_check_chirp = 1;
-		is_pri = 1;
-		is_hw_chirp = radar_event->pulse_is_chirp;
-
-		if ((uint32_t) dfs->dfs_phyerr_freq_min >
-		    radar_event->pulse_center_freq) {
-			dfs->dfs_phyerr_freq_min =
-				(int)radar_event->pulse_center_freq;
-		}
-
-		if (dfs->dfs_phyerr_freq_max <
-		    (int)radar_event->pulse_center_freq) {
-			dfs->dfs_phyerr_freq_max =
-				(int)radar_event->pulse_center_freq;
-		}
-	}
-
-	/*
-	 * Now, add the parsed, checked and filtered
-	 * radar phyerror event radar pulse event list.
-	 * This event will then be processed by
-	 * dfs_radar_processevent() to see if the pattern
-	 * of pulses in radar pulse list match any radar
-	 * singnature in the current regulatory domain.
-	 */
-
-	ATH_DFSEVENTQ_LOCK(dfs);
-	empty = STAILQ_EMPTY(&(dfs->dfs_eventq));
-	ATH_DFSEVENTQ_UNLOCK(dfs);
-	if (empty) {
-		return 0;
-	}
-	/*
-	 * Add the event to the list, if there's space.
-	 */
-	ATH_DFSEVENTQ_LOCK(dfs);
-	event = STAILQ_FIRST(&(dfs->dfs_eventq));
-	if (event == NULL) {
-		ATH_DFSEVENTQ_UNLOCK(dfs);
-		WMA_LOGE("%s: No more space left for queuing DFS Phyerror events",
-			__func__);
-		return 0;
-	}
-	STAILQ_REMOVE_HEAD(&(dfs->dfs_eventq), re_list);
-	ATH_DFSEVENTQ_UNLOCK(dfs);
-	dfs->dfs_phyerr_queued_count++;
-	dfs->dfs_phyerr_w53_counter++;
-	event->re_dur = (uint8_t) radar_event->pulse_duration;
-	event->re_rssi = radar_event->rssi;
-	event->re_ts = radar_event->pulse_detect_ts & DFS_TSMASK;
-	event->re_full_ts = (((uint64_t) radar_event->upload_fullts_high) << 32)
-			    | radar_event->upload_fullts_low;
-
-	/*
-	 * Index of peak magnitude
-	 */
-	event->sidx = radar_event->peak_sidx;
-	event->re_flags = 0;
-
-	/*
-	 * Handle chirp flags.
-	 */
-	if (do_check_chirp) {
-		event->re_flags |= DFS_EVENT_CHECKCHIRP;
-		if (is_hw_chirp) {
-			event->re_flags |= DFS_EVENT_HW_CHIRP;
-		}
-		if (is_sw_chirp) {
-			event->re_flags |= DFS_EVENT_SW_CHIRP;
-		}
-	}
-	/*
-	 * Correctly set which channel is being reported on
-	 */
-	if (is_pri) {
-		event->re_chanindex = (uint8_t) dfs->dfs_curchan_radindex;
-	} else {
-		if (dfs->dfs_extchan_radindex == -1) {
-			WMA_LOGI("%s phyerr on ext channel", __func__);
-		}
-		event->re_chanindex = (uint8_t) dfs->dfs_extchan_radindex;
-		WMA_LOGI("%s:New extension channel event is added to queue",
-			 __func__);
-	}
-
-	ATH_DFSQ_LOCK(dfs);
-
-	STAILQ_INSERT_TAIL(&(dfs->dfs_radarq), event, re_list);
-
-	empty = STAILQ_EMPTY(&dfs->dfs_radarq);
-
-	ATH_DFSQ_UNLOCK(dfs);
-
-	if (!empty && !dfs->ath_radar_tasksched) {
-		dfs->ath_radar_tasksched = 1;
-		OS_SET_TIMER(&dfs->ath_dfs_task_timer, 0);
-	}
-
-	return 1;
-
-}
-
-/**
- * wma_unified_phyerr_rx_event_handler() - phyerr event handler
- * @handle: wma handle
- * @data: data buffer
- * @datalen: buffer length
- *
- * WMI Handler for WMI_PHYERR_EVENTID event from firmware.
- * This handler is currently handling only DFS phy errors.
- * This handler will be invoked only when the DFS phyerror
- * filtering offload is disabled.
- *
- * Return:  1:Success, 0:Failure
- */
-static int wma_unified_phyerr_rx_event_handler(void *handle,
-					       uint8_t *data, uint32_t datalen)
-{
-	tp_wma_handle wma = (tp_wma_handle) handle;
-	WMI_PHYERR_EVENTID_param_tlvs *param_tlvs;
-	wmi_comb_phyerr_rx_hdr *pe_hdr;
-	uint8_t *bufp;
-	wmi_single_phyerr_rx_event *ev;
-	struct ieee80211com *ic = wma->dfs_ic;
-	qdf_size_t n;
-	A_UINT64 tsf64 = 0;
-	int phy_err_code = 0;
-	A_UINT32 phy_err_mask = 0;
-	int error = 0;
-	tpAniSirGlobal mac_ctx =
-		(tpAniSirGlobal)cds_get_context(QDF_MODULE_ID_PE);
-	bool enable_log = false;
-	int max_dfs_buf_length = 0;
-
-	if (NULL == mac_ctx) {
-		WMA_LOGE("%s: mac_ctx is NULL", __func__);
-		return 0;
-	}
-	enable_log = mac_ctx->sap.enable_dfs_phy_error_logs;
-
-	param_tlvs = (WMI_PHYERR_EVENTID_param_tlvs *) data;
-
-	if (!param_tlvs) {
-		WMA_LOGE("%s: Received NULL data from FW", __func__);
-		return 0;
-	}
-
-	pe_hdr = param_tlvs->hdr;
-	if (pe_hdr == NULL) {
-		WMA_LOGE("%s: Received Data PE Header is NULL", __func__);
-		return 0;
-	}
-
-	/* Ensure it's at least the size of the header */
-	if (datalen < sizeof(*pe_hdr)) {
-		WMA_LOGE("%s:  Expected minimum size %zu, received %d",
-			 __func__, sizeof(*pe_hdr), datalen);
-		return 0;
-	}
-	/*
-	 * The max buffer lenght is larger for DFS-3 than DFS-2.
-	 * So, accordingly use the correct max buffer size.
-	 */
-	if (wma->hw_bd_id != WMI_HWBD_QCA6174)
-		max_dfs_buf_length = DFS3_MAX_BUF_LENGTH;
-	else
-		max_dfs_buf_length = DFS_MAX_BUF_LENGTH;
-
-	if (pe_hdr->buf_len > max_dfs_buf_length) {
-		WMA_LOGE("%s: Received Invalid Phyerror event buffer length = %d"
-			"Maximum allowed buf length = %d", __func__,
-			pe_hdr->buf_len, max_dfs_buf_length);
-
-		return 0;
-	}
-
-	/*
-	 * Reconstruct the 64 bit event TSF. This isn't from the MAC, it's
-	 * at the time the event was sent to us, the TSF value will be
-	 * in the future.
-	 */
-	tsf64 = pe_hdr->tsf_l32;
-	tsf64 |= (((uint64_t) pe_hdr->tsf_u32) << 32);
-
-	/*
-	 * Check the HW board ID to figure out
-	 * if DFS-3 is supported. In DFS-3
-	 * phyerror mask indicates the type of
-	 * phyerror, whereas in DFS-2 phyerrorcode
-	 * indicates the type of phyerror. If the
-	 * board is NOT WMI_HWBD_QCA6174, for now
-	 * assume that it supports DFS-3.
-	 */
-	if (wma->hw_bd_id != WMI_HWBD_QCA6174) {
-		phy_err_mask = pe_hdr->rsPhyErrMask0;
-		WMA_LOGD("%s: DFS-3 phyerror mask = 0x%x",
-			  __func__, phy_err_mask);
-	}
-
-	/*
-	 * Loop over the bufp, extracting out phyerrors
-	 * wmi_unified_comb_phyerr_rx_event.bufp is a char pointer,
-	 * which isn't correct here - what we have received here
-	 * is an array of TLV-style PHY errors.
-	 */
-	n = 0;                  /* Start just after the header */
-	bufp = param_tlvs->bufp;
-	while (n < pe_hdr->buf_len) {
-		/* ensure there's at least space for the header */
-		if ((pe_hdr->buf_len - n) < sizeof(ev->hdr)) {
-			WMA_LOGE("%s: Not enough space.(datalen=%d, n=%zu, hdr=%zu bytes",
-				__func__, pe_hdr->buf_len, n, sizeof(ev->hdr));
-			error = 1;
-			break;
-		}
-		/*
-		 * Obtain a pointer to the beginning of the current event.
-		 * data[0] is the beginning of the WMI payload.
-		 */
-		ev = (wmi_single_phyerr_rx_event *) &bufp[n];
-
-		/*
-		 * Sanity check the buffer length of the event against
-		 * what we currently have.
-		 * Since buf_len is 32 bits, we check if it overflows
-		 * a large 32 bit value. It's not 0x7fffffff because
-		 * we increase n by (buf_len + sizeof(hdr)), which would
-		 * in itself cause n to overflow.
-		 * If "int" is 64 bits then this becomes a moot point.
-		 */
-		if (ev->hdr.buf_len > 0x7f000000) {
-			WMA_LOGE("%s:buf_len is garbage (0x%x)", __func__,
-				 ev->hdr.buf_len);
-			error = 1;
-			break;
-		}
-		if (n + ev->hdr.buf_len > pe_hdr->buf_len) {
-			WMA_LOGE("%s: buf_len exceeds available space n=%zu,"
-				 "buf_len=%d, datalen=%d",
-				 __func__, n, ev->hdr.buf_len, pe_hdr->buf_len);
-			error = 1;
-			break;
-		}
-		/*
-		 * If the board id is WMI_HWBD_QCA6174
-		 * then it supports only DFS-2. So, fetch
-		 * phyerror code in order to know the type
-		 * of phyerror.
-		 */
-		if (wma->hw_bd_id == WMI_HWBD_QCA6174) {
-			phy_err_code = WMI_UNIFIED_PHYERRCODE_GET(&ev->hdr);
-			WMA_LOGD("%s: DFS-2 phyerror code = 0x%x",
-				  __func__, phy_err_code);
-		}
-
-		/*
-		 * phy_err_code is set for DFS-2 and phy_err_mask
-		 * is set for DFS-3. Checking both to support
-		 * compatability for older platforms.
-		 * If the phyerror or phyerrmask category matches,
-		 * pass radar events to the dfs pattern matching code.
-		 * Don't pass radar events with no buffer payload.
-		 */
-		if (((phy_err_mask & WMI_PHY_ERROR_MASK0_RADAR) ||
-		     (phy_err_mask & WMI_PHY_ERROR_MASK0_FALSE_RADAR_EXT)) ||
-		    (phy_err_code == WMA_DFS2_PHYERROR_CODE ||
-		     phy_err_code == WMA_DFS2_FALSE_RADAR_EXT)) {
-			if (ev->hdr.buf_len > 0) {
-				/* Calling in to the DFS module to process the phyerr */
-				dfs_process_phyerr(ic, &ev->bufp[0],
-						   ev->hdr.buf_len,
-						   WMI_UNIFIED_RSSI_COMB_GET
-							   (&ev->hdr) & 0xff,
-						   /* Extension RSSI */
-						   WMI_UNIFIED_RSSI_COMB_GET
-							   (&ev->hdr) & 0xff,
-						   ev->hdr.tsf_timestamp,
-						   tsf64, enable_log);
-			}
-		}
-
-		/*
-		 * Advance the buffer pointer to the next PHY error.
-		 * buflen is the length of this payload, so we need to
-		 * advance past the current header _AND_ the payload.
-		 */
-		n += sizeof(*ev) + ev->hdr.buf_len;
-
-	} /*end while() */
-	if (error)
-		return 0;
-	else
-		return 1;
-}
-
-/**
- * wma_register_dfs_event_handler() - register dfs event handler
- * @wma_handle: wma handle
- *
- * Register appropriate dfs phyerror event handler
- * based on phyerror filtering offload is enabled
- * or disabled.
- *
- * Return: none
- */
-void wma_register_dfs_event_handler(tp_wma_handle wma_handle)
-{
-	if (NULL == wma_handle) {
-		WMA_LOGE("%s:wma_handle is NULL", __func__);
-		return;
-	}
-
-	if (false == wma_handle->dfs_phyerr_filter_offload) {
-		/*
-		 * Register the wma_unified_phyerr_rx_event_handler
-		 * for filtering offload disabled case to handle
-		 * the DFS phyerrors.
-		 */
-		WMA_LOGD("%s:Phyerror Filtering offload is Disabled in ini",
-			 __func__);
-		wmi_unified_register_event_handler(wma_handle->wmi_handle,
-					WMI_PHYERR_EVENTID,
-					wma_unified_phyerr_rx_event_handler,
-					WMA_RX_WORK_CTX);
-		WMA_LOGD("%s: WMI_PHYERR_EVENTID event handler registered",
-			 __func__);
-	} else {
-		WMA_LOGD("%s:Phyerror Filtering offload is Enabled in ini",
-			 __func__);
-		wmi_unified_register_event_handler(wma_handle->wmi_handle,
-					WMI_DFS_RADAR_EVENTID,
-					wma_unified_dfs_radar_rx_event_handler,
-					WMA_RX_WORK_CTX);
-		WMA_LOGD("%s:WMI_DFS_RADAR_EVENTID event handler registered",
-			 __func__);
-	}
-
-	return;
-}
-
-
-/**
- * wma_unified_dfs_phyerr_filter_offload_enable() - enable dfs phyerr filter
- * @wma_handle: wma handle
- *
- * Send WMI_DFS_PHYERR_FILTER_ENA_CMDID or
- * WMI_DFS_PHYERR_FILTER_DIS_CMDID command
- * to firmware based on phyerr filtering
- * offload status.
- *
- * Return: 1 success, 0 failure
- */
-int
-wma_unified_dfs_phyerr_filter_offload_enable(tp_wma_handle wma_handle)
-{
-	int ret;
-
-	if (NULL == wma_handle) {
-		WMA_LOGE("%s:wma_handle is NULL", __func__);
-		return 0;
-	}
-
-	ret = wmi_unified_dfs_phyerr_filter_offload_en_cmd(wma_handle->wmi_handle,
-					   wma_handle->dfs_phyerr_filter_offload);
-	if (ret)
-		return QDF_STATUS_E_FAILURE;
-
-
-	return QDF_STATUS_SUCCESS;
-}
-
 #if !defined(REMOVE_PKT_LOG)
 /**
  * wma_pktlog_wmi_send_cmd() - send pktlog enable/disable command to target
@@ -4891,496 +4421,6 @@ end_tdls_peer_state:
 }
 #endif /* FEATURE_WLAN_TDLS */
 
-
-/**
- * wma_dfs_attach() - Attach DFS methods to the umac state.
- * @dfs_ic: ieee80211com ptr
- *
- * Return: Return ieee80211com ptr with updated info
- */
-struct ieee80211com *wma_dfs_attach(struct ieee80211com *dfs_ic)
-{
-	/*Allocate memory for dfs_ic before passing it up to dfs_attach() */
-	dfs_ic = (struct ieee80211com *)
-		 os_malloc(NULL, sizeof(struct ieee80211com), GFP_ATOMIC);
-	if (dfs_ic == NULL) {
-		WMA_LOGE("%s:Allocation of dfs_ic failed %zu",
-			 __func__, sizeof(struct ieee80211com));
-		return NULL;
-	}
-	OS_MEMZERO(dfs_ic, sizeof(struct ieee80211com));
-	/* DFS pattern matching hooks */
-	dfs_ic->ic_dfs_attach = ol_if_dfs_attach;
-	dfs_ic->ic_dfs_disable = ol_if_dfs_disable;
-	dfs_ic->ic_find_channel = ieee80211_find_channel;
-	dfs_ic->ic_dfs_enable = ol_if_dfs_enable;
-	dfs_ic->ic_ieee2mhz = ieee80211_ieee2mhz;
-
-	/* Hardware facing hooks */
-	dfs_ic->ic_get_ext_busy = ol_if_dfs_get_ext_busy;
-	dfs_ic->ic_get_mib_cycle_counts_pct =
-		ol_if_dfs_get_mib_cycle_counts_pct;
-	dfs_ic->ic_get_TSF64 = ol_if_get_tsf64;
-
-	/* NOL related hooks */
-	dfs_ic->ic_dfs_usenol = ol_if_dfs_usenol;
-	/*
-	 * Hooks from wma/dfs/ back
-	 * into the PE/SME
-	 * and shared DFS code
-	 */
-	dfs_ic->ic_dfs_notify_radar = ieee80211_mark_dfs;
-	qdf_spinlock_create(&dfs_ic->chan_lock);
-	/* Initializes DFS Data Structures and queues */
-	dfs_attach(dfs_ic);
-
-	return dfs_ic;
-}
-
-/**
- * wma_dfs_detach() - Detach DFS methods
- * @dfs_ic: ieee80211com ptr
- *
- * Return: none
- */
-void wma_dfs_detach(struct ieee80211com *dfs_ic)
-{
-	dfs_detach(dfs_ic);
-
-	qdf_spinlock_destroy(&dfs_ic->chan_lock);
-	if (NULL != dfs_ic->ic_curchan) {
-		OS_FREE(dfs_ic->ic_curchan);
-		dfs_ic->ic_curchan = NULL;
-	}
-
-	OS_FREE(dfs_ic);
-}
-
-/**
- * wma_dfs_configure() - configure dfs
- * @ic: ieee80211com ptr
- *
- * Configures Radar Filters during
- * vdev start/channel change/regulatory domain
- * change.This Configuration enables to program
- * the DFS pattern matching module.
- *
- * Return: none
- */
-void wma_dfs_configure(struct ieee80211com *ic)
-{
-	struct ath_dfs_radar_tab_info rinfo;
-	int dfsdomain;
-	int radar_enabled_status = 0;
-	if (ic == NULL) {
-		WMA_LOGE("%s: DFS ic is Invalid", __func__);
-		return;
-	}
-
-	dfsdomain = ic->current_dfs_regdomain;
-
-	/* Fetch current radar patterns from the lmac */
-	OS_MEMZERO(&rinfo, sizeof(rinfo));
-
-	/*
-	 * Look up the current DFS
-	 * regulatory domain and decide
-	 * which radar pulses to use.
-	 */
-	switch (dfsdomain) {
-	case DFS_FCC_REG:
-		WMA_LOGI("%s: DFS-FCC domain", __func__);
-		rinfo.dfsdomain = DFS_FCC_REG;
-		rinfo.dfs_radars = dfs_fcc_radars;
-		rinfo.numradars = QDF_ARRAY_SIZE(dfs_fcc_radars);
-		rinfo.b5pulses = dfs_fcc_bin5pulses;
-		rinfo.numb5radars = QDF_ARRAY_SIZE(dfs_fcc_bin5pulses);
-		break;
-	case DFS_ETSI_REG:
-		WMA_LOGI("%s: DFS-ETSI domain", __func__);
-		rinfo.dfsdomain = DFS_ETSI_REG;
-		rinfo.dfs_radars = dfs_etsi_radars;
-		rinfo.numradars = QDF_ARRAY_SIZE(dfs_etsi_radars);
-		rinfo.b5pulses = NULL;
-		rinfo.numb5radars = 0;
-		break;
-	case DFS_MKK_REG:
-		WMA_LOGI("%s: DFS-MKK domain", __func__);
-		rinfo.dfsdomain = DFS_MKK_REG;
-		rinfo.dfs_radars = dfs_mkk4_radars;
-		rinfo.numradars = QDF_ARRAY_SIZE(dfs_mkk4_radars);
-		rinfo.b5pulses = dfs_jpn_bin5pulses;
-		rinfo.numb5radars = QDF_ARRAY_SIZE(dfs_jpn_bin5pulses);
-		break;
-	case DFS_CN_REG:
-		WMA_LOGI("%s: DFS-CN domain", __func__);
-		rinfo.dfsdomain = DFS_CN_REG;
-		rinfo.dfs_radars = dfs_china_radars;
-		rinfo.numradars = QDF_ARRAY_SIZE(dfs_china_radars);
-		rinfo.b5pulses = NULL;
-		rinfo.numb5radars = 0;
-		break;
-	case DFS_KR_REG:
-		WMA_LOGI("%s: DFS-KR domain", __func__);
-		rinfo.dfsdomain = DFS_KR_REG;
-		rinfo.dfs_radars = dfs_korea_radars;
-		rinfo.numradars = QDF_ARRAY_SIZE(dfs_korea_radars);
-		rinfo.b5pulses = NULL;
-		rinfo.numb5radars = 0;
-		break;
-	default:
-		WMA_LOGI("%s: DFS-UNINT domain", __func__);
-		rinfo.dfsdomain = DFS_UNINIT_REG;
-		rinfo.dfs_radars = NULL;
-		rinfo.numradars = 0;
-		rinfo.b5pulses = NULL;
-		rinfo.numb5radars = 0;
-		break;
-	}
-
-	rinfo.dfs_pri_multiplier = ic->dfs_pri_multiplier;
-
-	/*
-	 * Set the regulatory domain,
-	 * radar pulse table and enable
-	 * radar events if required.
-	 * dfs_radar_enable() returns
-	 * 0 on success and non-zero
-	 * failure.
-	 */
-	radar_enabled_status = dfs_radar_enable(ic, &rinfo);
-	if (radar_enabled_status != DFS_STATUS_SUCCESS) {
-		WMA_LOGE("%s[%d]: DFS- Radar Detection Enabling Failed",
-			 __func__, __LINE__);
-	}
-}
-
-/**
- * wma_dfs_configure_channel() - configure DFS channel
- * @dfs_ic: ieee80211com ptr
- * @band_center_freq1: center frequency 1
- * @band_center_freq2: center frequency 2
- *       (valid only for 11ac vht 80plus80 mode)
- * @ req: vdev start request
- *
- * Set the Channel parameters in to DFS module
- * Also,configure the DFS radar filters for
- * matching the DFS phyerrors.
- *
- * Return: dfs_ieee80211_channel / NULL for error
- */
-struct dfs_ieee80211_channel *wma_dfs_configure_channel(
-						struct ieee80211com *dfs_ic,
-						uint32_t band_center_freq1,
-						uint32_t band_center_freq2,
-						struct wma_vdev_start_req
-						*req)
-{
-	uint8_t ext_channel;
-	tp_wma_handle wma;
-
-	wma = cds_get_context(QDF_MODULE_ID_WMA);
-	if (!wma) {
-		WMA_LOGE("%s: DFS- Invalid wma", __func__);
-		return NULL;
-	}
-
-	if (dfs_ic == NULL) {
-		WMA_LOGE("%s: DFS ic is Invalid", __func__);
-		return NULL;
-	}
-
-	if (!dfs_ic->ic_curchan) {
-		dfs_ic->ic_curchan = (struct dfs_ieee80211_channel *)os_malloc(
-					NULL,
-					sizeof(struct dfs_ieee80211_channel),
-					GFP_ATOMIC);
-		if (dfs_ic->ic_curchan == NULL) {
-			WMA_LOGE(
-			    "%s: allocation of dfs_ic->ic_curchan failed %zu",
-			    __func__, sizeof(struct dfs_ieee80211_channel));
-			return NULL;
-		}
-	}
-
-	OS_MEMZERO(dfs_ic->ic_curchan, sizeof(struct dfs_ieee80211_channel));
-
-	dfs_ic->ic_curchan->ic_ieee = req->chan;
-	dfs_ic->ic_curchan->ic_freq = cds_chan_to_freq(req->chan);
-	dfs_ic->ic_curchan->ic_vhtop_ch_freq_seg1 = band_center_freq1;
-	dfs_ic->ic_curchan->ic_vhtop_ch_freq_seg2 = band_center_freq2;
-	dfs_ic->ic_curchan->ic_pri_freq_center_freq_mhz_separation =
-					dfs_ic->ic_curchan->ic_freq -
-				dfs_ic->ic_curchan->ic_vhtop_ch_freq_seg1;
-
-	if ((dfs_ic->ic_curchan->ic_ieee >= WMA_11A_CHANNEL_BEGIN) &&
-	    (dfs_ic->ic_curchan->ic_ieee <= WMA_11A_CHANNEL_END)) {
-		dfs_ic->ic_curchan->ic_flags |= IEEE80211_CHAN_5GHZ;
-	}
-
-	switch (req->chan_width) {
-	case CH_WIDTH_20MHZ:
-		dfs_ic->ic_curchan->ic_flags |=
-				(req->vht_capable ? IEEE80211_CHAN_VHT20 :
-							IEEE80211_CHAN_HT20);
-		break;
-	case CH_WIDTH_40MHZ:
-		if (req->chan < req->ch_center_freq_seg0)
-			dfs_ic->ic_curchan->ic_flags |=
-					(req->vht_capable ?
-					IEEE80211_CHAN_VHT40PLUS :
-					IEEE80211_CHAN_HT40PLUS);
-		else
-			dfs_ic->ic_curchan->ic_flags |=
-					(req->vht_capable ?
-					IEEE80211_CHAN_VHT40MINUS :
-					IEEE80211_CHAN_HT40MINUS);
-		break;
-	case CH_WIDTH_80MHZ:
-		dfs_ic->ic_curchan->ic_flags |= IEEE80211_CHAN_VHT80;
-		break;
-	case CH_WIDTH_80P80MHZ:
-		ext_channel = cds_freq_to_chan(band_center_freq2);
-		dfs_ic->ic_curchan->ic_flags |=
-					IEEE80211_CHAN_VHT80P80;
-		dfs_ic->ic_curchan->ic_freq_ext =
-						band_center_freq2;
-		dfs_ic->ic_curchan->ic_ieee_ext = ext_channel;
-
-		/* verify both the 80MHz are DFS bands or not */
-		if ((CHANNEL_STATE_DFS ==
-		     wlan_reg_get_5g_bonded_channel_state(wma->pdev,
-			     req->chan, CH_WIDTH_80MHZ)) &&
-		    (CHANNEL_STATE_DFS == wlan_reg_get_5g_bonded_channel_state(
-			wma->pdev, ext_channel - WMA_80MHZ_START_CENTER_CH_DIFF,
-			    CH_WIDTH_80MHZ)))
-			dfs_ic->ic_curchan->ic_80p80_both_dfs = true;
-		break;
-	case CH_WIDTH_160MHZ:
-		dfs_ic->ic_curchan->ic_flags |=
-					IEEE80211_CHAN_VHT160;
-		break;
-	default:
-		WMA_LOGE(
-		    "%s: Recieved a wrong channel width %d",
-		    __func__, req->chan_width);
-		break;
-	}
-
-	dfs_ic->ic_curchan->ic_flagext |= IEEE80211_CHAN_DFS;
-
-	if (req->oper_mode == BSS_OPERATIONAL_MODE_AP) {
-		dfs_ic->ic_opmode = IEEE80211_M_HOSTAP;
-		dfs_ic->vdev_id = req->vdev_id;
-	}
-
-	dfs_ic->dfs_pri_multiplier = req->dfs_pri_multiplier;
-
-	/*
-	 * Configuring the DFS with current channel and the radar filters
-	 */
-	wma_dfs_configure(dfs_ic);
-	WMA_LOGI("%s: DFS- CHANNEL CONFIGURED", __func__);
-	return dfs_ic->ic_curchan;
-}
-
-
-/**
- * wma_set_dfs_region() - set DFS region
- * @wma: wma handle
- *
- * Configure the DFS region for DFS radar filter initialization
- *
- * Return: none
- */
-void wma_set_dfs_region(tp_wma_handle wma, enum dfs_reg dfs_region)
-{
-	if (dfs_region >= DFS_UNDEF_REG ||
-	    dfs_region == DFS_UNINIT_REG)
-
-		/* assign DFS_FCC_REGION as default region*/
-		wma->dfs_ic->current_dfs_regdomain = DFS_FCC_REG;
-	else
-		wma->dfs_ic->current_dfs_regdomain = dfs_region;
-
-	WMA_LOGI("%s: DFS Region Domain: %d", __func__,
-			 wma->dfs_ic->current_dfs_regdomain);
-}
-
-/**
- * wma_get_channels() - prepare dfs radar channel list
- * @ichan: channel
- * @chan_list: return channel list
- *
- * Return: return number of channels
- */
-static int wma_get_channels(tp_wma_handle wma,
-		struct dfs_ieee80211_channel *ichan,
-		struct wma_dfs_radar_channel_list *chan_list)
-{
-	uint8_t center_chan = cds_freq_to_chan(ichan->ic_vhtop_ch_freq_seg1);
-	int count = 0;
-	int start_channel = 0;
-	int loop;
-
-	chan_list->nchannels = 0;
-
-	if (IEEE80211_IS_CHAN_11AC_VHT160(ichan)) {
-
-		/*
-		 * as per the latest draft for BSS bandwidth 160MHz,
-		 * channel frequency segment 2 represents the center
-		 * channel frequency.
-		 */
-		if (ichan->ic_vhtop_ch_freq_seg2)
-			center_chan =
-				cds_freq_to_chan(ichan->ic_vhtop_ch_freq_seg2);
-		/*
-		 * In 160MHz channel width, need to
-		 * check if each of the 8 20MHz channel
-		 * is DFS before adding to the NOL list.
-		 * As it is possible that part of the
-		 * 160MHz can be Non-DFS channels.
-		 */
-		start_channel = center_chan - WMA_160MHZ_START_CENTER_CH_DIFF;
-		for (loop = 0; loop < WMA_DFS_MAX_20M_SUB_CH; loop++) {
-			if (wlan_reg_get_channel_state(wma->pdev,
-						start_channel +
-				    (loop * WMA_NEXT_20MHZ_START_CH_DIFF)) ==
-							CHANNEL_STATE_DFS) {
-				chan_list->channels[count] = start_channel +
-					(loop * WMA_NEXT_20MHZ_START_CH_DIFF);
-				count++;
-			}
-		}
-		chan_list->nchannels = count;
-	} else if (IEEE80211_IS_CHAN_11AC_VHT80P80(ichan)) {
-		chan_list->nchannels = 4;
-		/*
-		 * If SAP is operating in 80p80 mode, either
-		 * one of the two 80 segments or both the 80
-		 * segments can be DFS channels, so need to
-		 * identify on which 80 segment radar has
-		 * been detected and only add those channels
-		 * to the NOL list. center frequency should be
-		 * based on the segment id passed as part of
-		 * channel information in radar indication.
-		 */
-		if (ichan->ic_radar_found_segid == DFS_80P80_SEG1)
-			center_chan =
-				cds_freq_to_chan(ichan->ic_vhtop_ch_freq_seg2);
-		chan_list->channels[0] = center_chan - 6;
-		chan_list->channels[1] = center_chan - 2;
-		chan_list->channels[2] = center_chan + 2;
-		chan_list->channels[3] = center_chan + 6;
-	} else if (IEEE80211_IS_CHAN_11AC_VHT80(ichan)) {
-		chan_list->nchannels = 4;
-		chan_list->channels[0] = center_chan - 6;
-		chan_list->channels[1] = center_chan - 2;
-		chan_list->channels[2] = center_chan + 2;
-		chan_list->channels[3] = center_chan + 6;
-	} else if (IEEE80211_IS_CHAN_11N_HT40(ichan) ||
-		   IEEE80211_IS_CHAN_11AC_VHT40(ichan)) {
-		chan_list->nchannels = 2;
-		chan_list->channels[0] = center_chan - 2;
-		chan_list->channels[1] = center_chan + 2;
-	} else {
-		chan_list->nchannels = 1;
-		chan_list->channels[0] = center_chan;
-	}
-
-	return chan_list->nchannels;
-}
-
-
-/**
- * wma_dfs_indicate_radar() - Indicate Radar to SAP/HDD
- * @ic: ieee80211com ptr
- * @ichan: ieee 80211 channel
- *
- * Return: 0 for success or error code
- */
-int wma_dfs_indicate_radar(struct ieee80211com *ic,
-			   struct dfs_ieee80211_channel *ichan)
-{
-	tp_wma_handle wma;
-	void *hdd_ctx;
-	struct wma_dfs_radar_indication *radar_event;
-	struct wma_dfs_radar_ind wma_radar_event;
-	tpAniSirGlobal pmac = NULL;
-	bool indication_status;
-
-	wma = cds_get_context(QDF_MODULE_ID_WMA);
-	if (wma == NULL) {
-		WMA_LOGE("%s: DFS- Invalid wma", __func__);
-		return -ENOENT;
-	}
-
-	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	pmac = (tpAniSirGlobal)
-		cds_get_context(QDF_MODULE_ID_PE);
-
-	if (!pmac) {
-		WMA_LOGE("%s: Invalid MAC handle", __func__);
-		return -ENOENT;
-	}
-
-	if (wma->dfs_ic != ic) {
-		WMA_LOGE("%s:DFS- Invalid WMA handle", __func__);
-		return -ENOENT;
-	}
-
-	/*
-	 * Do not post multiple Radar events on the same channel.
-	 * But, when DFS test mode is enabled, allow multiple dfs
-	 * radar events to be posted on the same channel.
-	 */
-	qdf_spin_lock_bh(&ic->chan_lock);
-	if (!pmac->sap.SapDfsInfo.disable_dfs_ch_switch)
-		wma->dfs_ic->disable_phy_err_processing = true;
-
-	if ((ichan->ic_ieee != (wma->dfs_ic->last_radar_found_chan)) ||
-	    (pmac->sap.SapDfsInfo.disable_dfs_ch_switch == true)) {
-		radar_event = (struct wma_dfs_radar_indication *)
-			qdf_mem_malloc(sizeof(struct wma_dfs_radar_indication));
-		if (radar_event == NULL) {
-			WMA_LOGE(FL("Failed to allocate memory for radar_event"));
-			qdf_spin_unlock_bh(&ic->chan_lock);
-			return -ENOMEM;
-		}
-		wma->dfs_ic->last_radar_found_chan = ichan->ic_ieee;
-		/* Indicate the radar event to HDD to stop the netif Tx queues */
-		wma_radar_event.chan_freq = ichan->ic_freq;
-		wma_radar_event.dfs_radar_status = WMA_DFS_RADAR_FOUND;
-		indication_status =
-			wma->dfs_radar_indication_cb(hdd_ctx, &wma_radar_event);
-		if (indication_status == false) {
-			WMA_LOGE("%s:Application triggered channel switch in progress!.. drop radar event indiaction to SAP",
-				__func__);
-			qdf_mem_free(radar_event);
-			qdf_spin_unlock_bh(&ic->chan_lock);
-			return 0;
-		}
-
-		WMA_LOGE("%s:DFS- RADAR INDICATED TO HDD", __func__);
-
-		wma_radar_event.ieee_chan_number = ichan->ic_ieee;
-		/*
-		 * Indicate to the radar event to SAP to
-		 * select a new channel and set CSA IE
-		 */
-		radar_event->vdev_id = ic->vdev_id;
-		wma_get_channels(wma, ichan, &radar_event->chan_list);
-		radar_event->dfs_radar_status = WMA_DFS_RADAR_FOUND;
-		radar_event->use_nol = ic->ic_dfs_usenol(ic);
-		wma_send_msg(wma, WMA_DFS_RADAR_IND, (void *)radar_event, 0);
-		WMA_LOGE("%s:DFS- WMA_DFS_RADAR_IND Message Posted", __func__);
-	}
-	qdf_spin_unlock_bh(&ic->chan_lock);
-
-	return 0;
-}
-
 #ifdef WLAN_FEATURE_MEMDUMP
 /*
  * wma_process_fw_mem_dump_req() - Function to request fw memory dump from

+ 0 - 69
core/wma/src/wma_main.c

@@ -69,7 +69,6 @@
 #include "csr_api.h"
 #include "ol_fw.h"
 
-#include "dfs.h"
 #include "wma_internal.h"
 
 #include "wma_ocb.h"
@@ -728,44 +727,6 @@ static int32_t wma_set_priv_cfg(tp_wma_handle wma_handle,
 			txSPEndInactivityTime);
 	}
 		break;
-	case WMA_VDEV_DFS_CONTROL_CMDID:
-	{
-		struct ieee80211com *dfs_ic = wma_handle->dfs_ic;
-		struct ath_dfs *dfs;
-
-		if (!dfs_ic) {
-			ret = -ENOENT;
-		} else {
-			if (dfs_ic->ic_curchan) {
-				WMA_LOGD("%s: Debug cmd: %s received on ch: %d",
-					__func__, "WMA_VDEV_DFS_CONTROL_CMDID",
-					dfs_ic->ic_curchan->ic_ieee);
-
-				if (dfs_ic->ic_curchan->ic_flagext &
-				    IEEE80211_CHAN_DFS) {
-					dfs = (struct ath_dfs *)dfs_ic->ic_dfs;
-					dfs->dfs_bangradar = 1;
-					dfs->ath_radar_tasksched = 1;
-					OS_SET_TIMER(&dfs->ath_dfs_task_timer,
-						     0);
-				} else {
-					ret = -ENOENT;
-				}
-			} else {
-				ret = -ENOENT;
-			}
-		}
-
-		if (ret == -ENOENT) {
-			WMA_LOGE("%s: Operating channel is not DFS capable,ignoring %s",
-				  __func__, "WMA_VDEV_DFS_CONTROL_CMDID");
-		} else if (ret) {
-			WMA_LOGE("%s: Sending command %s failed with %d\n",
-				__func__, "WMA_VDEV_DFS_CONTROL_CMDID",
-				ret);
-		}
-	}
-		break;
 	case WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS:
 	{
 		wma_handle->wma_ibss_power_save_params.ibssPsWarmupTime =
@@ -2096,14 +2057,12 @@ static int wma_flush_complete_evt_handler(void *handle,
  * @psoc: Psoc pointer
  * @cds_context:  cds context
  * @wma_tgt_cfg_cb: tgt config callback fun
- * @radar_ind_cb: dfs radar indication callback
  * @cds_cfg:  mac parameters
  *
  * Return: 0 on success, errno on failure
  */
 QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, void *cds_context,
 		    wma_tgt_cfg_cb tgt_cfg_cb,
-		    wma_dfs_radar_indication_cb radar_ind_cb,
 		    struct cds_config_info *cds_cfg)
 {
 	tp_wma_handle wma_handle;
@@ -2218,12 +2177,6 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, void *cds_context,
 	wma_handle->tx_chain_mask_cck = cds_cfg->tx_chain_mask_cck;
 	wma_handle->self_gen_frm_pwr = cds_cfg->self_gen_frm_pwr;
 
-	/* Allocate dfs_ic and initialize DFS */
-	wma_handle->dfs_ic = wma_dfs_attach(wma_handle->dfs_ic);
-	if (wma_handle->dfs_ic == NULL) {
-		WMA_LOGE("%s: Memory allocation failed for dfs_ic", __func__);
-		goto err_wmi_handle;
-	}
 #if defined(QCA_WIFI_FTM)
 	if (cds_get_conparam() == QDF_GLOBAL_FTM_MODE)
 		wma_utf_attach(wma_handle);
@@ -2266,13 +2219,6 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, void *cds_context,
 	wma_handle->is_lpass_enabled = cds_cfg->is_lpass_enabled;
 #endif
 	wma_set_nan_enable(wma_handle, cds_cfg);
-	/*
-	 * Indicates if DFS Phyerr filtering offload
-	 * is Enabled/Disabed from ini
-	 */
-	wma_handle->dfs_phyerr_filter_offload =
-		cds_cfg->dfs_phyerr_filter_offload;
-	wma_handle->dfs_pri_multiplier = cds_cfg->dfs_pri_multiplier;
 	wma_handle->interfaces = qdf_mem_malloc(sizeof(struct wma_txrx_node) *
 						wma_handle->max_bssid);
 	if (!wma_handle->interfaces) {
@@ -2294,7 +2240,6 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, void *cds_context,
 					WMA_RX_SERIALIZER_CTX);
 
 	wma_handle->tgt_cfg_update_cb = tgt_cfg_cb;
-	wma_handle->dfs_radar_indication_cb = radar_ind_cb;
 	wma_handle->old_hw_mode_index = WMA_DEFAULT_HW_MODE_INDEX;
 	wma_handle->new_hw_mode_index = WMA_DEFAULT_HW_MODE_INDEX;
 	wma_handle->saved_chan.num_channels = 0;
@@ -2419,12 +2364,6 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, void *cds_context,
 					   wma_oem_data_response_handler,
 					   WMA_RX_SERIALIZER_CTX);
 #endif /* FEATURE_OEM_DATA_SUPPORT */
-	/*
-	 * Register appropriate DFS phyerr event handler for
-	 * Phyerror events. Handlers differ for phyerr filtering
-	 * offload enable and disable cases.
-	 */
-	wma_register_dfs_event_handler(wma_handle);
 
 	/* Register peer change event handler */
 	wmi_unified_register_event_handler(wma_handle->wmi_handle,
@@ -2599,11 +2538,9 @@ err_event_init:
 					     WMI_DEBUG_PRINT_EVENTID);
 	qdf_mem_free(wma_handle->interfaces);
 err_scn_context:
-	wma_dfs_detach(wma_handle->dfs_ic);
 #if defined(QCA_WIFI_FTM)
 	wma_utf_detach(wma_handle);
 #endif /* QCA_WIFI_FTM */
-err_wmi_handle:
 	qdf_mem_free(((p_cds_contextType) cds_context)->cfg_ctx);
 	OS_FREE(wmi_handle);
 
@@ -3639,11 +3576,6 @@ QDF_STATUS wma_close(void *cds_ctx)
 		wma_utf_detach(wma_handle);
 #endif /* QCA_WIFI_FTM */
 
-	if (NULL != wma_handle->dfs_ic) {
-		wma_dfs_detach(wma_handle->dfs_ic);
-		wma_handle->dfs_ic = NULL;
-	}
-
 	if (NULL != wma_handle->pGetRssiReq) {
 		qdf_mem_free(wma_handle->pGetRssiReq);
 		wma_handle->pGetRssiReq = NULL;
@@ -4638,7 +4570,6 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info,
 			     sizeof(wma_handle->hw_bd_info));
 		WMA_LOGW("%s: Board version is unknown!", __func__);
 	}
-	wma_handle->dfs_ic->dfs_hw_bd_id = wma_handle->hw_bd_id;
 
 	/* TODO: Recheck below line to dump service ready event */
 	/* dbg_print_wmi_service_11ac(ev); */

+ 0 - 1
core/wma/src/wma_mgmt.c

@@ -61,7 +61,6 @@
 #include "dbglog_host.h"
 #include "csr_api.h"
 #include "ol_fw.h"
-#include "dfs.h"
 #include "wma_internal.h"
 #include "wlan_policy_mgr_api.h"
 #include "cdp_txrx_flow_ctrl_legacy.h"

+ 0 - 1
core/wma/src/wma_power.c

@@ -60,7 +60,6 @@
 #include "csr_api.h"
 #include "ol_fw.h"
 
-#include "dfs.h"
 #include "wma_internal.h"
 
 /**

+ 0 - 1
core/wma/src/wma_scan_roam.c

@@ -66,7 +66,6 @@
 #include "csr_api.h"
 #include "ol_fw.h"
 
-#include "dfs.h"
 #include "wma_internal.h"
 #include "wlan_tgt_def_config.h"
 #include "wlan_reg_services_api.h"

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

@@ -61,7 +61,6 @@
 #include "csr_api.h"
 #include "ol_fw.h"
 
-#include "dfs.h"
 #include "wma_internal.h"
 #include "wlan_policy_mgr_api.h"
 #include "wmi_unified_param.h"

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików