qcacld-3.0: Rename file name and function name for sysfs 'range_ext'
Rename file name and modify function names to keep it inline with sysfs attribute name 'range_ext' Change-Id: Icf7ebbbcf1b8b219e64d1c9b98f1946069f91322 CRs-Fixed: 2731064
Esse commit está contido em:
10
Kbuild
10
Kbuild
@@ -313,8 +313,8 @@ endif
|
||||
ifeq ($(CONFIG_WLAN_SYSFS_MONITOR_MODE_CHANNEL), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_sysfs_monitor_mode_channel.o
|
||||
endif
|
||||
ifeq ($(CONFIG_WLAN_SET_RANGE_EXT), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_sysfs_set_range_ext.o
|
||||
ifeq ($(CONFIG_WLAN_SYSFS_RANGE_EXT), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_sysfs_range_ext.o
|
||||
endif
|
||||
ifeq ($(CONFIG_WLAN_SYSFS_RADAR), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_sysfs_radar.o
|
||||
@@ -337,9 +337,6 @@ endif
|
||||
ifeq ($(CONFIG_WLAN_SYSFS_STATS), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_sysfs_stats.o
|
||||
endif
|
||||
ifeq ($(CONFIG_WLAN_GET_RANGE_EXT), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_sysfs_get_range_ext.o
|
||||
endif
|
||||
ifeq ($(CONFIG_WLAN_SYSFS_TDLS_PEERS), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_sysfs_tdls_peers.o
|
||||
endif
|
||||
@@ -2657,7 +2654,6 @@ cppflags-$(CONFIG_WLAN_TXRX_FW_STATS) += -DCONFIG_WLAN_TXRX_FW_STATS
|
||||
cppflags-$(CONFIG_WLAN_TXRX_STATS) += -DCONFIG_WLAN_TXRX_STATS
|
||||
cppflags-$(CONFIG_WLAN_SYSFS_DP_TRACE) += -DWLAN_SYSFS_DP_TRACE
|
||||
cppflags-$(CONFIG_WLAN_SYSFS_STATS) += -DWLAN_SYSFS_STATS
|
||||
cppflags-$(CONFIG_WLAN_GET_RANGE_EXT) += -DCONFIG_WLAN_GET_RANGE_EXT
|
||||
cppflags-$(CONFIG_WLAN_SYSFS_TEMPERATURE) += -DCONFIG_WLAN_SYSFS_TEMPERATURE
|
||||
cppflags-$(CONFIG_WLAN_THERMAL_CFG) += -DCONFIG_WLAN_THERMAL_CFG
|
||||
cppflags-$(CONFIG_FEATURE_UNIT_TEST_SUSPEND) += -DWLAN_SUSPEND_RESUME_TEST
|
||||
@@ -2698,7 +2694,7 @@ cppflags-$(CONFIG_QCOM_TDLS) += -DTDLS_WOW_ENABLED
|
||||
endif
|
||||
|
||||
cppflags-$(CONFIG_WLAN_SYSFS_TDLS_PEERS) += -DWLAN_SYSFS_TDLS_PEERS
|
||||
cppflags-$(CONFIG_WLAN_SET_RANGE_EXT) += -DWLAN_SET_RANGE_EXT
|
||||
cppflags-$(CONFIG_WLAN_SYSFS_RANGE_EXT) += -DWLAN_SYSFS_RANGE_EXT
|
||||
|
||||
ifeq ($(CONFIG_CM_ENABLE), y)
|
||||
cppflags-y += -DFEATURE_CM_ENABLE
|
||||
|
@@ -220,7 +220,6 @@ ifeq ($(CONFIG_WLAN_SYSFS), y)
|
||||
CONFIG_WLAN_TXRX_STATS := y
|
||||
CONFIG_WLAN_SYSFS_DP_TRACE := y
|
||||
CONFIG_WLAN_SYSFS_STATS := y
|
||||
CONFIG_WLAN_GET_RANGE_EXT := y
|
||||
ifeq ($(CONFIG_QCOM_TDLS), y)
|
||||
CONFIG_WLAN_SYSFS_TDLS_PEERS := y
|
||||
endif
|
||||
@@ -409,7 +408,7 @@ endif
|
||||
|
||||
ifeq ($(CONFIG_WLAN_SYSFS), y)
|
||||
ifeq ($(CONFIG_MPC_UT_FRAMEWORK), y)
|
||||
CONFIG_WLAN_SET_RANGE_EXT := y
|
||||
CONFIG_WLAN_SYSFS_RANGE_EXT := y
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@@ -15,15 +15,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: wlan_hdd_sysfs_set_range_ext.h
|
||||
* DOC: wlan_hdd_sysfs_range_ext.h
|
||||
*
|
||||
* implementation for creating sysfs file range_ext
|
||||
* Implementation for creating sysfs file range_ext
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_HDD_SYSFS_SET_RANGE_EXT_H
|
||||
#define _WLAN_HDD_SYSFS_SET_RANGE_EXT_H
|
||||
#ifndef _WLAN_HDD_SYSFS_RANGE_EXT_H
|
||||
#define _WLAN_HDD_SYSFS_RANGE_EXT_H
|
||||
|
||||
#if defined(WLAN_SYSFS) && defined(WLAN_SET_RANGE_EXT)
|
||||
#if defined(WLAN_SYSFS) && defined(WLAN_SYSFS_RANGE_EXT)
|
||||
/**
|
||||
* wlan_hdd_sysfs_range_ext_create() - API to create range_ext
|
||||
* @adapter: hdd adapter
|
||||
@@ -56,4 +56,4 @@ hdd_sysfs_range_ext_destroy(struct hdd_adapter *adapter)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#endif /* #ifndef _WLAN_HDD_SYSFS_SET_RANGE_EXT_H */
|
||||
#endif /* #ifndef _WLAN_HDD_SYSFS_RANGE_EXT_H */
|
@@ -59,7 +59,7 @@
|
||||
#include <wlan_hdd_sysfs_gtx_bw_mask.h>
|
||||
#include <wlan_hdd_sysfs_scan_config.h>
|
||||
#include <wlan_hdd_sysfs_monitor_mode_channel.h>
|
||||
#include <wlan_hdd_sysfs_set_range_ext.h>
|
||||
#include <wlan_hdd_sysfs_range_ext.h>
|
||||
#include <wlan_hdd_sysfs_radar.h>
|
||||
#include <wlan_hdd_sysfs_rts_cts.h>
|
||||
#include <wlan_hdd_sysfs_he_bss_color.h>
|
||||
@@ -67,7 +67,6 @@
|
||||
#include <wlan_hdd_sysfs_txrx_stats.h>
|
||||
#include <wlan_hdd_sysfs_dp_trace.h>
|
||||
#include <wlan_hdd_sysfs_stats.h>
|
||||
#include <wlan_hdd_sysfs_get_range_ext.h>
|
||||
#include <wlan_hdd_sysfs_tdls_peers.h>
|
||||
#include <wlan_hdd_sysfs_temperature.h>
|
||||
#include <wlan_hdd_sysfs_thermal_cfg.h>
|
||||
@@ -664,7 +663,6 @@ hdd_sysfs_create_sta_adapter_root_obj(struct hdd_adapter *adapter)
|
||||
hdd_sysfs_stats_create(adapter);
|
||||
hdd_sysfs_txrx_fw_stats_create(adapter);
|
||||
hdd_sysfs_txrx_stats_create(adapter);
|
||||
hdd_sysfs_get_range_ext_create(adapter);
|
||||
hdd_sysfs_tdls_peers_interface_create(adapter);
|
||||
hdd_sysfs_temperature_create(adapter);
|
||||
hdd_sysfs_motion_detection_create(adapter);
|
||||
@@ -678,7 +676,6 @@ hdd_sysfs_destroy_sta_adapter_root_obj(struct hdd_adapter *adapter)
|
||||
hdd_sysfs_motion_detection_destroy(adapter);
|
||||
hdd_sysfs_temperature_destroy(adapter);
|
||||
hdd_sysfs_tdls_peers_interface_destroy(adapter);
|
||||
hdd_sysfs_get_range_ext_destroy(adapter);
|
||||
hdd_sysfs_txrx_stats_destroy(adapter);
|
||||
hdd_sysfs_txrx_fw_stats_destroy(adapter);
|
||||
hdd_sysfs_stats_destroy(adapter);
|
||||
|
@@ -1,96 +0,0 @@
|
||||
/*
|
||||
* 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_get_range_ext.c
|
||||
*
|
||||
* implementation for creating sysfs file range_ext
|
||||
*/
|
||||
|
||||
#include <wlan_hdd_includes.h>
|
||||
#include <wlan_hdd_sysfs.h>
|
||||
#include "osif_vdev_sync.h"
|
||||
#include <wlan_hdd_sysfs_get_range_ext.h>
|
||||
#include "wma_api.h"
|
||||
#include "wmi_unified.h"
|
||||
|
||||
static ssize_t
|
||||
__hdd_sysfs_get_range_ext_show(struct net_device *net_dev, char *buf)
|
||||
{
|
||||
struct hdd_adapter *adapter = netdev_priv(net_dev);
|
||||
struct hdd_context *hdd_ctx;
|
||||
int value;
|
||||
int 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)
|
||||
return ret;
|
||||
|
||||
if (!wlan_hdd_validate_modules_state(hdd_ctx))
|
||||
return -EINVAL;
|
||||
|
||||
hdd_debug("GET WMI_VDEV_PARAM_HE_RANGE_EXT");
|
||||
value = wma_cli_get_command(adapter->vdev_id,
|
||||
WMI_VDEV_PARAM_HE_RANGE_EXT, VDEV_CMD);
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE, "%d\n", value);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
hdd_sysfs_get_range_ext_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct net_device *net_dev = container_of(dev, struct net_device, dev);
|
||||
struct osif_vdev_sync *vdev_sync;
|
||||
ssize_t err_size;
|
||||
|
||||
err_size = osif_vdev_sync_op_start(net_dev, &vdev_sync);
|
||||
if (err_size)
|
||||
return err_size;
|
||||
|
||||
err_size = __hdd_sysfs_get_range_ext_show(net_dev, buf);
|
||||
|
||||
osif_vdev_sync_op_stop(vdev_sync);
|
||||
|
||||
return err_size;
|
||||
}
|
||||
|
||||
static DEVICE_ATTR(range_ext, 0440,
|
||||
hdd_sysfs_get_range_ext_show, NULL);
|
||||
|
||||
int hdd_sysfs_get_range_ext_create(struct hdd_adapter *adapter)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = device_create_file(&adapter->dev->dev,
|
||||
&dev_attr_range_ext);
|
||||
if (error)
|
||||
hdd_err("could not create range_ext sysfs file");
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
void hdd_sysfs_get_range_ext_destroy(struct hdd_adapter *adapter)
|
||||
{
|
||||
device_remove_file(&adapter->dev->dev, &dev_attr_range_ext);
|
||||
}
|
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* 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_get_range_ext.h
|
||||
*
|
||||
* implementation for creating sysfs file range_ext
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_HDD_SYSFS_GET_RANGE_EXT_H
|
||||
#define _WLAN_HDD_SYSFS_GET_RANGE_EXT_H
|
||||
|
||||
#if defined(WLAN_SYSFS) && defined(CONFIG_WLAN_GET_RANGE_EXT)
|
||||
/**
|
||||
* hdd_sysfs_get_range_ext_create() - API to create range_ext
|
||||
* @adapter: pointer to adapter
|
||||
*
|
||||
* this file is created per adapter.
|
||||
* file path: /sys/class/net/wlanxx/range_ext
|
||||
* where wlanxx is adapter name
|
||||
*
|
||||
* usage:
|
||||
* cat /sys/class/net/wlanxx/range_ext
|
||||
*
|
||||
* Return: 0 on success and errno on failure
|
||||
*/
|
||||
int hdd_sysfs_get_range_ext_create(struct hdd_adapter *adapter);
|
||||
|
||||
/**
|
||||
* hdd_sysfs_get_range_ext_destroy() -
|
||||
* API to destroy range_ext
|
||||
* @adapter: pointer to adapter
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void hdd_sysfs_get_range_ext_destroy(struct hdd_adapter *adapter);
|
||||
#else
|
||||
static inline int
|
||||
hdd_sysfs_get_range_ext_create(struct hdd_adapter *adapter)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
hdd_sysfs_get_range_ext_destroy(struct hdd_adapter *adapter)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#endif /* #ifndef _WLAN_HDD_SYSFS_GET_RANGE_EXT_H */
|
@@ -24,7 +24,55 @@
|
||||
#include "osif_vdev_sync.h"
|
||||
#include <wlan_hdd_sysfs.h>
|
||||
#include "wma_api.h"
|
||||
#include "wlan_hdd_sysfs_set_range_ext.h"
|
||||
#include "wlan_hdd_sysfs_range_ext.h"
|
||||
|
||||
static ssize_t
|
||||
__hdd_sysfs_range_ext_show(struct net_device *net_dev, char *buf)
|
||||
{
|
||||
struct hdd_adapter *adapter = netdev_priv(net_dev);
|
||||
struct hdd_context *hdd_ctx;
|
||||
int value;
|
||||
int 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)
|
||||
return ret;
|
||||
|
||||
if (!wlan_hdd_validate_modules_state(hdd_ctx))
|
||||
return -EINVAL;
|
||||
|
||||
hdd_debug("GET WMI_VDEV_PARAM_HE_RANGE_EXT");
|
||||
value = wma_cli_get_command(adapter->vdev_id,
|
||||
WMI_VDEV_PARAM_HE_RANGE_EXT, VDEV_CMD);
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE, "%d\n", value);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
hdd_sysfs_range_ext_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct net_device *net_dev = container_of(dev, struct net_device, dev);
|
||||
struct osif_vdev_sync *vdev_sync;
|
||||
ssize_t err_size;
|
||||
|
||||
err_size = osif_vdev_sync_op_start(net_dev, &vdev_sync);
|
||||
if (err_size)
|
||||
return err_size;
|
||||
|
||||
err_size = __hdd_sysfs_range_ext_show(net_dev, buf);
|
||||
|
||||
osif_vdev_sync_op_stop(vdev_sync);
|
||||
|
||||
return err_size;
|
||||
}
|
||||
|
||||
static ssize_t __hdd_sysfs_range_ext_store(struct net_device *net_dev,
|
||||
char const *buf, size_t count)
|
||||
@@ -98,7 +146,8 @@ hdd_sysfs_range_ext_store(struct device *dev, struct device_attribute *attr,
|
||||
return errno_size;
|
||||
}
|
||||
|
||||
static DEVICE_ATTR(range_ext, 0220, NULL, hdd_sysfs_range_ext_store);
|
||||
static DEVICE_ATTR(range_ext, 0660, hdd_sysfs_range_ext_show,
|
||||
hdd_sysfs_range_ext_store);
|
||||
|
||||
void hdd_sysfs_range_ext_create(struct hdd_adapter *adapter)
|
||||
{
|
Referência em uma nova issue
Block a user