[9610] wlbt: Fix warnings for ERD 9610 Android P Project.
Stricter compilation seems to be on in MCD manifest for Android P so
fixing these for wifi hal project.
Change-Id: Ie63e5db6298d4e4a82764acd49fed2ebab45195a
SCSC-Bug-Id: SSB-41717
Signed-off-by: Tarun Karela <t.karela@samsung.com>
(cherry picked from commit 254df287a97fde15dfed8cfe487d87521f444e0d)
diff --git a/common.cpp b/common.cpp
index b28a815..e0de0bc 100755
--- a/common.cpp
+++ b/common.cpp
@@ -220,7 +220,6 @@
for (int i = 0; i < info->num_cmd; i++) {
if (info->cmd[i].cmd == cmd) {
- int id = info->cmd[i].id;
memmove(&info->cmd[i], &info->cmd[i+1], (info->num_cmd - i) * sizeof(cmd_info));
info->num_cmd--;
//ALOGI("Successfully removed command %d: %p from %d", id, cmd, i);
diff --git a/gscan.cpp b/gscan.cpp
index 063ac55..0b77503 100755
--- a/gscan.cpp
+++ b/gscan.cpp
@@ -1,4 +1,3 @@
-
#include <stdint.h>
#include <stddef.h>
#include <fcntl.h>
@@ -81,9 +80,6 @@
return NL_SKIP;
}
- int id = reply.get_vendor_id();
- int subcmd = reply.get_vendor_subcmd();
-
void *data = reply.get_vendor_data();
int len = reply.get_vendor_data_len();
@@ -140,8 +136,6 @@
return NL_SKIP;
}
- int id = reply.get_vendor_id();
- int subcmd = reply.get_vendor_subcmd();
int num_channels_to_copy = 0;
nlattr *vendor_data = reply.get_attribute(NL80211_ATTR_VENDOR_DATA);
@@ -182,6 +176,7 @@
/* helper functions */
+/*
static int parseScanResults(wifi_scan_result *results, int num, nlattr *attr)
{
memset(results, 0, sizeof(wifi_scan_result) * num);
@@ -189,7 +184,6 @@
int i = 0;
for (nl_iterator it(attr); it.has_next() && i < num; it.next(), i++) {
- int index = it.get_type();
nlattr *sc_data = (nlattr *) it.get_data();
wifi_scan_result *result = results + i;
@@ -221,6 +215,7 @@
return i;
}
+*/
int createFeatureRequest(WifiRequest& request, int subcmd) {
@@ -237,12 +232,10 @@
wifi_scan_cmd_params *mParams;
wifi_scan_result_handler mHandler;
static unsigned mGlobalFullScanBuckets;
- bool mLocalFullScanBuckets;
public:
ScanCommand(wifi_interface_handle iface, int id, wifi_scan_cmd_params *params,
wifi_scan_result_handler handler)
- : WifiCommand(iface, id), mParams(params), mHandler(handler),
- mLocalFullScanBuckets(0)
+ : WifiCommand(iface, id), mParams(params), mHandler(handler)
{ }
int createSetupRequest(WifiRequest& request) {
@@ -479,7 +472,6 @@
if(id == -1) {
wifi_scan_result_handler handler;
wifi_scan_cmd_params dummy_params;
- wifi_handle handle = getWifiHandle(iface);
memset(&handler, 0, sizeof(handler));
ScanCommand *cmd = new ScanCommand(iface, id, &dummy_params, handler);
@@ -574,9 +566,6 @@
return NL_SKIP;
}
- int id = reply.get_vendor_id();
- int subcmd = reply.get_vendor_subcmd();
-
nlattr *vendor_data = reply.get_attribute(NL80211_ATTR_VENDOR_DATA);
int len = reply.get_vendor_data_len();
@@ -611,8 +600,8 @@
num = min((int)MAX_AP_CACHE_PER_SCAN, num);
memcpy(mScanResults + mNextScanResult, it2.get_data(),
sizeof(wifi_scan_result) * num);
- wifi_scan_result *results = (wifi_scan_result *)it2.get_data();
/*
+ wifi_scan_result *results = (wifi_scan_result *)it2.get_data();
for (int i = 0; i < num; i++) {
wifi_scan_result *result = results + i;
ALOGD("%02d %-32s %02x:%02x:%02x:%02x:%02x:%02x %04d", i,
@@ -1148,7 +1137,6 @@
}
virtual int handleEvent(WifiEvent& event) {
- int event_id = event.get_vendor_subcmd();
// event.log();
nlattr *vendor_data = event.get_attribute(NL80211_ATTR_VENDOR_DATA);
diff --git a/link_layer_stats.cpp b/link_layer_stats.cpp
index cafabb6..bfdeac8 100755
--- a/link_layer_stats.cpp
+++ b/link_layer_stats.cpp
@@ -199,9 +199,7 @@
return NL_SKIP;
}
int id = reply.get_vendor_id();
- int subcmd = reply.get_vendor_subcmd();
u8 *data = (u8 *)reply.get_vendor_data();
- int len = reply.get_vendor_data_len();
int num_radios = 0, i = 0;
num_radios = data[0];
data += sizeof(data[0]);
diff --git a/roam.cpp b/roam.cpp
index 2f5e8a1..2fe5c26 100755
--- a/roam.cpp
+++ b/roam.cpp
@@ -106,7 +106,6 @@
wifi_error ret;
int requestId;
wifi_bssid_params bssid_params;
- wifi_handle wifiHandle = getWifiHandle(iface);
if (!roaming_config) {
ALOGE("%s: Invalid Buffer provided. Exit", __FUNCTION__);
diff --git a/wifi_hal.cpp b/wifi_hal.cpp
index 402c244..b38d333 100755
--- a/wifi_hal.cpp
+++ b/wifi_hal.cpp
@@ -41,7 +41,6 @@
#define ATTR_NODFS_VALUE 3
#define ATTR_COUNTRY_CODE 4
-static void internal_event_handler(wifi_handle handle, int events);
static int internal_no_seq_check(nl_msg *msg, void *arg);
static int internal_valid_message_handler(nl_msg *msg, void *arg);
static int wifi_get_multicast_id(wifi_handle handle, const char *name, const char *group);
@@ -840,9 +839,6 @@
protected:
virtual int handleResponse(WifiEvent& reply) {
- int id = reply.get_vendor_id();
- int subcmd = reply.get_vendor_subcmd();
-
if (reply.get_cmd() != NL80211_CMD_VENDOR) {
ALOGD("Ignore reply; cmd = %d", reply.get_cmd());
return NL_SKIP;
@@ -1004,7 +1000,6 @@
if(id == -1) {
wifi_rssi_event_handler handler;
- wifi_handle handle = getWifiHandle(iface);
memset(&handler, 0, sizeof(handler));
SetRSSIMonitorCommand *cmd = new SetRSSIMonitorCommand(id, iface,
0, 0, handler);
diff --git a/wifi_logger.cpp b/wifi_logger.cpp
index 03ed87f..0d8eed2 100755
--- a/wifi_logger.cpp
+++ b/wifi_logger.cpp
@@ -380,9 +380,8 @@
case GET_FEATURE:
{
void *data = reply.get_vendor_data();
- int len = reply.get_vendor_data_len();
- ALOGD("len = %d, expected len = %d", len, sizeof(unsigned int));
+ ALOGD("len = %d, expected len = %lu", reply.get_vendor_data_len(), (unsigned long)sizeof(unsigned int));
memcpy(mSupport, data, sizeof(unsigned int));
break;
}
@@ -677,7 +676,6 @@
}
virtual int handleEvent(WifiEvent& event) {
- wifi_ring_buffer_id ring_id;
char *buffer = NULL;
int buffer_size = 0;
@@ -944,7 +942,7 @@
for (nl_iterator it(vendor_data); it.has_next(); it.next()) {
if (it.get_type() == ENHANCE_LOGGER_ATTRIBUTE_PKT_FATE_NUM) {
*mNoProvidedFates = it.get_u32();
- ALOGI("No: of pkt fates provided is %d\n", *mNoProvidedFates);
+ ALOGI("No: of pkt fates provided is %zu\n", *mNoProvidedFates);
} else {
ALOGE("Ignoring invalid attribute type = %d, size = %d\n",
it.get_type(), it.get_len());
@@ -1174,6 +1172,16 @@
it.get_type(), it.get_len());
}
}
+ case GET_FW_VER:
+ case GET_DRV_VER:
+ case GET_RING_DATA:
+ case GET_RING_STATUS:
+ case GET_FEATURE:
+ case START_RING_LOG:
+ default:
+ {
+ ALOGW("Ignoring GetCmdType %d \n", mType);
+ }
}
return NL_OK;
}