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

Commit a470d161 authored by Abhishek Singh's avatar Abhishek Singh Committed by Madan Koyyalamudi
Browse files

qcacld-3.0: Use freq hint in scan for ssid

When Scan db reaches max size, driver deletes the oldest node,
so chances are that BSS on 1st freq scanned is removed.

This lead to scan for SSID, which will do a scan again on
all freqs, and thus we end up in flushing the entry again.

TO fix this use freq hint to scan for ssid to quickly find the
AP so that required AP remains in scan database as it will
be the latest entry.

Change-Id: I28849ee97ff1f492d372870c362288206c4ec9a5
CRs-Fixed: 3391899
parent bfa1c1a2
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -18688,7 +18688,8 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter,
				    const u8 *ssid, size_t ssid_len,
				    const u8 *bssid, const u8 *bssid_hint,
				    uint32_t oper_freq,
				    enum nl80211_chan_width ch_width)
				    enum nl80211_chan_width ch_width,
				    uint32_t ch_freq_hint)
{
	int status = 0;
	QDF_STATUS qdf_status;
@@ -18904,6 +18905,8 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter,
					  &roam_profile->ch_params);
		}
		roam_profile->freq_hint = ch_freq_hint;
		if (wlan_hdd_cfg80211_check_pmf_valid(roam_profile)) {
			status = -EINVAL;
			goto conn_failure;
@@ -21150,6 +21153,7 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
	struct hdd_context *hdd_ctx;
	uint8_t vdev_id_list[MAX_NUMBER_OF_CONC_CONNECTIONS], i;
	bool disable_nan = true;
	uint32_t ch_freq_hint = 0;
	hdd_enter();
@@ -21274,11 +21278,15 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
	else
		ch_freq = 0;
	if (req->channel_hint)
		ch_freq_hint = req->channel_hint->center_freq;
	wlan_hdd_check_ht20_ht40_ind(hdd_ctx, adapter, req);
	status = wlan_hdd_cfg80211_connect_start(adapter, req->ssid,
						 req->ssid_len, req->bssid,
						 bssid_hint, ch_freq, 0);
						 bssid_hint, ch_freq, 0,
						 ch_freq_hint);
	if (status) {
		wlan_hdd_cfg80211_clear_privacy(adapter);
		hdd_err("connect failed");
+2 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 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
@@ -713,6 +714,7 @@ struct csr_roam_profile {
	tCsrKeys Keys;
	tCsrChannelInfo ChannelInfo;
	uint32_t op_freq;
	uint32_t freq_hint;
	struct ch_params ch_params;
	/* If this is 0, SME will fill in for caller. */
	uint16_t beaconInterval;
+10 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 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
@@ -1427,6 +1428,15 @@ QDF_STATUS csr_scan_for_ssid(struct mac_context *mac_ctx, uint32_t session_id,
		req->scan_req.chan_list.num_chan = num_chan;
	}

	/* Add freq hint for scan for ssid */
	if (!num_chan && profile->freq_hint &&
	    csr_roam_is_valid_channel(mac_ctx, profile->freq_hint)) {
		sme_debug("add freq hint %d", profile->freq_hint);
		req->scan_req.chan_list.chan[0].freq =
						profile->freq_hint;
		req->scan_req.chan_list.num_chan = 1;
	}

	/* Extend it for multiple SSID */
	if (profile->SSIDs.numOfSSIDs) {
		if (profile->SSIDs.SSIDList[0].SSID.length > WLAN_SSID_MAX_LEN) {