Browse Source

qcacld-3.0: handle multiple sap if NAPI is enabled for IPA

Disable IPA when second SAP is turned on only if NAPI support
is enabled for IPA path.

Change-Id: Id30714156a959ed940d0480cb0e0d8db467c821f
CRs-Fixed: 2807158
Ananya Gupta 4 years ago
parent
commit
a43193f48b
2 changed files with 31 additions and 17 deletions
  1. 20 0
      components/ipa/core/inc/wlan_ipa_core.h
  2. 11 17
      components/ipa/core/src/wlan_ipa_core.c

+ 20 - 0
components/ipa/core/inc/wlan_ipa_core.h

@@ -595,6 +595,19 @@ void ipa_set_rps_per_vdev(struct wlan_ipa_priv *ipa_ctx, uint8_t vdev_id,
 	ipa_ctx->rps_enable(vdev_id, enable);
 }
 
+/**
+ * wlan_ipa_handle_multiple_sap_evt() - Handle multiple SAP connect/disconnect
+ * @ipa_ctx: IPA global context
+ * @type: IPA event type.
+ *
+ * This function is used to disable pipes when multiple SAP are connected and
+ * enable pipes back when only one SAP is connected.
+ *
+ * Return: None
+ */
+void wlan_ipa_handle_multiple_sap_evt(struct wlan_ipa_priv *ipa_ctx,
+				      qdf_ipa_wlan_event type);
+
 #else
 static inline
 void ipa_set_rps(struct wlan_ipa_priv *ipa_ctx, enum QDF_OPMODE mode,
@@ -607,6 +620,13 @@ void ipa_set_rps_per_vdev(struct wlan_ipa_priv *ipa_ctx, uint8_t vdev_id,
 			  bool enable)
 {
 }
+
+static inline
+void wlan_ipa_handle_multiple_sap_evt(struct wlan_ipa_priv *ipa_ctx,
+				      qdf_ipa_wlan_event type)
+{
+}
+
 #endif
 
 /**

+ 11 - 17
components/ipa/core/src/wlan_ipa_core.c

@@ -1622,7 +1622,7 @@ static QDF_STATUS wlan_ipa_uc_handle_first_con(struct wlan_ipa_priv *ipa_ctx)
 {
 	ipa_debug("enter");
 
-	if (ipa_ctx->num_sap_connected > 1) {
+	if (qdf_ipa_get_lan_rx_napi() && (ipa_ctx->num_sap_connected > 1)) {
 		ipa_debug("Multiple SAP connected. Not enabling pipes. Exit");
 		return QDF_STATUS_E_PERM;
 	}
@@ -1982,17 +1982,7 @@ static QDF_STATUS wlan_ipa_send_msg(qdf_netdev_t net_dev,
 	return QDF_STATUS_SUCCESS;
 }
 
-/**
- * wlan_ipa_handle_multiple_sap_evt() - Handle multiple SAP connect/disconnect
- * @ipa_ctx: IPA global context
- * @type: IPA event type.
- *
- * This function is used to disable pipes when multiple SAP are connected and
- * enable pipes back when only one SAP is connected.
- *
- * Return: None
- */
-static inline
+#ifdef IPA_LAN_RX_NAPI_SUPPORT
 void wlan_ipa_handle_multiple_sap_evt(struct wlan_ipa_priv *ipa_ctx,
 				      qdf_ipa_wlan_event type)
 {
@@ -2034,6 +2024,7 @@ void wlan_ipa_handle_multiple_sap_evt(struct wlan_ipa_priv *ipa_ctx,
 			wlan_ipa_uc_disable_pipes(ipa_ctx, true);
 	}
 }
+#endif
 
 /**
  * __wlan_ipa_wlan_evt() - IPA event handler
@@ -2184,7 +2175,8 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 					}
 				}
 
-				if (ipa_ctx->num_sap_connected == 1) {
+				if (qdf_ipa_get_lan_rx_napi() &&
+				    ipa_ctx->num_sap_connected == 1) {
 					wlan_ipa_handle_multiple_sap_evt(ipa_ctx,
 									 type);
 				}
@@ -2305,12 +2297,13 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 
 		if (wlan_ipa_uc_is_enabled(ipa_ctx->config)) {
 			qdf_mutex_release(&ipa_ctx->event_lock);
-			if (ipa_ctx->num_sap_connected == 1) {
+			if (qdf_ipa_get_lan_rx_napi() &&
+			    (ipa_ctx->num_sap_connected > 1)) {
+				wlan_ipa_handle_multiple_sap_evt(ipa_ctx, type);
+			} else {
 				wlan_ipa_uc_offload_enable_disable(ipa_ctx,
 							SIR_AP_RX_DATA_OFFLOAD,
 							session_id, true);
-			} else {
-				wlan_ipa_handle_multiple_sap_evt(ipa_ctx, type);
 			}
 			qdf_mutex_acquire(&ipa_ctx->event_lock);
 		}
@@ -2451,7 +2444,8 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 			}
 		}
 
-		if (ipa_ctx->num_sap_connected == 1)
+		if (qdf_ipa_get_lan_rx_napi() &&
+		    (ipa_ctx->num_sap_connected == 1))
 			wlan_ipa_handle_multiple_sap_evt(ipa_ctx, type);
 
 		qdf_mutex_release(&ipa_ctx->event_lock);