diff options
-rw-r--r-- | libwifi_hal/driver_tool.cpp | 38 | ||||
-rw-r--r-- | libwifi_hal/include/wifi_hal/driver_tool.h | 4 |
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; |