qcacld-3.0: add roam trigger bitmap sysfs functionality
Add support to configure roam_trigger_bitmap. Change-Id: I1a7329910e5276469fa7cf0711d412cc8850d98b CRs-Fixed: 3563225
This commit is contained in:
5
Kbuild
5
Kbuild
@@ -471,6 +471,10 @@ ifeq ($(CONFIG_WLAN_SYSFS_WDS_MODE), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_sysfs_wds_mode.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_WLAN_SYSFS_ROAM_TRIGGER_BITMAP), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_sysfs_roam_trigger_bitmap.o
|
||||
endif
|
||||
|
||||
endif # CONFIG_WLAN_SYSFS
|
||||
|
||||
ifeq ($(CONFIG_QCACLD_FEATURE_FW_STATE), y)
|
||||
@@ -3654,6 +3658,7 @@ ccflags-$(CONFIG_WLAN_SYSFS_LOG_BUFFER) += -DFEATURE_SYSFS_LOG_BUFFER
|
||||
ccflags-$(CONFIG_ENABLE_VALLOC_REPLACE_MALLOC) += -DENABLE_VALLOC_REPLACE_MALLOC
|
||||
ccflags-$(CONFIG_WLAN_SYSFS_DFSNOL) += -DCONFIG_WLAN_SYSFS_DFSNOL
|
||||
ccflags-$(CONFIG_WLAN_SYSFS_WDS_MODE) += -DFEATURE_SYSFS_WDS_MODE
|
||||
ccflags-$(CONFIG_WLAN_SYSFS_ROAM_TRIGGER_BITMAP) += -DFEATURE_SYSFS_ROAM_TRIGGER_BITMAP
|
||||
|
||||
ifeq ($(CONFIG_LEAK_DETECTION), y)
|
||||
ccflags-y += \
|
||||
|
@@ -3331,6 +3331,16 @@ wlan_mlme_set_roam_reason_vsie_status(struct wlan_objmgr_psoc *psoc,
|
||||
*/
|
||||
uint32_t wlan_mlme_get_roaming_triggers(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* wlan_mlme_set_roaming_triggers() - Set the roaming triggers bitmap
|
||||
* @psoc: Pointer to PSOC object
|
||||
* @trigger_bitmap: Roaming triggers bitmap to set
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void wlan_mlme_set_roaming_triggers(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t trigger_bitmap);
|
||||
|
||||
/**
|
||||
* wlan_mlme_get_roaming_offload() - Get roaming offload setting
|
||||
* @psoc: pointer to psoc object
|
||||
@@ -3458,6 +3468,12 @@ uint32_t wlan_mlme_get_roaming_triggers(struct wlan_objmgr_psoc *psoc)
|
||||
return 0xFFFF;
|
||||
}
|
||||
|
||||
static inline
|
||||
void wlan_mlme_set_roaming_triggers(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t trigger_bitmap)
|
||||
{
|
||||
}
|
||||
|
||||
static inline QDF_STATUS
|
||||
wlan_mlme_get_roaming_offload(struct wlan_objmgr_psoc *psoc,
|
||||
bool *val)
|
||||
|
@@ -1162,6 +1162,21 @@ ucfg_mlme_get_roaming_triggers(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return wlan_mlme_get_roaming_triggers(psoc);
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_mlme_set_roaming_triggers() - Set roaming triggers bitmap
|
||||
* value
|
||||
* @psoc: pointer to psoc object
|
||||
* @trigger_bitmap: Roaming triggers bitmap to set
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline void
|
||||
ucfg_mlme_set_roaming_triggers(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t trigger_bitmap)
|
||||
{
|
||||
wlan_mlme_set_roaming_triggers(psoc, trigger_bitmap);
|
||||
}
|
||||
#else
|
||||
static inline QDF_STATUS
|
||||
ucfg_mlme_get_roam_disable_config(struct wlan_objmgr_psoc *psoc,
|
||||
@@ -1191,6 +1206,12 @@ ucfg_mlme_get_roaming_triggers(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
static inline void
|
||||
ucfg_mlme_set_roaming_triggers(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t trigger_bitmap)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@@ -5211,6 +5211,18 @@ uint32_t wlan_mlme_get_roaming_triggers(struct wlan_objmgr_psoc *psoc)
|
||||
return mlme_obj->cfg.lfr.roam_trigger_bitmap;
|
||||
}
|
||||
|
||||
void wlan_mlme_set_roaming_triggers(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t trigger_bitmap)
|
||||
{
|
||||
struct wlan_mlme_psoc_ext_obj *mlme_obj;
|
||||
|
||||
mlme_obj = mlme_get_psoc_ext_obj(psoc);
|
||||
if (!mlme_obj)
|
||||
return;
|
||||
|
||||
mlme_obj->cfg.lfr.roam_trigger_bitmap = trigger_bitmap;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wlan_mlme_get_roaming_offload(struct wlan_objmgr_psoc *psoc,
|
||||
bool *val)
|
||||
|
@@ -920,6 +920,10 @@
|
||||
#define FEATURE_SYSFS_WDS_MODE (1)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WLAN_SYSFS_ROAM_TRIGGER_BITMAP
|
||||
#define FEATURE_SYSFS_ROAM_TRIGGER_BITMAP (1)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RX_PERFORMANCE
|
||||
#define RX_PERFORMANCE (1)
|
||||
#endif
|
||||
|
@@ -410,6 +410,7 @@ endif
|
||||
CONFIG_WLAN_SYSFS_LOG_BUFFER := y
|
||||
CONFIG_WLAN_SYSFS_DFSNOL := y
|
||||
CONFIG_WLAN_SYSFS_WDS_MODE := y
|
||||
CONFIG_WLAN_SYSFS_ROAM_TRIGGER_BITMAP := y
|
||||
endif
|
||||
CONFIG_WLAN_PDEV_VDEV_SEND_MULTI_PARAM := y
|
||||
CONFIG_WLAN_POWER_DEBUG := y
|
||||
|
@@ -93,6 +93,7 @@
|
||||
#include <wlan_hdd_sysfs_log_buffer.h>
|
||||
#include <wlan_hdd_sysfs_dfsnol.h>
|
||||
#include <wlan_hdd_sysfs_wds_mode.h>
|
||||
#include <wlan_hdd_sysfs_roam_trigger_bitmap.h>
|
||||
|
||||
#define MAX_PSOC_ID_SIZE 10
|
||||
|
||||
@@ -959,12 +960,14 @@ void hdd_create_sysfs_files(struct hdd_context *hdd_ctx)
|
||||
hdd_sysfs_runtime_pm_create(driver_kobject);
|
||||
hdd_sysfs_log_buffer_create(driver_kobject);
|
||||
hdd_sysfs_wds_mode_create(driver_kobject);
|
||||
hdd_sysfs_roam_trigger_bitmap_create(driver_kobject);
|
||||
}
|
||||
}
|
||||
|
||||
void hdd_destroy_sysfs_files(void)
|
||||
{
|
||||
if (QDF_GLOBAL_MISSION_MODE == hdd_get_conparam()) {
|
||||
hdd_sysfs_roam_trigger_bitmap_destroy(driver_kobject);
|
||||
hdd_sysfs_wds_mode_destroy(driver_kobject);
|
||||
hdd_sysfs_log_buffer_destroy(driver_kobject);
|
||||
hdd_sysfs_runtime_pm_destroy(driver_kobject);
|
||||
|
148
core/hdd/src/wlan_hdd_sysfs_roam_trigger_bitmap.c
Normal file
148
core/hdd/src/wlan_hdd_sysfs_roam_trigger_bitmap.c
Normal file
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* Copyright (c) 2023 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.
|
||||
*/
|
||||
|
||||
#include <wlan_hdd_includes.h>
|
||||
#include "osif_psoc_sync.h"
|
||||
#include <wlan_hdd_sysfs.h>
|
||||
#include <wlan_hdd_sysfs_roam_trigger_bitmap.h>
|
||||
|
||||
static ssize_t __hdd_sysfs_roam_trigger_bitmap_show(struct hdd_context *hdd_ctx,
|
||||
struct kobj_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!hdd_ctx || !hdd_ctx->psoc) {
|
||||
hdd_err_rl("invalid input");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = scnprintf(buf, PAGE_SIZE, "0x%x",
|
||||
ucfg_mlme_get_roaming_triggers(hdd_ctx->psoc));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t hdd_sysfs_roam_trigger_bitmap_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct osif_psoc_sync *psoc_sync;
|
||||
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
||||
ssize_t errno_size;
|
||||
|
||||
errno_size = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy),
|
||||
&psoc_sync);
|
||||
if (errno_size)
|
||||
return errno_size;
|
||||
|
||||
errno_size = __hdd_sysfs_roam_trigger_bitmap_show(hdd_ctx, attr, buf);
|
||||
|
||||
osif_psoc_sync_op_stop(psoc_sync);
|
||||
|
||||
return errno_size;
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
__hdd_sysfs_roam_trigger_bitmap_store(struct hdd_context *hdd_ctx,
|
||||
struct kobj_attribute *attr,
|
||||
const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
char buf_local[MAX_SYSFS_USER_COMMAND_SIZE_LENGTH + 1];
|
||||
char *sptr, *token;
|
||||
uint32_t value;
|
||||
int ret = 0;
|
||||
|
||||
if (!hdd_ctx || !hdd_ctx->psoc) {
|
||||
hdd_err_rl("invalid hdd ctx");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = hdd_sysfs_validate_and_copy_buf(buf_local, sizeof(buf_local),
|
||||
buf, count);
|
||||
|
||||
if (ret) {
|
||||
hdd_err_rl("invalid input");
|
||||
return ret;
|
||||
}
|
||||
|
||||
sptr = buf_local;
|
||||
token = strsep(&sptr, " ");
|
||||
if (!token)
|
||||
return -EINVAL;
|
||||
if (kstrtou32(token, 0, &value))
|
||||
return -EINVAL;
|
||||
|
||||
hdd_debug("roam_trigger_bitmap: 0x%x", value);
|
||||
|
||||
ucfg_mlme_set_roaming_triggers(hdd_ctx->psoc, value);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
hdd_sysfs_roam_trigger_bitmap_store(struct kobject *kobj,
|
||||
struct kobj_attribute *attr,
|
||||
char const *buf, size_t count)
|
||||
{
|
||||
struct osif_psoc_sync *psoc_sync;
|
||||
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
||||
ssize_t errno_size;
|
||||
|
||||
errno_size = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy),
|
||||
&psoc_sync);
|
||||
if (errno_size)
|
||||
return errno_size;
|
||||
|
||||
errno_size = __hdd_sysfs_roam_trigger_bitmap_store(hdd_ctx, attr,
|
||||
buf, count);
|
||||
|
||||
osif_psoc_sync_op_stop(psoc_sync);
|
||||
|
||||
return errno_size;
|
||||
}
|
||||
|
||||
static struct kobj_attribute roam_trigger_bitmap_attribute =
|
||||
__ATTR(roam_trigger_bitmap, 0664, hdd_sysfs_roam_trigger_bitmap_show,
|
||||
hdd_sysfs_roam_trigger_bitmap_store);
|
||||
|
||||
int hdd_sysfs_roam_trigger_bitmap_create(struct kobject *driver_kobject)
|
||||
{
|
||||
int error;
|
||||
|
||||
if (!driver_kobject) {
|
||||
hdd_err("could not get driver kobject!");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
error = sysfs_create_file(driver_kobject,
|
||||
&roam_trigger_bitmap_attribute.attr);
|
||||
if (error)
|
||||
hdd_err("could not create roam_trigger_bitmap sysfs file");
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
void
|
||||
hdd_sysfs_roam_trigger_bitmap_destroy(struct kobject *driver_kobject)
|
||||
{
|
||||
if (!driver_kobject) {
|
||||
hdd_err("could not get driver kobject!");
|
||||
return;
|
||||
}
|
||||
sysfs_remove_file(driver_kobject, &roam_trigger_bitmap_attribute.attr);
|
||||
}
|
60
core/hdd/src/wlan_hdd_sysfs_roam_trigger_bitmap.h
Normal file
60
core/hdd/src/wlan_hdd_sysfs_roam_trigger_bitmap.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2023 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.
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_HDD_SYSFS_ROAM_TRIGGER_BITMAP_H
|
||||
#define _WLAN_HDD_SYSFS_ROAM_TRIGGER_BITMAP_H
|
||||
|
||||
#if defined(WLAN_SYSFS) && defined(FEATURE_SYSFS_ROAM_TRIGGER_BITMAP)
|
||||
|
||||
/**
|
||||
* hdd_sysfs_roam_trigger_bitmap_create() - API to create roam_trigger_bitmap
|
||||
* sysfs file
|
||||
* @driver_kobject: sysfs driver kobject
|
||||
*
|
||||
* file path: /sys/kernel/kiwi_v2/roam_trigger_bitmap
|
||||
*
|
||||
* usage:
|
||||
* echo [arg_0] > roam_trigger_bitmap
|
||||
*
|
||||
* Return: 0 on success and errno on failure
|
||||
*/
|
||||
int hdd_sysfs_roam_trigger_bitmap_create(struct kobject *driver_kobject);
|
||||
|
||||
/**
|
||||
* hdd_sysfs_roam_trigger_bitmap_destroy() - destroy hdd roam_trigger_bitmap
|
||||
* sysfs node
|
||||
* @driver_kobject: pointer to driver kobject
|
||||
*
|
||||
* Return: void
|
||||
*
|
||||
*/
|
||||
void
|
||||
hdd_sysfs_roam_trigger_bitmap_destroy(struct kobject *driver_kobject);
|
||||
|
||||
#else
|
||||
|
||||
static inline int
|
||||
hdd_sysfs_roam_trigger_bitmap_create(struct kobject *driver_kobject)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
hdd_sysfs_roam_trigger_bitmap_destroy(struct kobject *driver_kobject)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#endif
|
@@ -1872,6 +1872,11 @@ _conditional_srcs = {
|
||||
"core/hdd/src/wlan_hdd_sysfs_wds_mode.c",
|
||||
],
|
||||
},
|
||||
"CONFIG_WLAN_SYSFS_ROAM_TRIGGER_BITMAP": {
|
||||
True: [
|
||||
"core/hdd/src/wlan_hdd_sysfs_roam_trigger_bitmap.c",
|
||||
],
|
||||
},
|
||||
"CONFIG_WLAN_SYSFS_DP_STATS": {
|
||||
True: [
|
||||
"core/hdd/src/wlan_hdd_sysfs_txrx_stats_console.c",
|
||||
|
Reference in New Issue
Block a user