mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
qcacld-3.0: Add a sysfs replacement for set_he_bss_clr
Add the sysfs entry for set_he_bss_clr. Previously these commands would be queried via iwpriv --> iwpriv wlan0 set_he_bss_clr [value] it is now changed to support via sysfs: --> echo [value] > /sys/class/net/wlanxx/he_bss_color Change-Id: I4700414469be018de9758277c4e095e64cabb376 CRs-Fixed: 2692916
This commit is contained in:
parent
7b3c654516
commit
bc1a807ec5
5 changed files with 184 additions and 0 deletions
4
Kbuild
4
Kbuild
|
|
@ -320,6 +320,9 @@ endif
|
|||
ifeq ($(CONFIG_WLAN_SYSFS_RTS_CTS), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_sysfs_rts_cts.o
|
||||
endif
|
||||
ifeq ($(CONFIG_WLAN_SYSFS_HE_BSS_COLOR), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_sysfs_he_bss_color.o
|
||||
endif
|
||||
ifeq ($(CONFIG_WLAN_TXRX_FW_STATS), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_sysfs_txrx_fw_stats.o
|
||||
endif
|
||||
|
|
@ -2610,6 +2613,7 @@ cppflags-$(CONFIG_WLAN_THERMAL_CFG) += -DCONFIG_WLAN_THERMAL_CFG
|
|||
cppflags-$(CONFIG_FEATURE_UNIT_TEST_SUSPEND) += -DWLAN_SUSPEND_RESUME_TEST
|
||||
cppflags-$(CONFIG_FEATURE_WLM_STATS) += -DFEATURE_WLM_STATS
|
||||
cppflags-$(CONFIG_WLAN_SYSFS_DCM) += -DWLAN_SYSFS_DCM
|
||||
cppflags-$(CONFIG_WLAN_SYSFS_HE_BSS_COLOR) += -DWLAN_SYSFS_HE_BSS_COLOR
|
||||
cppflags-$(CONFIG_WLAN_SYSFS_GET_STA_INFO) += -DWLAN_SYSFS_GET_STA_INFO
|
||||
|
||||
ifeq ($(CONFIG_LEAK_DETECTION), y)
|
||||
|
|
|
|||
|
|
@ -194,6 +194,7 @@ ifeq ($(CONFIG_WLAN_SYSFS), y)
|
|||
CONFIG_WLAN_SET_MON_CHAN := y
|
||||
CONFIG_WLAN_SET_RADAR := y
|
||||
CONFIG_WLAN_SYSFS_RTS_CTS := y
|
||||
CONFIG_WLAN_SYSFS_HE_BSS_COLOR := y
|
||||
CONFIG_WLAN_TXRX_FW_STATS := y
|
||||
CONFIG_WLAN_TXRX_STATS := y
|
||||
CONFIG_WLAN_SYSFS_DP_TRACE := y
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@
|
|||
#include <wlan_hdd_sysfs_set_range_ext.h>
|
||||
#include <wlan_hdd_sysfs_set_radar.h>
|
||||
#include <wlan_hdd_sysfs_rts_cts.h>
|
||||
#include <wlan_hdd_sysfs_he_bss_color.h>
|
||||
#include <wlan_hdd_sysfs_txrx_fw_stats.h>
|
||||
#include <wlan_hdd_sysfs_txrx_stats.h>
|
||||
#include <wlan_hdd_sysfs_dp_trace.h>
|
||||
|
|
@ -715,6 +716,7 @@ hdd_sysfs_create_sap_adapter_root_obj(struct hdd_adapter *adapter)
|
|||
hdd_sysfs_set_radar_create(adapter);
|
||||
hdd_sysfs_rts_cts_create(adapter);
|
||||
hdd_sysfs_stats_create(adapter);
|
||||
hdd_sysfs_he_bss_color_create(adapter);
|
||||
hdd_sysfs_txrx_fw_stats_create(adapter);
|
||||
hdd_sysfs_txrx_stats_create(adapter);
|
||||
hdd_sysfs_get_temp_create(adapter);
|
||||
|
|
@ -730,6 +732,7 @@ hdd_sysfs_destroy_sap_adapter_root_obj(struct hdd_adapter *adapter)
|
|||
hdd_sysfs_get_temp_destroy(adapter);
|
||||
hdd_sysfs_txrx_stats_destroy(adapter);
|
||||
hdd_sysfs_txrx_fw_stats_destroy(adapter);
|
||||
hdd_sysfs_he_bss_color_destroy(adapter);
|
||||
hdd_sysfs_stats_destroy(adapter);
|
||||
hdd_sysfs_rts_cts_destroy(adapter);
|
||||
hdd_sysfs_set_radar_destroy(adapter);
|
||||
|
|
|
|||
115
core/hdd/src/wlan_hdd_sysfs_he_bss_color.c
Normal file
115
core/hdd/src/wlan_hdd_sysfs_he_bss_color.c
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
* Copyright (c) 2011-2020, The Linux Foundation. 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: wlan_hdd_sysfs_he_bss_color.c
|
||||
*
|
||||
* implementation for creating sysfs file he_bss_color
|
||||
*/
|
||||
|
||||
#include <wlan_hdd_includes.h>
|
||||
#include "osif_vdev_sync.h"
|
||||
#include <wlan_hdd_sysfs.h>
|
||||
#include "wlan_hdd_sysfs_he_bss_color.h"
|
||||
#include <sme_api.h>
|
||||
|
||||
static ssize_t
|
||||
__hdd_sysfs_he_bss_color_store(struct net_device *net_dev,
|
||||
char const *buf, size_t count)
|
||||
{
|
||||
struct hdd_adapter *adapter = netdev_priv(net_dev);
|
||||
char buf_local[MAX_SYSFS_USER_COMMAND_SIZE_LENGTH + 1];
|
||||
struct hdd_context *hdd_ctx;
|
||||
char *sptr, *token;
|
||||
QDF_STATUS status;
|
||||
int value, ret;
|
||||
|
||||
if (hdd_validate_adapter(adapter)) {
|
||||
hdd_err_rl("adapter validate fail");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
ret = wlan_hdd_validate_context(hdd_ctx);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
if (!wlan_hdd_validate_modules_state(hdd_ctx))
|
||||
return -EINVAL;
|
||||
|
||||
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;
|
||||
|
||||
status = sme_set_he_bss_color(hdd_ctx->mac_handle, adapter->vdev_id,
|
||||
value);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
hdd_err_rl("Failed to set HE BSS color, status %d", status);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
hdd_sysfs_he_bss_color_store(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char const *buf, size_t count)
|
||||
{
|
||||
struct net_device *net_dev = container_of(dev, struct net_device, dev);
|
||||
struct osif_vdev_sync *vdev_sync;
|
||||
ssize_t errno_size;
|
||||
|
||||
errno_size = osif_vdev_sync_op_start(net_dev, &vdev_sync);
|
||||
if (errno_size)
|
||||
return errno_size;
|
||||
|
||||
errno_size = __hdd_sysfs_he_bss_color_store(net_dev, buf, count);
|
||||
|
||||
osif_vdev_sync_op_stop(vdev_sync);
|
||||
|
||||
return errno_size;
|
||||
}
|
||||
|
||||
static DEVICE_ATTR(he_bss_color, 0220,
|
||||
NULL, hdd_sysfs_he_bss_color_store);
|
||||
|
||||
int hdd_sysfs_he_bss_color_create(struct hdd_adapter *adapter)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = device_create_file(&adapter->dev->dev, &dev_attr_he_bss_color);
|
||||
if (error)
|
||||
hdd_err("could not create he_bss_color sysfs file");
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
void hdd_sysfs_he_bss_color_destroy(struct hdd_adapter *adapter)
|
||||
{
|
||||
device_remove_file(&adapter->dev->dev, &dev_attr_he_bss_color);
|
||||
}
|
||||
61
core/hdd/src/wlan_hdd_sysfs_he_bss_color.h
Normal file
61
core/hdd/src/wlan_hdd_sysfs_he_bss_color.h
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* Copyright (c) 2011-2020, The Linux Foundation. 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: wlan_hdd_sysfs_he_bss_color.h
|
||||
*
|
||||
* implementation for creating sysfs file he_bss_color
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_HDD_SYSFS_HE_BSS_COLOR_H
|
||||
#define _WLAN_HDD_SYSFS_HE_BSS_COLOR_H
|
||||
|
||||
#if defined(WLAN_SYSFS) && defined(WLAN_SYSFS_HE_BSS_COLOR)
|
||||
|
||||
/**
|
||||
* hdd_sysfs_he_bss_color_create() - API to create he_bss_color
|
||||
* @adapter: hdd adapter
|
||||
*
|
||||
* this file is created per adapter.
|
||||
* file path: /sys/class/net/wlanxx/he_bss_color
|
||||
* (wlanxx is adapter name)
|
||||
* usage:
|
||||
* echo [value] > he_bss_color
|
||||
*
|
||||
* Return: 0 on success and errno on failure
|
||||
*/
|
||||
int hdd_sysfs_he_bss_color_create(struct hdd_adapter *adapter);
|
||||
|
||||
/**
|
||||
* hdd_sysfs_he_bss_color_destroy() - API to destroy he_bss_color
|
||||
* @adapter: pointer to adapter
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void hdd_sysfs_he_bss_color_destroy(struct hdd_adapter *adapter);
|
||||
#else
|
||||
static inline int
|
||||
hdd_sysfs_he_bss_color_create(struct hdd_adapter *adapter)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
hdd_sysfs_he_bss_color_destroy(struct hdd_adapter *adapter)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#endif /* #ifndef _WLAN_HDD_SYSFS_HE_BSS_COLOR_H */
|
||||
Loading…
Reference in a new issue