summaryrefslogtreecommitdiffstats
path: root/libwifi_hal/wifi_hal_common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libwifi_hal/wifi_hal_common.cpp')
-rw-r--r--libwifi_hal/wifi_hal_common.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/libwifi_hal/wifi_hal_common.cpp b/libwifi_hal/wifi_hal_common.cpp
index 459fdf515..7df84bd95 100644
--- a/libwifi_hal/wifi_hal_common.cpp
+++ b/libwifi_hal/wifi_hal_common.cpp
@@ -16,13 +16,11 @@
#include "hardware_legacy/wifi.h"
-#define LOG_TAG "WifiHalCommon"
-
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
-#include <cutils/log.h>
+#include <android-base/logging.h>
#include <cutils/misc.h>
#include <cutils/properties.h>
@@ -80,8 +78,7 @@ static int rmmod(const char *modname) {
}
if (ret != 0)
- ALOGD("Unable to unload driver module \"%s\": %s\n", modname,
- strerror(errno));
+ PLOG(DEBUG) << "Unable to unload driver module '" << modname << "'";
return ret;
}
@@ -94,12 +91,12 @@ int wifi_change_driver_state(const char *state) {
if (!state) return -1;
fd = TEMP_FAILURE_RETRY(open(WIFI_DRIVER_STATE_CTRL_PARAM, O_WRONLY));
if (fd < 0) {
- ALOGE("Failed to open driver state control param (%s)", strerror(errno));
+ PLOG(ERROR) << "Failed to open driver state control param";
return -1;
}
len = strlen(state) + 1;
if (TEMP_FAILURE_RETRY(write(fd, state, len)) != len) {
- ALOGE("Failed to write driver state control param (%s)", strerror(errno));
+ PLOG(ERROR) << "Failed to write driver state control param";
ret = -1;
}
close(fd);
@@ -126,7 +123,7 @@ int is_wifi_driver_loaded() {
* crash.
*/
if ((proc = fopen(MODULE_FILE, "r")) == NULL) {
- ALOGW("Could not open %s: %s", MODULE_FILE, strerror(errno));
+ PLOG(WARNING) << "Could not open " << MODULE_FILE;
property_set(DRIVER_PROP_NAME, "unloaded");
return 0;
}
@@ -210,12 +207,12 @@ int wifi_change_fw_path(const char *fwpath) {
if (!fwpath) return ret;
fd = TEMP_FAILURE_RETRY(open(WIFI_DRIVER_FW_PATH_PARAM, O_WRONLY));
if (fd < 0) {
- ALOGE("Failed to open wlan fw path param (%s)", strerror(errno));
+ PLOG(ERROR) << "Failed to open wlan fw path param";
return -1;
}
len = strlen(fwpath) + 1;
if (TEMP_FAILURE_RETRY(write(fd, fwpath, len)) != len) {
- ALOGE("Failed to write wlan fw path param (%s)", strerror(errno));
+ PLOG(ERROR) << "Failed to write wlan fw path param";
ret = -1;
}
close(fd);