浏览代码

qcacmn: Support CFR capture_count and MO marking requirement

Support a new capture_interval_mode: capture_count, where after
capture_count+1 number of frames, MAC stops channel capture and
waits for capture_interval duration before enabling again.

Add nob(capture_intervalmode_sel) to switch to capture_count or
capture_duration mode in wlanconfig application, where
capture_intervalmode_sel=0 indicates the old capture_durarion
mode where MAC stops channel capture after capture_duration
instead of capture_count. capture_intervalmode_sel=1 indicates
the capture_count mode.

Support MO marking: Current ENH CFR uses the existing MD/MO,
type/subtype filters to filterin the packets with programmed
type/subtype as either MD/MO. But for m_TARA it is also required
to consider the bw/nss/ta/ra setting. Therefore, it is possible
that not all the filtered-in PPDUs have channel capture and lead
to processing of packets which does not have captured data.
To overcome this issue, from QCN9000 onwards, MAC has MO marking
feature added for M_TARA filter mode, where MAC will consider
all TARA group configuration as filterin criteria & provides
an option to HOST to choose either filterin mode as FP or MO.
en_ta_ra_filter_in_as_fp is added to support MO marking.
Based on the discussion between HOST, FW & MAC teams, 0 is the
recommended & default setting for en_ta_ra_filter_in_as_fp.
Add nob to configure en_ta_ra_filter_in_as_fp but do not expose
to user.

Change-Id: I75cd3218fa4308afad21052e4535ef9b8e5a5869
Shwetha G K 5 年之前
父节点
当前提交
9472bdfb6c

+ 17 - 1
umac/cfr/dispatcher/inc/wlan_cfr_public_structs.h

@@ -22,6 +22,8 @@
 
 #define MAC_ADDR_LEN 6
 
