Commit graph

48 commits

Author SHA1 Message Date
Automerger Merge Worker
d719d5726e [AWARE] Protect string copy against buffer overflow am: 5039b6099e
Change-Id: If36fa8b7de6f0b9092e9c7c7f50f6fd8111f6cb3
2019-12-19 01:38:38 +00:00
Etan Cohen
5039b6099e [AWARE] Protect string copy against buffer overflow
Fixes: 143789898
Test: (Unit) atest com.android.server.wifi
Test: ACTS ThroughputTest:test_iperf_single_ndp_aware_only_ib
Test: (VTS) atest VtsHalWifiApV1_4TargetTest
Change-Id: I5b8aa1d9a6388fe20cb7e1cd6a76d5e59e14d099
2019-12-18 15:08:00 -08:00
Nick Desaulniers
f5b16f32f5 [hardware][interfaces][wifi] fix -Wreorder-init-list
C++20 will require members in a designated initializer to be in order
unlike C99.

Bug: 139945549
Test: mm
Change-Id: If22be04df7d2d0aae9ed50fada53d0ccd4edc9d1
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-10-14 11:06:08 -07:00
Steven Moreland
b3a4d3832e Remove libhwbinder/libhidltransport deps
Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I075670b64eebbbbd6a6ae0e84ad51bf1c6f5ba36
2019-09-06 01:07:02 +00:00
Peter Kalauskas
caed24ba9b Convert LazyServiceRegistrar usage to singleton
Test: lshal
Bug: 139376253
Change-Id: I32cb803fb73aa15b52676847b6e7eb09b86657dc
2019-08-19 21:15:30 +00:00
Felix
37298a7616 Merge "Add interface info to .rc files"
am: 98d0f4d52c

Change-Id: Ie6cfbacd523c4b09f77bee3369ec8e88b3fa0419
2019-07-08 12:22:23 -07:00
Steven Moreland
085a82ecb1 libhidltransport users user libhidlbase
libhidltransport symbols are being moved into libhidlbase in order to
optimize linking/memory usage. libhidltransport will no longer be
required in the future (however removing references to it will come
separately).

Bug: 134961554
Test: boot
Change-Id: Ibcc2db32d3bec1a786b60e11d4820ecd0605f403
2019-06-12 13:49:19 -07:00
James Mattis
87592de6f2 Merge "Fix so that dual access points (AP) works." into qt-dev 2019-05-24 23:21:37 +00:00
James Mattis
d2e4c07465 Fix so that dual access points (AP) works.
Devices that only have dual AP setup without an STA were not working. A
use case for this would be in a car, having a wifi hotspot active while
also projecting to the car head unit from your phone. This was working
but a recent change in CL a3e5b7f that forced STA to be on wlan0 and AP to start at
wlan1 broke this functionality. This change is to augment the original
CL to keep it's function in place while also taking into
account devices that have dual AP.

Bug: 132268977
Test: Manual boot of hawk device along with testing of tethering and
local only hotspot.

Change-Id: I8da5dd4f0baea1bf0f22d3275e356936a58fb3d1
2019-05-22 16:26:55 -07:00
Roshan Pius
c885df0af3 wifi(tests): Unit tests for iface event cb's
Few class refactors to help with unit tests for ag/7567226.

Bug: 132943959
Test: ./hardware/interfaces/wifi/1.3/default/tests/runtests.sh
Change-Id: I62909f3f94899bc1593824684b93d29f44954eae
2019-05-22 14:22:01 -07:00
Roshan Pius
356d5a6ed2 wifi(implementation): Send NAN disabled on wlan0 down & up
When the iface state is toggled for MAC address change on the underlying
interface for NAN operations, send NAN disabled event up to the
framework. The iface down/up toggle resets all NAN operations in the
firmware. So, this callback should trigger a cleanup of any
operations initiated by the framework.

