Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76b9577f authored by Lincoln Tran's avatar Lincoln Tran Committed by snandini
Browse files

qcacld-3.0: Update from band_info to band bitmap

Currently the band_capabability from mlme_cfg is a bitmap over
reg_wifi_band. Update the checks so that it is compared with
a bitmap, instead of with band_info.

Change-Id: Ibad0231f1f6e5c555e6e5be5a5662fd26c549037
CRs-fixed: 2738440
parent 7ab7b027
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -859,7 +859,7 @@ static QDF_STATUS lim_send_tdls_dis_rsp_frame(struct mac_context *mac,
						       &tdlsDisRsp.SuppChannels,
						       &tdlsDisRsp.
						       SuppOperatingClasses);
		if (mac->mlme_cfg->gen.band_capability != BAND_2G) {
		if (mac->mlme_cfg->gen.band_capability != BIT(REG_BAND_2G)) {
			tdlsDisRsp.ht2040_bss_coexistence.present = 1;
			tdlsDisRsp.ht2040_bss_coexistence.info_request = 1;
		}
@@ -1228,7 +1228,7 @@ QDF_STATUS lim_send_tdls_link_setup_req_frame(struct mac_context *mac,
						     &tdlsSetupReq.SuppChannels,
						     &tdlsSetupReq.
						     SuppOperatingClasses);
		if (mac->mlme_cfg->gen.band_capability != BAND_2G) {
		if (mac->mlme_cfg->gen.band_capability != BIT(REG_BAND_2G)) {
			tdlsSetupReq.ht2040_bss_coexistence.present = 1;
			tdlsSetupReq.ht2040_bss_coexistence.info_request = 1;
		}
@@ -1681,7 +1681,7 @@ static QDF_STATUS lim_send_tdls_setup_rsp_frame(struct mac_context *mac,
						    &tdlsSetupRsp.SuppChannels,
						    &tdlsSetupRsp.
						    SuppOperatingClasses);
		if (mac->mlme_cfg->gen.band_capability != BAND_2G) {
		if (mac->mlme_cfg->gen.band_capability != BIT(REG_BAND_2G)) {
			tdlsSetupRsp.ht2040_bss_coexistence.present = 1;
			tdlsSetupRsp.ht2040_bss_coexistence.info_request = 1;
		}
+5 −4
Original line number Diff line number Diff line
@@ -808,16 +808,17 @@ struct csr_roamstruct {
 * the 2.4 GHz band, meaning. it is NOT operating in the 5.0 GHz band.
 */
#define CSR_IS_24_BAND_ONLY(mac) \
	(BAND_2G == (mac)->mlme_cfg->gen.band)
	(BIT(REG_BAND_2G) == (mac)->mlme_cfg->gen.band)

#define CSR_IS_5G_BAND_ONLY(mac) \
	(BAND_5G == (mac)->mlme_cfg->gen.band)
	(BIT(REG_BAND_5G) == (mac)->mlme_cfg->gen.band)

#define CSR_IS_RADIO_DUAL_BAND(mac) \
	(BAND_ALL == (mac)->mlme_cfg->gen.band_capability)
	((BIT(REG_BAND_2G) | BIT(REG_BAND_5G)) == \
		(mac)->mlme_cfg->gen.band_capability)

#define CSR_IS_RADIO_BG_ONLY(mac) \
	(BAND_2G == (mac)->mlme_cfg->gen.band_capability)
	(BIT(REG_BAND_2G) == (mac)->mlme_cfg->gen.band_capability)

/*
 * this function returns true if the NIC is operating exclusively in the 5.0 GHz
+7 −5
Original line number Diff line number Diff line
@@ -18252,6 +18252,7 @@ csr_populate_roam_chan_list(struct mac_context *mac_ctx,
			    tCsrChannelInfo *src)
{
	enum band_info band;
	uint32_t band_cap;
	uint8_t i = 0;
	uint8_t num_channels = 0;
	uint32_t *freq_lst = src->freq_list;
@@ -18260,15 +18261,16 @@ csr_populate_roam_chan_list(struct mac_context *mac_ctx,
	 * The INI channels need to be filtered with respect to the current band
	 * that is supported.
	 */
	band = mac_ctx->mlme_cfg->gen.band_capability;
	if ((BAND_2G != band) && (BAND_5G != band)
	    && (BAND_ALL != band)) {
	band_cap = mac_ctx->mlme_cfg->gen.band_capability;
	if (!band_cap) {
		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
			 "Invalid band(%d), roam scan offload req aborted",
			  band);
			 "Invalid band_cap(%d), roam scan offload req aborted",
			  band_cap);
		return QDF_STATUS_E_FAILURE;
	}
	band = wlan_reg_band_bitmap_to_band_info(band_cap);
	num_channels = dst->ChannelCount;
	for (i = 0; i < src->numOfChannels; i++) {
		if (csr_is_channel_present_in_list(dst->chan_freq_cache,
+2 −8
Original line number Diff line number Diff line
@@ -1457,10 +1457,7 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma,
			break;
		case WMI_PDEV_PARAM_TXPOWER_LIMIT2G:
			wma->pdevconfig.txpow2g = privcmd->param_value;
			if ((mac->mlme_cfg->gen.band_capability ==
			     BAND_ALL) ||
			    (mac->mlme_cfg->gen.band_capability ==
			     BAND_2G))
			if (mac->mlme_cfg->gen.band_capability & BIT(REG_BAND_2G))
				mac->mlme_cfg->power.current_tx_power_level =
					(uint8_t)privcmd->param_value;
			else
@@ -1468,10 +1465,7 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma,
			break;
		case WMI_PDEV_PARAM_TXPOWER_LIMIT5G:
			wma->pdevconfig.txpow5g = privcmd->param_value;
			if ((mac->mlme_cfg->gen.band_capability ==
			     BAND_ALL) ||
			    (mac->mlme_cfg->gen.band_capability ==
			     BAND_5G))
			if (mac->mlme_cfg->gen.band_capability & BIT(REG_BAND_5G))
				mac->mlme_cfg->power.current_tx_power_level =
					(uint8_t)privcmd->param_value;
			else