qcacld-3.0: Check peer TWT capabilities
In TWT component, for TWT setup request added below checks: 1. For individual TWT setup command, if peer does not support TWT responder capability then host will reject individual TWT setup request. 2. For broadcast TWT setup request, if peer does not support TWT broadcast capability then host will reject broadcast TWT setup request. Change-Id: I7265520b1bdceab67b121ba2250d374b1c284275 CRs-Fixed: 3131628
This commit is contained in:

committed by
Madan Koyyalamudi

parent
8cce734a2f
commit
a4febcf3f4
@@ -933,6 +933,8 @@ int osif_twt_setup_req(struct wlan_objmgr_vdev *vdev,
|
||||
uint8_t vdev_id, pdev_id;
|
||||
struct twt_add_dialog_param params = {0};
|
||||
uint32_t congestion_timeout = 0;
|
||||
uint8_t peer_cap;
|
||||
QDF_STATUS qdf_status;
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
@@ -968,6 +970,21 @@ int osif_twt_setup_req(struct wlan_objmgr_vdev *vdev,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
qdf_status = ucfg_twt_get_peer_capabilities(psoc, ¶ms.peer_macaddr,
|
||||
&peer_cap);
|
||||
if (QDF_IS_STATUS_ERROR(qdf_status))
|
||||
return -EINVAL;
|
||||
|
||||
if (params.flag_bcast && !(peer_cap & WLAN_TWT_CAPA_BROADCAST)) {
|
||||
osif_err_rl("TWT setup reject: TWT Broadcast not supported");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
if (!params.flag_bcast && !(peer_cap & WLAN_TWT_CAPA_RESPONDER)) {
|
||||
osif_err_rl("TWT setup reject: TWT responder not supported");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
ucfg_twt_cfg_get_congestion_timeout(psoc, &congestion_timeout);
|
||||
|
||||
if (congestion_timeout) {
|
||||
|
Reference in New Issue
Block a user