+#define MAX_CAPTURE_COUNT_VAL 0xFFFF
+
 /**
  * cfr_cwm_width : Capture bandwidth
  * 0 : 20MHz, 1 : 40MHz, 2 : 80MHz, 3 : 160MHz, 4 : 80+80MHz
@@ -77,6 +79,9 @@ enum cfr_capture_method {
  * @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
+ * @en_ta_ra_filter_in_as_fp: Filter in frames as FP/MO in m_ta_ra_filter mode
+ *		0: as MO
+ *		1: as FP
  *
  * **** Fixed parameters ****
  * @cap_dur: Capture duration
@@ -109,6 +114,12 @@ enum cfr_capture_method {
  * 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.
+ *
+ * @cap_count: After capture_count+1 number of captures, MAC stops RCC and
+ * waits for capture_interval duration before enabling again
+ *
+ * @cap_intval_mode_sel: 0 indicates capture_duration mode, 1 indicates the
+ * capture_count mode.
  */
 struct cfr_wlanconfig_param {
 	enum cfr_cwm_width bandwidth;
@@ -132,7 +143,8 @@ struct cfr_wlanconfig_param {
 		 dis_all_ftm_ack             :1,
 		 dis_ndpa_ndp_all            :1,
 		 dis_all_pkt                 :1,
-		 rsvd0                       :4;
+		 en_ta_ra_filter_in_as_fp    :1,
+		 rsvd0                       :3;
 
 	uint32_t cap_dur                     :24,
 		 rsvd1                       :8;
@@ -158,6 +170,10 @@ struct cfr_wlanconfig_param {
 	uint32_t freeze_tlv_delay_cnt_en :1,
 		 freeze_tlv_delay_cnt_thr :8,
 		 rsvd6 :23;
+
+	uint32_t cap_count                   :16,
+		 cap_intval_mode_sel         :1,
+		 rsvd7                       :15;
 #endif
 };
 

+ 21 - 0
umac/cfr/dispatcher/inc/wlan_cfr_tgt_api.h

@@ -91,6 +91,27 @@ tgt_cfr_enable_cfr_timer(struct wlan_objmgr_pdev *pdev, uint32_t cfr_timer);
  */
 void tgt_cfr_support_set(struct wlan_objmgr_psoc *psoc, uint32_t value);
 
+/**
+ * tgt_cfr_capture_count_support_set() - API to set capture_count support
+ * @psoc: pointer to psoc_object
+ * @value: value to be set
+ *
+ * Return: success/failure
+ */
+QDF_STATUS
+tgt_cfr_capture_count_support_set(struct wlan_objmgr_psoc *psoc,
+				  uint32_t value);
+
+/**
+ * tgt_cfr_mo_marking_support_set() - API to set MO marking support
+ * @psoc: pointer to psoc_object
+ * @value: value to be set
+ *
+ * Return: success/failure
+ */
+QDF_STATUS
+tgt_cfr_mo_marking_support_set(struct wlan_objmgr_psoc *psoc, uint32_t value);
+
 /**
  * tgt_cfr_info_send() - API to send cfr info
  * @pdev: pointer to pdev_object

+ 34 - 0
umac/cfr/dispatcher/inc/wlan_cfr_ucfg_api.h

@@ -221,6 +221,40 @@ QDF_STATUS
 ucfg_cfr_set_capture_interval(struct wlan_objmgr_vdev *vdev,
 			      struct cfr_wlanconfig_param *params);
 
+/**
+ * ucfg_cfr_set_tara_filterin_as_fp() - function to FP/MO filtering for m_TA_RA
+ * @vdev: pointer to vdev object
+ * @params: user config
+ *
+ * Return: status
+ */
+QDF_STATUS
+ucfg_cfr_set_tara_filterin_as_fp(struct wlan_objmgr_vdev *vdev,
+				 struct cfr_wlanconfig_param *params);
+
+/**
+ * ucfg_cfr_set_capture_count() - function to configure capture count
+ * @vdev: pointer to vdev object
+ * @params: user config
+ *
+ * Return: status
+ */
+QDF_STATUS
+ucfg_cfr_set_capture_count(struct wlan_objmgr_vdev *vdev,
+			   struct cfr_wlanconfig_param *params);
+
+/**
+ * ucfg_cfr_set_capture_interval_mode_sel() - function to configure capture
+ *					      interval mode nob
+ * @vdev: pointer to vdev object
+ * @params: user confi
+ *
+ * Return: status
+ */
+QDF_STATUS
+ucfg_cfr_set_capture_interval_mode_sel(struct wlan_objmgr_vdev *vdev,
+				       struct cfr_wlanconfig_param *params);
+
 /**
  * ucfg_cfr_set_en_bitmap() - function to configure 16-bit bitmap in TA_RA mode
  * @vdev: pointer to vdev object

+ 29 - 7
umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h

@@ -223,10 +223,18 @@ struct cfr_capture_params {
  * struct psoc_cfr - private psoc object for cfr
  * psoc_obj: pointer to psoc object
  * is_cfr_capable: flag to determine if cfr is enabled or not
+ * is_cap_interval_mode_sel_support: flag to determine if target supports both
+ *				     capture_count and capture_duration modes
+ *				     with a nob provided to configure
+ * is_mo_marking_support: flag to determine if MO marking is supported or not
  */
 struct psoc_cfr {
 	struct wlan_objmgr_psoc *psoc_obj;
 	uint8_t is_cfr_capable;
+#ifdef WLAN_ENH_CFR_ENABLE
+	uint8_t is_cap_interval_mode_sel_support;
+	uint8_t is_mo_marking_support;
+#endif
 };
 
 /**
@@ -402,11 +410,16 @@ struct ta_ra_cfr_cfg {
  * m_ta_ra_filter: Filter Frames based on TA/RA/Subtype as provided in CFR Group
  * config
  * m_all_packet: Filter in All packets for CFR Capture
+ * en_ta_ra_filter_in_as_fp: Filter in frames as FP/MO in m_ta_ra_filter mode
  * num_grp_tlvs: Indicates the number of groups in M_TA_RA mode, that have
  * changes in the current commit session, use to construct WMI group TLV(s)
  * curr: Placeholder for M_TA_RA group config in current commit session
  * modified_in_curr_session: Bitmap indicating number of groups in M_TA_RA mode
  * that have changed in current commit session.
+ * capture_count: After capture_count+1 number of captures, MAC stops RCC  and
+ * waits for capture_interval duration before enabling again
+ * capture_intval_mode_sel: 0 indicates capture_duration mode, 1 indicates the
+ * capture_count mode.
  */
 struct cfr_rcc_param {
 	uint8_t pdev_id;
@@ -420,17 +433,21 @@ struct cfr_rcc_param {
 		 freeze_tlv_delay_cnt_thr :8,
 		 rsvd0 :7;
 	uint16_t filter_group_bitmap;
-	uint8_t m_directed_ftm      : 1,
-		m_all_ftm_ack       : 1,
-		m_ndpa_ndp_directed : 1,
-		m_ndpa_ndp_all      : 1,
-		m_ta_ra_filter      : 1,
-		m_all_packet        : 1,
-		rsvd1               : 2;
+	uint8_t m_directed_ftm           : 1,
+		m_all_ftm_ack            : 1,
+		m_ndpa_ndp_directed      : 1,
+		m_ndpa_ndp_all           : 1,
+		m_ta_ra_filter           : 1,
+		m_all_packet             : 1,
+		en_ta_ra_filter_in_as_fp : 1,
+		rsvd1                    : 1;
 	uint8_t num_grp_tlvs;
 
 	struct ta_ra_cfr_cfg curr[MAX_TA_RA_ENTRIES];
 	uint16_t modified_in_curr_session;
+	uint32_t capture_count            :16,
+		 capture_intval_mode_sel  :1,
+		 rsvd2                    :15;
 };
 #endif /* WLAN_ENH_CFR_ENABLE */
 
@@ -476,6 +493,9 @@ struct cfr_rcc_param {
  * last_success_tstamp: DBR timestamp which indicates that both DBR and TX/RX
  * events have been received successfully.
  * cfr_dma_aborts: No. of CFR DMA aborts in ucode
+ * is_cap_interval_mode_sel_support: flag to determine if target supports both
+ * is_mo_marking_support: flag to determine if MO marking is supported or not
+ * capture_count and capture_duration modes with a nob provided to configure.
  * unassoc_pool: Pool of un-associated clients used when capture method is
  * CFR_CAPTURE_METHOD_PROBE_RESPONSE
  * lut_lock: Lock to protect access to cfr lookup table
@@ -521,6 +541,8 @@ struct pdev_cfr {
 	uint64_t clear_txrx_event;
 	uint64_t last_success_tstamp;
 	uint64_t cfr_dma_aborts;
+	uint8_t is_cap_interval_mode_sel_support;
+	uint8_t is_mo_marking_support;
 #endif
 	struct unassoc_pool_entry unassoc_pool[MAX_CFR_ENABLED_CLIENTS];
 	qdf_spinlock_t lut_lock;

+ 66 - 0
umac/cfr/dispatcher/src/wlan_cfr_tgt_api.c

@@ -317,4 +317,70 @@ QDF_STATUS tgt_cfr_subscribe_ppdu_desc(struct wlan_objmgr_pdev *pdev,
 
 	return QDF_STATUS_SUCCESS;
 }
+
+QDF_STATUS
+tgt_cfr_capture_count_support_set(struct wlan_objmgr_psoc *psoc,
+				  uint32_t value)
+{
+	struct psoc_cfr *cfr_sc;
+
+	if (!psoc) {
+		cfr_err("CFR: NULL PSOC!!");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	cfr_sc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
+						       WLAN_UMAC_COMP_CFR);
+
+	if (!cfr_sc) {
+		cfr_err("Failed to get CFR component priv obj!!");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	cfr_sc->is_cap_interval_mode_sel_support = !!value;
+	cfr_debug("CFR: cap_interval_mode_sel_support is %s\n",
+		  (cfr_sc->is_cap_interval_mode_sel_support) ?
+		  "enabled" :
+		  "disabled");
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+tgt_cfr_mo_marking_support_set(struct wlan_objmgr_psoc *psoc, uint32_t value)
+{
+	struct psoc_cfr *cfr_sc;
+
+	if (!psoc) {
+		cfr_err("CFR: NULL PSOC!!");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	cfr_sc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
+						       WLAN_UMAC_COMP_CFR);
+	if (!cfr_sc) {
+		cfr_err("Failed to get CFR component priv obj!!");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	cfr_sc->is_mo_marking_support = !!value;
+	cfr_debug("CFR: mo_marking_support is %s\n",
+		  (cfr_sc->is_mo_marking_support) ? "enabled" : "disabled");
+
+	return QDF_STATUS_SUCCESS;
+}
+#else
+QDF_STATUS
+tgt_cfr_capture_count_support_set(struct wlan_objmgr_psoc *psoc,
+				  uint32_t value)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+QDF_STATUS
+tgt_cfr_mo_marking_support_set(struct wlan_objmgr_psoc *psoc,
+			       uint32_t value)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
 #endif

+ 87 - 0
umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c

@@ -628,6 +628,89 @@ ucfg_cfr_set_freeze_tlv_delay_cnt(struct wlan_objmgr_vdev *vdev,
 	return status;
 }
 
+/*
+ * Configure ta_ra_filter_in_as_fp from the provided configuration into
+ * cfr_rcc_param. All fixed parameters needed to be stored into cfr_rcc_param.
+ */
+QDF_STATUS
+ucfg_cfr_set_tara_filterin_as_fp(struct wlan_objmgr_vdev *vdev,
+				 struct cfr_wlanconfig_param *params)
+{
+	struct pdev_cfr *pcfr = NULL;
+	struct wlan_objmgr_pdev *pdev = NULL;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	status = dev_sanity_check(vdev, &pdev, &pcfr);
+	if (status != QDF_STATUS_SUCCESS)
+		return status;
+
+	if (!pcfr->is_mo_marking_support) {
+		cfr_err("MO marking support not available to filter as FP/MO");
+		status = QDF_STATUS_E_NOSUPPORT;
+	} else {
+		pcfr->rcc_param.en_ta_ra_filter_in_as_fp =
+			params->en_ta_ra_filter_in_as_fp;
+	}
+	wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
+
+	return status;
+}
+
+/*
+ * Set the capture count from the provided configuration into cfr_rcc_param.
+ * All fixed parameters are needed to be stored into cfr_rcc_param.
+ */
+QDF_STATUS
+ucfg_cfr_set_capture_count(struct wlan_objmgr_vdev *vdev,
+			   struct cfr_wlanconfig_param *params)
+{
+	struct pdev_cfr *pcfr = NULL;
+	struct wlan_objmgr_pdev *pdev = NULL;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	status = dev_sanity_check(vdev, &pdev, &pcfr);
+	if (status != QDF_STATUS_SUCCESS)
+		return status;
+
+	if (!pcfr->is_cap_interval_mode_sel_support) {
+		cfr_err("Capture count support not enabled");
+		status = QDF_STATUS_E_NOSUPPORT;
+	} else {
+		pcfr->rcc_param.capture_count = params->cap_count;
+	}
+	wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
+
+	return status;
+}
+
+/*
+ * Set interval mode sel nob from the provided configuration into cfr_rcc_param.
+ * All fixed parameters are needed to be stored into cfr_rcc_param
+ */
+QDF_STATUS
+ucfg_cfr_set_capture_interval_mode_sel(struct wlan_objmgr_vdev *vdev,
+				       struct cfr_wlanconfig_param *params)
+{
+	struct pdev_cfr *pcfr = NULL;
+	struct wlan_objmgr_pdev *pdev = NULL;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	status = dev_sanity_check(vdev, &pdev, &pcfr);
+	if (status != QDF_STATUS_SUCCESS)
+		return status;
+
+	if (!pcfr->is_cap_interval_mode_sel_support) {
+		cfr_err("Capture count support not enabled");
+		status = QDF_STATUS_E_NOSUPPORT;
+	} else {
+		pcfr->rcc_param.capture_intval_mode_sel =
+			params->cap_intval_mode_sel;
+	}
+	wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
+
+	return status;
+}
+
 /*
  * Set capture interval from the provided configuration into cfr_rcc_param.
  * All fixed parameters are needed to be stored into cfr_rcc_param.
@@ -844,6 +927,10 @@ QDF_STATUS ucfg_cfr_get_cfg(struct wlan_objmgr_vdev *vdev)
 		pcfr->rcc_param.capture_duration);
 	cfr_err("capture interval : %u usec\n",
 		pcfr->rcc_param.capture_interval);
+	cfr_err("capture count : %u\n",
+		pcfr->rcc_param.capture_count);
+	cfr_err("capture interval mode sel : %u\n",
+		pcfr->rcc_param.capture_intval_mode_sel);
 	cfr_err("UL MU User mask lower : %u\n",
 		pcfr->rcc_param.ul_mu_user_mask_lower);
 	cfr_err("UL MU User mask upper : %u\n",

+ 7 - 0
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -1394,12 +1394,19 @@ struct wlan_lmac_if_sa_api_rx_ops {
  * struct wlan_lmac_if_cfr_rx_ops - CFR south bound rx function pointers
  * @cfr_support_set: Set the CFR support based on FW advert
  * @cfr_info_send: Send cfr info to upper layers
+ * @cfr_capture_count_support_set: Set the capture_count support based on FW
+ * advert
+ * @cfr_mo_marking_support_set: Set MO marking supported based on FW advert
  */
 struct wlan_lmac_if_cfr_rx_ops {
 	void (*cfr_support_set)(struct wlan_objmgr_psoc *psoc, uint32_t value);
 	uint32_t (*cfr_info_send)(struct wlan_objmgr_pdev *pdev, void *head,
 				  size_t hlen, void *data, size_t dlen,
 				  void *tail, size_t tlen);
+	QDF_STATUS (*cfr_capture_count_support_set)(
+			struct wlan_objmgr_psoc *psoc, uint32_t value);
+	QDF_STATUS (*cfr_mo_marking_support_set)(struct wlan_objmgr_psoc *psoc,
+						 uint32_t value);
 };
 #endif
 

+ 3 - 0
umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

@@ -264,6 +264,9 @@ wlan_lmac_if_cfr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 	/* CFR rx ops */
 	cfr_rx_ops->cfr_support_set = tgt_cfr_support_set;
 	cfr_rx_ops->cfr_info_send  = tgt_cfr_info_send;
+	cfr_rx_ops->cfr_capture_count_support_set =
+		tgt_cfr_capture_count_support_set;
+	cfr_rx_ops->cfr_mo_marking_support_set = tgt_cfr_mo_marking_support_set;
 }
 #else
 static void