summaryrefslogtreecommitdiffstats
path: root/libwifi_hal
diff options
context:
space:
mode:
authorQuang Luong <qal@google.com>2018-09-18 17:02:31 -0700
committerQuang Luong <qal@google.com>2018-09-18 17:02:31 -0700
commit612cbfc83f9b8a8e79cbaf23f7871571dbb0d8a5 (patch)
tree99b85dd7ad36926a62368f02f444f239498fc96e /libwifi_hal
parentcbb8527acff680300c7d853318ed3afbd0663078 (diff)
downloadandroid_frameworks_opt_net_wifi-612cbfc83f9b8a8e79cbaf23f7871571dbb0d8a5.tar.gz
android_frameworks_opt_net_wifi-612cbfc83f9b8a8e79cbaf23f7871571dbb0d8a5.tar.bz2
android_frameworks_opt_net_wifi-612cbfc83f9b8a8e79cbaf23f7871571dbb0d8a5.zip
Wifi HIDL HAL: Removed unused function in DriverTool
Removed DriverTool::TakeOwnershipOfFirmwareReload Bug: 33434584 Test: build, unit tests Change-Id: I2250419a4cd29564d8e2a0ce2a1b16f1d26eaf6c
Diffstat (limited to 'libwifi_hal')
-rw-r--r--libwifi_hal/driver_tool.cpp38
-rw-r--r--libwifi_hal/include/wifi_hal/driver_tool.h4
2 files changed, 0 insertions, 42 deletions
diff --git a/libwifi_hal/driver_tool.cpp b/libwifi_hal/driver_tool.cpp
index 405254824..b9bca1929 100644
--- a/libwifi_hal/driver_tool.cpp
+++ b/libwifi_hal/driver_tool.cpp
@@ -31,44 +31,6 @@ const int DriverTool::kFirmwareModeSta = WIFI_GET_FW_PATH_STA;
const int DriverTool::kFirmwareModeAp = WIFI_GET_FW_PATH_AP;
const int DriverTool::kFirmwareModeP2p = WIFI_GET_FW_PATH_P2P;
-bool DriverTool::TakeOwnershipOfFirmwareReload() {
- if (!wifi_get_fw_path(kFirmwareModeSta) &&
- !wifi_get_fw_path(kFirmwareModeAp) &&
- !wifi_get_fw_path(kFirmwareModeP2p)) {
- return true; // HAL doesn't think we need to load firmware for any mode.
- }
-
- errno = 0;
- struct passwd *pwd = getpwnam("wifi");
- if (pwd == nullptr) {
- if (errno == 0) {
- PLOG(ERROR) << "No user 'wifi' found";
- } else {
- PLOG(ERROR) << "Error getting uid for wifi: " << strerror(errno);
- }
- return false;
- }
-
- errno = 0;
- struct group *grp = getgrnam("wifi");
- if (grp == nullptr) {
- if (errno == 0) {
- PLOG(ERROR) << "No group 'wifi' found";
- } else {
- PLOG(ERROR) << "Error getting gid for wifi: " << strerror(errno);
- }
- return false;
- }
-
- if (chown(WIFI_DRIVER_FW_PATH_PARAM, pwd->pw_uid, grp->gr_gid) != 0) {
- PLOG(ERROR) << "Error changing ownership of '" << WIFI_DRIVER_FW_PATH_PARAM
- << "' to wifi:wifi";
- return false;
- }
-
- return true;
-}
-
bool DriverTool::LoadDriver() {
return ::wifi_load_driver() == 0;
}
diff --git a/libwifi_hal/include/wifi_hal/driver_tool.h b/libwifi_hal/include/wifi_hal/driver_tool.h
index a27641bd9..c87983aaf 100644
--- a/libwifi_hal/include/wifi_hal/driver_tool.h
+++ b/libwifi_hal/include/wifi_hal/driver_tool.h
@@ -27,10 +27,6 @@ class DriverTool {
static const int kFirmwareModeAp;
static const int kFirmwareModeP2p;
- // Change the owner of the firmware reload path to wifi:wifi if
- // firmware reload is supported.
- static bool TakeOwnershipOfFirmwareReload();
-
DriverTool() = default;
virtual ~DriverTool() = default;