ソースを参照

qcacld-3.0: Use mac_handle_t in wlan_hdd_hostapd

Change "qcacld-3.0: Introduce mac_handle_t" introduced a modern
name for what was previously called the tHalHandle. Transition
wlan_hdd_hostapd to use the new naming.

Change-Id: I63b3bc8017de7f73a09599f9e8c9ef41009d6bc6
CRs-Fixed: 2267151
Jeff Johnson 6 年 前
コミット
89a0c74c9b
2 ファイル変更99 行追加105 行削除
  1. 99 98
      core/hdd/src/wlan_hdd_hostapd.c
  2. 0 7
      core/hdd/src/wlan_hdd_hostapd.h

+ 99 - 98
core/hdd/src/wlan_hdd_hostapd.c

@@ -515,7 +515,7 @@ static int __hdd_hostapd_stop(struct net_device *dev)
 	clear_bit(DEVICE_IFACE_OPENED, &adapter->event_flags);
 
 	if (!hdd_is_cli_iface_up(hdd_ctx))
-		sme_scan_flush_result(hdd_ctx->hHal);
+		sme_scan_flush_result(hdd_ctx->mac_handle);
 
 	/* Stop all tx queues */
 	hdd_debug("Disabling queues");
@@ -632,19 +632,19 @@ QDF_STATUS hdd_set_sap_ht2040_mode(struct hdd_adapter *adapter,
 				   uint8_t channel_type)
 {
 	QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
-	void *hHal = NULL;
+	mac_handle_t mac_handle;
 
 	hdd_debug("change HT20/40 mode");
 
 	if (QDF_SAP_MODE == adapter->device_mode) {
-		hHal = WLAN_HDD_GET_HAL_CTX(adapter);
-		if (NULL == hHal) {
-			hdd_err("Hal ctx is null");
+		mac_handle = adapter->hdd_ctx->mac_handle;
+		if (!mac_handle) {
+			hdd_err("mac handle is null");
 			return QDF_STATUS_E_FAULT;
 		}
 		qdf_ret_status =
-			sme_set_ht2040_mode(hHal, adapter->session_id,
-					channel_type, true);
+			sme_set_ht2040_mode(mac_handle, adapter->session_id,
+					    channel_type, true);
 		if (qdf_ret_status == QDF_STATUS_E_FAILURE) {
 			hdd_err("Failed to change HT20/40 mode");
 			return QDF_STATUS_E_FAILURE;
@@ -816,10 +816,10 @@ QDF_STATUS hdd_chan_change_notify(struct hdd_adapter *adapter,
 	struct cfg80211_chan_def chandef;
 	enum nl80211_channel_type channel_type;
 	uint32_t freq;
-	tHalHandle  hal = WLAN_HDD_GET_HAL_CTX(adapter);
+	mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle;
 
-	if (NULL == hal) {
-		hdd_err("hal is NULL");
+	if (!mac_handle) {
+		hdd_err("mac_handle is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -1614,6 +1614,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 	bool legacy_phymode;
 	tSap_StationDisassocCompleteEvent *disassoc_comp;
 	struct hdd_station_info *stainfo;
+	mac_handle_t mac_handle;
 
 	dev = context;
 	if (!dev) {
@@ -1653,8 +1654,9 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	mac_handle = hdd_ctx->mac_handle;
 	dfs_info.channel = ap_ctx->operating_channel;
-	sme_get_country_code(hdd_ctx->hHal, dfs_info.country_code, &cc_len);
+	sme_get_country_code(mac_handle, dfs_info.country_code, &cc_len);
 	staId = pSapEvent->sapevt.sapStartBssCompleteEvent.staId;
 
 	switch (sapEvent) {
@@ -1680,7 +1682,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 			pSapEvent->sapevt.sapStartBssCompleteEvent.status;
 
 		qdf_atomic_set(&adapter->dfs_radar_found, 0);
-		wlansap_get_dfs_ignore_cac(hdd_ctx->hHal, &ignoreCAC);
+		wlansap_get_dfs_ignore_cac(mac_handle, &ignoreCAC);
 
 		/* DFS requirement: DO NOT transmit during CAC. */
 		if ((CHANNEL_STATE_DFS !=
@@ -1711,7 +1713,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 			qdf_event_set(&hostapd_state->qdf_event);
 			goto stopbss;
 		} else {
-			sme_ch_avoid_update_req(hdd_ctx->hHal);
+			sme_ch_avoid_update_req(mac_handle);
 
 			ap_ctx->broadcast_sta_id =
 				pSapEvent->sapevt.sapStartBssCompleteEvent.staId;
@@ -1752,10 +1754,9 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 		/* Set default key index */
 		hdd_debug("default key index %hu", ap_ctx->wep_def_key_idx);
 
-		sme_roam_set_default_key_index(
-			WLAN_HDD_GET_HAL_CTX(adapter),
-			adapter->session_id,
-			ap_ctx->wep_def_key_idx);
+		sme_roam_set_default_key_index(mac_handle,
+					       adapter->session_id,
+					       ap_ctx->wep_def_key_idx);
 
 		/* Set group key / WEP key every time when BSS is restarted */
 		if (ap_ctx->group_key.keyLength) {
@@ -2544,13 +2545,13 @@ stopbss:
 	return QDF_STATUS_SUCCESS;
 }
 
-int hdd_softap_unpack_ie(tHalHandle halHandle,
-			 eCsrEncryptionType *pEncryptType,
-			 eCsrEncryptionType *mcEncryptType,
-			 eCsrAuthType *pAuthType,
-			 bool *pMFPCapable,
-			 bool *pMFPRequired,
-			 uint16_t gen_ie_len, uint8_t *gen_ie)
+static int hdd_softap_unpack_ie(mac_handle_t mac_handle,
+				eCsrEncryptionType *pEncryptType,
+				eCsrEncryptionType *mcEncryptType,
+				eCsrAuthType *pAuthType,
+				bool *pMFPCapable,
+				bool *pMFPRequired,
+				uint16_t gen_ie_len, uint8_t *gen_ie)
 {
 	uint32_t ret;
 	uint8_t *pRsnIe;
@@ -2558,7 +2559,7 @@ int hdd_softap_unpack_ie(tHalHandle halHandle,
 	tDot11fIERSN dot11RSNIE = {0};
 	tDot11fIEWPA dot11WPAIE = {0};
 
-	if (NULL == halHandle) {
+	if (NULL == mac_handle) {
 		hdd_err("Error haHandle returned NULL");
 		return -EINVAL;
 	}
@@ -2579,7 +2580,7 @@ int hdd_softap_unpack_ie(tHalHandle halHandle,
 		RSNIeLen = gen_ie_len - 2;
 		/* Unpack the RSN IE */
 		memset(&dot11RSNIE, 0, sizeof(tDot11fIERSN));
-		ret = sme_unpack_rsn_ie(halHandle, pRsnIe, RSNIeLen,
+		ret = sme_unpack_rsn_ie(mac_handle, pRsnIe, RSNIeLen,
 					&dot11RSNIE, false);
 		if (DOT11F_FAILED(ret)) {
 			hdd_err("unpack failed, ret: 0x%x", ret);
@@ -2620,7 +2621,7 @@ int hdd_softap_unpack_ie(tHalHandle halHandle,
 		RSNIeLen = gen_ie_len - (2 + 4);
 		/* Unpack the WPA IE */
 		memset(&dot11WPAIE, 0, sizeof(tDot11fIEWPA));
-		ret = dot11f_unpack_ie_wpa((tpAniSirGlobal) halHandle,
+		ret = dot11f_unpack_ie_wpa((tpAniSirGlobal) mac_handle,
 				     pRsnIe, RSNIeLen, &dot11WPAIE, false);
 		if (DOT11F_FAILED(ret)) {
 			hdd_err("unpack failed, ret: 0x%x", ret);
@@ -2797,7 +2798,7 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
 				uint8_t vdev_id, uint8_t *channel,
 				uint8_t *sec_ch)
 {
-	tHalHandle hal_handle;
+	mac_handle_t mac_handle;
 	struct hdd_ap_ctx *hdd_ap_ctx;
 	uint8_t intf_ch = 0;
 	struct hdd_context *hdd_ctx;
@@ -2834,11 +2835,11 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
 	}
 
 	hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);
-	hal_handle = WLAN_HDD_GET_HAL_CTX(ap_adapter);
 	hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(sta_adapter);
 
-	if (!hal_handle) {
-		hdd_err("hal_handle is NULL");
+	mac_handle = hdd_ctx->mac_handle;
+	if (!mac_handle) {
+		hdd_err("mac_handle is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -3256,7 +3257,7 @@ static __iw_softap_setparam(struct net_device *dev,
 			    union iwreq_data *wrqu, char *extra)
 {
 	struct hdd_adapter *adapter = (netdev_priv(dev));
-	tHalHandle hHal;
+	mac_handle_t mac_handle;
 	int *value = (int *)extra;
 	int sub_cmd = value[0];
 	int set_value = value[1];
@@ -3275,9 +3276,9 @@ static __iw_softap_setparam(struct net_device *dev,
 	if (0 != ret)
 		return ret;
 
-	hHal = WLAN_HDD_GET_HAL_CTX(adapter);
-	if (!hHal) {
-		hdd_err("Hal ctx is null");
+	mac_handle = hdd_ctx->mac_handle;
+	if (!mac_handle) {
+		hdd_err("mac handle is null");
 		return -EINVAL;
 	}
 
@@ -3285,7 +3286,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCASAP_SET_RADAR_DBG:
 		hdd_debug("QCASAP_SET_RADAR_DBG called with: value: %x",
 				set_value);
-		wlan_sap_enable_phy_error_logs(hHal, set_value);
+		wlan_sap_enable_phy_error_logs(mac_handle, set_value);
 		break;
 
 	case QCSAP_PARAM_CLR_ACL:
@@ -3343,8 +3344,9 @@ static __iw_softap_setparam(struct net_device *dev,
 				hdd_warn("Setting it to max allowed and continuing");
 				set_value = WNI_CFG_ASSOC_STA_LIMIT_STAMAX;
 			}
-			status = sme_cfg_set_int(hHal, WNI_CFG_ASSOC_STA_LIMIT,
-					set_value);
+			status = sme_cfg_set_int(mac_handle,
+						 WNI_CFG_ASSOC_STA_LIMIT,
+						 set_value);
 			if (status != QDF_STATUS_SUCCESS) {
 				hdd_err("setMaxAssoc failure, status: %d",
 				       status);
@@ -3357,7 +3359,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	{
 		QDF_STATUS status;
 
-		status = sme_update_session_param(hHal,
+		status = sme_update_session_param(mac_handle,
 				adapter->session_id,
 				SIR_PARAM_SSID_HIDDEN, set_value);
 		if (QDF_STATUS_SUCCESS != status) {
@@ -3380,7 +3382,7 @@ static __iw_softap_setparam(struct net_device *dev,
 		rateUpdate.mcastDataRate24GHzTxFlag = 1;
 		rateUpdate.mcastDataRate5GHz = set_value;
 		rateUpdate.bcastDataRate = -1;
-		status = sme_send_rate_update_ind(hHal, &rateUpdate);
+		status = sme_send_rate_update_ind(mac_handle, &rateUpdate);
 		if (QDF_STATUS_SUCCESS != status) {
 			hdd_err("SET_MC_RATE failed");
 			ret = -1;
@@ -3606,7 +3608,7 @@ static __iw_softap_setparam(struct net_device *dev,
 		 *
 		 * SGI is same for 20MHZ and 40MHZ.
 		 */
-		ret = sme_update_ht_config(hHal, adapter->session_id,
+		ret = sme_update_ht_config(mac_handle, adapter->session_id,
 					   WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ,
 					   set_value);
 		if (ret)
@@ -3706,7 +3708,7 @@ static __iw_softap_setparam(struct net_device *dev,
 	case QCASAP_SET_TM_LEVEL:
 	{
 		hdd_debug("Set Thermal Mitigation Level %d", set_value);
-		(void)sme_set_thermal_level(hHal, set_value);
+		(void)sme_set_thermal_level(mac_handle, set_value);
 		break;
 	}
 
@@ -3717,7 +3719,7 @@ static __iw_softap_setparam(struct net_device *dev,
 		if (adapter->device_mode != QDF_SAP_MODE)
 			return -EINVAL;
 
-		ret = wlansap_set_dfs_ignore_cac(hHal, set_value);
+		ret = wlansap_set_dfs_ignore_cac(mac_handle, set_value);
 		break;
 	}
 
@@ -3728,7 +3730,7 @@ static __iw_softap_setparam(struct net_device *dev,
 		if (adapter->device_mode != QDF_SAP_MODE)
 			return -EINVAL;
 
-		ret = wlansap_set_dfs_target_chnl(hHal, set_value);
+		ret = wlansap_set_dfs_target_chnl(mac_handle, set_value);
 		break;
 	}
 
@@ -3736,7 +3738,7 @@ static __iw_softap_setparam(struct net_device *dev,
 		if (adapter->device_mode != QDF_SAP_MODE)
 			return -EINVAL;
 
-		status = sme_set_he_bss_color(hHal, adapter->session_id,
+		status = sme_set_he_bss_color(mac_handle, adapter->session_id,
 				set_value);
 		if (QDF_STATUS_SUCCESS != status) {
 			hdd_err("SET_HE_BSS_COLOR failed");
@@ -3751,7 +3753,6 @@ static __iw_softap_setparam(struct net_device *dev,
 
 	case QCASAP_SET_RADAR_CMD:
 	{
-		struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 		struct hdd_ap_ctx *ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(adapter);
 		uint8_t ch = ap_ctx->operating_channel;
 		struct wlan_objmgr_pdev *pdev;
@@ -3828,15 +3829,10 @@ static __iw_softap_setparam(struct net_device *dev,
 	}
 
 	case QCASAP_SET_PHYMODE:
-	{
-		struct hdd_context *phddctx =
-			WLAN_HDD_GET_CTX(adapter);
-
-		ret =
-			wlan_hdd_update_phymode(dev, hHal, set_value,
-						phddctx);
+		ret = wlan_hdd_update_phymode(dev, mac_handle, set_value,
+					      hdd_ctx);
 		break;
-	}
+
 	case QCASAP_DUMP_STATS:
 	{
 		hdd_debug("QCASAP_DUMP_STATS val %d", set_value);
@@ -3845,8 +3841,6 @@ static __iw_softap_setparam(struct net_device *dev,
 	}
 	case QCASAP_CLEAR_STATS:
 	{
-		struct hdd_context *hdd_ctx =
-			WLAN_HDD_GET_CTX(adapter);
 		void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 		hdd_debug("QCASAP_CLEAR_STATS val %d", set_value);
@@ -4013,7 +4007,6 @@ static __iw_softap_getparam(struct net_device *dev,
 			    union iwreq_data *wrqu, char *extra)
 {
 	struct hdd_adapter *adapter = (netdev_priv(dev));
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(adapter);
 	int *value = (int *)extra;
 	int sub_cmd = value[0];
 	QDF_STATUS status;
@@ -4033,8 +4026,9 @@ static __iw_softap_getparam(struct net_device *dev,
 
 	switch (sub_cmd) {
 	case QCSAP_PARAM_MAX_ASSOC:
-		status = sme_cfg_get_int(hHal, WNI_CFG_ASSOC_STA_LIMIT,
-					(uint32_t *) value);
+		status = sme_cfg_get_int(hdd_ctx->mac_handle,
+					 WNI_CFG_ASSOC_STA_LIMIT,
+					 (uint32_t *)value);
 		if (QDF_STATUS_SUCCESS != status) {
 			hdd_err("get WNI_CFG_ASSOC_STA_LIMIT failed status: %d",
 				status);
@@ -4391,7 +4385,6 @@ static __iw_softap_set_max_tx_power(struct net_device *dev,
 {
 	struct hdd_adapter *adapter = (netdev_priv(dev));
 	struct hdd_context *hdd_ctx;
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(adapter);
 	int *value = (int *)extra;
 	int set_value;
 	int ret;
@@ -4418,7 +4411,8 @@ static __iw_softap_set_max_tx_power(struct net_device *dev,
 
 	set_value = value[0];
 	if (QDF_STATUS_SUCCESS !=
-	    sme_set_max_tx_power(hHal, bssid, selfMac, set_value)) {
+	    sme_set_max_tx_power(hdd_ctx->mac_handle, bssid,
+				 selfMac, set_value)) {
 		hdd_err("Setting maximum tx power failed");
 		return -EIO;
 	}
@@ -4495,7 +4489,6 @@ static __iw_softap_set_tx_power(struct net_device *dev,
 				union iwreq_data *wrqu, char *extra)
 {
 	struct hdd_adapter *adapter = (netdev_priv(dev));
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(adapter);
 	struct hdd_context *hdd_ctx;
 	int *value = (int *)extra;
 	int set_value;
@@ -4517,7 +4510,7 @@ static __iw_softap_set_tx_power(struct net_device *dev,
 
 	set_value = value[0];
 	if (QDF_STATUS_SUCCESS !=
-	    sme_set_tx_power(hHal, adapter->session_id, bssid,
+	    sme_set_tx_power(hdd_ctx->mac_handle, adapter->session_id, bssid,
 			     adapter->device_mode, set_value)) {
 		hdd_err("Setting tx power failed");
 		return -EIO;
@@ -4775,7 +4768,6 @@ static int __iw_get_channel_list(struct net_device *dev,
 	uint8_t band_start_channel = CHAN_ENUM_1;
 	uint8_t band_end_channel = CHAN_ENUM_184;
 	struct hdd_adapter *hostapd_adapter = (netdev_priv(dev));
-	tHalHandle hal = WLAN_HDD_GET_HAL_CTX(hostapd_adapter);
 	struct channel_list_info *channel_list =
 					(struct channel_list_info *) extra;
 	enum band_info cur_band = BAND_ALL;
@@ -4794,7 +4786,8 @@ static int __iw_get_channel_list(struct net_device *dev,
 	if (0 != ret)
 		return ret;
 
-	if (QDF_STATUS_SUCCESS != sme_get_freq_band(hal, &cur_band)) {
+	if (QDF_STATUS_SUCCESS != sme_get_freq_band(hdd_ctx->mac_handle,
+						    &cur_band)) {
 		hdd_err("not able get the current frequency band");
 		return -EIO;
 	}
@@ -6063,7 +6056,7 @@ QDF_STATUS hdd_init_ap_mode(struct hdd_adapter *adapter, bool reinit)
 	/* Allocate the Wireless Extensions state structure */
 	phostapdBuf = WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter);
 
-	sme_set_curr_device_mode(hdd_ctx->hHal, adapter->device_mode);
+	sme_set_curr_device_mode(hdd_ctx->mac_handle, adapter->device_mode);
 
 	/* Zero the memory.  This zeros the profile structure. */
 	memset(phostapdBuf, 0, sizeof(struct hdd_hostapd_state));
@@ -6318,12 +6311,14 @@ static bool wlan_hdd_get_sap_obss(struct hdd_adapter *adapter)
 	tDot11fIEHTCaps dot11_ht_cap_ie = {0};
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	struct hdd_beacon_data *beacon = adapter->session.ap.beacon;
+	mac_handle_t mac_handle;
 
+	mac_handle = hdd_ctx->mac_handle;
 	ie = wlan_get_ie_ptr_from_eid(WLAN_EID_HT_CAPABILITY,
 					beacon->tail, beacon->tail_len);
 	if (ie && ie[1]) {
 		qdf_mem_copy(ht_cap_ie, &ie[2], DOT11F_IE_HTCAPS_MAX_LEN);
-		ret = dot11f_unpack_ie_ht_caps((tpAniSirGlobal)hdd_ctx->hHal,
+		ret = dot11f_unpack_ie_ht_caps((tpAniSirGlobal)mac_handle,
 					       ht_cap_ie, ie[1],
 					       &dot11_ht_cap_ie, false);
 		if (DOT11F_FAILED(ret)) {
@@ -6361,13 +6356,12 @@ int wlan_hdd_set_channel(struct wiphy *wiphy,
 	int channel_seg2 = 0;
 	struct hdd_context *hdd_ctx;
 	int status;
-
+	mac_handle_t mac_handle;
 	tSmeConfigParams *sme_config;
 	tsap_config_t *sap_config;
 
 	hdd_enter();
 
-
 	if (NULL == dev) {
 		hdd_err("Called with dev = NULL");
 		return -ENODEV;
@@ -6387,6 +6381,7 @@ int wlan_hdd_set_channel(struct wiphy *wiphy,
 	if (status)
 		return status;
 
+	mac_handle = hdd_ctx->mac_handle;
 
 	/*
 	 * Do freq to chan conversion
@@ -6487,7 +6482,7 @@ int wlan_hdd_set_channel(struct wiphy *wiphy,
 				hdd_err("Unable to allocate memory for smeconfig!");
 				return -ENOMEM;
 			}
-			sme_get_config_param(hdd_ctx->hHal, sme_config);
+			sme_get_config_param(mac_handle, sme_config);
 			switch (channel_type) {
 			case NL80211_CHAN_HT20:
 			case NL80211_CHAN_NO_HT:
@@ -6508,7 +6503,7 @@ int wlan_hdd_set_channel(struct wiphy *wiphy,
 			sme_config->csrConfig.obssEnabled =
 				wlan_hdd_get_sap_obss(adapter);
 
-			sme_update_config(hdd_ctx->hHal, sme_config);
+			sme_update_config(mac_handle, sme_config);
 			qdf_mem_free(sme_config);
 		}
 	} else {
@@ -6894,6 +6889,7 @@ int wlan_hdd_cfg80211_update_apies(struct hdd_adapter *adapter)
 	struct hdd_beacon_data *beacon = NULL;
 	uint16_t proberesp_ies_len;
 	uint8_t *proberesp_ies = NULL;
+	mac_handle_t mac_handle;
 
 	pConfig = &adapter->session.ap.sap_config;
 	beacon = adapter->session.ap.beacon;
@@ -6907,6 +6903,8 @@ int wlan_hdd_cfg80211_update_apies(struct hdd_adapter *adapter)
 	if (genie == NULL)
 		return -ENOMEM;
 
+	mac_handle = adapter->hdd_ctx->mac_handle;
+
 	wlan_hdd_add_extra_ie(adapter, genie, &total_ielen,
 			      WLAN_EID_VHT_TX_POWER_ENVELOPE);
 
@@ -6945,7 +6943,7 @@ int wlan_hdd_cfg80211_update_apies(struct hdd_adapter *adapter)
 		updateIE.pAdditionIEBuffer = genie;
 		updateIE.append = false;
 		updateIE.notify = true;
-		if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(adapter),
+		if (sme_update_add_ie(mac_handle,
 				      &updateIE,
 				      eUPDATE_IE_PROBE_BCN) ==
 		    QDF_STATUS_E_FAILURE) {
@@ -6982,7 +6980,7 @@ int wlan_hdd_cfg80211_update_apies(struct hdd_adapter *adapter)
 		updateIE.pAdditionIEBuffer = proberesp_ies;
 		updateIE.append = false;
 		updateIE.notify = false;
-		if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(adapter),
+		if (sme_update_add_ie(mac_handle,
 				      &updateIE,
 				      eUPDATE_IE_PROBE_RESP) ==
 		    QDF_STATUS_E_FAILURE) {
@@ -7004,7 +7002,7 @@ int wlan_hdd_cfg80211_update_apies(struct hdd_adapter *adapter)
 		updateIE.pAdditionIEBuffer = (uint8_t *) beacon->assocresp_ies;
 		updateIE.append = false;
 		updateIE.notify = false;
-		if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(adapter),
+		if (sme_update_add_ie(mac_handle,
 				      &updateIE,
 				      eUPDATE_IE_ASSOC_RESP) ==
 		    QDF_STATUS_E_FAILURE) {
@@ -7095,21 +7093,21 @@ static void wlan_hdd_set_sap_hwmode(struct hdd_adapter *adapter)
  *
  * Return: The QDF_STATUS code associated with performing the operation.
  */
-QDF_STATUS wlan_hdd_config_acs(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter)
+QDF_STATUS wlan_hdd_config_acs(struct hdd_context *hdd_ctx,
+			       struct hdd_adapter *adapter)
 {
 	tsap_config_t *sap_config;
 	struct hdd_config *ini_config;
-	tHalHandle hal;
+	mac_handle_t mac_handle;
 
-	hal = WLAN_HDD_GET_HAL_CTX(adapter);
+	mac_handle = hdd_ctx->mac_handle;
 	sap_config = &adapter->session.ap.sap_config;
 	ini_config = hdd_ctx->config;
 
 	sap_config->enOverLapCh = !!hdd_ctx->config->gEnableOverLapCh;
 
 #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
-	hdd_debug("HDD_ACS_SKIP_STATUS = %d",
-						hdd_ctx->skip_acs_scan_status);
+	hdd_debug("HDD_ACS_SKIP_STATUS = %d", hdd_ctx->skip_acs_scan_status);
 	if (hdd_ctx->skip_acs_scan_status == eSAP_SKIP_ACS_SCAN) {
 		struct hdd_adapter *con_sap_adapter;
 		tsap_config_t *con_sap_config = NULL;
@@ -7138,11 +7136,11 @@ QDF_STATUS wlan_hdd_config_acs(struct hdd_context *hdd_ctx, struct hdd_adapter *
 			cur_sap_st_ch = sap_config->acs_cfg.start_ch;
 			cur_sap_end_ch = sap_config->acs_cfg.end_ch;
 
-			wlansap_extend_to_acs_range(hal, &cur_sap_st_ch,
+			wlansap_extend_to_acs_range(mac_handle, &cur_sap_st_ch,
 					&cur_sap_end_ch, &bandStartChannel,
 					&bandEndChannel);
 
-			wlansap_extend_to_acs_range(hal,
+			wlansap_extend_to_acs_range(mac_handle,
 					&con_sap_st_ch, &con_sap_end_ch,
 					&bandStartChannel, &bandEndChannel);
 
@@ -7337,7 +7335,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 	int qdf_status = QDF_STATUS_SUCCESS;
 	tpWLAN_SAPEventCB pSapEventCallback;
 	struct hdd_hostapd_state *hostapd_state;
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(adapter);
+	mac_handle_t mac_handle;
 	struct qc_mac_acl_entry *acl_entry = NULL;
 	int32_t i;
 	struct hdd_config *iniConfig;
@@ -7391,7 +7389,8 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 	 * sme_is_any_session_in_middle_of_roaming is for LFR2 and
 	 * hdd_is_roaming_in_progress is for LFR3
 	 */
-	if (sme_is_any_session_in_middle_of_roaming(hdd_ctx->hHal) ||
+	mac_handle = hdd_ctx->mac_handle;
+	if (sme_is_any_session_in_middle_of_roaming(mac_handle) ||
 	    hdd_is_roaming_in_progress(hdd_ctx)) {
 		hdd_info("Reassociation in progress");
 		return -EINVAL;
@@ -7417,7 +7416,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 	if (iniConfig->force_ssc_disable_indoor_channel) {
 		hdd_update_indoor_channel(hdd_ctx, true);
 		if (QDF_IS_STATUS_ERROR(
-		    sme_update_channel_list(hdd_ctx->hHal))) {
+		    sme_update_channel_list(mac_handle))) {
 			hdd_update_indoor_channel(hdd_ctx, false);
 			hdd_err("Can't start BSS: update channel list failed");
 			ret = -EINVAL;
@@ -7538,13 +7537,13 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 				goto error;
 			}
 		}
-		wlansap_set_dfs_ignore_cac(hHal, iniConfig->ignoreCAC);
-		wlansap_set_dfs_restrict_japan_w53(hHal,
+		wlansap_set_dfs_ignore_cac(mac_handle, iniConfig->ignoreCAC);
+		wlansap_set_dfs_restrict_japan_w53(mac_handle,
 			iniConfig->gDisableDfsJapanW53);
-		wlansap_set_dfs_preferred_channel_location(hHal,
+		wlansap_set_dfs_preferred_channel_location(mac_handle,
 			iniConfig->gSapPreferredChanLocation);
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
-		wlan_sap_set_channel_avoidance(hHal,
+		wlan_sap_set_channel_avoidance(mac_handle,
 					iniConfig->sap_channel_avoidance);
 #endif
 	} else if (adapter->device_mode == QDF_P2P_GO_MODE) {
@@ -7555,7 +7554,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 		pConfig->ieee80211d = 0;
 	}
 
-	wlansap_set_tx_leakage_threshold(hHal,
+	wlansap_set_tx_leakage_threshold(mac_handle,
 		iniConfig->sap_tx_leakage_threshold);
 
 	capab_info = pMgmt_frame->u.beacon.capab_info;
@@ -7847,7 +7846,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 	}
 
 	qdf_mem_zero(sme_config, sizeof(*sme_config));
-	sme_get_config_param(hdd_ctx->hHal, sme_config);
+	sme_get_config_param(mac_handle, sme_config);
 	/* Override hostapd.conf wmm_enabled only for 11n and 11AC configs (IOT)
 	 * As per spec 11N/AC STA are QOS STA and may not connect or throughput
 	 * may not be good with non QOS 11N AP
@@ -7860,7 +7859,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 		pConfig->SapHw_mode == eCSR_DOT11_MODE_11g ||
 		pConfig->SapHw_mode == eCSR_DOT11_MODE_11b))
 		sme_config->csrConfig.WMMSupportMode = eCsrRoamWmmNoQos;
-	sme_update_config(hdd_ctx->hHal, sme_config);
+	sme_update_config(mac_handle, sme_config);
 
 	if (!((adapter->device_mode == QDF_SAP_MODE) &&
 	     (hdd_ctx->config->sap_force_11n_for_11ac)) ||
@@ -8005,7 +8004,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 
 		hdd_err("qdf wait for single_event failed!!");
 		hdd_set_connection_in_progress(false);
-		sme_get_command_q_status(hHal);
+		sme_get_command_q_status(mac_handle);
 		wlansap_stop_bss(WLAN_HDD_GET_SAP_CTX_PTR(adapter));
 		QDF_ASSERT(0);
 		ret = -EINVAL;
@@ -8044,7 +8043,7 @@ error:
 	/* Revert the indoor to passive marking if START BSS fails */
 	if (iniConfig->force_ssc_disable_indoor_channel) {
 		hdd_update_indoor_channel(hdd_ctx, false);
-		sme_update_channel_list(hdd_ctx->hHal);
+		sme_update_channel_list(mac_handle);
 	}
 	clear_bit(SOFTAP_INIT_DONE, &adapter->event_flags);
 	qdf_atomic_set(&adapter->session.ap.acs_in_progress, 0);
@@ -8101,6 +8100,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 	tSirUpdateIE updateIE;
 	struct hdd_beacon_data *old;
 	int ret;
+	mac_handle_t mac_handle;
 
 	hdd_enter();
 
@@ -8227,7 +8227,8 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 	}
 	mutex_unlock(&hdd_ctx->sap_lock);
 
-	if (wlan_sap_is_pre_cac_active(hdd_ctx->hHal))
+	mac_handle = hdd_ctx->mac_handle;
+	if (wlan_sap_is_pre_cac_active(mac_handle))
 		hdd_clean_up_pre_cac_interface(hdd_ctx);
 
 	if (status != QDF_STATUS_SUCCESS) {
@@ -8241,13 +8242,13 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 	updateIE.pAdditionIEBuffer = NULL;
 	updateIE.append = true;
 	updateIE.notify = true;
-	if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(adapter),
+	if (sme_update_add_ie(mac_handle,
 			      &updateIE,
 			      eUPDATE_IE_PROBE_BCN) == QDF_STATUS_E_FAILURE) {
 		hdd_err("Could not pass on PROBE_RSP_BCN data to PE");
 	}
 
-	if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(adapter),
+	if (sme_update_add_ie(mac_handle,
 			      &updateIE,
 			      eUPDATE_IE_ASSOC_RESP) == QDF_STATUS_E_FAILURE) {
 		hdd_err("Could not pass on ASSOC_RSP data to PE");
@@ -8634,8 +8635,8 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 			sta_inactivity_timer->session_id = adapter->session_id;
 			sta_inactivity_timer->sta_inactivity_timeout =
 				params->inactivity_timeout;
-			sme_update_sta_inactivity_timeout(WLAN_HDD_GET_HAL_CTX
-					(adapter), sta_inactivity_timer);
+			sme_update_sta_inactivity_timeout(hdd_ctx->mac_handle,
+							  sta_inactivity_timer);
 			qdf_mem_free(sta_inactivity_timer);
 		}
 	}

+ 0 - 7
core/hdd/src/wlan_hdd_hostapd.h

@@ -110,13 +110,6 @@ QDF_STATUS hdd_softap_sta_deauth(struct hdd_adapter *adapter,
 		struct csr_del_sta_params *pDelStaParams);
 void hdd_softap_sta_disassoc(struct hdd_adapter *adapter,
 			     struct csr_del_sta_params *pDelStaParams);
-int hdd_softap_unpack_ie(tHalHandle halHandle,
-			 eCsrEncryptionType *pEncryptType,
-			 eCsrEncryptionType *mcEncryptType,
-			 eCsrAuthType *pAuthType,
-			 bool *pMFPCapable,
-			 bool *pMFPRequired,
-			 uint16_t gen_ie_len, uint8_t *gen_ie);
 
 QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 				    void *context);