Bug: 132943959
Test: Unit tests in the follow-up CL.
Test: Will send for regression tests.
Change-Id: I760dc5ca3b9276956f5edd40a97c3c13811f442c
2019-05-22 14:11:16 -07:00
Roshan Pius
8236850bc0 wifi(implementation): Invalidate NAN iface on STA iface removal
NAN iface/RTT controllers are sharing the STA iface. When a STA iface is
removed, we should remove these dependent modules as well to ensure
proper cleanup.

Bug: 132837537
Test: ./hardware/interfaces/wifi/1.3/default/tests/runtests.sh
Test: Will send for regression tests.
Change-Id: Ia2da1dcf66b388f54e916ae69e2f4e26f20ecfad
2019-05-17 15:23:09 -07:00
Roshan Pius
444473fbc0 wifi(implementation): Simplify getFirstActiveWlanIfaceName
Get rid of the unnecessary looping inside the method which was causing a
bunch of unnecessary selinux denial logs.

Bug: 130384921
Test: ./data/android.hardware.wifi@1.0-service-tests
Test: Manually verified the property name after wifi on/off & softap
on/off.

Change-Id: Ia9f61749b2017234851d67b027deb685cb8b539e
2019-04-22 08:58:46 -07:00
TreeHugger Robot
65ae914635 Merge "wifi(implementation): Set prop with the first active iface" 2019-04-02 22:01:31 +00:00
Ahmed ElArabawy
ccf9cbea58 Merge "Wifi: Add ether_type to sending offloaded packet" 2019-04-02 16:43:48 +00:00
Roshan Pius
8574e7fd8b wifi(implementation): Set prop with the first active iface
This is updated whenever a new STA or AP iface is created & removed.
Also, when the chip is configured.

This property can be read by the rest of the system (including vendor
specific HAL instances) to retrieve the active iface name.

Bug: 129506593
Test: ./data/android.hardware.wifi@1.0-service-tests
Test: Manually verified the property name after wifi on/off & softap
on/off.

Change-Id: Ic1c21fd3a1c6894c797070bf889f705e4cba6dd1
2019-04-02 09:41:15 -07:00
Roshan Pius
6036c02d83 wifi(implementation): Use the active iface for chip operation
For the chip level operations, the actual interface itself does not
matter. So, instead of hard-coding these operations to wlan0 interface,
find the first active interface to use. This will still return wlan0 if
it's active, but if only AP is up (& pinned to wlan1), then it will use
wlan1 instead.

Bug: 129358937
Test: ./data/android.hardware.wifi@1.0-service-tests
Test: Verified manually that SAR commands are now correctly sent down.
Change-Id: I5a6175579027cbb45c09d32633ed81b9f72224dd
2019-03-27 12:30:03 -07:00
Roshan Pius
a3e5b7fce7 wifi(implementation): Pin primary STA iface to wlan0
The primary STA iface will always be pinned to wlan0.
The primary AP iface will be pinned to wlan0 for devices not supporting
STA + AP concurrency & wlan1 for devices supporting STA + AP concurrency.

All secondary STA or AP ifaces will be allocated on a first come first
service basis (the current logic).

Also, refactored/renamed some of the iface combo selection logic methods
to help check whether concurrency is allowed in the current mode.

Bug: 128946563
Test: ./data/android.hardware.wifi@1.0-service-tests
Test: Will send for full regression tests.
Test: On crosshatch, ensured that STA always comes up on wlan0 & AP
comes up on wlan1 regardless of the sequence of toggle followed.
Change-Id: Idca8de42ce819240bf0fac2a9039d15ed4bcaf90
2019-03-27 10:48:10 -07:00
Roshan Pius
1cd82a8cf2 wifi(implementation): Fix unit test failures
ag/6722341 caused some unit test failures. Fixing them.

Bug: 127715974
Test: ./data/android.hardware.wifi@1.0-service-tests
Change-Id: Ib504cf55b9990dba081eb1b07bc32508e09ad0a6
2019-03-25 13:51:28 -07:00
Ahmed ElArabawy
ffbad18ca0 Wifi: Add ether_type to sending offloaded packet
This commit adds the ether_type as an argument to the legacy hal
function to send an offloaded packet.

