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

Commit 4ad3c3d1 authored by Surya Prakash Sivaraj's avatar Surya Prakash Sivaraj Committed by Gerrit - the friendly Code Review server
Browse files

qcacld-3.0: Update preauth candidate entry to scan table

During SAE roam auth offload, update the beacon/probe response
frame coming from the FW via WMI_ROAM_FRAME_EVENTID into the
scan db.

When the bss info of the preauth candidate is unavailable in
the host/kernel scan entry, supplicant fails to determine the
proper SAE PWE config of the peer and the commit request fails.

Change-Id: Ia782ece7bebf8274f949fe9fb3b2a2882bf47597
CRs-Fixed: 3075458
parent ca5a0168
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -482,6 +482,9 @@ struct sme_ready_req {
					uint16_t deauth_disassoc_frame_len,
					uint16_t reason_code);
	csr_roam_pmkid_req_fn_t csr_roam_pmkid_req_cb;
	QDF_STATUS (*csr_roam_candidate_event_cb)(struct mac_context *mac,
						  uint8_t *frame,
						  uint32_t len);
};

/**
@@ -2929,6 +2932,18 @@ struct roam_offload_synch_ind {
	enum wlan_phymode phy_mode; /*phy mode sent by fw */
};

/*
 * struct roam_scan_candidate_frame Roam candidate scan entry
 * vdev_id : vdev id
 * frame_len : Length of the beacon/probe rsp frame
 * frame : Pointer to the frame
 */
struct roam_scan_candidate_frame {
	uint8_t vdev_id;
	uint32_t frame_length;
	uint8_t *frame;
};

#ifdef WLAN_FEATURE_ROAM_OFFLOAD
struct handoff_failure_ind {
	uint8_t vdev_id;
+2 −1
Original line number Diff line number Diff line
@@ -1356,7 +1356,8 @@ void pe_register_callbacks_with_wma(struct mac_context *mac,
			ready_req->csr_roam_auth_event_handle_cb,
			ready_req->pe_roam_synch_cb,
			ready_req->pe_disconnect_cb,
			ready_req->csr_roam_pmkid_req_cb);
			ready_req->csr_roam_pmkid_req_cb,
			ready_req->csr_roam_candidate_event_cb);
	if (status != QDF_STATUS_SUCCESS)
		pe_err("Registering roaming callbacks with WMA failed");
}
+12 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 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
@@ -380,6 +381,7 @@ QDF_STATUS
csr_process_roam_pmkid_req_callback(struct mac_context *mac_ctx,
				    uint8_t vdev_id,
				    struct roam_pmkid_req_event *roam_bsslist);

#else
static inline QDF_STATUS
csr_roam_pmkid_req_callback(uint8_t vdev_id,
@@ -388,7 +390,9 @@ csr_roam_pmkid_req_callback(uint8_t vdev_id,
	return QDF_STATUS_SUCCESS;
}
#endif /* WLAN_FEATURE_FIPS */

QDF_STATUS
csr_roam_candidate_event_handle_callback(struct mac_context *mac_ctx,
					 uint8_t *frame, uint32_t len);
#else
static inline QDF_STATUS csr_roam_synch_callback(struct mac_context *mac,
	struct roam_offload_synch_ind *roam_synch_data,
@@ -420,6 +424,13 @@ csr_roam_pmkid_req_callback(uint8_t vdev_id,
{
	return QDF_STATUS_E_NOSUPPORT;
}

QDF_STATUS
csr_roam_candidate_event_handle_callback(struct mac_context *mac_ctx,
					 uint8_t *frame, uint32_t len)
{
	return QDF_STATUS_SUCCESS;
}
#endif
void csr_neighbor_roam_state_transition(struct mac_context *mac_ctx,
		uint8_t newstate, uint8_t session);
+2 −0
Original line number Diff line number Diff line
@@ -1185,6 +1185,8 @@ QDF_STATUS sme_hdd_ready_ind(mac_handle_t mac_handle)
		msg->csr_roam_auth_event_handle_cb =
				csr_roam_auth_offload_callback;
		msg->csr_roam_pmkid_req_cb = csr_roam_pmkid_req_callback;
		msg->csr_roam_candidate_event_cb =
				csr_roam_candidate_event_handle_callback;

		status = u_mac_post_ctrl_msg(mac_handle, (tSirMbMsg *)msg);
		if (QDF_IS_STATUS_ERROR(status)) {
+122 −0
Original line number Diff line number Diff line
@@ -21938,6 +21938,128 @@ csr_roam_auth_offload_callback(struct mac_context *mac_ctx,
	return status;
}
static
void csr_inform_bcn_probe(struct mac_context *mac_ctx,
			  uint8_t *frame, uint32_t len,
			  qdf_freq_t freq)
{
	qdf_nbuf_t buf;
	uint8_t *data, i;
	struct mgmt_rx_event_params rx_param = {0};
	struct wlan_frame_hdr *hdr;
	enum mgmt_frame_type frm_type = MGMT_BEACON;
	hdr = (struct wlan_frame_hdr *)frame;
	if ((hdr->i_fc[0] & QDF_IEEE80211_FC0_SUBTYPE_MASK) ==
	    MGMT_SUBTYPE_PROBE_RESP)
		frm_type = MGMT_PROBE_RESP;
	rx_param.pdev_id = 0;
	rx_param.chan_freq = freq;
	/* Real RSSI will be filled after roam sync */
	rx_param.rssi = 0;
	/* Set all per chain rssi as invalid */
	for (i = 0; i < WLAN_MGMT_TXRX_HOST_MAX_ANTENNA; i++)
		rx_param.rssi_ctl[i] = WLAN_INVALID_PER_CHAIN_RSSI;
	buf = qdf_nbuf_alloc(NULL, qdf_roundup(len, 4), 0, 4, false);
	if (!buf)
		return;
	qdf_nbuf_put_tail(buf, len);
	qdf_nbuf_set_protocol(buf, ETH_P_CONTROL);
	data = qdf_nbuf_data(buf);
	qdf_mem_copy(data, frame, len);
	/* buf will be freed by scan module in error or success case */
	wlan_scan_process_bcn_probe_rx_sync(wlan_pdev_get_psoc(mac_ctx->pdev),
					    buf, &rx_param, frm_type);
}
QDF_STATUS
csr_roam_candidate_event_handle_callback(struct mac_context *mac_ctx,
					 uint8_t *frame, uint32_t len)
{
	uint32_t ie_offset, ie_len;
	uint8_t *ie_ptr = NULL;
	uint8_t *extracted_ie = NULL;
	uint8_t primary_channel, band;
	qdf_freq_t op_freq;
	QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_MLME, QDF_TRACE_LEVEL_DEBUG,
			   frame, len);
	/* Fixed parameters offset */
	ie_offset = sizeof(struct wlan_frame_hdr) + SIR_MAC_B_PR_SSID_OFFSET;
	if (len <= ie_offset) {
		mlme_err("Invalid frame length");
		return QDF_STATUS_E_FAILURE;
	}
	ie_ptr = frame + ie_offset;
	ie_len = len - ie_offset;
	/* For 2.4GHz,5GHz get channel from DS IE */
	extracted_ie = (uint8_t *)wlan_get_ie_ptr_from_eid(WLAN_ELEMID_DSPARMS,
							   ie_ptr, ie_len);
	if (extracted_ie && extracted_ie[0] == WLAN_ELEMID_DSPARMS &&
	    extracted_ie[1] == WLAN_DS_PARAM_IE_MAX_LEN) {
		band = BIT(REG_BAND_2G) | BIT(REG_BAND_5G);
		primary_channel = *(extracted_ie + 2);
		sme_debug("Extracted primary channel from DS : %d",
			  primary_channel);
		goto update_beacon;
	}
	/* For HT, VHT and non-6GHz HE, get channel from HTINFO IE */
	extracted_ie = (uint8_t *)
		wlan_get_ie_ptr_from_eid(WLAN_ELEMID_HTINFO_ANA,
					 ie_ptr, ie_len);
	if (extracted_ie && extracted_ie[0] == WLAN_ELEMID_HTINFO_ANA &&
	    extracted_ie[1] == sizeof(struct wlan_ie_htinfo_cmn)) {
		band = BIT(REG_BAND_2G) | BIT(REG_BAND_5G);
		primary_channel =
			((struct wlan_ie_htinfo *)extracted_ie)->
						hi_ie.hi_ctrlchannel;
		sme_debug("Extracted primary channel from HT INFO : %d",
			  primary_channel);
		goto update_beacon;
	}
	/* For 6GHz, get channel from HE OP IE */
	extracted_ie = (uint8_t *)
		wlan_get_ext_ie_ptr_from_ext_id(WLAN_HEOP_OUI_TYPE,
						(uint8_t)
						WLAN_HEOP_OUI_SIZE,
						ie_ptr, ie_len);
	if (extracted_ie &&
	    !qdf_mem_cmp(&extracted_ie[2], WLAN_HEOP_OUI_TYPE,
			 WLAN_HEOP_OUI_SIZE) &&
	     extracted_ie[1] <= WLAN_MAX_HEOP_IE_LEN) {
		band = BIT(REG_BAND_6G);
		primary_channel = util_scan_get_6g_oper_channel(extracted_ie);
		sme_debug("Extracted primary channel from HE OP : %d",
			  primary_channel);
		if (primary_channel)
			goto update_beacon;
	}
	mlme_err("Primary channel was not found in the candidate scan entry");
	return QDF_STATUS_E_FAILURE;
update_beacon:
	op_freq = wlan_reg_chan_band_to_freq(mac_ctx->pdev,
					     primary_channel, band);
	sme_debug("Roaming candidate frequency : %d", op_freq);
	csr_inform_bcn_probe(mac_ctx, frame, len, op_freq);
	return QDF_STATUS_SUCCESS;
}
#endif
QDF_STATUS csr_update_owe_info(struct mac_context *mac,
Loading