WiFi-Hal: De-couple roaming feature with Gscan

Per WiFi HAL design, roaming feature should have nothing to do with
Gscan, but in current impl, these two are tightly coupled:
- Roaming capabilities is queried by vendor cmd GSCAN_GET_CAPABILITY.
- Set blacklist bssid returns error if Gscan not supported

So de-couple roaming feature with Gscan by:
- Set default roaming capabilities if Gscan not supported.
- Set blacklist bssid returns error if Roaming not supported.

CRs-Fixed: 2405118
Change-Id: I9f96546538dd4d07a1f930f107c0024436907927
diff --git a/qcwcn/wifi_hal/roam.cpp b/qcwcn/wifi_hal/roam.cpp
index 2e3f214..9b38dba 100644
--- a/qcwcn/wifi_hal/roam.cpp
+++ b/qcwcn/wifi_hal/roam.cpp
@@ -19,6 +19,9 @@
 #include "common.h"
 #include "roamcommand.h"
 
+#define WLAN_ROAM_MAX_NUM_WHITE_LIST 4
+#define WLAN_ROAM_MAX_NUM_BLACK_LIST 16
+
 RoamCommand::RoamCommand(wifi_handle handle, int id, u32 vendor_id, u32 subcmd)
         : WifiVendorCommand(handle, id, vendor_id, subcmd)
 {
@@ -65,8 +68,8 @@
     wifi_handle wifiHandle = getWifiHandle(iface);
     hal_info *info = getHalInfo(wifiHandle);
 
-    if (!(info->supported_feature_set & WIFI_FEATURE_GSCAN)) {
-        ALOGE("%s: GSCAN is not supported by driver",
+    if (!(info->supported_feature_set & WIFI_FEATURE_CONTROL_ROAMING)) {
+        ALOGE("%s: Roaming is not supported by driver",
             __FUNCTION__);
         return WIFI_ERROR_NOT_SUPPORTED;
     }
@@ -246,6 +249,17 @@
         return WIFI_ERROR_INVALID_ARGS;
     }
 
+    // Per WiFi HAL design, roaming feature should have nothing to do with Gscan
+    // But for current driver impl, roaming_capa is provided as part of
+    // GSCAN_GET_CAPABILITY query, so if Gscan is not supported, roaming_capa
+    // is not set (uses initial value 0).
+    // To de-couple roaming with Gscan, set default values for roaming_capa
+    // if Gscan is not supported.
+    // TODO: removes below if driver has new API to get roaming_capa.
+    if (!(info->supported_feature_set & WIFI_FEATURE_GSCAN)) {
+        info->capa.roaming_capa.max_whitelist_size = WLAN_ROAM_MAX_NUM_WHITE_LIST;
+        info->capa.roaming_capa.max_blacklist_size = WLAN_ROAM_MAX_NUM_BLACK_LIST;
+    }
     memcpy(caps, &info->capa.roaming_capa, sizeof(wifi_roaming_capabilities));
 
     return WIFI_SUCCESS;