|
@@ -1157,43 +1157,6 @@ int wlan_hdd_set_power_save(struct hdd_adapter *adapter,
|
|
|
return qdf_status_to_os_return(status);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- * wlan_hdd_update_mcc_adaptive_scheduler() - Function to update
|
|
|
- * MAS value to FW
|
|
|
- * @adapter: adapter object data
|
|
|
- * @is_enable: 0-Disable, 1-Enable MAS
|
|
|
- *
|
|
|
- * This function passes down the value of MAS to UMAC
|
|
|
- *
|
|
|
- * Return: 0 for success else non zero
|
|
|
- *
|
|
|
- */
|
|
|
-static int32_t wlan_hdd_update_mcc_adaptive_scheduler(
|
|
|
- struct hdd_adapter *adapter, bool is_enable)
|
|
|
-{
|
|
|
- struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
- uint8_t enable_mcc_adaptive_sch = 0;
|
|
|
-
|
|
|
- if (!hdd_ctx) {
|
|
|
- hdd_err("HDD context is null");
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
- hdd_info("enable/disable MAS :%d", is_enable);
|
|
|
- ucfg_policy_mgr_get_mcc_adaptive_sch(hdd_ctx->psoc,
|
|
|
- &enable_mcc_adaptive_sch);
|
|
|
- if (enable_mcc_adaptive_sch) {
|
|
|
-
|
|
|
-
|
|
|
- if (QDF_STATUS_SUCCESS != sme_set_mas(is_enable)) {
|
|
|
- hdd_err("Failed to enable/disable MAS");
|
|
|
- return -EAGAIN;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
* wlan_hdd_update_mcc_p2p_quota() - Function to Update P2P
|
|
|
* quota to FW
|
|
@@ -1233,20 +1196,32 @@ static void wlan_hdd_update_mcc_p2p_quota(struct hdd_adapter *adapter,
|
|
|
|
|
|
int32_t wlan_hdd_set_mas(struct hdd_adapter *adapter, uint8_t mas_value)
|
|
|
{
|
|
|
- int32_t ret = 0;
|
|
|
+ struct hdd_context *hdd_ctx;
|
|
|
+ uint8_t enable_mcc_adaptive_sch = 0;
|
|
|
|
|
|
if (!adapter) {
|
|
|
hdd_err("Adapter is NULL");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
+ hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
+ if (!hdd_ctx) {
|
|
|
+ hdd_err("HDD context is null");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
if (mas_value) {
|
|
|
hdd_info("Miracast is ON. Disable MAS and configure P2P quota");
|
|
|
- ret = wlan_hdd_update_mcc_adaptive_scheduler(
|
|
|
- adapter, false);
|
|
|
- if (0 != ret) {
|
|
|
- hdd_err("Failed to disable MAS");
|
|
|
- goto done;
|
|
|
+ ucfg_policy_mgr_get_mcc_adaptive_sch(hdd_ctx->psoc,
|
|
|
+ &enable_mcc_adaptive_sch);
|
|
|
+ if (enable_mcc_adaptive_sch) {
|
|
|
+ ucfg_policy_mgr_set_dynamic_mcc_adaptive_sch(
|
|
|
+ hdd_ctx->psoc, false);
|
|
|
+
|
|
|
+ if (QDF_STATUS_SUCCESS != sme_set_mas(false)) {
|
|
|
+ hdd_err("Failed to disable MAS");
|
|
|
+ return -EAGAIN;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1255,16 +1230,20 @@ int32_t wlan_hdd_set_mas(struct hdd_adapter *adapter, uint8_t mas_value)
|
|
|
hdd_info("Miracast is OFF. Enable MAS and reset P2P quota");
|
|
|
wlan_hdd_update_mcc_p2p_quota(adapter, false);
|
|
|
|
|
|
- ret = wlan_hdd_update_mcc_adaptive_scheduler(
|
|
|
- adapter, true);
|
|
|
- if (0 != ret) {
|
|
|
- hdd_err("Failed to enable MAS");
|
|
|
- goto done;
|
|
|
+ ucfg_policy_mgr_get_mcc_adaptive_sch(hdd_ctx->psoc,
|
|
|
+ &enable_mcc_adaptive_sch);
|
|
|
+ if (enable_mcc_adaptive_sch) {
|
|
|
+ ucfg_policy_mgr_set_dynamic_mcc_adaptive_sch(
|
|
|
+ hdd_ctx->psoc, true);
|
|
|
+
|
|
|
+ if (QDF_STATUS_SUCCESS != sme_set_mas(true)) {
|
|
|
+ hdd_err("Failed to enable MAS");
|
|
|
+ return -EAGAIN;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-done:
|
|
|
- return ret;
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
|