summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsanfran <sanfran.shen@broadcom.corp-partner.google.com>2020-04-29 19:10:26 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-04-29 19:10:26 +0000
commitba8cec4ff26aeb722ad11f494f60f7588220cb8f (patch)
tree69d8274eb0840b5f9d2f8c5aa71cb40153f5c0bc
parent103da6c76c1a98911b30164c05c675157d87ac81 (diff)
parente3cd0a1f4275e0d857e3da2c69eebbb1cdfd6706 (diff)
downloadplatform_hardware_broadcom_wlan-ba8cec4ff26aeb722ad11f494f60f7588220cb8f.tar.gz
platform_hardware_broadcom_wlan-ba8cec4ff26aeb722ad11f494f60f7588220cb8f.tar.bz2
platform_hardware_broadcom_wlan-ba8cec4ff26aeb722ad11f494f60f7588220cb8f.zip
Add Support Getting Roaming Capabilities am: e3cd0a1f42
Change-Id: I8d4099d613f6f83f43274e1cbecd3409a5b984c1
-rwxr-xr-x[-rw-r--r--]bcmdhd/wifi_hal/common.h2
-rwxr-xr-x[-rw-r--r--]bcmdhd/wifi_hal/gscan.cpp36
-rwxr-xr-x[-rw-r--r--]bcmdhd/wifi_hal/wifi_hal.cpp1
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;
}