Ver Fonte

qcacld-3.0: Issue disconnect for STA if new interface is Mon intf

Currently, when Rx monitor mode interface is coming up, STA is
not disconnected causing RXDMA ring to be used as both error ring
and destination ring. This is causing backpressure in RXDMA ring.
To fix this, issue disconnect for STA when Rx monitor mode is
being added.

Change-Id: I95e73edd80472a8aae9092ebdbce5e514b1cd531
CRs-Fixed: 3799325
Ananya Gupta há 1 ano atrás
pai
commit
25b2dea7fd

+ 4 - 5
components/dp/dispatcher/inc/wlan_dp_api.h

@@ -76,17 +76,16 @@ void wlan_dp_set_fisa_dynamic_aggr_size_support(bool dynamic_aggr_size_support);
 
 #ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
 /**
- * wlan_dp_is_local_pkt_capture_enabled() - Get local packet capture config
+ * wlan_dp_is_local_pkt_capture_active() - Get local packet capture config
  * @psoc: pointer to psoc object
  *
- * Return: true if local packet capture is enabled from ini
- *         false otherwise
+ * Return: true if local packet capture is active, false otherwise
  */
 bool
-wlan_dp_is_local_pkt_capture_enabled(struct wlan_objmgr_psoc *psoc);
+wlan_dp_is_local_pkt_capture_active(struct wlan_objmgr_psoc *psoc);
 #else
 static inline bool
-wlan_dp_is_local_pkt_capture_enabled(struct wlan_objmgr_psoc *psoc)
+wlan_dp_is_local_pkt_capture_active(struct wlan_objmgr_psoc *psoc)
 {
 	return false;
 }

+ 15 - 2
components/dp/dispatcher/src/wlan_dp_api.c

@@ -21,6 +21,7 @@
 #include "wlan_dp_main.h"
 #include "wlan_dp_api.h"
 #include <wlan_dp_fisa_rx.h>
+#include <cdp_txrx_ctrl.h>
 
 void wlan_dp_update_peer_map_unmap_version(uint8_t *version)
 {
@@ -53,11 +54,23 @@ void wlan_dp_set_fisa_dynamic_aggr_size_support(bool dynamic_aggr_size_support)
 }
 
 #ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
-bool wlan_dp_is_local_pkt_capture_enabled(struct wlan_objmgr_psoc *psoc)
+bool wlan_dp_is_local_pkt_capture_active(struct wlan_objmgr_psoc *psoc)
 {
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
+	union cdp_config_param_t param;
+	QDF_STATUS status;
 
-	return cdp_cfg_get(soc, cfg_dp_local_pkt_capture);
+	status = cdp_txrx_get_psoc_param(soc, CDP_MONITOR_FLAG, &param);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		dp_err("Unable to fetch monitor flags.");
+		return false;
+	}
+
+	if (cdp_cfg_get(soc, cfg_dp_local_pkt_capture) &&
+	    !(QDF_MONITOR_FLAG_OTHER_BSS & param.cdp_monitor_flag))
+		return true;
+
+	return false;
 }
 #endif
 

+ 1 - 1
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c

@@ -1059,7 +1059,7 @@ QDF_STATUS cm_connect_start_ind(struct wlan_objmgr_vdev *vdev,
 		return QDF_STATUS_E_INVAL;
 	}
 
-	if (!wlan_dp_is_local_pkt_capture_enabled(psoc) &&
+	if (!wlan_dp_is_local_pkt_capture_active(psoc) &&
 	    policy_mgr_is_sta_mon_concurrency(psoc))
 		return QDF_STATUS_E_NOSUPPORT;
 

+ 3 - 1
core/hdd/inc/wlan_hdd_main.h

@@ -5093,6 +5093,7 @@ bool wlan_hdd_is_session_type_monitor(uint8_t session_type);
  * @name: name of the interface
  * @rtnl_held: True if RTNL lock is held
  * @name_assign_type: the name of assign type of the netdev
+ * @is_rx_mon: if monitor mode is getting enabled
  *
  * Return: 0 - on success
  *         err code - on failure
@@ -5100,7 +5101,8 @@ bool wlan_hdd_is_session_type_monitor(uint8_t session_type);
 int wlan_hdd_add_monitor_check(struct hdd_context *hdd_ctx,
 			       struct hdd_adapter **adapter,
 			       const char *name, bool rtnl_held,
-			       unsigned char name_assign_type);
+			       unsigned char name_assign_type,
+			       bool is_rx_mon);
 
 #ifdef CONFIG_WLAN_DEBUG_CRASH_INJECT
 /**

+ 2 - 3
core/hdd/src/wlan_hdd_main.c

@@ -21766,7 +21766,7 @@ int
 wlan_hdd_add_monitor_check(struct hdd_context *hdd_ctx,
 			   struct hdd_adapter **adapter,
 			   const char *name, bool rtnl_held,
-			   unsigned char name_assign_type)
+			   unsigned char name_assign_type, bool is_rx_mon)
 {
 	struct hdd_adapter *sta_adapter;
 	struct hdd_adapter *mon_adapter;
@@ -21790,8 +21790,7 @@ wlan_hdd_add_monitor_check(struct hdd_context *hdd_ctx,
 		return -EINVAL;
 	}
 
-	if (!ucfg_dp_is_local_pkt_capture_enabled(hdd_ctx->psoc) &&
-	    ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc)) {
+	if (is_rx_mon) {
 		num_open_session = policy_mgr_mode_specific_connection_count(
 						hdd_ctx->psoc,
 						PM_STA_MODE,

+ 6 - 3
core/hdd/src/wlan_hdd_p2p.c

@@ -772,6 +772,8 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
 
 	adapter = NULL;
 	if (type == NL80211_IFTYPE_MONITOR) {
+		bool is_rx_mon = QDF_MONITOR_FLAG_OTHER_BSS & *flags;
+
 		/*
 		 * if QDF_MONITOR_FLAG_OTHER_BSS bit is set in monitor flags
 		 * driver will assume current mode as STA + Monitor Mode.
@@ -780,14 +782,15 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
 		 * reject the request.
 		 **/
 		if ((ucfg_dp_is_local_pkt_capture_enabled(hdd_ctx->psoc) &&
-		     !(QDF_MONITOR_FLAG_OTHER_BSS & *flags)) ||
+		     !is_rx_mon) ||
 		    (ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc) &&
-		     (QDF_MONITOR_FLAG_OTHER_BSS & *flags)) ||
+		     is_rx_mon) ||
 		    ucfg_pkt_capture_get_mode(hdd_ctx->psoc) !=
 						PACKET_CAPTURE_MODE_DISABLE) {
 			ret = wlan_hdd_add_monitor_check(hdd_ctx,
 							 &adapter, name, true,
-							 name_assign_type);
+							 name_assign_type,
+							 is_rx_mon);
 			if (ret)
 				return ERR_PTR(-EINVAL);