diff options
author | sanfran <sanfran.shen@broadcom.corp-partner.google.com> | 2020-04-01 14:11:19 +0800 |
---|---|---|
committer | Ahmed ElArabawy <arabawy@google.com> | 2020-04-29 17:48:37 +0000 |
commit | e3cd0a1f4275e0d857e3da2c69eebbb1cdfd6706 (patch) | |
tree | 69d8274eb0840b5f9d2f8c5aa71cb40153f5c0bc | |
parent | 103da6c76c1a98911b30164c05c675157d87ac81 (diff) | |
download | platform_hardware_broadcom_wlan-e3cd0a1f4275e0d857e3da2c69eebbb1cdfd6706.tar.gz platform_hardware_broadcom_wlan-e3cd0a1f4275e0d857e3da2c69eebbb1cdfd6706.tar.bz2 platform_hardware_broadcom_wlan-e3cd0a1f4275e0d857e3da2c69eebbb1cdfd6706.zip |
Add Support Getting Roaming Capabilities
Add function getRoamingCapabilities in wifi HAL.
Bug: 151575865
Test: Usage: halutil -get_roaming_capabilities and work
Signed-off-by: sanfran <sanfran.shen@broadcom.corp-partner.google.com>
MERGED-IN: I1e281579df63483ad2e4aa8fd32581f94d05d7b9
Change-Id: I1e281579df63483ad2e4aa8fd32581f94d05d7b9
(cherry picked from commit d46432c425f7ac89f8d894445041c2b4ec9ba36c)
-rwxr-xr-x[-rw-r--r--] | bcmdhd/wifi_hal/common.h | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | bcmdhd/wifi_hal/gscan.cpp | 36 | ||||
-rwxr-xr-x[-rw-r--r--] | bcmdhd/wifi_hal/wifi_hal.cpp | 1 |
3 files changed, 26 insertions, 13 deletions
diff --git a/bcmdhd/wifi_hal/common.h b/bcmdhd/wifi_hal/common.h index 28e2156..080cb46 100644..100755 --- a/bcmdhd/wifi_hal/common.h +++ b/bcmdhd/wifi_hal/common.h @@ -129,7 +129,7 @@ typedef enum { WIFI_SUBCMD_SET_RSSI_MONITOR, /* 0x1016 */ WIFI_SUBCMD_CONFIG_ND_OFFLOAD, /* 0x1017 */ /* Add more sub commands here */ - + WIFI_SUBCMD_ROAM_CAPABILITY = 0x101a, /* 0x101a*/ GSCAN_SUBCMD_MAX, APF_SUBCMD_GET_CAPABILITIES = ANDROID_NL80211_SUBCMD_PKT_FILTER_RANGE_START, diff --git a/bcmdhd/wifi_hal/gscan.cpp b/bcmdhd/wifi_hal/gscan.cpp index 4e4ee93..d626ee1 100644..100755 --- a/bcmdhd/wifi_hal/gscan.cpp +++ b/bcmdhd/wifi_hal/gscan.cpp @@ -190,18 +190,22 @@ void convert_to_hal_result(wifi_scan_result *to, wifi_gscan_result_t *from) class GetCapabilitiesCommand : public WifiCommand { - wifi_gscan_capabilities *mCapabilities; -public: - GetCapabilitiesCommand(wifi_interface_handle iface, wifi_gscan_capabilities *capabitlites) - : WifiCommand("GetGscanCapabilitiesCommand", iface, 0), mCapabilities(capabitlites) + void *mCapabilities; + uint16_t mRequesttype; + int mRequestsize; + public: + GetCapabilitiesCommand(wifi_interface_handle iface, void *capabitlites, uint16_t request_type, + int request_size) + : WifiCommand("GetGscanCapabilitiesCommand", iface, 0), mCapabilities(capabitlites), mRequesttype(request_type), + mRequestsize(request_size) { - memset(mCapabilities, 0, sizeof(*mCapabilities)); + memset(mCapabilities, 0, mRequestsize); } virtual int create() { ALOGV("Creating message to get scan capablities; iface = %d", mIfaceInfo->id); - int ret = mMsg.create(GOOGLE_OUI, GSCAN_SUBCMD_GET_CAPABILITIES); + int ret = mMsg.create(GOOGLE_OUI, mRequesttype); if (ret < 0) { return ret; } @@ -209,7 +213,7 @@ public: return ret; } -protected: + protected: virtual int handleResponse(WifiEvent& reply) { ALOGV("In GetCapabilities::handleResponse"); @@ -225,20 +229,28 @@ protected: void *data = reply.get_vendor_data(); int len = reply.get_vendor_data_len(); - ALOGV("Id = %0x, subcmd = %d, len = %d, expected len = %d", id, subcmd, len, - sizeof(*mCapabilities)); + ALOGV("Id = %0x, subcmd = 0x%x, len = %d, expected len = %zd", id, subcmd, len, + mRequestsize); - memcpy(mCapabilities, data, min(len, (int) sizeof(*mCapabilities))); + memcpy(mCapabilities, data, min(len, mRequestsize)); return NL_OK; } }; - wifi_error wifi_get_gscan_capabilities(wifi_interface_handle handle, wifi_gscan_capabilities *capabilities) { - GetCapabilitiesCommand command(handle, capabilities); + GetCapabilitiesCommand command(handle, capabilities, GSCAN_SUBCMD_GET_CAPABILITIES, + (int)sizeof(wifi_gscan_capabilities)); + return (wifi_error) command.requestResponse(); +} + +wifi_error wifi_get_roaming_capabilities(wifi_interface_handle handle, + wifi_roaming_capabilities *capabilities) +{ + GetCapabilitiesCommand command(handle, capabilities, WIFI_SUBCMD_ROAM_CAPABILITY, + (int)sizeof(wifi_roaming_capabilities)); return (wifi_error) command.requestResponse(); } diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp index 508268e..20df171 100644..100755 --- a/bcmdhd/wifi_hal/wifi_hal.cpp +++ b/bcmdhd/wifi_hal/wifi_hal.cpp @@ -212,6 +212,7 @@ wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn) fn->wifi_get_rx_pkt_fates = wifi_get_rx_pkt_fates; fn->wifi_get_packet_filter_capabilities = wifi_get_packet_filter_capabilities; fn->wifi_set_packet_filter = wifi_set_packet_filter; + fn->wifi_get_roaming_capabilities = wifi_get_roaming_capabilities; return WIFI_SUCCESS; } |