mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
qcacld-3.0: Add TWT service bit capability support for ack event
Add TWT service bit capability support to check whether firmware supports ack event or not. If firmware doesn't support ack event then service bit capability will become 0 and whenever the TWT command comes, host will not wait for ack event and sends command in a legacy way This support is mainly added to handle new host and old firmware combination. Change-Id: I556d8edf0b505b774d756d6d904dd445418837bf CRs-Fixed: 2987966
This commit is contained in:
parent
f2be8b8bf6
commit
dc1ddf5e3b
1 changed files with 52 additions and 0 deletions
|
|
@ -37,6 +37,7 @@
|
|||
#include "cfg_ucfg_api.h"
|
||||
#include <wlan_cp_stats_mc_ucfg_api.h>
|
||||
#include <wlan_mlme_twt_ucfg_api.h>
|
||||
#include <target_if.h>
|
||||
|
||||
#define TWT_DISABLE_COMPLETE_TIMEOUT 1000
|
||||
#define TWT_ENABLE_COMPLETE_TIMEOUT 1000
|
||||
|
|
@ -1560,8 +1561,10 @@ static
|
|||
int hdd_send_twt_add_dialog_cmd(struct hdd_context *hdd_ctx,
|
||||
struct wmi_twt_add_dialog_param *twt_params)
|
||||
{
|
||||
struct target_psoc_info *tgt_hdl;
|
||||
QDF_STATUS status;
|
||||
int ret;
|
||||
bool twt_ack_cap;
|
||||
|
||||
status = sme_add_dialog_cmd(hdd_ctx->mac_handle,
|
||||
hdd_twt_add_dialog_comp_cb,
|
||||
|
|
@ -1569,6 +1572,14 @@ int hdd_send_twt_add_dialog_cmd(struct hdd_context *hdd_ctx,
|
|||
if (!QDF_IS_STATUS_SUCCESS(status))
|
||||
hdd_err("Failed to send add dialog command");
|
||||
|
||||
tgt_hdl = wlan_psoc_get_tgt_if_handle(hdd_ctx->psoc);
|
||||
if (!tgt_hdl) {
|
||||
hdd_err("tgt_hdl is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
target_psoc_get_twt_ack_cap(tgt_hdl, &twt_ack_cap);
|
||||
|
||||
ret = qdf_status_to_os_return(status);
|
||||
|
||||
return ret;
|
||||
|
|
@ -1881,17 +1892,28 @@ static
|
|||
int hdd_send_twt_del_dialog_cmd(struct hdd_context *hdd_ctx,
|
||||
struct wmi_twt_del_dialog_param *twt_params)
|
||||
{
|
||||
struct target_psoc_info *tgt_hdl;
|
||||
QDF_STATUS status;
|
||||
int ret = 0;
|
||||
bool twt_ack_cap;
|
||||
|
||||
status = sme_del_dialog_cmd(hdd_ctx->mac_handle,
|
||||
hdd_twt_del_dialog_comp_cb,
|
||||
twt_params);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
hdd_err("Failed to send del dialog command");
|
||||
ret = qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
tgt_hdl = wlan_psoc_get_tgt_if_handle(hdd_ctx->psoc);
|
||||
if (!tgt_hdl) {
|
||||
hdd_err("tgt_hdl is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
target_psoc_get_twt_ack_cap(tgt_hdl, &twt_ack_cap);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2353,8 +2375,10 @@ static
|
|||
int hdd_send_twt_pause_dialog_cmd(struct hdd_context *hdd_ctx,
|
||||
struct wmi_twt_pause_dialog_cmd_param *twt_params)
|
||||
{
|
||||
struct target_psoc_info *tgt_hdl;
|
||||
QDF_STATUS status;
|
||||
int ret = 0;
|
||||
bool twt_ack_cap;
|
||||
|
||||
status = sme_pause_dialog_cmd(hdd_ctx->mac_handle,
|
||||
twt_params);
|
||||
|
|
@ -2363,6 +2387,14 @@ int hdd_send_twt_pause_dialog_cmd(struct hdd_context *hdd_ctx,
|
|||
ret = qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
tgt_hdl = wlan_psoc_get_tgt_if_handle(hdd_ctx->psoc);
|
||||
if (!tgt_hdl) {
|
||||
hdd_err("tgt_hdl is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
target_psoc_get_twt_ack_cap(tgt_hdl, &twt_ack_cap);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2447,12 +2479,22 @@ static
|
|||
int hdd_send_twt_nudge_dialog_cmd(struct hdd_context *hdd_ctx,
|
||||
struct wmi_twt_nudge_dialog_cmd_param *twt_params)
|
||||
{
|
||||
struct target_psoc_info *tgt_hdl;
|
||||
QDF_STATUS status;
|
||||
bool twt_ack_cap;
|
||||
|
||||
status = sme_nudge_dialog_cmd(hdd_ctx->mac_handle, twt_params);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
hdd_err("Failed to send nudge dialog command");
|
||||
|
||||
tgt_hdl = wlan_psoc_get_tgt_if_handle(hdd_ctx->psoc);
|
||||
if (!tgt_hdl) {
|
||||
hdd_err("tgt_hdl is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
target_psoc_get_twt_ack_cap(tgt_hdl, &twt_ack_cap);
|
||||
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
|
|
@ -2680,8 +2722,10 @@ static int
|
|||
hdd_send_twt_resume_dialog_cmd(struct hdd_context *hdd_ctx,
|
||||
struct wmi_twt_resume_dialog_cmd_param *twt_params)
|
||||
{
|
||||
struct target_psoc_info *tgt_hdl;
|
||||
QDF_STATUS status;
|
||||
int ret = 0;
|
||||
bool twt_ack_cap;
|
||||
|
||||
status = sme_resume_dialog_cmd(hdd_ctx->mac_handle,
|
||||
twt_params);
|
||||
|
|
@ -2690,6 +2734,14 @@ hdd_send_twt_resume_dialog_cmd(struct hdd_context *hdd_ctx,
|
|||
ret = qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
tgt_hdl = wlan_psoc_get_tgt_if_handle(hdd_ctx->psoc);
|
||||
if (!tgt_hdl) {
|
||||
hdd_err("tgt_hdl is NULL");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
target_psoc_get_twt_ack_cap(tgt_hdl, &twt_ack_cap);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue