The country code may change when SAP enable. Move resister (country code
event) to interface handler and handle mapping between wiphy_index and
band on SAP interface.
Bug: 173000706
Test: Manual Test on Pixel 4a, country code can be passd to SoftApManager
correctly and supported channel can be updated after country code
changed when SAP enabled.
Change-Id: Ia716054a3cb886ac321eea5d748707f4b652409c
Add a global callback : WificondEventCallback.
And add onRegDomainChanged pass to framework
Note: The nl80211 may report country code change event it doesn't
change which depends on OEM driver implementation.
Bug: 177630837
Test: Manual Test, event pass to framework succeefully.
Change-Id: I6e28647a0cb379e3e1a9b9008aee9e1ff07940f7
In C++, using "map[key]" to read a key from the map results in the
creation of "key" if it does not already exist in the map. Need to use
"map.find(key)" to check for existence before read. This was causing a
corruption of the |iface_to_wiphy_index_map_| in the dump() function.
This issue has existed for a while in S (introduced as a part of 60Ghz
upstreams). This issue was however exposed by the recent changes added
in ag/13225431 (since we check for the map contents before updating the
|band_to_wiphy_index| map).
Instead store the |wiphy_index| directly in InterfaceInfo to help in
dumping.
Also, removed/reduced some logs previously added for debugging the
issue.
Bug: 177936058
Test: Manual steps which repro'ed the issue before the fix:
i. Toggle wifi off.
ii. adb shell dumpsys wifinl80211 (or trigger bugreport)
iii. Turn wifi on.
iv. Verify scans are not working without the fix & works with the fix.
Change-Id: I84b85b24a6c0a0efc6c22bb74560e5ccc5f0b39d
Unable to repro the corresponding bug. Adding logs to help debug the
issue.
Bug: 177936058
Test: Manual connection to wifi, toggle wifi off/on.
Change-Id: I88af48dbc6ee215cb6ff6c545297d434686c6c1b
- Multiple ifaces can map to one wiphy.
- One band can only map to one wiphy.
Previously, if any iface was removed, all wiphy's associated
with that iface will also be removed, including all
associated bands. This is not correct, as there could also
be other ifaces associated with that wiphy which are still
active.
Fixed to only remove the wiphy (and associated bands) once
no active ifaces remain for that wiphy.
Also, cleaned up weird idiom of deleting from a map while
iterating over it (no change in behavior intended).
Bug: 175614847
Test: system/connectivity/wificond/runtests.sh
Test: 1. Connect to network1 on device1.
2. Turn on SAP for network2 on device2.
3. Since device1 prefers network1 (configured ahead of time with user
connect choice), it will connect to network2 using Make-Before-Break
(MBB).
4. After MBB completes and network1 is disconnected, turn off SAP.
5. device1 will disconnect from network2.
6. Verify scans are triggered and connects back to network1.
Change-Id: Ie8d2f6e12a350501dee82d6bdde3501afc556d69
Add 60G channels list to BandInfo.
Add getAvailable60gChannels for retrieving the 60g channels.
Bug: 147522434
Test: system/connectivity/wificond/runtests.sh
Change-Id: Ice1abf3d4345b80560cbbc2b3207889ca4fb6f8f
Add a map for keeping unique wiphy index per interface.
This is needed in order to support multiple interfaces
from different chips, since each chip will have a
different wiphy index.
Bug: 147522434
Test: system/connectivity/wificond/runtests.sh
Change-Id: I2bdea0547aa145e52507c788a46390514f582d25
AIDL generates optional<T> for nullable T types for C++, which is more
efficient and idomatic and easy to use.
Bug: 144773267
Test: build/flash/boot
Change-Id: Iac0c34e10bc09f1230d0a941b05618671cbcbb5e
This commit adds the following parameters to DeviceWiphyCapabilities:
1. Support of 160MHz / 80+80MHz channel width
2. Max number of Tx/Rx spatial streams.
Note that this commit does not fill those parameters from the device
NL80211 response. A separate CL should take care of this.
Bug: 144576344
Test: Manual
Change-Id: Id3f9e1ad43a576adec869d485d1001c806c34bcf
This commits adds support for query for device wiphy capabilities.
Bug: 143543900
Bug: 134688244
Bug: 144576344
Test: Manual
Change-Id: Iebb1e748d3c07624b2bb7fbfe5eacc66d9693491
Move the rest of the code to the wifi.wificond namespace from the
wifi namespace. Cleanup since wificond is outside the Wi-Fi module.
Non-functional change.
Bug: 140062898
Test: atest android.net.wifi
Test: atest com.android.server.wifi
Test: ./system/connectivity/wificond/runtests.sh
Test: (CTS) atest android.net.wifi.cts
Change-Id: I257cabf92f0046214331616b381981f789933a87
This commit adds support for 6GHz band for providing a list of available
channels for a specific band. This is used by the system API
getAvailableChannels().
Bug: 139354972
Test: Manual
Test: ./system/connectivity/wificon/runtests.sh
Change-Id: I99c03015b59867e2690477962726d599eeb51c0b
Moved wificond AIDL from android.net.wifi to
com.android.server.wifi.wificond since android.net.wifi
should only be used for external APIs to apps.
Bug: 140062898
Test: ./runtest.sh
Change-Id: Ib7cf128ca584e1432073304aa77e8b78eaf663f1
As the issue tracker: https://issuetracker.google.com/issues/122429718
The current Android P framework doesn't support the wifi devices with
multiple phy's.
Suppose that the wifi has two or more wiphys.
(e.g. wlan0 - phy#0 - ifindex 6, and wlan1 - phy#1 - ifindex 8)
And the system is built with
WIFI_HIDL_FEATURE_DUAL_INTERFACE := true
PRODUCT_PROPERTY_OVERRIDES += wifi.interface=wlan0
PRODUCT_PROPERTY_OVERRIDES += wifi.concurrent.interface=wlan1
At first, we connected to one AP successfully, and then we tried
to start hotspot, but the hotspot can not be enabled.
After checking, we found that in the Android P source code,
setupInterfaceForSoftApMode()
=> mWificond.createApInterface(ifaceName) // wificond/server.cpp
==> SetupInterface(iface_name, &interface)
===> !RefreshWiphyIndex()
====> netlink_utils_->GetWiphyIndex(&wiphy_index_)
The iface_name here, assigned by upper Android framework,
is wlan1 as expected. Meanwhile, in the GetWiphyIndex(),
it uses NL80211_CMD_GET_WIPHY command, with flag - NLM_F_DUMP,
it doesn't assign NL80211_ATTR_IFINDEX, so the results have all the wiphy,
and eventually return the last one phy#0, instead of phy#1.
Then in server.cpp::SetupInterface(), wiphy_index_ is assigned to 0,
it can not find wlan1, since wlan1's wiphy number is 1, not 0.
Thus it fails.
So we would like to suggest to add parameter NL80211_ATTR_IFINDEX
in the function GetWiphyIndex(), for the command NL80211_CMD_GET_WIPHY,
then it can find the correct wiphy number phy#1, instead of phy#0,
when using interface wlan1.
In the NetlinkUtils::GetWiphyIndex(), we add one more parameter,
string iface_name. And if the string is empty, it means we use the
original way to do GetWiphyIndex; If the string is not empty,
it will add attribute NL80211_ATTR_IFINDEX for NL80211_CMD_GET_WIPHY.
Test: built, tested manually with the wifi which has two phy
Change-Id: I9319633d0ef220b9ba4a226ee5446bef08e4ac78
Signed-off-by: Neo Jou <neojou@gmail.com>
This is no longer needed since we'll be using the lazy HAL startup
mechanism provided by HIDL to start/stop supplicant.
Created a new method for registering the softap callbacks (previously
was a part of startHostapd. The callback will be removed when we
teardown the interface.
libwifi-system (HostapdManager & SupplicantManager) will be removed in
subsequent CL's once VTS tests migrates to the new mechanism.
Bug: 72394251
Bug: 30311493
Test: ./system/connectivity/wificond/runtests.sh
Test: Device boots up & connects to wifi networks.
Change-Id: If41d40af2970d0e09b0d73388fe4f7a0640cd52b
wificond no longer (was planned) manages the entire system state. The
framework is responsible for managing all the native daemons and the
interface state. So, don't reset system state (i.e kill supplicant,
hostapd and mark interfaces down) when wificond boots up.
Note: This change eliminates the second death notification that framework
has been receiving on killing wificond (previously: one for wificond, one
for supplicant; now: just one for wificond).
Bug: 75993335
Test: ./system/connectivity/wificond/runtests.sh
Test: Ran WifiManager & WifiSoftAp ACTS tests locally
Test: 'killall wificond' only produces 1 death notification.
Change-Id: I5effcbb6898f6744632cc7de65fccb4721b9add6
This creates nl80211 helper function to get country
code from kernel.
This also gets and logs the country code upon log dump.
Bug: 67053311
Test: compile, unit tests, manual test
Change-Id: I0ccc84763cf0588be1a2d3804bb1dca29eaa3581
Changes in the CL:
a) Create a map of iface name to handle for all the interfaces setup by
wificond.
b) Remove the old check to ensure that only 1 interface was active at
any point.
c) Add methods to teardown individual interfaces.
Bug: 69319369
Test: ./system/connectivity/wificond/runtests.sh
Change-Id: I0945c54a76fc076eb5554c34ce3c006aca3eebac
Move enable/disable Supplicant to top level wificond Aidl object since
this is used for both STA & AP operations now.
Bug: 69319369
Test: Turn on wifi/softap succesfully.
Test: ./system/connectivity/wificond/runtests.sh
Change-Id: I3c2463f8c2bcb081503103a46188e4ec3e3e6b3e
These get*Channels() APIs should be used by java framework
in both client and AP mode.
They are implemented by GetWiphy command which is associated to
a wihpy instead of a interface.
We need to move these APIs to wificond main interface for both
correctness and convienience.
This also removes the corresponding integration test. Since wificond
no longer load/unload driver/fw, we are not able to run and verify
these tests. It's reasonble to remove them for now.
Bug: 35707768
Test: compile, unit tests
Change-Id: I7ba562fbb788a6032832a0ab1ff917b5ba869670
Use the passed in iface name to create the corresponding interface
object.
Bug: 67365651
Test: ./system/connectivity/wificond/runtests.sh
Test: Will send for regression tests.
Change-Id: I9e8d748d47388a45567234b93f8aff854d784aea
This allows wificond's ClientInterfaceImpl and
ApInterfaceImpl to dump state.
The dump state includes scan capabilities, wiphy features, and
number of current associated stations for AP mode.
This also adds the missing const keyword for IsAssociated().
Bug: 31336376
Test: compile, manual test
Sample dump output:
Current wiphy index: 0
Cached interfaces list from kernel message:
Interface index: 23, name: p2p0, mac address: 66:bc:0c:47:df:00
Interface index: 22, name: wlan0, mac address: 64:bc:0c:47:df:00
------- Dump of client interface with index: 22 and name: wlan0-------
Max number of ssids for single shot scan: 10
Max number of ssids for scheduled scan: 16
Max number of match sets for scheduled scan: 16
Device supports random MAC for single shot scan: 1
Device supports random MAC for scheduled scan: 1
------- Dump End -------
--------- 0.004s was the duration of dumpsys wificond
Change-Id: I862974af743ca6ca303dfc1a4f6c773dd5b7a03e
Bug: 31336376
Test: compile
Test: manual test, check bug report
For example, I can see the following dump state:
Cached interfaces list from kernel message:
Interface index: 23, name: p2p0, mac address: 66:bc:0c:47:df:00
Interface index: 22, name: wlan0, mac address: 64:bc:0c:47:df:00
Change-Id: Iae02bc85a73f211aa39fb16d77eb17d399651dce
This adds the dump() function for wificond to dump logs
to provided fd.
Bug: 31336376
Test: compile
Test: manual test, see wificond dump logs in bug report
Change-Id: Ia27cee9c14728095d9843dfc08994ec981283ee3
This replaces NetlinkUtils::GetInterfaceInfo with NetlinkUtils::
GetInterfaces. Instead of picking client interface inside NetlinkUtils,
this change allows wificond main object(server) to dump all the interfaces
from kernel.
Being able to dump all interfaces, wificond main object therefore can mark
down all the interfaces upon cleanup.
Bug: 36139978
Bug: 35949498
Test: compile, unit tests, manual test, integration test
Change-Id: I66dd4f8c3b26087dd182591763de8fa4da29f1d6
Also,
Removed the usage of DriverTool & HalTool from wificond.
Bug: 35765841
Test: Will send for integration tests.
Change-Id: Ie029816bec5b168e34b3b18892b9da82285c66c0
This adds the function of regulatory domain change monitoring
on wificond.
This also allows wificond to print the supported bands/channels
upon regulatory domain change.
This also adds the corresponding unit tests.
Bug: 35150708
Test: compile, unit tests, manual tests
Change-Id: Idbcf9ebf25f4e7be3b371ec3531b6b52303476e8
This adds a struct WiphyFeatures to save wiphy feature flags
from netlink wiphy message. Currently we only add fields for
randomized mac address support.
This also allows ClientInterfaceImpl to expose channel info, scan
capabilities and wiphy features to ScannerImpl object.
Bug: 33216906
Test: compile, unit tests, manual test
Change-Id: Iac9355e45a3cf2011120fc6a91ccfb2dee434951
This add RttController interface as a lazy initialization object.
User can get an instance of RttController while register a RttClient
through wificond.
Currently HAL RttController has an optional parameter for choosing
on which network interface will RTT run. However, in order to
hide interface concept from RTT framework as well as keep simplicity,
we don't expose this interface choice via aidl to framework for now.
Bug: 31756849
Test: compile
Change-Id: I2a13374254fd8c6bd7911e5cfbe3297cde25e9e7
We would like to reason about our interfaces as being up
when they are configured and ready for use, and down otherwise.
This helps when switching modes. For example, when setting up a SoftAP,
you can expect that the interface starts in a down state, and
transitions to up when hostapd is ready for business. Note that we
cannot do this after firmware reload, because this may cause driver
de-initialization (see c#6 in b/31205821).
Bug: 31337216
Test: Integration tests pass
Change-Id: I03a71ea623e29ef9b023d97afc81cf836ebfb1ff
This also adds the missing 'override' to enableSupplicant() and
disableSupplicant().
BUG=31430211
TEST=compile, manual tests
Change-Id: I23db45a41d1dcbf5d3294b50e94961eb2de6bf4a
This broadcasts interface ready/towndown events after we
create/remove an interface.
BUG=31349441
TEST=compile, unit tests
Change-Id: I8d4f20ddb82db1bb53d12f3feeb06d4e761be689
CleanUpSystemState() calls GetWiphyIndex() to mark down
any existing interfaces.
It should not be an ERROR if we find no wiphy/interface
at this time.
BUG=None
TEST=compile
Change-Id: I64c1f81625c4964b5ed8c501bd6f761cde883495
This allows us to mock interactions with supplicant in unit tests.
Bug: 29620309
Test: unit/integration tests pass
Change-Id: I1526c90ffa9822a4d7dcabe5752676bfc61d6965
This cleans up after we unceremoniously kill hostapd with SIGKILL.
It also guarantees that we don't continue beaconing after the death
of hostapd.
Test: Unit and integration tests pass
Bug: 31023120
Change-Id: I6a363bfdab81ea24a25d6a86a42ff4ccc99556dd
Rename the |GetInterfaceNameAndIndex| function to
|GetInterfaceInfo| and fetch the mac address assigned to the interface
along with the other info being fetched.
BUG: 31038272
TEST: Modified existing tests
TEST: Manual tests on bullhead to see if the correct mac address is
fetched.
Change-Id: I89c11e2227ef9bdf90dfd681df09d8b8116cd53f
This CL includes the following changes:
1. Add functions which can subscribe and unsubscribe scan results
notification in ScanUtils, so we don't need to expose a NetlinkManager
object to ClientInterfaceImpl.
2. ClientInterfaceImpl subscribes the scan results when it is
initialized. It unsubscribes the scan results when it is destroyed.
3. ClientInterfaceImpl requests scan results objects using ScanUtils.
In later CLs these objects are supposed to be sent to java framework
through binder.
4. Add corresponding mock classes and unit tests adjustment for the
changes above.
This CL won't enable the scan results monitoring unless we uncomment
SubscribeToEvents() in NetlinkManager::Start().
BUG=30896985
TEST=compile, unit tests, manual tests
Manual test:
1. Uncomment SubscribeToEvents() in NetlinkManager::Start().
2. Call ScanResult::DebugLog() in ClientInterfaceImpl::
OnScanResultsReady().
After 1 and 2 we can see detail scan results in wificond logs.
Change-Id: I502fb4704ffce4dd2bf8de8d0d5d9293b2b43d9a
This CL adds the interface index query to interface name query.
With interface index wificond can assign scan request to specific
interface and ignore scan result from uninteresting interfaces.
BUG=30808053
TEST=compile, unit tests, integration tests
Change-Id: I2a6333dcad4e9faadb7793501762602017125865
This creates a new clas NetlinkUtils and moves two util
functions GetWiphyIndex() and GetInterfaceName() from
NelinkManager to NetlinkUtils.
BUG=30565670
TEST=unit tests and integration tests
Change-Id: I713d4388e688f5235b7fbf61c7b9ea9341d667db