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

Commit 4d2f99f7 authored by Jia Ding's avatar Jia Ding Committed by snandini
Browse files

qcacld-3.0: Intersect 40 MHz channel width in 2.4 GHz band

When sending WMI_VDEV_SET_IE_CMDID, do an intersection between
gChannelBondingMode24GHz and target capabilities for 40 MHz
channel width support and 20 MHz in 40 MHz HE PPDU in HE PHY
capabilities IE.

Change-Id: I9c2b3200f35fa6ffb11e5165cec64a23645241c3
CRs-Fixed: 2738040
parent 0aad826c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5401,6 +5401,7 @@ struct ppet_hdr {
#define HE_CH_WIDTH_COMBINE(b0, b1, b2, b3, b4, b5, b6)             \
	((uint8_t)(b0) | ((b1) << 1) | ((b2) << 2) |  ((b3) << 3) | \
	((b4) << 4) | ((b5) << 5) | ((b6) << 6))
#define HE_CH_WIDTH_CLR_BIT(ch_wd, bit)      (((ch_wd) >> (bit)) & ~1)

/*
 * MCS values are interpreted as in IEEE 11ax-D1.4 spec onwards
+30 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@
#include <wlan_scan_ucfg_api.h>
#include <wlan_blm_api.h>
#include <lim_assoc_utils.h>
#include "wlan_mlme_ucfg_api.h"

#define ASCII_SPACE_CHARACTER 0x20

@@ -7527,6 +7528,33 @@ void lim_set_he_caps(struct mac_context *mac, struct pe_session *session,
	}
}

static void lim_intersect_he_ch_width_2g(struct mac_context *mac,
					 struct he_capability_info *he_cap)
{
	struct wlan_objmgr_psoc *psoc;
	uint32_t cbm_24ghz;
	QDF_STATUS ret;

	psoc = mac->psoc;
	if (!psoc)
		return;

	ret = ucfg_mlme_get_channel_bonding_24ghz(psoc, &cbm_24ghz);
	if (QDF_IS_STATUS_ERROR(ret))
		return;

	pe_debug("channel bonding mode 2.4GHz %d", cbm_24ghz);

	if (!cbm_24ghz) {
		/* B0: 40Mhz channel width in the 2.4GHz band */
		he_cap->chan_width = HE_CH_WIDTH_CLR_BIT(he_cap->chan_width, 0);
		he_cap->he_ppdu_20_in_40Mhz_2G = 0;
	}

	pe_debug("HE cap: chan_width: 0x%07x he_ppdu_20_in_40Mhz_2G %d",
		 he_cap->chan_width, he_cap->he_ppdu_20_in_40Mhz_2G);
}

QDF_STATUS lim_send_he_caps_ie(struct mac_context *mac_ctx,
			       struct pe_session *session,
			       enum QDF_OPMODE device_mode,
@@ -7566,6 +7594,8 @@ QDF_STATUS lim_send_he_caps_ie(struct mac_context *mac_ctx,
		pe_err("Unable send HE Cap IE for 5GHZ band, status: %d",
			status_5g);

	lim_intersect_he_ch_width_2g(mac_ctx, he_cap);

	status_2g = lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HE_CAP,
			CDS_BAND_2GHZ, &he_caps[2],
			he_caps[1] + 1);