Ver Fonte

qcacld-3.0: Add is_2g_iface support in WLAN IPA

With IPA TX two pipes support, TX rings for 2G and 5G traffic
are separated. As a result, WLAN needs to let IPA driver
know if the interface registered to IPA is 2G or 5G so that
IPA could differentiate and designate the interface for the
correct IPA TX pipe.

In this change, a new param is_2g_iface is added for the
event interface between protocol and IPA component. And
this new param is applicable only STA_CONNECT and
AP_CONNECT where wlan will register interface details
including is_2g_iface to IPA driver.

For two pipes implementation, is_2g_iface piggy-backs
session_id when passing it to CDP layer. And CDP layer
needs to decode session_id and is_2g_iface.

Change-Id: I5e02ec6969bb2f77d6b40e89d5a9451a7bb0be9d
CRs-Fixed: 2702704
Tiger Yu há 4 anos atrás
pai
commit
fee8629f3e

+ 2 - 1
components/ipa/core/inc/wlan_ipa_core.h

@@ -746,13 +746,14 @@ static inline void wlan_ipa_mcc_work_handler(void *data)
  * @session_id: session id for the event
  * @type: event enum of type ipa_wlan_event
  * @mac_address: MAC address associated with the event
+ * @is_2g_iface: true if interface is operating on 2G band, otherwise false
  *
  * Return: QDF_STATUS
  */
 QDF_STATUS wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 			     uint8_t session_id,
 			     enum wlan_ipa_wlan_event ipa_event_type,
