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

Commit 1ff1a00b authored by Surabhi Vishnoi's avatar Surabhi Vishnoi Committed by Gerrit - the friendly Code Review server
Browse files

qcacmn: Fix 6 GHz bss HE capable beamformee score

Currently, BSS beamformee score is calculated from vht_cap or
eht caps, so for 6 GHz HE capable BSS it will calculated to zero.
Due to this 5 GHz will always get selected compared to 6 GHz BSS with
all other capabilities and conditions same in both BSS as 5 GHz
will have more total candidate score.
Fix this issue by correct calculation of AP beamformer capability
in case of 6 GHz HE BSS.

Change-Id: I0f3285ce1c5c1aeeba624c5371ff0f884ae78c58
CRs-Fixed: 3351991
parent 52274954
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -1400,11 +1400,16 @@ struct wlan_ie_vhtop {
	uint16_t vhtop_basic_mcs_set;
} qdf_packed;

#define WLAN_HE_PHYCAP_SU_BFER_OFFSET 3
#define WLAN_HE_PHYCAP_SU_BFER_IDX 7
#define WLAN_HE_PHYCAP_SU_BFER_BITS 1

#define WLAN_HE_PHYCAP_160_SUPPORT BIT(2)
#define WLAN_HE_PHYCAP_80_80_SUPPORT BIT(3)
#define WLAN_HE_MACCAP_LEN 6
#define WLAN_HE_PHYCAP_LEN 11
#define WLAN_HE_MAX_MCS_MAPS 3

/**
 * struct wlan_ie_hecaps - HT capabilities
 * @elem_id: HE caps IE
+12 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
@@ -1416,6 +1417,7 @@ static int cm_calculate_bss_score(struct wlan_objmgr_psoc *psoc,
	bool same_bucket = false;
	bool ap_su_beam_former = false;
	struct wlan_ie_vhtcaps *vht_cap;
	struct wlan_ie_hecaps *he_cap;
	struct scoring_cfg *score_config;
	struct weight_cfg *weight_config;
	uint32_t sta_nss;
@@ -1504,8 +1506,17 @@ static int cm_calculate_bss_score(struct wlan_objmgr_psoc *psoc,
				score_config->rssi_score.bad_rssi_bucket_size);

	vht_cap = (struct wlan_ie_vhtcaps *)util_scan_entry_vhtcap(entry);
	if (vht_cap && vht_cap->su_beam_former)
	he_cap = (struct wlan_ie_hecaps *)util_scan_entry_hecap(entry);

	if (vht_cap && vht_cap->su_beam_former) {
		ap_su_beam_former = true;

	} else if (he_cap && QDF_GET_BITS(*(he_cap->he_phy_cap.phy_cap_bytes +
		   WLAN_HE_PHYCAP_SU_BFER_OFFSET), WLAN_HE_PHYCAP_SU_BFER_IDX,
		   WLAN_HE_PHYCAP_SU_BFER_BITS)) {
		ap_su_beam_former = true;
	}

	if (phy_config->beamformee_cap && is_vht &&
	    ap_su_beam_former &&
	    (entry->rssi_raw > rssi_pref_5g_rssi_thresh) && !same_bucket)