Bug: 122487582
Test: Manual
Test: Make sure ether_type is passed all the way to vendor hal function
Change-Id: I5918088000cc455e7f83feddc1090803ccc04c06
2019-03-18 16:06:12 -07:00
chenpaul
f5eca2949b wifi - Add wlan driver/fw version when device boot up
Bug: 127715974
Test: Property with wlan driver/fw version when device boot up
Change-Id: Idf1215ceb2c34502ed5eac6c8900350e511732fc
2019-03-14 12:33:29 +00:00
Elliott Hughes
14c495fc88 Merge "wifi: use PLOG rather than LOG strerror." am: fba8a08e6f am: 6d37b594a8
am: 9034bf375d

Change-Id: I483a457782a441e5b59f7b0b08e7a4cdf4f12949
2019-03-12 08:11:39 -07:00
TreeHugger Robot
6f058fb3ed Merge "wifi(implementation): Fix spammy log" 2019-03-05 01:44:56 +00:00
Ahmed ElArabawy
4822938217 Add an api call to check if legacy hal is started
This commit adds a public api call for legacy hal to check if it is
successfully started.
This is to be used by callers of legacy hal to make sure not to request
functionality while legacy hal (and hence all interfaces) are not
started.

Bug: 112205428
Test: Manual
Change-Id: I5183d01811e35edb3149cfb3784067c68b40e46d
2019-03-01 23:45:36 +00:00
Roshan Pius
5b3334648b wifi(implementation): Fix spammy log
wifi.interface.0, etc should only be checked if the primary property
used on most devices (wifi.interface & wifi.concurrent.interface) does
not exist.

wifi.interface.0, etc should only defined on Android auto platforms.

Bug: 126925255
Test: Manually verified that the spammy log does not exist
Change-Id: Ib5e6a87a7da2d4b26cdd35f668385b503e7c8006
2019-03-01 14:08:47 -08:00
Roshan Pius
ce02fb3c51 wifi(tests): Fix runtest.sh
Bug: 79261060
Test: ./hardware/interfaces/wifi/1.3/default/tests/runtests.sh
Change-Id: Idca21bf264640fb2e5eaa1791f3ff29e138bbbb2
2019-02-28 08:12:35 -08:00
Roshan Pius
c4446793d1 wifi(implementation): Generate randomized mac address
Generate random MAC address on the first creation of AP iface after
reboot.

Bug: 78353419
Test: ./hardware/interfaces/wifi/1.3/default/tests/runtests.sh
Test: Manually verified that the AP MAC address & BSSID changes on every
reboot.
Change-Id: Ie9984ec72b2dfec9b7de7a9ef33b9e9ebfaf945c
2019-02-26 07:12:52 -08:00
Roshan Pius
3b6705fb20 wifi(implementation): Set randomized MAC address for AP
Add the plumbing required for setting a random MAC address on AP
startup. The random MAC address is created once for the lifetime of
the daemon and then reused for any further AP creation. This would
ensure that the MAC address is changed on every reboot.

The feature is turned on by default, devices will need to set the
|WIFI_HIDL_FEATURE_DISABLE_AP_MAC_RANDOMIZATION| in their .mk file to
disable the feature at compile time.

Bug: 78353419
Test: ./hardware/interfaces/wifi/1.3/default/tests/runtests.sh
Change-Id: I054d5249c20cc582b76966313135295873cd0b61
2019-02-26 07:11:40 -08:00
Roshan Pius
99dab386d3 wifi(implementation): Move set/getMacaddress to a util class
This is just a refactor to move the setMacAddress & getFactoryMacAddress
methods to a util class within the HAL. This can be then reused in AP
iface for mac randomization of SoftAp.

This also fixes a bug in the existing setMacAddress() method, the
current method always sets wlan0 up/down. STA interface could be wlan1
on some devices.

