Jelajahi Sumber

qcacmn: Add new file to hold CFR specific configuration

Add new file to exchange CFR config with userspace

Change-Id: Ia66dfdcd1f121699f04b579c9867a9f78286a4f8
CRs-Fixed: 2639069
Padma Raghunathan 5 tahun lalu
induk
melakukan
cf4f404f0f

+ 1 - 1
spectral/Kbuild

@@ -189,7 +189,7 @@ endif
 
 ifeq ($(QCA_CFR_SUPPORT), 1)
 ccflags-y+= -DWLAN_CFR_ENABLE=1
-INCS += -I$(obj)/$(DEPTH)/component_dev/umac/cfr/dispatcher/inc
+INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cfr/dispatcher/inc
 INCS += -I$(obj)/$(DEPTH)/component_dev/qal/inc
 endif
 

+ 167 - 0
umac/cfr/dispatcher/inc/wlan_cfr_public_structs.h

@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2020, The Linux Foundation. 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
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: declare the data structure to hold CFR specific configurations
+ */
+#ifndef _WLAN_CFR_PUBLIC_STRUCTS_H_
+#define _WLAN_CFR_PUBLIC_STRUCTS_H_
+
+#ifdef WLAN_CFR_ENABLE
+#include "qdf_types.h"
+
+/**
+ * cfr_cwm_width : Capture bandwidth
+ * 0 : 20MHz, 1 : 40MHz, 2 : 80MHz, 3 : 160MHz, 4 : 80+80MHz
+ */
+enum cfr_cwm_width {
+	CFR_CWM_WIDTH20,
+	CFR_CWM_WIDTH40,
+	CFR_CWM_WIDTH80,
+	CFR_CWM_WIDTH160,
+	CFR_CWM_WIDTH80_80,
+
+	CFR_CWM_WIDTH_MAX,
+	CFR_CWM_WIDTHINVALID = 0xff
+};
+
+/**
+ * cfr_capture_method : Tx based CFR capture method
+ * @CFR_CAPTURE_METHOD_QOS_NULL : Send QOS Null frame and capture CFR on ACK
+ * @CFR_CAPTURE_METHOD_QOS_NULL_WITH_PHASE: Send QoS Null frame with phase
+ * @CFR_CAPTURE_METHOD_PROBE_RESPONSE : Capture is enabled on probe response
+ * If node is not found, trigger unassociated capture.
+ */
+enum cfr_capture_method {
+	CFR_CAPTURE_METHOD_QOS_NULL = 0,
+	CFR_CAPTURE_METHOD_QOS_NULL_WITH_PHASE = 1,
+	CFR_CAPTURE_METHOD_PROBE_RESPONSE = 2,
+	CFR_CAPTURE_METHOD_LAST_VALID,
+	CFR_CAPTURE_METHOD_AUTO = 0xff,
+	CFR_CAPTURE_METHOD_MAX,
+};
+
+/**
+ * cfr_wlanconfig_param : CFR params used to store user provided inputs
+ * @bandwidth : CFR capture bandwidth
+ * @periodicity : CFR capture periodicity in milli seconds
+ * @capture_method : CFR capture method
+ * @mac : peer mac address
+ * @ta : Tx address
+ * @ra : Rx Address
+ * @ta_mask: Tx address mask
+ * @ra_mask; Rx address mask
+ * *** Controls for different capture modes in RCC ***
+ * @en_directed_ftm: Enable capture for directed RTT FTM Packet
+ * @en_directed_ndpa_ndp: Enable NDPA filter followed by directed NDP capture
+ * @en_ta_ra_filter: Enable MAC TA/RA/type filtering channel capture
+ * @en_all_ftm_ack: Enable all FTM and ACK capture
+ * @en_ndpa_ndp_all: Enable NDPA filter followed by NDP capture,
+ *                   capture includes both directed and non-directed packets.
+ * @en_all_pkt: Enable capture mode to filter in all packets
+ * @dis_directed_ftm: Drop directed RTT FTM packets
+ * @dis_directed_ndpa_ndp: Drop directed NDPA and NDP packets
+ * @dis_ta_ra_filter: Disable MAC TA/RA/type filtering channel capture
+ * @dis_all_ftm_ack: Drop all FTM and ACK capture
+ * @dis_ndpa_ndp_all: Drop all NDPA and NDP packets
+ * @dis_all_pkt: Do not filter in any packet
+ *
+ * **** Fixed parameters ****
+ * @cap_dur: Capture duration
+ * @cap_intvl: Capture interval
+ * FW may limit the interval and duration during which HW may attempt
+ * to capture by programming the user provided values.
+ * These values(cap_dur, cap_intvl) range from 1 us to roughly 16.8 in 1 us
+ * units. Max value is 0xFFFFFF, i.e., 16.777215 s
+ * @bw: Bandwidth: 20, 40, 80, 160, 320MHz
+ * @nss: 8 bits are allotted for NSS mask. Specifies which numbers of
+ * spatial streams (MIMO factor) are permitted
+ * @grp_id:  Group id could of any value between 0 and 15
+ * @expected_mgmt_subtype/ expected_ctrl_subtype / expected_data_subtype:
+ * corresponds to mgmt/ ctrl/ data, all are bitmasks, in which each bit
+ * represents the corresponding type/ subtype value as per IEEE80211.
+ *
+ * @en_cfg and reset_cfg: This bitmap of 16 bits, indicates 16 groups.
+ * Valid entry should be in between 0 to 0xFFFF.
+ * Turning on a bit in en_cfg will enable MAC TA_RA filter
+ * for corresponding group; whereas turning on a bit in reset_cfg
+ * will reset all 9 params in the corresponding group to default values.
+ *
+ * @ul_mu_user_mask_lower, ul_mu_user_mask_upper :
+ * Since Cypress supports max bandwidth of 80Mhz, maximum number
+ * of users in a UL MU-MIMO transmission would be 37.
+ * mask_lower_32: Bits from 31 to 0 indicate user indices for 32 users.
+ * mask_upper_32: Bits from 0 to 4 indicate user indices from 33 to 37.
+ *
+ * @ freeze_tlv_delay_cnt_en, freeze_tlv_delay_cnt_thr :
+ * freeze_tlv_delay_cnt_thr will decide the threshold for MAC to drop the
+ * freeze TLV. freeze_tlv_delay_cnt_thr will only be applicable if
+ * freeze_tlv_delay_cnt_en is enabled.
+ */
+struct cfr_wlanconfig_param {
+	enum cfr_cwm_width bandwidth;
+	uint32_t periodicity;
+	enum cfr_capture_method capture_method;
+	uint8_t mac[QDF_MAC_ADDR_SIZE];
+#ifdef WLAN_ENH_CFR_ENABLE
+	uint8_t ta[QDF_MAC_ADDR_SIZE];
+	uint8_t ra[QDF_MAC_ADDR_SIZE];
+	uint8_t ta_mask[QDF_MAC_ADDR_SIZE];
+	uint8_t ra_mask[QDF_MAC_ADDR_SIZE];
+	uint16_t en_directed_ftm             :1,
+		 en_directed_ndpa_ndp        :1,
+		 en_ta_ra_filter             :1,
+		 en_all_ftm_ack              :1,
+		 en_ndpa_ndp_all             :1,
+		 en_all_pkt                  :1,
+		 dis_directed_ftm            :1,
+		 dis_directed_ndpa_ndp       :1,
+		 dis_ta_ra_filter            :1,
+		 dis_all_ftm_ack             :1,
+		 dis_ndpa_ndp_all            :1,
+		 dis_all_pkt                 :1,
+		 rsvd0                       :4;
+
+	uint32_t cap_dur                     :24,
+		 rsvd1                       :8;
+	uint32_t cap_intvl                   :24,
+		 rsvd2                       :8;
+	uint32_t bw                          :5,
+		 nss                         :8,
+		 grp_id                      :4,
+		 rsvd3                       :15;
+
+	uint32_t expected_mgmt_subtype       :16,
+		 expected_ctrl_subtype       :16;
+
+	uint32_t expected_data_subtype       :16,
+		 rsvd5                       :16;
+
+	uint32_t en_cfg                      :16,
+		 reset_cfg                   :16;
+
+	uint32_t ul_mu_user_mask_lower;
+	uint32_t ul_mu_user_mask_upper;
+
+	uint32_t freeze_tlv_delay_cnt_en :1,
+		 freeze_tlv_delay_cnt_thr :8,
+		 rsvd6 :23;
+#endif
+};
+
+#endif /* WLAN_CFR_ENABLE */
+#endif /* _WLAN_CFR_PUBLIC_STRUCTS_H_ */
+

+ 11 - 11
umac/cfr/dispatcher/inc/wlan_cfr_ucfg_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2020 The Linux Foundation. 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
@@ -21,7 +21,7 @@
 
 #include <wlan_objmgr_peer_obj.h>
 #include <wlan_objmgr_pdev_obj.h>
-#include <ieee80211_ioctl.h>
+#include <wlan_cfr_public_structs.h>
 
 #define MAX_CFR_PRD        (10*60*1000)        /* 10 minutes */
 
@@ -135,7 +135,7 @@ bool ucfg_cfr_get_rcc_enabled(struct wlan_objmgr_vdev *vdev);
  * Return: status
  */
 QDF_STATUS ucfg_cfr_set_tara_config(struct wlan_objmgr_vdev *vdev,
-				    struct ieee80211_wlanconfig_cfr *params);
+				    struct cfr_wlanconfig_param *params);
 
 /**
  * ucfg_cfr_set_bw_nss() - function to configure nss and bandwidth
@@ -145,7 +145,7 @@ QDF_STATUS ucfg_cfr_set_tara_config(struct wlan_objmgr_vdev *vdev,
  * Return: status
  */
 QDF_STATUS ucfg_cfr_set_bw_nss(struct wlan_objmgr_vdev *vdev,
-			       struct ieee80211_wlanconfig_cfr *params);
+			       struct cfr_wlanconfig_param *params);
 
 /**
  * ucfg_cfr_set_frame_type_subtype() - function to configure frame type/subtype
@@ -156,7 +156,7 @@ QDF_STATUS ucfg_cfr_set_bw_nss(struct wlan_objmgr_vdev *vdev,
  */
 QDF_STATUS
 ucfg_cfr_set_frame_type_subtype(struct wlan_objmgr_vdev *vdev,
-				struct ieee80211_wlanconfig_cfr *params);
+				struct cfr_wlanconfig_param *params);
 
 /**
  * ucfg_cfr_set_capture_duration() - function to configure capture duration
@@ -167,7 +167,7 @@ ucfg_cfr_set_frame_type_subtype(struct wlan_objmgr_vdev *vdev,
  */
 QDF_STATUS
 ucfg_cfr_set_capture_duration(struct wlan_objmgr_vdev *vdev,
-			      struct ieee80211_wlanconfig_cfr *params);
+			      struct cfr_wlanconfig_param *params);
 
 /**
  * ucfg_cfr_set_capture_interval() - function to configure capture interval
@@ -178,7 +178,7 @@ ucfg_cfr_set_capture_duration(struct wlan_objmgr_vdev *vdev,
  */
 QDF_STATUS
 ucfg_cfr_set_capture_interval(struct wlan_objmgr_vdev *vdev,
-			      struct ieee80211_wlanconfig_cfr *params);
+			      struct cfr_wlanconfig_param *params);
 
 /**
  * ucfg_cfr_set_en_bitmap() - function to configure 16-bit bitmap in TA_RA mode
@@ -188,7 +188,7 @@ ucfg_cfr_set_capture_interval(struct wlan_objmgr_vdev *vdev,
  * Return: status
  */
 QDF_STATUS ucfg_cfr_set_en_bitmap(struct wlan_objmgr_vdev *vdev,
-				  struct ieee80211_wlanconfig_cfr *params);
+				  struct cfr_wlanconfig_param *params);
 
 /**
  * ucfg_cfr_set_reset_bitmap() - function to clear all 9 params for all 16
@@ -199,7 +199,7 @@ QDF_STATUS ucfg_cfr_set_en_bitmap(struct wlan_objmgr_vdev *vdev,
  * Return: status
  */
 QDF_STATUS ucfg_cfr_set_reset_bitmap(struct wlan_objmgr_vdev *vdev,
-				     struct ieee80211_wlanconfig_cfr *params);
+				     struct cfr_wlanconfig_param *params);
 
 /**
  * ucfg_cfr_set_ul_mu_user_mask() - function to configure UL MU user mask
@@ -210,7 +210,7 @@ QDF_STATUS ucfg_cfr_set_reset_bitmap(struct wlan_objmgr_vdev *vdev,
  */
 QDF_STATUS
 ucfg_cfr_set_ul_mu_user_mask(struct wlan_objmgr_vdev *vdev,
-			     struct ieee80211_wlanconfig_cfr *params);
+			     struct cfr_wlanconfig_param *params);
 
 /**
  * ucfg_cfr_set_freeze_tlv_delay_cnt() - function to configure freeze TLV delay
@@ -222,7 +222,7 @@ ucfg_cfr_set_ul_mu_user_mask(struct wlan_objmgr_vdev *vdev,
  */
 QDF_STATUS
 ucfg_cfr_set_freeze_tlv_delay_cnt(struct wlan_objmgr_vdev *vdev,
-				  struct ieee80211_wlanconfig_cfr *params);
+				  struct cfr_wlanconfig_param *params);
 
 /**
  * ucfg_cfr_committed_rcc_config() - function to commit user config

+ 10 - 10
umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2020 The Linux Foundation. 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
@@ -334,7 +334,7 @@ QDF_STATUS dev_sanity_check(struct wlan_objmgr_vdev *vdev,
  */
 
 QDF_STATUS ucfg_cfr_set_reset_bitmap(struct wlan_objmgr_vdev *vdev,
-				     struct ieee80211_wlanconfig_cfr *params)
+				     struct cfr_wlanconfig_param *params)
 {
 	struct pdev_cfr *pcfr = NULL;
 	struct wlan_objmgr_pdev *pdev = NULL;
@@ -366,7 +366,7 @@ QDF_STATUS ucfg_cfr_set_reset_bitmap(struct wlan_objmgr_vdev *vdev,
  */
 
 QDF_STATUS ucfg_cfr_set_en_bitmap(struct wlan_objmgr_vdev *vdev,
-				  struct ieee80211_wlanconfig_cfr *params)
+				  struct cfr_wlanconfig_param *params)
 {
 	struct pdev_cfr *pcfr = NULL;
 	struct wlan_objmgr_pdev *pdev = NULL;
@@ -389,7 +389,7 @@ QDF_STATUS ucfg_cfr_set_en_bitmap(struct wlan_objmgr_vdev *vdev,
 
 QDF_STATUS
 ucfg_cfr_set_ul_mu_user_mask(struct wlan_objmgr_vdev *vdev,
-			     struct ieee80211_wlanconfig_cfr *params)
+			     struct cfr_wlanconfig_param *params)
 {
 	struct pdev_cfr *pcfr = NULL;
 	struct wlan_objmgr_pdev *pdev = NULL;
@@ -420,7 +420,7 @@ ucfg_cfr_set_ul_mu_user_mask(struct wlan_objmgr_vdev *vdev,
 
 QDF_STATUS
 ucfg_cfr_set_freeze_tlv_delay_cnt(struct wlan_objmgr_vdev *vdev,
-				  struct ieee80211_wlanconfig_cfr *params)
+				  struct cfr_wlanconfig_param *params)
 {
 	struct pdev_cfr *pcfr = NULL;
 	struct wlan_objmgr_pdev *pdev = NULL;
@@ -448,7 +448,7 @@ ucfg_cfr_set_freeze_tlv_delay_cnt(struct wlan_objmgr_vdev *vdev,
 
 QDF_STATUS
 ucfg_cfr_set_capture_interval(struct wlan_objmgr_vdev *vdev,
-			      struct ieee80211_wlanconfig_cfr *params)
+			      struct cfr_wlanconfig_param *params)
 {
 	struct pdev_cfr *pcfr = NULL;
 	struct wlan_objmgr_pdev *pdev = NULL;
@@ -472,7 +472,7 @@ ucfg_cfr_set_capture_interval(struct wlan_objmgr_vdev *vdev,
 
 QDF_STATUS
 ucfg_cfr_set_capture_duration(struct wlan_objmgr_vdev *vdev,
-			      struct ieee80211_wlanconfig_cfr *params)
+			      struct cfr_wlanconfig_param *params)
 {
 	struct pdev_cfr *pcfr = NULL;
 	struct wlan_objmgr_pdev *pdev = NULL;
@@ -498,7 +498,7 @@ ucfg_cfr_set_capture_duration(struct wlan_objmgr_vdev *vdev,
 
 QDF_STATUS
 ucfg_cfr_set_frame_type_subtype(struct wlan_objmgr_vdev *vdev,
-				struct ieee80211_wlanconfig_cfr *params)
+				struct cfr_wlanconfig_param *params)
 {
 	struct pdev_cfr *pcfr = NULL;
 	struct wlan_objmgr_pdev *pdev = NULL;
@@ -536,7 +536,7 @@ ucfg_cfr_set_frame_type_subtype(struct wlan_objmgr_vdev *vdev,
  */
 
 QDF_STATUS ucfg_cfr_set_bw_nss(struct wlan_objmgr_vdev *vdev,
-			       struct ieee80211_wlanconfig_cfr *params)
+			       struct cfr_wlanconfig_param *params)
 {
 	struct pdev_cfr *pcfr = NULL;
 	struct wlan_objmgr_pdev *pdev = NULL;
@@ -571,7 +571,7 @@ QDF_STATUS ucfg_cfr_set_bw_nss(struct wlan_objmgr_vdev *vdev,
  */
 
 QDF_STATUS ucfg_cfr_set_tara_config(struct wlan_objmgr_vdev *vdev,
-				    struct ieee80211_wlanconfig_cfr *params)
+				    struct cfr_wlanconfig_param *params)
 {
 	struct pdev_cfr *pcfr = NULL;
 	struct wlan_objmgr_pdev *pdev = NULL;