-			     uint8_t *mac_addr);
+			     uint8_t *mac_addr, bool is_2g_iface);
 
 /**
  * wlan_ipa_uc_smmu_map() - Map / Unmap DMA buffer to IPA UC

+ 2 - 1
components/ipa/core/inc/wlan_ipa_main.h

@@ -396,13 +396,14 @@ QDF_STATUS ipa_send_mcc_scc_msg(struct wlan_objmgr_pdev *pdev,
  * @session_id: session id for the event
  * @type: event enum of type ipa_wlan_event
  * @mac_address: MAC address associated with the event
+ * @is_2g_iface: true if interface is operating on 2G band, otherwise false
  *
  * Return: QDF_STATUS
  */
 QDF_STATUS ipa_wlan_evt(struct wlan_objmgr_pdev *pdev, qdf_netdev_t net_dev,
 			uint8_t device_mode, uint8_t session_id,
 			enum wlan_ipa_wlan_event ipa_event_type,
-			uint8_t *mac_addr);
+			uint8_t *mac_addr, bool is_2g_iface);
 
 /**
  * ipa_uc_smmu_map() - Map / Unmap DMA buffer to IPA UC

+ 2 - 0
components/ipa/core/inc/wlan_ipa_priv.h

@@ -471,6 +471,7 @@ struct ipa_uc_fw_stats {
  * @session_id: Session ID
  * @mac_addr: Mac address
  * @is_loading: Driver loading flag
+ * @is_2g_iface: true if interface is operating on 2G band, otherwise false
  */
 struct wlan_ipa_uc_pending_event {
 	qdf_list_node_t node;
@@ -480,6 +481,7 @@ struct wlan_ipa_uc_pending_event {
 	uint8_t session_id;
 	uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
 	bool is_loading;
+	bool is_2g_iface;
 };
 
 /**

+ 32 - 8
components/ipa/core/src/wlan_ipa_core.c

@@ -1604,6 +1604,19 @@ static void wlan_ipa_nbuf_cb(qdf_nbuf_t skb)
 
 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
 
+#ifdef IPA_WDI3_TX_TWO_PIPES
+#define WLAN_IPA_SESSION_ID_SHIFT 1
+static uint8_t wlan_ipa_set_session_id(uint8_t session_id, bool is_2g_iface)
+{
+	return (session_id << WLAN_IPA_SESSION_ID_SHIFT) | is_2g_iface;
+}
+#else
+static uint8_t wlan_ipa_set_session_id(uint8_t session_id, bool is_2g_iface)
+{
+	return session_id;
+}
+#endif
+
 /**
  * wlan_ipa_setup_iface() - Setup IPA on a given interface
  * @ipa_ctx: IPA IPA global context
@@ -1612,6 +1625,7 @@ static void wlan_ipa_nbuf_cb(qdf_nbuf_t skb)
  * @adapter: Interface upon which IPA is being setup
  * @session_id: Station ID of the API instance
  * @mac_addr: MAC addr of the API instance
+ * @is_2g_iface: true if Net interface is operating on 2G band, otherwise false
  *
  * Return: QDF STATUS
  */
@@ -1619,7 +1633,8 @@ static QDF_STATUS wlan_ipa_setup_iface(struct wlan_ipa_priv *ipa_ctx,
 				       qdf_netdev_t net_dev,
 				       uint8_t device_mode,
 				       uint8_t session_id,
-				       uint8_t *mac_addr)
+				       uint8_t *mac_addr,
+				       bool is_2g_iface)
 {
 	struct wlan_ipa_iface_context *iface_context = NULL;
 	int i;
@@ -1704,7 +1719,8 @@ static QDF_STATUS wlan_ipa_setup_iface(struct wlan_ipa_priv *ipa_ctx,
 				     net_dev->dev_addr,
 				     iface_context->prod_client,
 				     iface_context->cons_client,
-				     session_id,
+				     wlan_ipa_set_session_id(session_id,
+							     is_2g_iface),
 				     wlan_ipa_is_ipv6_enabled(ipa_ctx->config));
 	if (status != QDF_STATUS_SUCCESS)
 		goto end;
@@ -2171,6 +2187,8 @@ void wlan_ipa_handle_multiple_sap_evt(struct wlan_ipa_priv *ipa_ctx,
  * @session_id: session id for the event
  * @type: event enum of type ipa_wlan_event
  * @mac_address: MAC address associated with the event
+ * @is_2g_iface: @net_dev is 2G or not for QDF_IPA_STA_CONNECT and
+ *		 QDF_IPA_AP_CONNECT
  *
  * This function is meant to be called from within wlan_ipa_ctx.c
  *
@@ -2179,7 +2197,7 @@ void wlan_ipa_handle_multiple_sap_evt(struct wlan_ipa_priv *ipa_ctx,
 static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 				      uint8_t session_id,
 				      qdf_ipa_wlan_event type,
-				      uint8_t *mac_addr)
+				      uint8_t *mac_addr, bool is_2g_iface)
 {
 	struct wlan_ipa_priv *ipa_ctx = gp_ipa;
 	struct wlan_ipa_iface_context *iface_ctx = NULL;
@@ -2296,6 +2314,7 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 			pending_event->is_loading = ipa_ctx->resource_loading;
 			qdf_mem_copy(pending_event->mac_addr,
 				     mac_addr, QDF_MAC_ADDR_SIZE);
+			pending_event->is_2g_iface = is_2g_iface;
 			qdf_list_insert_back(&ipa_ctx->pending_event,
 					     &pending_event->node);
 
@@ -2359,7 +2378,8 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 		}
 
 		status = wlan_ipa_setup_iface(ipa_ctx, net_dev, device_mode,
-					      session_id, mac_addr);
+					      session_id, mac_addr,
+					      is_2g_iface);
 		if (status != QDF_STATUS_SUCCESS) {
 			ipa_err("wlan_ipa_setup_iface failed %u", status);
 			qdf_mutex_release(&ipa_ctx->event_lock);
@@ -2430,7 +2450,8 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 		}
 
 		status = wlan_ipa_setup_iface(ipa_ctx, net_dev, device_mode,
-					      session_id, mac_addr);
+					      session_id, mac_addr,
+					      is_2g_iface);
 		if (status != QDF_STATUS_SUCCESS) {
 			qdf_mutex_release(&ipa_ctx->event_lock);
 			ipa_err("%s: Evt: %d, Interface setup failed",
@@ -2860,13 +2881,14 @@ wlan_host_to_ipa_wlan_event(enum wlan_ipa_wlan_event wlan_ipa_event_type)
  * @session_id: session id for the event
  * @ipa_event_type: event enum of type wlan_ipa_wlan_event
  * @mac_address: MAC address associated with the event
+ * @is_2g_iface: @net_dev is 2g interface or not
  *
  * Return: QDF_STATUS
  */
 QDF_STATUS wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 		      uint8_t session_id,
 		      enum wlan_ipa_wlan_event ipa_event_type,
-		      uint8_t *mac_addr)
+		      uint8_t *mac_addr, bool is_2g_iface)
 {
 	qdf_ipa_wlan_event type = wlan_host_to_ipa_wlan_event(ipa_event_type);
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
@@ -2875,7 +2897,8 @@ QDF_STATUS wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
 	if ((device_mode == QDF_STA_MODE) ||
 	    (device_mode == QDF_SAP_MODE))
 		status  = __wlan_ipa_wlan_evt(net_dev, device_mode,
-					      session_id, type, mac_addr);
+					      session_id, type, mac_addr,
+					      is_2g_iface);
 
 	return status;
 }