Bug: 78353419
Test: ./hardware/interfaces/wifi/1.3/default/tests/runtests.sh
Test: Manually verified STA MAC randomization still works.
Change-Id: I0bb8154f7e6dcae37c977454423c8c299762260e
2019-02-26 07:09:52 -08:00
Etan Cohen
4cd0dbf6bb Revert "[AWARE] Disable NANv3 data-path capabilities"
This reverts commit e338c81190.

Cannot be supported without additional HAL APIs to provide the
device's capability to the host. These aren't necessary since
this capability should be enabled by default by the firmware.

Bug: 112586769
Test: (ACTS) act.py
ThroughputTest:test_iperf_max_ndi_aware_only_passphrases
Test: (CTS) atest SingleDeviceTest
2019-02-11 12:50:40 -08:00
Peter Kalauskas
1f6e6e3a65 Add new lazy wifi HAL target
Devices can use the lazy wifi HAL to allow it to exit when wifi is not
in use.

Test: Flash walleye_svelte-userdebug and check that HAL only runs when
      wifi is on.
Bug: 123307146
Change-Id: If20120f902a7e102372666447b39cf9fdad7d352
2019-01-31 15:44:47 -08:00
Jimmy Chen
62c6495663 Merge "p2p: add HAL method to enable P2P random MAC address feature" 2019-01-23 02:53:12 +00:00
Jimmy Chen
d87a0ee2f5 p2p: add HAL method to enable P2P random MAC address feature
There are compatibility issue with driver for P2P random MAC.
The framework needs to check driver capability first before enabling
P2P random MAC address feature.

Bug: 118904478
Test: vts - atest VtsHalWifiSupplicantP2pV1_2TargetTest
Test: manual test
      * Enter WiFI Direct Page
      * check the feature is enabled in logcat
        * WifiP2pService: Supported feature: P2P MAC randomization
      * check p2p0 MAC address is randomized.

Change-Id: I28e226e7d51e3d5e3e6013d3772e643c1df1ab54
2019-01-18 17:50:36 +08:00
Etan Cohen
e338c81190 [AWARE] Disable NANv3 data-path capabilities
Disable the firmware to send NANv3 data-path negotiations packets.
Means that device will only use NANv2 data-path negotiation packets.
That is interoperable - though may miss extra information from pure
NANv3 peers - where extra = port/transport-protocol/ipv6 address (we
have an AOSP-specific emulation of this feature).

Bug: 112586769
Test: (ACTS) act.py ThroughputTest:test_iperf_max_ndi_aware_only_passphrases
Test: (CTS) atest SingleDeviceTest
Change-Id: I3fd3e3bfc80a7815e035c592967e5448601c8153
2019-01-15 18:09:47 -08:00
TreeHugger Robot
687cb73835 Merge "WiFi: support more wlan interfaces than 2" 2019-01-09 01:30:35 +00:00
Tomasz Wasilczyk
77401d3812 WiFi: support more wlan interfaces than 2
Bug: 36120314
Test: KitchenSink (see go/aae-dual-ap)
Test: ./runtests.sh
Change-Id: I57ec1d3faf78ffc14868a760995496b866b1171a
2019-01-02 15:36:28 -08:00
Roger Wang
b294c76a0b wifi(implementation): API to flush HAL ringbuffer to files
Wlan log does not include correct timestamp while
taking bug report. Flush HAL ringbuffe to files
directly when issue happen.

Bug: 118854557
Test: Builds and wifi works
Change-Id: Ic9a6b7470f943f1498428e8b0d40b117b2ff04e6
2018-12-21 15:59:15 +08:00
Oscar Shu
a2b457ebd5 Merge "Add Wifi HAL to get factory MAC address" 2018-12-15 00:13:53 +00:00
Tomasz Wasilczyk
b424da7872 WiFi: enable any combination of STA/AP/P2P/NAN interfaces.
The total number of interfaces is still limited to 2,
will be addressed in a separate change.

