summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-02-03 05:22:52 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-02-03 05:22:52 +0000
commit94fbca64a6efeaa56f73da9988d01710df3e63c7 (patch)
tree659ce48acda5ef7e97cae9678a96197182a50e9c
parent3ef849f4c6a7fa662e474496e8eb836d06476519 (diff)
parentc6528ee67568b37a35e871294df58b1a4be81fa0 (diff)
downloadwlan-94fbca64a6efeaa56f73da9988d01710df3e63c7.tar.gz
Snap for 9558098 from c6528ee67568b37a35e871294df58b1a4be81fa0 to udc-d1-release
Change-Id: Id308387e7ea897912cc97e931e98640a87ee6e27
-rw-r--r--OWNERS1
-rw-r--r--bcmdhd/wifi_hal/common.h1
-rw-r--r--bcmdhd/wifi_hal/wifi_hal.cpp48
3 files changed, 50 insertions, 0 deletions
diff --git a/OWNERS b/OWNERS
index d8c95cc..dd590d3 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,3 +1,4 @@
arabawy@google.com
etancohen@google.com
kumachang@google.com
+wangroger@google.com
diff --git a/bcmdhd/wifi_hal/common.h b/bcmdhd/wifi_hal/common.h
index bf992b8..b54fbb1 100644
--- a/bcmdhd/wifi_hal/common.h
+++ b/bcmdhd/wifi_hal/common.h
@@ -191,6 +191,7 @@ typedef enum {
WIFI_SUBCMD_SET_MULTISTA_PRIMARY_CONNECTION, /* 0x101c */
WIFI_SUBCMD_SET_MULTISTA_USE_CASE, /* 0x101d */
WIFI_SUBCMD_SET_DTIM_CONFIG, /* 0x101e */
+ WIFI_SUBCMD_CHANNEL_POLICY, /* 0x101f */
GSCAN_SUBCMD_MAX,
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp
index 2f2caa9..f746f09 100644
--- a/bcmdhd/wifi_hal/wifi_hal.cpp
+++ b/bcmdhd/wifi_hal/wifi_hal.cpp
@@ -102,6 +102,8 @@ static wifi_error wifi_enable_tx_power_limits(wifi_interface_handle iface,
bool isEnable);
wifi_error wifi_get_cached_scan_results(wifi_interface_handle iface,
wifi_cached_scan_result_handler handler);
+wifi_error wifi_enable_sta_channel_for_peer_network(wifi_handle handle,
+ u32 channelCategoryEnableFlag);
typedef enum wifi_attr {
ANDR_WIFI_ATTRIBUTE_INVALID = 0,
@@ -119,6 +121,7 @@ typedef enum wifi_attr {
ANDR_WIFI_ATTRIBUTE_THERMAL_COMPLETION_WINDOW = 12,
ANDR_WIFI_ATTRIBUTE_VOIP_MODE = 13,
ANDR_WIFI_ATTRIBUTE_DTIM_MULTIPLIER = 14,
+ ANDR_WIFI_ATTRIBUTE_CHAN_POLICY = 15,
// Add more attribute here
ANDR_WIFI_ATTRIBUTE_MAX
} wifi_attr_t;
@@ -358,6 +361,7 @@ wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn)
fn->wifi_chre_register_handler = nan_chre_register_handler;
fn->wifi_enable_tx_power_limits = wifi_enable_tx_power_limits;
fn->wifi_get_cached_scan_results = wifi_get_cached_scan_results;
+ fn->wifi_enable_sta_channel_for_peer_network = wifi_enable_sta_channel_for_peer_network;
return WIFI_SUCCESS;
}
#ifdef GOOGLE_WIFI_FW_CONFIG_VERSION_C_WRAPPER
@@ -3058,3 +3062,47 @@ wifi_error wifi_enable_tx_power_limits(wifi_interface_handle handle, bool isEnab
EnableTxPowerLimit command(handle, isEnable);
return (wifi_error) command.requestResponse();
}
+
+//////////////////////////////////////////////////////
+class EnableStaChannel : public WifiCommand {
+
+private:
+ u32 mChannelCatEnabFlag;
+public:
+ EnableStaChannel(wifi_interface_handle handle, u32 channelCategoryEnableFlag)
+ : WifiCommand("EnableStaChannel", handle, 0) {
+ mChannelCatEnabFlag = channelCategoryEnableFlag;
+ }
+ virtual int create() {
+ int ret;
+
+ ret = mMsg.create(GOOGLE_OUI, WIFI_SUBCMD_CHANNEL_POLICY);
+ 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_u32(ANDR_WIFI_ATTRIBUTE_CHAN_POLICY, mChannelCatEnabFlag);
+ if (ret < 0) {
+ return ret;
+ }
+
+ mMsg.attr_end(data);
+ return WIFI_SUCCESS;
+ }
+};
+
+/* enable or disable the feature of allowing current STA-connected
+ * channel for WFA GO, SAP and Wi-Fi Aware when the regulatory allows.
+ */
+wifi_error wifi_enable_sta_channel_for_peer_network(wifi_handle handle,
+ u32 channelCategoryEnableFlag) {
+ int numIfaceHandles = 0;
+ wifi_interface_handle *ifaceHandles = NULL;
+ wifi_interface_handle wlan0Handle;
+
+ wlan0Handle = wifi_get_wlan_interface((wifi_handle)handle, ifaceHandles, numIfaceHandles);
+ EnableStaChannel command(wlan0Handle, channelCategoryEnableFlag);
+ return (wifi_error) command.requestResponse();
+}