@@ -2914,7 +2937,8 @@ wlan_ipa_uc_proc_pending_event(struct wlan_ipa_priv *ipa_ctx, bool is_loading)
 					   pending_event->device_mode,
 					   pending_event->session_id,
 					   pending_event->type,
-					   pending_event->mac_addr);
+					   pending_event->mac_addr,
+					   pending_event->is_2g_iface);
 		}
 
 		if (vdev)

+ 2 - 2
components/ipa/core/src/wlan_ipa_main.c

@@ -627,7 +627,7 @@ QDF_STATUS ipa_send_mcc_scc_msg(struct wlan_objmgr_pdev *pdev,
 QDF_STATUS ipa_wlan_evt(struct wlan_objmgr_pdev *pdev, qdf_netdev_t net_dev,
 			uint8_t device_mode, uint8_t session_id,
 			enum wlan_ipa_wlan_event ipa_event_type,
-			uint8_t *mac_addr)
+			uint8_t *mac_addr, bool is_2g_iface)
 {
 	struct wlan_ipa_priv *ipa_obj;
 
@@ -641,7 +641,7 @@ QDF_STATUS ipa_wlan_evt(struct wlan_objmgr_pdev *pdev, qdf_netdev_t net_dev,
 	}
 
 	return wlan_ipa_wlan_evt(net_dev, device_mode, session_id,
-				 ipa_event_type, mac_addr);
+				 ipa_event_type, mac_addr, is_2g_iface);
 }
 
 int ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)

