summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAjay Davanageri <ajay.davanageri@broadcom.com>2022-05-05 16:24:42 +0530
committerIsaac Chiou <isaacchiou@google.com>2022-05-10 04:12:08 +0000
commit18cb514aa65d4939ceec0547ca4c83dd5e08b6ba (patch)
tree9e2a58904c5ee9cbb8591e68713766b7cf911e23
parent7be3e13264aa312f929b42a970bc09956b145a8b (diff)
downloadwlan-18cb514aa65d4939ceec0547ca4c83dd5e08b6ba.tar.gz
Interface to changes for tx power limit set.
Bug: 215193418 Test: Verified using the halutil cli Signed-off-by: Ajay Davanageri <ajay.davanageri@broadcom.com> Change-Id: I488a9630eaa04e72031b7919b9bc8e18bcfa83b8
-rwxr-xr-xbcmdhd/wifi_hal/common.h1
-rwxr-xr-xbcmdhd/wifi_hal/wifi_hal.cpp50
2 files changed, 51 insertions, 0 deletions
diff --git a/bcmdhd/wifi_hal/common.h b/bcmdhd/wifi_hal/common.h
index ecc1abf..ad9922d 100755
--- a/bcmdhd/wifi_hal/common.h
+++ b/bcmdhd/wifi_hal/common.h
@@ -233,6 +233,7 @@ typedef enum {
WIFI_SUBCMD_USABLE_CHANNEL = ANDROID_NL80211_SUBCMD_USABLE_CHANNEL_START,
WIFI_SUBCMD_TRIGGER_SSR = ANDROID_NL80211_SUBCMD_INIT_DEINIT_RANGE_START,
WIFI_SUBCMD_GET_RADIO_COMBO_MATRIX,
+ WIFI_SUBCMD_ENABLE_TX_POWER_LIMIT,
} WIFI_SUB_COMMAND;
typedef enum {
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp
index fe679ab..36976fe 100755
--- a/bcmdhd/wifi_hal/wifi_hal.cpp
+++ b/bcmdhd/wifi_hal/wifi_hal.cpp
@@ -98,6 +98,9 @@ static wifi_error wifi_get_supported_radio_combinations_matrix(wifi_handle handl
u32 max_size, u32* size, wifi_radio_combination_matrix *radio_combination_matrix);
static void wifi_cleanup_dynamic_ifaces(wifi_handle handle);
+static wifi_error wifi_enable_tx_power_limits(wifi_interface_handle iface,
+ bool isEnable);
+
typedef enum wifi_attr {
ANDR_WIFI_ATTRIBUTE_INVALID = 0,
ANDR_WIFI_ATTRIBUTE_NUM_FEATURE_SET = 1,
@@ -196,6 +199,13 @@ enum multista_request_type {
SET_USE_CASE
};
+enum wifi_tx_power_limits {
+ TX_POWER_CAP_ATTRIBUTE_INVALID = 0,
+ TX_POWER_CAP_ENABLE_ATTRIBUTE = 1,
+ /* Add more attributes here */
+ TX_POWER_ATTRIBUTE_MAX
+};
+
/* Initialize/Cleanup */
void wifi_socket_set_local_port(struct nl_sock *sock, uint32_t port)
@@ -344,6 +354,7 @@ wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn)
fn->wifi_nan_rtt_chre_enable_request = nan_chre_enable_request;
fn->wifi_nan_rtt_chre_disable_request = nan_chre_disable_request;
fn->wifi_chre_register_handler = nan_chre_register_handler;
+ fn->wifi_enable_tx_power_limits = wifi_enable_tx_power_limits;
return WIFI_SUCCESS;
}
@@ -3001,3 +3012,42 @@ wifi_error wifi_get_usable_channels(wifi_handle handle, u32 band_mask, u32 iface
filter_mask, max_size, size, channels);
return (wifi_error)command.start();
}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+class EnableTxPowerLimit : public WifiCommand {
+private:
+ bool mEnableTxLimits;
+public:
+ EnableTxPowerLimit(wifi_interface_handle handle, bool enable_tx_pwr_limits)
+ : WifiCommand("EnableTxPowerLimit", handle, 0)
+ {
+ mEnableTxLimits = enable_tx_pwr_limits;
+ }
+
+ virtual int create() {
+ int ret;
+
+ ret = mMsg.create(GOOGLE_OUI, WIFI_SUBCMD_ENABLE_TX_POWER_LIMIT);
+ if (ret < 0) {
+ ALOGE("Can't create message to send to driver - %d", ret);
+ return ret;
+ }
+
+ nlattr *data = mMsg.attr_start(NL80211_ATTR_VENDOR_DATA);
+ ret = mMsg.put_u8(TX_POWER_CAP_ENABLE_ATTRIBUTE, mEnableTxLimits);
+ if (ret < 0) {
+ ALOGE("Failed to put enable tx power limit param %d\n", mEnableTxLimits);
+ return ret;
+ }
+ mMsg.attr_end(data);
+ return WIFI_SUCCESS;
+ }
+};
+
+wifi_error wifi_enable_tx_power_limits(wifi_interface_handle handle, bool isEnable)
+{
+ ALOGD("Configuring the tx power limits , halHandle = %p\n", handle);
+
+ EnableTxPowerLimit command(handle, isEnable);
+ return (wifi_error) command.requestResponse();
+}