qcacld-3.0: Add spatial reuse feature support
Add SAP mode support for non-srg spatial reuse. Change-Id: Ic575eefd0d36b6750d826c9bccbd53f07ae9ea75 CRs-Fixed: 3213404
This commit is contained in:

committed by
Madan Koyyalamudi

parent
19a58a9c0f
commit
e728680f11
42
components/spatial_reuse/dispatcher/src/spatial_reuse_api.c
Normal file
42
components/spatial_reuse/dispatcher/src/spatial_reuse_api.c
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2022 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
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC : contains interface prototypes for spatial_reuse api
|
||||
*/
|
||||
|
||||
#include <spatial_reuse_api.h>
|
||||
|
||||
QDF_STATUS wlan_spatial_reuse_config_set(struct wlan_objmgr_vdev *vdev,
|
||||
uint8_t sr_ctrl,
|
||||
uint8_t non_srg_max_pd_offset)
|
||||
{
|
||||
struct wlan_lmac_if_tx_ops *tx_ops;
|
||||
struct wlan_objmgr_psoc *psoc = wlan_vdev_get_psoc(vdev);
|
||||
|
||||
if (!psoc)
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
|
||||
tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
|
||||
if (!tx_ops)
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
|
||||
if (tx_ops->spatial_reuse_tx_ops.send_cfg)
|
||||
return tx_ops->spatial_reuse_tx_ops.send_cfg(vdev, sr_ctrl,
|
||||
non_srg_max_pd_offset);
|
||||
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 2022 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
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC : contains interface prototypes for OS_IF layer
|
||||
*/
|
||||
|
||||
#include <qdf_trace.h>
|
||||
#include <spatial_reuse_ucfg_api.h>
|
||||
#include <spatial_reuse_api.h>
|
||||
|
||||
void ucfg_spatial_reuse_get_sr_config(struct wlan_objmgr_vdev *vdev,
|
||||
uint8_t *sr_ctrl,
|
||||
uint8_t *non_srg_max_pd_offset,
|
||||
bool *he_spr_enabled)
|
||||
{
|
||||
*sr_ctrl = wlan_vdev_mlme_get_sr_ctrl(vdev);
|
||||
*non_srg_max_pd_offset = wlan_vdev_mlme_get_pd_offset(vdev);
|
||||
*he_spr_enabled = wlan_vdev_mlme_get_he_spr_enabled(vdev);
|
||||
}
|
||||
|
||||
void ucfg_spatial_reuse_set_sr_config(struct wlan_objmgr_vdev *vdev,
|
||||
uint8_t sr_ctrl,
|
||||
uint8_t non_srg_max_pd_offset)
|
||||
{
|
||||
wlan_vdev_mlme_set_sr_ctrl(vdev, sr_ctrl);
|
||||
wlan_vdev_mlme_set_pd_offset(vdev, non_srg_max_pd_offset);
|
||||
}
|
||||
|
||||
void ucfg_spatial_reuse_send_sr_config(struct wlan_objmgr_vdev *vdev,
|
||||
bool enable)
|
||||
{
|
||||
uint8_t sr_ctrl = 0;
|
||||
uint8_t non_srg_max_pd_offset = 0;
|
||||
|
||||
if (enable && (!wlan_vdev_mlme_get_he_spr_enabled(vdev))) {
|
||||
sr_ctrl = wlan_vdev_mlme_get_sr_ctrl(vdev);
|
||||
non_srg_max_pd_offset = wlan_vdev_mlme_get_pd_offset(vdev);
|
||||
if (sr_ctrl && non_srg_max_pd_offset) {
|
||||
wlan_spatial_reuse_config_set(vdev, sr_ctrl,
|
||||
non_srg_max_pd_offset);
|
||||
wlan_vdev_mlme_set_he_spr_enabled(vdev, true);
|
||||
}
|
||||
} else if (!enable && wlan_vdev_mlme_get_he_spr_enabled(vdev)) {
|
||||
wlan_spatial_reuse_config_set(vdev, sr_ctrl,
|
||||
non_srg_max_pd_offset);
|
||||
wlan_vdev_mlme_set_he_spr_enabled(vdev, false);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user