summaryrefslogtreecommitdiffstats
path: root/libwifi_system
Commit message (Collapse)AuthorAgeFilesLines
* Refactor hostapd manager unit testsNingyuan Wang2017-08-151-48/+31
| | | | | | | | | | | | In order to expand hotstapd manager, we might introduce new parameters to hostapd config file. This CL refactors hostapd manager unit tests, allowing the unit tests to be more scalable. Bug: 34669770 Test: compile, unit tests Change-Id: I97d946d6bbf011691d2ef72e05819f0ee71137b3
* Use cc_library for libwifi_system[_iface].Tri Vo2017-08-041-1/+1
| | | | | | | | | | | Both static and shared versions are now available. These libs are dependencies of VtsHalWifiSupplicantV1_0TargetTest, but are not guaranteed to be on the device. So the static versions are needed for testing. Bug: 64040096 Test: compiles Change-Id: Ia1e551f5a90bfe8f06c245c4102be375de8f3f26
* Add missing gmock.h includes for mock class headersNingyuan Wang2017-06-263-0/+3
| | | | | | | | | | Mock class headers should include gmock.h, otherwise it imposes a requirement that anyone who uses the mock class header should include gmock.h before that. Bug: 62961379 Test: compile, unittests Change-Id: I788badd961de04dc6a0c584e08264c94692250b5
* Merge "Improve logging for supplicant config file" into oc-devNingyuan Wang2017-06-151-8/+14
|\ | | | | | | | | | | am: 619693476e Change-Id: I0eee0a03535f531ccd1cf6f7062a2f981e85df09
| * Merge "Improve logging for supplicant config file" into oc-devTreeHugger Robot2017-06-151-8/+14
| |\
| | * Improve logging for supplicant config fileNingyuan Wang2017-06-011-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Supplicant config could be in either /system or /vendor, we should only log error if we can't find it in both places. Bug: 62268780 Test: compile, unit tests, manual test Change-Id: I5a66ef27385aee79f3ec6fdcaafc46c8cda793d8
* | | Merge "Print stat() info on hostapd config file error" into oc-devNingyuan Wang2017-06-121-0/+8
|\| | | | | | | | | | | | | | | | | am: 706ca6ce2d Change-Id: I99bb100cf91e03ca1a57923ccf6477ac27ca81ca
| * | Print stat() info on hostapd config file errorNingyuan Wang2017-06-081-0/+8
| |/ | | | | | | | | | | | | | | | | | | This infomration will be helpful for debugging on writing hostapd file error. Bug: 37535105 Test: compile, manual test Change-Id: Iee07a02227601adcf1e8d6ed3aad86b19251184f
* | Split InterfaceTool from libwifi-system.soLogan Chien2017-04-264-192/+0
| | | | | | | | | | | | | | | | | | | | | | This commit extracts InterfaceTool from libwifi-system.so into a new library named libwifi-system-iface.so. libwifi-system-iface.so will be vendor_available because it will be used by both wificond and android.hardware.wifi@1.0-service. Bug: 37429084 Test: Sailfish builds, boots, and wifi works. Change-Id: Iad93c6d258507df3bbb97228814ff5ce5cc2a2f9
* | Convert Android.mk to Android.bpLogan Chien2017-04-262-76/+77
|/ | | | | | | | | | | This commit converts Android.mk to Android.bp. Besides, during the transition, we found that $(wificond_cpp_flags) should be $(wifi_system_cflags). Bug: 37429084 Test: Sailfish builds, boots, and wifi works. Change-Id: Ida255cd6ac0cd9434bd95f1ae570683dccb0388e
* lib-wifisystem: Remove unused dependenciesNingyuan Wang2017-03-316-476/+52
| | | | | | | | | | | | This removes ununsed libwpa_client, libnetutils, libnl from libwifi-system. This also removes wifi.h and wifi.cpp. The only useful function ensure_entropy_file_exists() is moved to SupplicantManager. Bug: 36697996 Test: compile, manual test: wifi works with toggling Change-Id: I1f55813ee43a821d18d2368c1cc28a3bf95b6c93
* Merge "wpa_supplicant.conf can be in either /system or /vendor"TreeHugger Robot2017-03-141-5/+13
|\
| * wpa_supplicant.conf can be in either /system or /vendorJiyong Park2017-03-101-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | wpa_supplicant.conf is not generic and thus it should be moved to /vendor/etc/wifi. However because we currently have many non-generic products that put the file in /system/etc/wifi, supplicant_manager is modified to read both places; /vendor/etc/wifi is accessed if it can't read the file under /system/etc/wifi. Bug: 36015569 Test: have wpa_supplicant.conf under /vendor/etc/wifi and not under /system/etc/wifi. Wifi should work. Change-Id: I4d6969ab4b224e5aaee132ccf6f64cdc9b56f48a
* | HalTool: Move haltool out of libwifi-systemRoshan Pius2017-03-103-620/+1
|/ | | | | | | | | | HalTool is used mainly by test tools and needs to link against libwifi-hal. So, move this out of libwifi-system to libwifi-hal. The libwifi-hal folder will get moved out to hardware/interfaces soon. Bug: 34457880 Test: Compiles & device boots up. Change-Id: I00ce0ed2c271e8c4e1295d004d0b7479365cb8d7
* Merge "Enable libwifi-hal-common, libwifi_system in the PDK"Dan Willemsen2016-12-131-4/+0
|\
| * Enable libwifi-hal-common, libwifi_system in the PDKDan Willemsen2016-12-121-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | libwifi-hal-common is required by libhardware_legacy, which does need to build in the PDK. libwifi_system is required by libwificond, which builds in the PDK. Bug: 33451638 Test: With PDK, mmma -j frameworks/opt/net/wifi/libwifi_hal Test: With PDK, mmma -j frameworks/opt/net/wifi/libwifi_system Change-Id: I55a534714e6ce23f39326359cdfaef939fd028df
* | Remove obsoleted HAL API set_bssid_blacklistRandy Pan2016-12-121-7/+0
|/ | | | | | | Bug: 32907214 Test: Bulid Change-Id: Ibeedb6f95349ce8f225228ba02cdd4eedc599074 Merged-In: Ibeedb6f95349ce8f225228ba02cdd4eedc599074
* Add a helper to read the interface stateChristopher Wiley2016-09-223-9/+38
| | | | | | | | | | This helper doesn't really distinguish between "I failed to read the state" and "state is down" but I think that if we cannot observe the interface to be up, it may as well be down. Bug: 31337216 Test: Compiles Change-Id: Id48968844fea120bc0a4c439693db58d72feb4a1
* Remove superfluous definition of wpa_ctrl_cleanupChristopher Wiley2016-08-251-1/+0
| | | | | | | | | We no longer use this in wifi.cpp, and the two definitions cause problems at link time on platforms without supplicant. Bug: 29620309 Change-Id: I97bf827ec114343d0885a2b148e5f9adc4510a62 Test: Should fix build on mac
* Move supplicant management functions to delegateChristopher Wiley2016-08-256-190/+319
| | | | | | | | | This makes them easier to mock out in unit testing. Bug: 29620309 Test: wificond integration tests continue to pass Change-Id: I5b794b9b5c7fb291d253e28ca5f60cd69f39c280
* Allow wificond to run as wifi:wifiChristopher Wiley2016-08-222-13/+1
| | | | | | | | | | | | | | Expose the firmware path from libwifi_hal. We need to access this at wificond startup to chown the firmware reload path to wifi:wifi. Remove some superfluous chown calls. The callsites should only be used from wificond. Bug: 29870863 Test: wificond unit and integration tests pass Change-Id: If2fa38be252999a01f6d967ca8601d1789318103
* Remove hostapd pid manipulationChristopher Wiley2016-08-222-42/+0
| | | | | | | | | This is no longer needed now that we can clean up after unclean shutdowns. Bug: 31023120 Change-Id: I459d62d3f199c8acd35a139fa4f8ca60042d6bbf Test: wificond unit and integration tests pass
* Rely on wificond to start/stop supplicantChristopher Wiley2016-08-121-4/+2
| | | | | | | Bug: 30666540 Test: Still able to connect via WiFi Change-Id: Ia8a706db70be18b2d4b4687400d9a06d0819690e
* Always start/stop wpa_supplicant service on requestChristopher Wiley2016-08-122-46/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | For a given product, P2P is either supported or not supported, depending on the product configuration and hardware support. Because of this, on a given product, we do not need to determine which wpa_supplicant configuration to run, we can just use "whatever the given product supports." We've changed init files to define a single service "wpa_supplicant". In places where there were both p2p_supplicant and wpa_supplicant services defined, we have removed the wpa_supplicant service, and replaced it with the definition of p2p_supplicant. Above the supplicant we choose for a given platform, we still keep the hooks that allow optional P2P support in the framework, since the framework needs to support hardware with P2P support, and hardware without. Bug: 30816535 Test: unit tests pass on bullhead Test: cts-tradefed run cts-dev \ --module=CtsNetTestCases \ --test=android.net.wifi.cts.ConcurrencyTest passes Change-Id: I6ea65fde1707f65e70b41c94ca823bb2318d81f0
* Set SOCK_CLOEXEC on libwifi-system interface socketChristopher Wiley2016-08-021-1/+1
| | | | | | This is more hygienic, although not especially necessary. Change-Id: I68d4e19c2daa0a2231b6ae2d0cffd2833a4f7913
* Merge "Use android-base/logging.h in libwifi-system"TreeHugger Robot2016-08-022-8/+11
|\
| * Use android-base/logging.h in libwifi-systemChristopher Wiley2016-08-012-8/+11
| | | | | | | | | | | | | | This allows log messages to properly inherit the log tag of the logging process. Change-Id: Ib40b991842ea741cce33f20db2253723d3fdbef1
* | Merge "Track hostapd's life via pid files"Christopher Wiley2016-08-022-14/+39
|\ \
| * | Track hostapd's life via pid filesChristopher Wiley2016-08-012-14/+39
| |/ | | | | | | | | | | | | | | | | | | init now writes hostapd's pid to a file. We can use this information to check if there is a process that looks like hostapd running. Bug: 30311493 Change-Id: I3ad24b5fa70ae963c1aa0d4b1c11d00f60dff8d1 Test: with a patch to wificond, hostapd starts and stops reliably on bullhead
* / Fix libwifi-system unit testsChristopher Wiley2016-07-291-1/+1
|/ | | | | | Bug: 30311493 Change-Id: I117433e486d65e408ed523a4d5f10d0c49562399 Test: These pass again.
* Give hostapd its own directory for control socketsChristopher Wiley2016-07-271-1/+1
| | | | | | | | | | hostapd likes to create/remove this directory when it starts up. This is especially true when hostapd encounters an error, and tries to remove the control socket directory. Bug: 30311493 Change-Id: Ifce67d54e510b39918a2141ececf569daf0e82af Test: hostapd starts up/shuts down (even on error) without avc denials
* Add MockHostapdManager class declarationChristopher Wiley2016-07-211-0/+46
| | | | | | | | | Having this mock in a shared location helps us not duplicate it across different binaries linking libwifi-system. Bug: 30040724 Change-Id: I5ea4c84d1af29f9eb1c1da8339b45a6c135b6920 Test: Unit tests using this class pass.
* Move hostapd management logic to libwifi-systemChristopher Wiley2016-07-185-0/+475
| | | | | | | | | | | | | | | | | This is the logic that existed in netd, but moved into a mockable C++ object and formulated to support unittesting the config file generation. Bug: 30040724 Test: unit tests pass, data for tests extracted from config files generated by existing netd code. Test: netd continues to be able to set up APs for tethering using libwifi-system rather than previous code. Test: No SELinux policy violations during/after setup. Test: Can sign in to network backed by hostapd started by netd using libwifi-system. Change-Id: I1156c494fc889a3fdf14182b11c7697d93fdf586
* Add mocks for wifi librariesChristopher Wiley2016-06-283-5/+95
| | | | | | Bug: 29634806 Change-Id: I2383f4a6294a8ee9e86564ad21c99b539de62eec Test: wificond tests can use these headers
* Allow libwifi-system to be mockedChristopher Wiley2016-06-275-24/+38
| | | | | | | Bug: 29634806 Test: Compiles, unittests pass on bullhead Change-Id: Ic3baf86961be077231d40ae1732b127d668e9589
* clang-format libwifi-systemChristopher Wiley2016-06-222-435/+425
| | | | | | | | | | | | | | | The only changes in this CL are the result of: find . -name "*.cpp" | xargs clang-format \ -style='{BasedOnStyle: Google, DerivePointerAlignment: false, PointerAlignment: Left}' -i A similar command for headers makes no edits. Bug: 29418225 Change-Id: Ifcf8be88cb5c95fb6f35615f25ec83e1421ba343
* Move basic HAL init code to libwifi_systemChristopher Wiley2016-06-213-1/+620
| | | | | | | | | | While here, fix a bug where the conditional for "do we support getting valid channels" was reversed in the implementation. Bug: 29417819 Test: Compiles, Wifi continues to associate on angler Change-Id: Ife3eee3aa25dfaf62589b395c74c4f8473238758
* Move set_iface_flags to libwifi-systemChristopher Wiley2016-06-203-1/+119
| | | | | | | | | | | | | Rename to the more accurate set_iface_up(). Expose an alias to encode assumptions about global iface names. Return an error when buffer overflow is averted. Handle EINTR from ioctls. Wrap socket fd in a scoped closer. Minor refactors to clean up logic and remove dead logging. Bug: 29417819 Change-Id: Ib1fde6dae5e3068643950d0905f5761d0c9b6daf Test: Compiles, WiFi still associates on bullhead.
* Make wifi.c code a little more C++Christopher Wiley2016-06-203-132/+146
| | | | | | | | | | | | Compile functionality as C++. Put everything in namespaces. Remove string #defines from the header. Reorder public function definitions to match the header. Bug: 29418225 Test: Compiles Change-Id: I5461f5cfe0db24e338c24489df511eea2257dc39
* Move device dependent functionality to libwifi-halChristopher Wiley2016-06-173-293/+9
| | | | | | Bug: 29418968 Change-Id: I0fa3047972c57af7128ce6384b62960f6f017d93 Test: wifi works/unittests pass on bullhead
* Move wifi.c to libwifi-systemChristopher Wiley2016-06-153-0/+994
This library will eventually contain only device independent wifi related code. For now, it still takes a few parameters from the build system to control #defines in a device specific way. Bug: 29321445 Change-Id: I6d0054a15b0e448019bb51728763d961132c5464 Test: Compiles, can associate to APs on bullhead, angler