Bug: 36120314
Test: KitchenSink (see go/aae-dual-ap)
Test: b/120081854
Change-Id: I8962c5167fcbe55805fce320f639d37b4b902c5c
2018-12-11 14:06:28 -08:00
Sunil Ravi
c6b34d6bfb Merge "WiFi: Get channel stats from linklayer radio stats" 2018-12-08 02:55:35 +00:00
Jong Wook Kim
0ee7743dbe Add Wifi HAL to get factory MAC address
Add getFactoryMacAddress method to retrieve the factory MAC of Sta
interface.

Bug: 111634904
Test: Manual Verification
Test: run vts with command "mma -j64 && adb sync data && adb shell data/nativetest64/VtsHalWifiV1_3TargetTest/VtsHalWifiV1_3TargetTest"
Change-Id: I82b47366d3576201ef54a4e89a3f864c31fff42c
2018-12-05 13:40:53 -08:00
Ahmed ElArabawy
eaf8240cf1 Wifi: Add Implementation for low-latency modes API
This commit adds default implementation for the new API for low-latency
modes in IWifiChip@1.3

Bug: 34905427
Test: Unit test
Test: ./hardware/interfaces/wifi/1.3/default/tests/runtests.sh
Test: VTS test
Test: run vts -m VtsHalWifiV1_3TargetTest

Change-Id: I7109fbad75c0e5adf89edb47f5614a636c65d68f
2018-12-04 18:10:15 +00:00
Sunil Ravi
b0343e7d30 WiFi: Get channel stats from linklayer radio stats
Get the list of channel stats from linklayerstats radiostats
and send it to framework.

Bug: 79111545
Test: Connected STA to AP and verified the link layer stats
Test: Unit test
Test: ./wifi/1.3/default/tests/runtests.sh
Change-Id: If1008256afe0ec918cdbd952aa4f14012d5b0caf
2018-11-26 15:17:55 -08:00
Chih-Hung Hsieh
fb83d77f64 Allow implicit-fallthrough warnings locally.
It will be a global error by default.

Test: make checkbuild
Bug: 112564944
Change-Id: Iccb4189374015ceea26b0d9b3d3af2afdccbde38
Exempt-From-Owner-Approval: do not block on new warnings
2018-10-22 12:04:10 -07:00
Etan Cohen
7240a1a88a [RTT] Condition RTT Controller on availability of a STA mode
Condition creation of the RTT controller on the chip being in a mode
which can support a STA (whether one is already created or one could
be created).

This is the default behavior on currently supported Wi-Fi devices.

Note: this is part of the reference HAL implementation - it is not
expected to reflect behavior of all devices. Vendors may and should
replace or modify the reference HAL implementation.

Bug: 79565105
Bug: 111218083
Test: ACTS RangeApSupporting11McTest:test_rtt_in_and_after_softap_mode
Change-Id: If76b6598acb22f7821b34f7f1c8ae2873a6dac1d
2018-10-05 07:41:19 -07:00
xshu
e9873256d9 Add StaLinkLayerStats V1_3
Gets additional scan related information from legacy_hal up to
framework.

Bug: 77603419
Test: compile, unit tests
Change-Id: I9c948166b640af192c8e6f85ed6c76719e0937a4
2018-09-14 13:58:04 -07:00
Ahmed ElArabawy
7153e81c2f Wifi: Set wlan.driver.status to 'ok' when ready
Currently, the wlan.driver.status property is set to 'ok' once the
driver is loaded. This is not accurate, cause having the driver loaded
does not necessarily means it is ready for operation.

This commit sets the driver to 'ok' state after it is checked for
readiness. This implementation of the check is device specific.

Bug: 111924712
Test: Manual test

Change-Id: I074d819e9acdfdd6f033d85cdd71c0bc3984eb9d
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
2018-08-20 08:03:24 -07:00
Jong Wook Kim
da830c9da7 Uprev Wifi HAL to 1.3
Move Wifi HAL from 1.2 to 1.3

Bug: 111753174
Test: Builds and wifi works
Change-Id: I6a2b203997d6328d09065f23636d4ce01420942a
2018-08-09 15:40:09 -07:00