wlbt: Fix for nl attribute index match for Batch-1 commands.
authorMohit Ghuley <mohit.ghuley@samsung.com>
Tue, 11 Aug 2020 13:15:37 +0000 (18:45 +0530)
committerYoungsoo Kim <youngss.kim@samsung.com>
Mon, 31 Aug 2020 04:37:31 +0000 (13:37 +0900)
Changes are done to match index of nl attribute
in scsc driver and wifi-hal.

SCSC-Bug-Id: HOST-13256
Signed-off-by: Mohit Ghuley <mohit.ghuley@samsung.com>
Change-Id: Id97f25aff0a3b92374cf4633705e9e676c4a97f6

Android.bp
common.h
roam.cpp
soong/Android.bp [new file with mode: 0644]
soong/slsi_wifi_hal.go [new file with mode: 0644]
wifi_hal.cpp
wifi_offload.cpp

index 0ba125c5bd4a095525de9584ade035b4b187c7c7..32c68e6316b74b9c57a71a6997d8a6ab77fb7d5d 100644 (file)
@@ -9,10 +9,18 @@
 
 // Make the HAL library
 // ============================================================
+
+slsi_wifi_hal_defaults {
+   name: "slsiwifihal-defaults-instance",
+   cppflags: [
+       "-Wno-unused-parameter",
+   ],
+}
+
 cc_library_static {
     name: "libwifi-hal-slsi",
 
-    cflags: ["-Wno-unused-parameter"],
+    defaults: ["slsiwifihal-defaults-instance"],
 
     include_dirs: [
         "system/core/include/",
index e9ea5489e5f40949017c56868e232e1f207bdbc8..f60753555dc177e1e7553af3c9ad3f65c8d0de47 100755 (executable)
--- a/common.h
+++ b/common.h
 #define DEFAULT_CMD_SIZE        (64)
 #define DOT11_OUI_LEN             3
 
+#ifdef SLSI_WIFI_HAL_NL_ATTR_CONFIG
+#define WIFI_HAL_ATTR_START 1
+#else
+#define WIFI_HAL_ATTR_START 0
+#endif
+
 typedef struct {
        int num_bssid;
        mac_addr bssids[MAX_BLACKLIST_BSSID];
index 1d79b9d59f170cbd6e03090904eae3539e14ee00..d3b8f41215c9edb9d9e1d9bc62f7d1c96e23b0bb 100755 (executable)
--- a/roam.cpp
+++ b/roam.cpp
@@ -32,7 +32,8 @@
 enum roam_attributes {\r
     SLSI_ATTR_ROAM_CAPABILITY_BLACKLIST_SIZE,\r
     SLSI_ATTR_ROAM_CAPABILITY_WHITELIST_SIZE,\r
-    SLSI_ATTR_ROAM_STATE\r
+    SLSI_ATTR_ROAM_STATE,\r
+    SLSI_ATTR_ROAM_MAX\r
 };\r
 \r
 class BssidBlacklistCommand : public WifiCommand\r
diff --git a/soong/Android.bp b/soong/Android.bp
new file mode 100644 (file)
index 0000000..25ac12e
--- /dev/null
@@ -0,0 +1,13 @@
+bootstrap_go_package {
+    name: "soong-slsi-wifi-hal",
+    pkgPath: "android/soong/hardware/samsung_slsi/scsc_wifibt/wifi_hal",
+    deps: [
+        "soong",
+        "soong-android",
+        "soong-cc"
+    ],
+    srcs: [
+        "slsi_wifi_hal.go"
+    ],
+    pluginFor: ["soong_build"]
+}
diff --git a/soong/slsi_wifi_hal.go b/soong/slsi_wifi_hal.go
new file mode 100644 (file)
index 0000000..fb8b747
--- /dev/null
@@ -0,0 +1,69 @@
+package slsi_wifi_hal
+
+import (
+    "android/soong/android"
+    "android/soong/cc"
+)
+
+func globalFlags(ctx android.BaseContext) []string {
+    var cflags []string
+
+    slsiwifihalconfig := ctx.DeviceConfig().WifiHalConfig()
+    if (slsiwifihalconfig == "true") {
+        cflags = append(cflags, "-DSLSI_WIFI_HAL_NL_ATTR_CONFIG")
+    }
+    return cflags
+}
+
+func deviceFlags(ctx android.BaseContext) []string {
+    var cflags []string
+
+    return cflags
+}
+
+func hostFlags(ctx android.BaseContext) []string {
+    var cflags []string
+
+    return cflags
+}
+
+func slsiWifiHalDefaults(ctx android.LoadHookContext) {
+    type props struct {
+        Target struct {
+            Android struct {
+                Cflags []string
+                Enabled *bool
+            }
+            Host struct {
+                Enabled *bool
+            }
+            Linux struct {
+                Cflags []string
+            }
+            Darwin struct {
+                Cflags []string
+            }
+        }
+        Cflags []string
+    }
+
+    p := &props{}
+    p.Cflags = globalFlags(ctx)
+    p.Target.Android.Cflags = deviceFlags(ctx)
+    h := hostFlags(ctx)
+    p.Target.Linux.Cflags = h
+    p.Target.Darwin.Cflags = h
+
+    ctx.AppendProperties(p)
+}
+
+func init() {
+    android.RegisterModuleType("slsi_wifi_hal_defaults", slsiWifiHalDefaultsFactory)
+}
+
+func slsiWifiHalDefaultsFactory() android.Module {
+    module := cc.DefaultsFactory()
+    android.AddLoadHook(module, slsiWifiHalDefaults)
+
+    return module
+}
index 11d32f0a4738afdf6381e36b843c525f2cd26a9d..1cf3116f12b5833a3e512719c8bfec87bc17e529 100755 (executable)
 #define FEATURE_SET                  0
 #define FEATURE_SET_MATRIX           1
 #define ATTR_NODFS_VALUE             3
+#ifndef SLSI_WIFI_HAL_NL_ATTR_CONFIG
 #define ATTR_COUNTRY_CODE            4
 #define ATTR_LOW_LATENCY_MODE        5
+#endif
 
 static int internal_no_seq_check(nl_msg *msg, void *arg);
 static int internal_valid_message_handler(nl_msg *msg, void *arg);
@@ -72,6 +74,18 @@ enum apf_request_type {
     READ_APF_PROGRAM
 };
 
+#ifdef SLSI_WIFI_HAL_NL_ATTR_CONFIG
+enum wifi_low_latency_attr {
+    ATTR_LOW_LATENCY_MODE = 1,
+    ATTR_LOW_LATENCY_MAX
+};
+
+enum country_code_attr {
+    ATTR_COUNTRY_CODE = 1,
+    ATTR_COUNTRY_CODE_MAX
+};
+#endif
+
 static wifi_error wifi_start_rssi_monitoring(wifi_request_id id, wifi_interface_handle
                         iface, s8 max_rssi, s8 min_rssi, wifi_rssi_event_handler eh);
 static wifi_error wifi_stop_rssi_monitoring(wifi_request_id id, wifi_interface_handle iface);
index f20ce465a1df3706f0bbcda519bfad982cab2aa0..a58bf3860cc21c396e8f9574ef86dca45f705168 100755 (executable)
 #include "cpp_bindings.h"
 
 typedef enum {
-    MKEEP_ALIVE_ATTRIBUTE_ID,
+    MKEEP_ALIVE_ATTRIBUTE_ID = WIFI_HAL_ATTR_START,
     MKEEP_ALIVE_ATTRIBUTE_IP_PKT,
     MKEEP_ALIVE_ATTRIBUTE_IP_PKT_LEN,
     MKEEP_ALIVE_ATTRIBUTE_SRC_MAC_ADDR,
     MKEEP_ALIVE_ATTRIBUTE_DST_MAC_ADDR,
-    MKEEP_ALIVE_ATTRIBUTE_PERIOD_MSEC
+    MKEEP_ALIVE_ATTRIBUTE_PERIOD_MSEC,
+    MKEEP_ALIVE_ATTRIBUTE_MAX
 } WIFI_MKEEP_ALIVE_ATTRIBUTE;
 
 typedef enum {