mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
qcacld-3.0: Check peer TWT capability before TWT setup request
Currently, in TWT setup command, if peer does not support TWT capabilities then firmware returns status = 4. Add condition to check the peer capabilities before sends TWT setup request to firmware. Change-Id: Icd1cbeff2db2bdec4e456013e98270a526ff22ce CRs-Fixed: 3082071
This commit is contained in:
parent
074c34f983
commit
770f87ec4c
3 changed files with 43 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 above
|
||||
|
|
@ -382,6 +383,18 @@ uint8_t ucfg_mlme_get_twt_peer_capabilities(struct wlan_objmgr_psoc *psoc,
|
|||
return mlme_get_twt_peer_capabilities(psoc, peer_mac);
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_mlme_get_twt_peer_responder_capabilities() - Get peer responder
|
||||
* capabilities
|
||||
* @psoc: Pointer to global psoc object
|
||||
* @peer_mac: Pointer to peer mac address
|
||||
*
|
||||
* Return: Return True if peer responder capabilities support else False
|
||||
*/
|
||||
bool ucfg_mlme_get_twt_peer_responder_capabilities(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct qdf_mac_addr *peer_mac);
|
||||
|
||||
/**
|
||||
* ucfg_mlme_init_twt_context() - Initialize TWT context
|
||||
* @psoc: Pointer to global psoc object
|
||||
|
|
@ -678,6 +691,14 @@ uint8_t ucfg_mlme_get_twt_peer_capabilities(struct wlan_objmgr_psoc *psoc,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline
|
||||
bool ucfg_mlme_get_twt_peer_responder_capabilities(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct qdf_mac_addr *peer_mac)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline
|
||||
QDF_STATUS ucfg_mlme_init_twt_context(struct wlan_objmgr_psoc *psoc,
|
||||
struct qdf_mac_addr *peer_mac,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 above
|
||||
|
|
@ -259,6 +260,20 @@ ucfg_mlme_set_twt_nudge_tgt_cap(struct wlan_objmgr_psoc *psoc, bool val)
|
|||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
bool ucfg_mlme_get_twt_peer_responder_capabilities(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct qdf_mac_addr *peer_mac)
|
||||
{
|
||||
uint8_t peer_cap;
|
||||
|
||||
peer_cap = mlme_get_twt_peer_capabilities(psoc, peer_mac);
|
||||
|
||||
if (peer_cap & WLAN_TWT_CAPA_RESPONDER)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_mlme_get_twt_nudge_tgt_cap(struct wlan_objmgr_psoc *psoc, bool *val)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1817,6 +1817,13 @@ static int hdd_twt_setup_session(struct hdd_adapter *adapter,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!ucfg_mlme_get_twt_peer_responder_capabilities(
|
||||
adapter->hdd_ctx->psoc,
|
||||
&hdd_sta_ctx->conn_info.bssid)) {
|
||||
hdd_err_rl("TWT setup reject: TWT responder not supported");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
ret = hdd_twt_get_add_dialog_values(tb2, ¶ms);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue