Bläddra i källkod

qcacmn: Remove api wlan_add_age_ie on scan result

In api wlan_add_age_ie(), age ie is included in scan
result.

Remove api wlan_add_age_ie() as the bss age is
calculated using NL80211_BSS_SEEN_MS_AGO.

Change-Id: Ided2364ce7a52d942d29343455fc7ae511be9a18
CRs-Fixed: 3391276
Vijay Raj 2 år sedan
förälder
incheckning
6effc63bb2

+ 0 - 33
os_if/linux/scan/inc/wlan_cfg80211_scan.h

@@ -53,43 +53,10 @@ extern const struct nla_policy cfg80211_scan_policy[
 				      QCA_WLAN_VENDOR_ATTR_SCAN_MAX) \
 	},
 
-/* GPS application requirement */
-#define QCOM_VENDOR_IE_ID 221
-#define QCOM_OUI1         0x00
-#define QCOM_OUI2         0xA0
-#define QCOM_OUI3         0xC6
-#define QCOM_VENDOR_IE_AGE_TYPE  0x100
-#define QCOM_VENDOR_IE_AGE_LEN   (sizeof(qcom_ie_age) - 2)
 #define SCAN_DONE_EVENT_BUF_SIZE 4096
 #define SCAN_WAKE_LOCK_CONNECT_DURATION (1 * 1000) /* in msec */
 #define SCAN_WAKE_LOCK_SCAN_DURATION (5 * 1000) /* in msec */
 
-/**
- * typedef qcom_ie_age - age ie
- * @element_id: Element id
- * @len: Length
- * @oui_1: OUI 1
- * @oui_2: OUI 2
- * @oui_3: OUI 3
- * @type: Type
- * @age: Age
- * @tsf_delta: tsf delta from FW
- * @beacon_tsf: original beacon TSF
- * @seq_ctrl: sequence control field
- */
-typedef struct {
-	u8 element_id;
-	u8 len;
-	u8 oui_1;
-	u8 oui_2;
-	u8 oui_3;
-	u32 type;
-	u32 age;
-	u32 tsf_delta;
-	u64 beacon_tsf;
-	u16 seq_ctrl;
-} __attribute__ ((packed)) qcom_ie_age;
-
 /**
  * struct osif_scan_pdev - OS scan private structure
  * @scan_req_q: Scan request queue

+ 1 - 50
os_if/linux/scan/src/wlan_cfg80211_scan.c

@@ -1958,54 +1958,6 @@ wlan_get_ieee80211_channel(struct wiphy *wiphy,
 	return chan;
 }
 
-#ifdef WLAN_ENABLE_AGEIE_ON_SCAN_RESULTS
-static inline int wlan_get_frame_len(struct scan_cache_entry *scan_params)
-{
-	return util_scan_entry_frame_len(scan_params) + sizeof(qcom_ie_age);
-}
-
-static inline void wlan_add_age_ie(uint8_t *mgmt_frame,
-	struct scan_cache_entry *scan_params)
-{
-	qcom_ie_age *qie_age = NULL;
-
-	/* GPS Requirement: need age ie per entry. Using vendor specific. */
-	/* Assuming this is the last IE, copy at the end */
-	qie_age = (qcom_ie_age *) (mgmt_frame +
-		   util_scan_entry_frame_len(scan_params));
-	qie_age->element_id = QCOM_VENDOR_IE_ID;
-	qie_age->len = QCOM_VENDOR_IE_AGE_LEN;
-	qie_age->oui_1 = QCOM_OUI1;
-	qie_age->oui_2 = QCOM_OUI2;
-	qie_age->oui_3 = QCOM_OUI3;
-	qie_age->type = QCOM_VENDOR_IE_AGE_TYPE;
-	/*
-	 * Lowi expects the timestamp of bss in units of 1/10 ms. In driver
-	 * all bss related timestamp is in units of ms. Due to this when scan
-	 * results are sent to lowi the scan age is high.To address this,
-	 * send age in units of 1/10 ms.
-	 */
-	qie_age->age =
-		(uint32_t)(qdf_mc_timer_get_system_time() -
-		  scan_params->scan_entry_time)/10;
-	qie_age->tsf_delta = scan_params->tsf_delta;
-	memcpy(&qie_age->beacon_tsf, scan_params->tsf_info.data,
-		  sizeof(qie_age->beacon_tsf));
-	memcpy(&qie_age->seq_ctrl, &scan_params->seq_num,
-	       sizeof(qie_age->seq_ctrl));
-}
-#else
-static inline int wlan_get_frame_len(struct scan_cache_entry *scan_params)
-{
-	return util_scan_entry_frame_len(scan_params);
-}
-
-static inline void wlan_add_age_ie(uint8_t *mgmt_frame,
-	struct scan_cache_entry *scan_params)
-{
-}
-#endif /* WLAN_ENABLE_AGEIE_ON_SCAN_RESULTS */
-
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) || \
 	defined(CFG80211_INFORM_BSS_FRAME_DATA)
 /**
@@ -2102,7 +2054,7 @@ void wlan_cfg80211_inform_bss_frame(struct wlan_objmgr_pdev *pdev,
 
 	wiphy = pdev_ospriv->wiphy;
 
-	bss_data.frame_len = wlan_get_frame_len(scan_params);
+	bss_data.frame_len = ucfg_scan_get_entry_frame_len(scan_params);
 	bss_data.mgmt = qdf_mem_malloc_atomic(bss_data.frame_len);
 	if (!bss_data.mgmt) {
 		osif_err("bss mem alloc failed for seq %d",
@@ -2117,7 +2069,6 @@ void wlan_cfg80211_inform_bss_frame(struct wlan_objmgr_pdev *pdev,
 	 * Instead it wants a monotonic increasing value
 	 */
 	bss_data.mgmt->u.probe_resp.timestamp = qdf_get_monotonic_boottime();
-	wlan_add_age_ie((uint8_t *)bss_data.mgmt, scan_params);
 	/*
 	 * Based on .ini configuration, raw rssi can be reported for bss.
 	 * Raw rssi is typically used for estimating power.

+ 9 - 1
umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 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
@@ -97,6 +97,14 @@ wlan_scan_id ucfg_scan_get_scan_id(struct wlan_objmgr_psoc *psoc)
 	return wlan_scan_get_scan_id(psoc);
 }
 
+/**
+ * ucfg_scan_get_entry_frame_len() - API to get scan entry frame length
+ * @scan_entry: Scan entry
+ *
+ * Return: scan entry frame length
+ */
+uint32_t ucfg_scan_get_entry_frame_len(struct scan_cache_entry *scan_entry);
+
 #ifdef FEATURE_WLAN_SCAN_PNO
 /**
  * ucfg_scan_pno_start() - Public API to start PNO

+ 6 - 1
umac/scan/dispatcher/src/wlan_scan_ucfg_api.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-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
@@ -77,6 +77,11 @@ void ucfg_scan_filter_valid_channel(struct wlan_objmgr_pdev *pdev,
 	scm_filter_valid_channel(pdev, chan_freq_list, num_chan);
 }
 
+uint32_t ucfg_scan_get_entry_frame_len(struct scan_cache_entry *scan_entry)
+{
+	return util_scan_entry_frame_len(scan_entry);
+}
+
 QDF_STATUS ucfg_scan_init(void)
 {
 	QDF_STATUS status;