[9610] wlbt: Move around code to fix compilation error (Android P)
authorTarun Karela <t.karela@samsung.com>
Tue, 5 Jun 2018 10:55:09 +0000 (11:55 +0100)
committerTarun Karela <t.karela@samsung.com>
Tue, 5 Jun 2018 10:55:09 +0000 (11:55 +0100)
Move various definations to beGinning of file to fix compilation error

Change-Id: Ic30aa7f168bbdae79fc766cac5230c7cb52b69ee
SCSC-Bug-Id: SSB-40175
Signed-off-by: Tarun Karela <t.karela@samsung.com>
wifi_hal.cpp

index 0ea9f4613075ca48bfcd5533a83ab372a22532bf..bdc55451a33e18da2653e4a07c3900d91a1a2007 100755 (executable)
@@ -72,6 +72,35 @@ void wifi_socket_set_local_port(struct nl_sock *sock, uint32_t port)
     nl_socket_set_local_port(sock, pid + (port << 22));
 }
 
+class SetNdoffloadCommand : public WifiCommand {
+
+private:
+    u8 mEnable;
+public:
+    SetNdoffloadCommand(wifi_interface_handle handle, u8 enable)
+        : WifiCommand(handle, 0) {
+        mEnable = enable;
+    }
+    virtual int create() {
+        int ret;
+
+        ret = mMsg.create(GOOGLE_OUI, SLSI_NL80211_VENDOR_SUBCMD_CONFIGURE_ND_OFFLOAD);
+        if (ret < 0) {
+            ALOGE("Can't create message to send to driver - %d", ret);
+            return WIFI_ERROR_NOT_AVAILABLE;
+        }
+
+        nlattr *data = mMsg.attr_start(NL80211_ATTR_VENDOR_DATA);
+        ret = mMsg.put_u8(ANDR_WIFI_ATTRIBUTE_ND_OFFLOAD_CONFIG, mEnable);
+        if (ret < 0) {
+               return ret;
+        }
+       ALOGD("Driver message has been created successfully--> %d", mEnable);
+        mMsg.attr_end(data);
+        return WIFI_SUCCESS;
+    }
+};
+
 static nl_sock * wifi_create_nl_socket(int port)
 {
     struct nl_sock *sock = nl_socket_alloc();
@@ -91,6 +120,32 @@ static nl_sock * wifi_create_nl_socket(int port)
     return sock;
 }
 
+
+wifi_error wifi_configure_nd_offload(wifi_interface_handle handle, u8 enable)
+{
+       SetNdoffloadCommand command(handle, enable);
+       int ret = command.requestResponse();
+       if (ret != WIFI_SUCCESS) {
+               if (ret == -EPERM) {           /*This is just to pass VTS test */
+                       ALOGD("return value from driver--> %d",ret);
+                       return WIFI_SUCCESS;
+               }
+       }
+       return (wifi_error)ret;
+}
+
+wifi_error wifi_get_packet_filter_capabilities(wifi_interface_handle handle,
+                                                      u32 *version, u32 *max_len)
+{
+       /*Return success to pass VTS test.*/
+       ALOGD("Packet filter not supported");
+
+       *version = 0;
+       *max_len = 0;
+
+       return WIFI_SUCCESS;
+}
+
 /* Initialize HAL function pointer table */
 wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn)
 {
@@ -802,34 +857,7 @@ protected:
 
 };
 
-class SetNdoffloadCommand : public WifiCommand {
 
-private:
-    u8 mEnable;
-public:
-    SetNdoffloadCommand(wifi_interface_handle handle, u8 enable)
-        : WifiCommand(handle, 0) {
-        mEnable = enable;
-    }
-    virtual int create() {
-        int ret;
-
-        ret = mMsg.create(GOOGLE_OUI, SLSI_NL80211_VENDOR_SUBCMD_CONFIGURE_ND_OFFLOAD);
-        if (ret < 0) {
-            ALOGE("Can't create message to send to driver - %d", ret);
-            return WIFI_ERROR_NOT_AVAILABLE;
-        }
-
-        nlattr *data = mMsg.attr_start(NL80211_ATTR_VENDOR_DATA);
-        ret = mMsg.put_u8(ANDR_WIFI_ATTRIBUTE_ND_OFFLOAD_CONFIG, mEnable);
-        if (ret < 0) {
-               return ret;
-        }
-       ALOGD("Driver message has been created successfully--> %d", mEnable);
-        mMsg.attr_end(data);
-        return WIFI_SUCCESS;
-    }
-};
 
 static int wifi_get_multicast_id(wifi_handle handle, const char *name, const char *group)
 {
@@ -989,30 +1017,6 @@ wifi_error wifi_set_country_code(wifi_interface_handle handle, const char *count
     return (wifi_error) command.requestResponse();
 }
 
-wifi_error wifi_configure_nd_offload(wifi_interface_handle handle, u8 enable)
-{
-       SetNdoffloadCommand command(handle, enable);
-       int ret = command.requestResponse();
-       if (ret != WIFI_SUCCESS) {
-               if (ret == -EPERM) {           /*This is just to pass VTS test */
-                       ALOGD("return value from driver--> %d",ret);
-                       return WIFI_SUCCESS;
-               }
-       }
-       return (wifi_error)ret;
-}
-
-wifi_error wifi_get_packet_filter_capabilities(wifi_interface_handle handle,
-                                                      u32 *version, u32 *max_len)
-{
-       /*Return success to pass VTS test.*/
-       ALOGD("Packet filter not supported");
-
-       *version = 0;
-       *max_len = 0;
-
-       return WIFI_SUCCESS;
-}
 
 /////////////////////////////////////////////////////////////////////////////