|
@@ -2061,6 +2061,53 @@ static void wlan_ipa_teardown_sys_pipe(struct wlan_ipa_priv *ipa_ctx)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+#ifndef QCA_LL_TX_FLOW_CONTROL_V2
|
|
|
+QDF_STATUS wlan_ipa_send_mcc_scc_msg(struct wlan_ipa_priv *ipa_ctx,
|
|
|
+ bool mcc_mode)
|
|
|
+{
|
|
|
+ qdf_ipa_msg_meta_t meta;
|
|
|
+ qdf_ipa_wlan_msg_t *msg;
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ if (!wlan_ipa_uc_sta_is_enabled(ipa_ctx->config))
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+
|
|
|
+ /* Send SCC/MCC Switching event to IPA */
|
|
|
+ QDF_IPA_MSG_META_MSG_LEN(&meta) = sizeof(*msg);
|
|
|
+ msg = qdf_mem_malloc(QDF_IPA_MSG_META_MSG_LEN(&meta));
|
|
|
+ if (msg == NULL) {
|
|
|
+ ipa_err("msg allocation failed");
|
|
|
+ return QDF_STATUS_E_NOMEM;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mcc_mode)
|
|
|
+ QDF_IPA_SET_META_MSG_TYPE(&meta, QDF_SWITCH_TO_MCC);
|
|
|
+ else
|
|
|
+ QDF_IPA_SET_META_MSG_TYPE(&meta, QDF_SWITCH_TO_SCC);
|
|
|
+ WLAN_IPA_LOG(QDF_TRACE_LEVEL_DEBUG,
|
|
|
+ "ipa_send_msg(Evt:%d)",
|
|
|
+ QDF_IPA_MSG_META_MSG_TYPE(&meta));
|
|
|
+
|
|
|
+ ret = qdf_ipa_send_msg(&meta, msg, wlan_ipa_msg_free_fn);
|
|
|
+
|
|
|
+ if (ret) {
|
|
|
+ ipa_err("ipa_send_msg(Evt:%d) - fail=%d",
|
|
|
+ QDF_IPA_MSG_META_MSG_TYPE(&meta), ret);
|
|
|
+ qdf_mem_free(msg);
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+static void wlan_ipa_mcc_work_handler(void *data)
|
|
|
+{
|
|
|
+ struct wlan_ipa_priv *ipa_ctx = (struct wlan_ipa_priv *)data;
|
|
|
+
|
|
|
+ wlan_ipa_send_mcc_scc_msg(ipa_ctx, ipa_ctx->mcc_mode);
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
/**
|
|
|
* wlan_ipa_setup() - IPA initialization function
|
|
|
* @ipa_ctx: IPA context
|
|
@@ -2134,6 +2181,9 @@ QDF_STATUS wlan_ipa_setup(struct wlan_ipa_priv *ipa_ctx,
|
|
|
ret = wlan_ipa_setup_sys_pipe(ipa_ctx);
|
|
|
if (ret)
|
|
|
goto fail_create_sys_pipe;
|
|
|
+
|
|
|
+ qdf_create_work(0, &ipa_ctx->mcc_work,
|
|
|
+ wlan_ipa_mcc_work_handler, ipa_ctx);
|
|
|
}
|
|
|
|
|
|
status = wlan_ipa_wdi_init(ipa_ctx);
|
|
@@ -2208,8 +2258,10 @@ QDF_STATUS wlan_ipa_cleanup(struct wlan_ipa_priv *ipa_ctx)
|
|
|
wlan_ipa_teardown_sys_pipe(ipa_ctx);
|
|
|
|
|
|
/* Teardown IPA sys_pipe for MCC */
|
|
|
- if (wlan_ipa_uc_sta_is_enabled(ipa_ctx->config))
|
|
|
+ if (wlan_ipa_uc_sta_is_enabled(ipa_ctx->config)) {
|
|
|
wlan_ipa_teardown_sys_pipe(ipa_ctx);
|
|
|
+ qdf_cancel_work(&ipa_ctx->mcc_work);
|
|
|
+ }
|
|
|
|
|
|
wlan_ipa_wdi_destroy_rm(ipa_ctx);
|
|
|
|
|
@@ -2253,45 +2305,17 @@ struct wlan_ipa_iface_context
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
-#ifndef QCA_LL_TX_FLOW_CONTROL_V2
|
|
|
-QDF_STATUS wlan_ipa_send_mcc_scc_msg(struct wlan_ipa_priv *ipa_ctx,
|
|
|
- bool mcc_mode)
|
|
|
+void wlan_ipa_set_mcc_mode(struct wlan_ipa_priv *ipa_ctx, bool mcc_mode)
|
|
|
{
|
|
|
- qdf_ipa_msg_meta_t meta;
|
|
|
- qdf_ipa_wlan_msg_t *msg;
|
|
|
- int ret;
|
|
|
-
|
|
|
if (!wlan_ipa_uc_sta_is_enabled(ipa_ctx->config))
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
-
|
|
|
- /* Send SCC/MCC Switching event to IPA */
|
|
|
- QDF_IPA_MSG_META_MSG_LEN(&meta) = sizeof(*msg);
|
|
|
- msg = qdf_mem_malloc(QDF_IPA_MSG_META_MSG_LEN(&meta));
|
|
|
- if (msg == NULL) {
|
|
|
- ipa_err("msg allocation failed");
|
|
|
- return QDF_STATUS_E_NOMEM;
|
|
|
- }
|
|
|
-
|
|
|
- if (mcc_mode)
|
|
|
- QDF_IPA_SET_META_MSG_TYPE(&meta, QDF_SWITCH_TO_MCC);
|
|
|
- else
|
|
|
- QDF_IPA_SET_META_MSG_TYPE(&meta, QDF_SWITCH_TO_SCC);
|
|
|
- WLAN_IPA_LOG(QDF_TRACE_LEVEL_DEBUG,
|
|
|
- "ipa_send_msg(Evt:%d)",
|
|
|
- QDF_IPA_MSG_META_MSG_TYPE(&meta));
|
|
|
-
|
|
|
- ret = qdf_ipa_send_msg(&meta, msg, wlan_ipa_msg_free_fn);
|
|
|
+ return;
|
|
|
|
|
|
- if (ret) {
|
|
|
- ipa_err("ipa_send_msg(Evt:%d) - fail=%d",
|
|
|
- QDF_IPA_MSG_META_MSG_TYPE(&meta), ret);
|
|
|
- qdf_mem_free(msg);
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
- }
|
|
|
+ if (ipa_ctx->mcc_mode == mcc_mode)
|
|
|
+ return;
|
|
|
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
+ ipa_ctx->mcc_mode = mcc_mode;
|
|
|
+ qdf_sched_work(0, &ipa_ctx->mcc_work);
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
/**
|
|
|
* wlan_ipa_uc_loaded_handler() - Process IPA uC loaded indication
|