qcacld-3.0: Add async event for Spatial Reuse

Add async event for Spatial Reuse and also send Spatial Reuse
enable / disable event to upper layer due to same MAC concurrency.

Change-Id: Idcb5b99e39f1810e63ae7ac1e8d2eab6028a163f
CRs-Fixed: 3307801
This commit is contained in:
Rachit Kankane
2022-10-07 21:29:19 +05:30
committed by Madan Koyyalamudi
parent 45f42c90a8
commit 14e356b81e
11 changed files with 309 additions and 6 deletions

View File

@@ -25,6 +25,43 @@
#include <qdf_trace.h>
#include <wlan_objmgr_vdev_obj.h>
/**
* enum sr_osif_operation - Spatial Reuse operation
* @SR_OPERATION_SUSPEND: Spatial Reuse suspend indication
* @SR_OPERATION_RESUME: Spatial Reuse resume indication
* @SR_OPERATION_UPDATE_PARAMS: Spatial Reuse parameters are updated
*/
enum sr_osif_operation {
SR_OPERATION_SUSPEND = 0,
SR_OPERATION_RESUME = 1,
SR_OPERATION_UPDATE_PARAMS = 2,
};
/**
* enum sr_osif_reason_code - Spatial Reuse reason codes
* @SR_REASON_CODE_ROAMING: Spatial Reuse reason code is Roaming will be
* set when SR is suspended / resumed due to roaming
* @SR_REASON_CODE_CONCURRENCY: Spatial Reuse reason code is concurrency
* will be set when SR is suspended / resumed
* due to concurrency
*/
enum sr_osif_reason_code {
SR_REASON_CODE_ROAMING = 0,
SR_REASON_CODE_CONCURRENCY = 1,
};
/**
* sr_osif_event_cb() - CB to deliver SR events
* @vdev: objmgr manager vdev
* @sr_osif_oper: SR Operation like suspend / resume
* @sr_osif_rc: Event reason code
*
* Return: void
*/
typedef void (*sr_osif_event_cb)(struct wlan_objmgr_vdev *vdev,
enum sr_osif_operation sr_osif_oper,
enum sr_osif_reason_code sr_osif_rc);
#ifdef WLAN_FEATURE_SR
/**
* wlan_spatial_reuse_config_set() - Set spatial reuse config
@@ -47,6 +84,28 @@ QDF_STATUS wlan_spatial_reuse_config_set(struct wlan_objmgr_vdev *vdev,
* Return: QDF_STATUS
*/
QDF_STATUS wlan_spatial_reuse_pdev_init(struct wlan_objmgr_pdev *pdev);
/**
* wlan_sr_register_callback() - registers SR osif events
* @psoc: pointer to psoc
* @cb: Callback to be registered
*
* Return: void
*/
void wlan_sr_register_callback(struct wlan_objmgr_psoc *psoc,
sr_osif_event_cb cb);
/**
* wlan_spatial_reuse_osif_event() - Send SR asynchronous events
* @vdev: objmgr manager vdev
* @sr_osif_oper: SR Operation like suspend / resume
* @sr_osif_rc: Event reason code
*
* Return: void
*/
void wlan_spatial_reuse_osif_event(struct wlan_objmgr_vdev *vdev,
enum sr_osif_operation sr_osif_oper,
enum sr_osif_reason_code sr_osif_rc);
#else
static inline
QDF_STATUS wlan_spatial_reuse_config_set(struct wlan_objmgr_vdev *vdev,
@@ -61,6 +120,13 @@ QDF_STATUS wlan_spatial_reuse_pdev_init(struct wlan_objmgr_pdev *pdev)
{
return QDF_STATUS_SUCCESS;
}
static inline
void wlan_spatial_reuse_osif_event(struct wlan_objmgr_vdev *vdev,
enum sr_osif_operation sr_osif_oper,
enum sr_osif_reason_code sr_osif_rc)
{
}
#endif
/**

View File

@@ -20,9 +20,21 @@
#ifndef _SPATIAL_REUSE_UCFG_API_H_
#define _SPATIAL_REUSE_UCFG_API_H_
#ifdef WLAN_FEATURE_SR
#include <qdf_trace.h>
#include <wlan_objmgr_vdev_obj.h>
#include <spatial_reuse_api.h>
#ifdef WLAN_FEATURE_SR
/**
* ucfg_spatial_reuse_register_cb() - Registers CB for SR
* @psoc: pointer to psoc
* @cb: SR osif event callback
*
* Return: void
*/
void ucfg_spatial_reuse_register_cb(struct wlan_objmgr_psoc *psoc,
sr_osif_event_cb cb);
/**
* ucfg_spatial_reuse_get_sr_config() - Spatial reuse config get
*
@@ -120,5 +132,11 @@ QDF_STATUS ucfg_spatial_reuse_setup_req(struct wlan_objmgr_vdev *vdev,
struct wlan_objmgr_pdev *pdev,
bool is_sr_enable,
int32_t pd_threshold);
#else
static inline
void ucfg_spatial_reuse_register_cb(struct wlan_objmgr_psoc *psoc,
sr_osif_event_cb cb)
{
}
#endif
#endif

View File

@@ -20,6 +20,10 @@
#include <spatial_reuse_api.h>
#include <target_if_spatial_reuse.h>
struct sr_cb {
sr_osif_event_cb send_osif_event;
} sr_cb;
QDF_STATUS wlan_spatial_reuse_config_set(struct wlan_objmgr_vdev *vdev,
uint8_t sr_ctrl,
uint8_t non_srg_max_pd_offset)
@@ -114,3 +118,19 @@ QDF_STATUS wlan_spatial_reuse_pdev_init(struct wlan_objmgr_pdev *pdev)
return wmi_unified_pdev_param_send(wmi_handle, &pparam,
WILDCARD_PDEV_ID);
}
void wlan_sr_register_callback(struct wlan_objmgr_psoc *psoc,
sr_osif_event_cb cb)
{
if (!psoc)
return;
sr_cb.send_osif_event = cb;
}
void wlan_spatial_reuse_osif_event(struct wlan_objmgr_vdev *vdev,
enum sr_osif_operation sr_osif_oper,
enum sr_osif_reason_code sr_osif_rc)
{
if (sr_cb.send_osif_event)
sr_cb.send_osif_event(vdev, sr_osif_oper, sr_osif_rc);
}

View File

@@ -21,6 +21,12 @@
#include <spatial_reuse_ucfg_api.h>
#include <spatial_reuse_api.h>
void ucfg_spatial_reuse_register_cb(struct wlan_objmgr_psoc *psoc,
sr_osif_event_cb cb)
{
wlan_sr_register_callback(psoc, cb);
}
void ucfg_spatial_reuse_get_sr_config(struct wlan_objmgr_vdev *vdev,
uint8_t *sr_ctrl,
uint8_t *non_srg_max_pd_offset,