+ 4 - 3
components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2021 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
@@ -298,6 +298,7 @@ QDF_STATUS ucfg_ipa_send_mcc_scc_msg(struct wlan_objmgr_pdev *pdev,
  * @session_id: session id for the event
  * @type: event enum of type ipa_wlan_event
  * @mac_address: MAC address associated with the event
+ * @is_2g_iface: true if interface is operating on 2G band, otherwise false
  *
  * Return: QDF_STATUS
  */
@@ -305,7 +306,7 @@ QDF_STATUS ucfg_ipa_wlan_evt(struct wlan_objmgr_pdev *pdev,
 			     qdf_netdev_t net_dev, uint8_t device_mode,
 			     uint8_t session_id,
 			     enum wlan_ipa_wlan_event ipa_event_type,
-			     uint8_t *mac_addr);
+			     uint8_t *mac_addr, bool is_2g_iface);
 
 /**
  * ucfg_ipa_uc_smmu_map() - Map / Unmap DMA buffer to IPA UC
@@ -586,7 +587,7 @@ QDF_STATUS ucfg_ipa_wlan_evt(struct wlan_objmgr_pdev *pdev,
 			     qdf_netdev_t net_dev, uint8_t device_mode,
 			     uint8_t session_id,
 			     enum wlan_ipa_wlan_event ipa_event_type,
-			     uint8_t *mac_addr)
+			     uint8_t *mac_addr, bool is_2g_iface)
 {
 	return QDF_STATUS_SUCCESS;
 }

+ 3 - 3
components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2021 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
@@ -176,10 +176,10 @@ QDF_STATUS ucfg_ipa_wlan_evt(struct wlan_objmgr_pdev *pdev,
 			     qdf_netdev_t net_dev, uint8_t device_mode,
 			     uint8_t session_id,
 			     enum wlan_ipa_wlan_event ipa_event_type,
-			     uint8_t *mac_addr)
+			     uint8_t *mac_addr, bool is_2g_iface)
 {
 	return ipa_wlan_evt(pdev, net_dev, device_mode, session_id,
-			    ipa_event_type, mac_addr);
+			    ipa_event_type, mac_addr, is_2g_iface);
 }
 
 int ucfg_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)

+ 3 - 1
core/hdd/src/wlan_hdd_assoc.c

@@ -2732,7 +2732,9 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 					  adapter->device_mode,
 					  adapter->vdev_id,
 					  WLAN_IPA_STA_CONNECT,
-					  roam_info->bssid.bytes);
+					  roam_info->bssid.bytes,
+					  WLAN_REG_IS_24GHZ_CH_FREQ(
+						sta_ctx->conn_info.chan_freq));
 
 		if (adapter->device_mode == QDF_STA_MODE)
 			cdp_reset_rx_hw_ext_stats(soc);

+ 3 - 1
core/hdd/src/wlan_hdd_cm_connect.c

@@ -912,7 +912,9 @@ hdd_cm_connect_success_pre_user_update(struct wlan_objmgr_vdev *vdev,
 				  adapter->device_mode,
 				  adapter->vdev_id,
 				  WLAN_IPA_STA_CONNECT,
-				  rsp->bssid.bytes);
+				  rsp->bssid.bytes,
+				  WLAN_REG_IS_24GHZ_CH_FREQ(
+					sta_ctx->conn_info.chan_freq));
 
 	if (adapter->device_mode == QDF_STA_MODE)
 		cdp_reset_rx_hw_ext_stats(soc);

+ 2 - 1
core/hdd/src/wlan_hdd_cm_disconnect.c

@@ -123,7 +123,8 @@ void __hdd_cm_disconnect_handler_pre_user_update(struct hdd_adapter *adapter)
 				  adapter->device_mode,
 				  adapter->vdev_id,
 				  WLAN_IPA_STA_DISCONNECT,
-				  sta_ctx->conn_info.bssid.bytes);
+				  sta_ctx->conn_info.bssid.bytes,
+				  false);
 
 	hdd_periodic_sta_stats_stop(adapter);
 	wlan_hdd_auto_shutdown_enable(hdd_ctx, true);

+ 11 - 7
core/hdd/src/wlan_hdd_hostapd.c

@@ -1971,12 +1971,15 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 		}
 
 		if (ucfg_ipa_is_enabled()) {
-			status = ucfg_ipa_wlan_evt(hdd_ctx->pdev,
-						   adapter->dev,
-						   adapter->device_mode,
-						   adapter->vdev_id,
-						   WLAN_IPA_AP_CONNECT,
-						   adapter->dev->dev_addr);
+			status = ucfg_ipa_wlan_evt(
+					hdd_ctx->pdev,
+					adapter->dev,
+					adapter->device_mode,
+					adapter->vdev_id,
+					WLAN_IPA_AP_CONNECT,
+					adapter->dev->dev_addr,
+					WLAN_REG_IS_24GHZ_CH_FREQ(
+						ap_ctx->operating_chan_freq));
 			if (status)
 				hdd_err("WLAN_AP_CONNECT event failed");
 		}
@@ -2326,7 +2329,8 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 						   adapter->device_mode,
 						   adapter->vdev_id,
 						   WLAN_IPA_CLIENT_CONNECT_EX,
-						   event->staMac.bytes);
+						   event->staMac.bytes,
+						   false);
 			if (status)
 				hdd_err("WLAN_CLIENT_CONNECT_EX event failed");
 		}

+ 4 - 3
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -1267,7 +1267,8 @@ QDF_STATUS hdd_softap_deregister_sta(struct hdd_adapter *adapter,
 				      adapter->device_mode,
 				      adapter->vdev_id,
 				      WLAN_IPA_CLIENT_DISCONNECT,
-				      mac_addr->bytes) != QDF_STATUS_SUCCESS)
+				      mac_addr->bytes,
+				      false) != QDF_STATUS_SUCCESS)
 			hdd_debug("WLAN_CLIENT_DISCONNECT event failed");
 	}
 
@@ -1485,8 +1486,8 @@ QDF_STATUS hdd_softap_stop_bss(struct hdd_adapter *adapter)
 				      adapter->device_mode,
 				      adapter->vdev_id,
 				      WLAN_IPA_AP_DISCONNECT,
-				      adapter->dev->dev_addr) !=
-		    QDF_STATUS_SUCCESS)
+				      adapter->dev->dev_addr,
+				      false) != QDF_STATUS_SUCCESS)
 			hdd_err("WLAN_AP_DISCONNECT event failed");
 	}