Commit graph

466 commits

Author SHA1 Message Date
Isaac Chiou
e1aad8d6ec Add HAL APIs and configurations for CHRE NAN RTT
Add HAL APIs and configuration in wifi_hal.h.

Test: Build pass
Test: New APIs work fine.
Bug: 206614765
Change-Id: I30681a580f1751518a30c258524a9b6216aab705
2022-01-29 07:31:06 +08:00
Sunil Ravi
3f3737abcd wifi: Get the supported radio combinations matrix
Added API to get the supported radio combinations
of the chip. This is mainly to check if the chip is
capable of multi band simultaneous operation.

For Example in case of a chip which has two radios, where one radio is
capable of 2.4GHz 2X2 only and another radio which is capable of either
5GHz or 6GHz 2X2, number of possible radio combinations in this case
are 5 and possible combinations are
    {{{2G 2X2}}, //Standalone 2G
    {{5G 2X2}}, //Standalone 5G
    {{6G 2X2}}, //Standalone 6G
    {{2G 2X2}, {5G 2X2}}, //2G+5G DBS
    {{2G 2X2}, {6G 2X2}}} //2G+6G DBS

Bug: 208877624
Test: unit test
Change-Id: I4c90f80002ca138133a575bca80dfdef2a593ab2
2022-01-26 23:21:57 -08:00
Sunil Ravi
8ec08d0216 Wifi: API to set the indoor state of device
If set, it indicates that the device is operating
in an indoor environment. When driver receives this
indication, it can safely enable WFD GO operation
on indoor channels.

Bug: 207671411
Test: Manual basic wifi tests
Change-Id: I970dd54f538ee85d76d702b1ce36432bad901602
2022-01-25 11:44:15 -08:00
Ahmed ElArabawy
60d787cd15 Wifi: Add needed definitions for 11be support
This commit adds the necessary defines for 11be(WiFi-7) support

Bug: 198746544
Test: Builds Successfully
Change-Id: I5be07dac3f5eb196717474ac8a1f2e3b1e2556d5
2022-01-21 22:09:46 +00:00
Nate(Qiang) Jiang
a07d7c97d0 Merge "Add wifi-aware 3.1 support" 2022-01-07 01:43:57 +00:00
Nate Jiang
4dac6dcef8 Add wifi-aware 3.1 support
Add instant communication mode and NCS-PK support

Bug: 203220137
Test: build
Change-Id: I46fd18d1e1780b76c40f59ed05503e39b71e3aa6
2021-10-18 16:57:57 -07:00
Veerendranath Jakkam
6a489c0360 wifi: Add feature flag to indicate support for set MAC without iface reset
This commit adds the enum to indicate driver support for MAC address
change without iface reset.

Bug: 202424223
Test: atest VtsHalWifiV1_5TargetTest
Test: Manual - Connect STA to AP and check random mac is set

Change-Id: I29662153d83eedf9986142f8371f3a7251b625dc
2021-10-14 13:05:42 -07:00
Ahmed ElArabawy
2cf8cd3978 WiFi: Add new SAR Scenarios for foldable devices
This commit adds new SAR scenarios for foldable devices.

Bug: 188138055
Test: Verify proper scenario selection
Change-Id: I472d3989edb1f8949a0eb1efd249b13aa55dc537
2021-05-19 09:11:23 +00:00
chenpaul
4ebb0af45c Wifi: Add argument "WifiHandle" in "wifi_set_subsystem_restart_handler"
Bug: 178126071
Bug: 183483123
Test: vendor HAL can received API call
Change-Id: I0d6c9ce294e1bcea1ed19e4050babd923e6b6141
2021-03-31 20:15:55 +08:00
chenpaul
35390b6dff Wifi: New API to query the trigger subsystem restart
This commit adds a method to forward the subsystem restart request

Bug: 178126071
Test: Trigger firmware restart and make sure event was forwarded

Change-Id: I5e97e645b630822865b1614f999e8b465a6d2b0b
2021-03-19 15:21:39 +08:00
Ahmed ElArabawy
1e6f8f6fcf Merge "WiFi: Add new SAR scenarios" into sc-dev 2021-03-18 21:10:11 +00:00
Ahmed ElArabawy
958307b14f WiFi: Add new SAR scenarios
This commit adds new SAR Scenarios.

Bug: 162191325
Test: Builds successfully
Change-Id: I70c45a5675b9bc374422fe732f888b3782058dd2
2021-03-15 21:41:42 -07:00
Kumar Anand
f2eed442a6 Wifi: Remove multiple definitions
Remove compilation warnings due to -Wtypedef-redefinition.

Bug: 160212907
Test: Build Successfully
Change-Id: I8925cf33fa64fbba4a6cbb782ecc107a7741fe87
2021-03-15 11:27:54 -07:00
Kalesh Singh
a731921669 Merge "RAII style wakelocks: Add tryGet() factory method." am: ddff8e6dd0 am: e3a6357533 am: 9176bf1929
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware_legacy/+/1592033

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I51ad002d2d778d6e674a86363e74eb5040d3219a
2021-02-24 23:51:50 +00:00
Kalesh Singh
d8da2af1e5 RAII style wakelocks: Add tryGet() factory method.
Wakelock acquisition can fail if suspend service is not available.
Make this clear by returning an optional value that client must
check before entering wakelock critical sections.

Bug: b/179229598
Test: Boot test on Pixel 4 device
Change-Id: Ied00fa919c20d8a30f1c40ee34a91a2a7e240689
2021-02-23 10:06:19 -05:00
Kumar Anand
33adbb23f6 Wifi: Filter usable channels by Coex, Concurrency
Add ability to filter usable channnels due to coex &
concurrency limitations. Normally in standalone mode,
list of usable channels is dictated by regulatory. But
list of usable channels could be additionally limited
due to coex and also due to concurrency limitations.

Bug: 160212907
Test: Using halutil
Change-Id: Iafde3b4fe9ca8986404ee078ed0a1a31062a4bbb
2021-02-16 14:12:48 -08:00
Kumar Anand
b25c2d1d71 Wifi: New API to query the list of usable channels
Introduce a new API that can be used to query what modes (SAP,
STA, WFD Client, WFD Group Owner, TDLS, NAN) can be supported
on each channel. With this new API driver, has flexibility to
indicate to framework unambiguously what channels are usable
by each mode. Until now, framework had to derive this using
one of the NL80211_FREQUENCY_ATTR_X (NO_IR, DFS, INDOOR) which
is not sufficent to unambiguously determine allowed channels
for each interface modes.

Bug: 160212907
Test: Using halutil
Change-Id: I25ce9b5083bd6fb650e02c5113bc11b559e80cb5
2021-01-28 20:54:18 +00:00
Kai Shi
8485407bcc Add wifi_set_dtim_config for power optimization
Add the new HAL API for WLAN power optimization in the suspend mode.

Test: halutil test
Bug: 170678227
Change-Id: Icff3d01585213431be539913c8d229fdc4875934
2021-01-11 20:30:17 -08:00
Damon Kim
359fa1d1ba HAL: Fix to support CCA Level and Load info in WiFi link-layer statistics.
- CCA Level and Load info
  (Channel Utilization and Station Count from BSS load IE in beacon)
- For supporing this feature,
  DHD and HALUTIL also should be fixed accordingly. (>= DHD 101.10.460)

Bug: 173477163
Test: Builds successfully
Change-Id: Ic1bd3e26888f8005fdb6c14d8ffeee9d3d04c3d3
2021-01-07 14:34:50 -08:00
Kai Shi
3adc28c891 Add HAL API for VoIP optimization
Add HAL API for VoIP optimization. This includes set_voip_mode() as well
as TWT control related API.

Test: compilation
Bug: 166311728
Change-Id: Ib1210cf200ed692433626b8df549262ddf660359
2020-12-18 12:51:42 -08:00
Quang Luong
f499981aa0 libhardware_legacy(wifi): Add enum for wifi coex restrictions
Add custom enum for wifi coex since IfaceType is not suitable for
bitmasks.

Bug: 153651001
Test: build
Change-Id: I58b55c64f5358ff26fc45451b66e8818bb3c3d30
2020-12-15 05:49:48 +00:00
Quang Luong
85f84d3796 libhardware_legacy(wifi): Add coex APIs
Bug: 153651001
Test: build
Change-Id: Id7f551fd2446a0484e229145a14ef27facaeab97
2020-12-04 18:18:52 -08:00
Mikhail Naganov
0fb2f22696 Convert mask types from uint32_t to enum type
This applies to the following types:

- audio_gain_mode_t;
- audio_flags_mask_t;
- audio_channel_representation_t;
- audio_channel_mask_t;
- audio_devices_t.

Enum types are distinct thus proper overloading on the type
is possible in C++. Also, assignments to enum types are
less prone to errors.

Bug: 169889714
Test: basic audio functionality
Change-Id: I6366511b421ccab2782310ecc15a13e08d9c17af
Merged-In: I6366511b421ccab2782310ecc15a13e08d9c17af
2020-11-24 03:42:39 +00:00
Roshan Pius
85bac74511 Merge "libhardware_legacy(wifi): Add STA + STA APIs" 2020-10-20 23:18:30 +00:00
Nate Jiang
4eb8117537 Merge "[Aware] Add instant mode support" 2020-10-20 16:19:00 +00:00
Roshan Pius
354fe63de7 libhardware_legacy(wifi): Add STA + STA APIs
Bug: 170305665
Test: Compiles
Change-Id: I23633ee79b27a602a609edf84efec49b39af0ac9
2020-10-19 17:33:46 -07:00
Mikhail Naganov
afea6a410f Convert mask types from uint32_t to enum type
This applies to the following types:

- audio_gain_mode_t;
- audio_flags_mask_t;
- audio_channel_representation_t;
- audio_channel_mask_t;
- audio_devices_t.

Enum types are distinct thus proper overloading on the type
is possible in C++. Also, assignments to enum types are
less prone to errors.

Bug: 169889714
Test: basic audio functionality
Change-Id: I6366511b421ccab2782310ecc15a13e08d9c17af
2020-10-08 17:25:28 +00:00
Nate Jiang
9e25034006 [Aware] Add instant mode support
Bug: 160725208
Test: build
Change-Id: Ia123cba1669c71317723831385d9c5b234155563
2020-08-26 14:41:52 -07:00
Jimmy Chen
ba1d91c5fd Wifi: add 60GHz feature bit
Added a new feature code INFRA_60G for chips that operate
on the 60GHz band.

Bug: 146922967
Test: atest VtsHalWifiV1_0TargetTest VtsHalWifiNanV1_0TargetTest VtsHalWifiApV1_0TargetTest \
            VtsHalWifiV1_1TargetTest \
            VtsHalWifiV1_2TargetTest VtsHalWifiNanV1_2TargetTest \
            VtsHalWifiV1_3TargetTest \
            VtsHalWifiApV1_4TargetTest VtsHalWifiNanV1_4TargetTest VtsHalWifiRttV1_4TargetTest

Change-Id: I4248c6d5e086305a7628497675fbd5b2a5b52e1b
2020-08-11 14:18:42 +08:00
Jimmy Chen
28f471d3bf Wifi: enhanced API to support multiple WIFI chips
Enhance the API to support multiple WIFI chips.
Each WIFI chip is represented by a separate and independent
vendor HAL library providing its own function table
(wifi_hal_fn structure).
New functions added to the function table in order to
better support multiple WIFI chips:
1. In the existing hardware/interfaces/wifi implementation,
WIFI chip modes and concurrency combinations are hard-coded.
Since each WIFI chip can have its own concurrency
combinations, it is no longer possible to hard-code the
modes/combinations.
Add new function wifi_get_chip_modes for reporting
chip modes/concurrency combinations. For backward compatibility,
if the vendor HAL does not implement this function,
the previous hard-coded chip modes and concurrency combinations
will be used.
2. In the existing hardware/interfaces/wifi implementation,
when creating a new interface, it will use a fixed name
such as wlan0 or wlan1. This does not extend well to
multiple WIFI chips, as different WIFI chips may want
to use their own interface names, or the suggested interface
name may have been pre-created by another chip.
In order to better support interface creation on multiple
WIFI chips, add a function wifi_get_supported_interface_name
that allows the vendor HAL to specify its own interface
name for upcoming interface creation. If the vendor HAL returns
an interface name, it should be passed to
wifi_virtual_interface_create to create the interface
with the provided name.
3. In the existing hardware/interfaces/wifi implementation,
wifi_initialize is only called when creating the first
interface (typically when enabling WIFI). However some
chips may want to perform early initialization and provide
some functionality while WIFI is still disabled. One example
is reporting chip-global capabilities that may affect
the UI even before WIFI is enabled.
In order to support this, add a new function
wifi_early_initialize which will perform early initialization.
The function should be called as soon as possible after
loading the vendor HAL, and if it returns a failure, the vendor
HAL should not be considered usable and no WIFI chip should
be created based on it.
4. In some cases it is needed to query chip features before
creating any interfaces. For example, for trying to start
a SoftAP on the 60GHz band, it is needed to detect a chip
which supports the 60GHz band, and only if such chip was detected,
then an AP interface can be created on it.
The wifi_get_supported_feature_set function only works on
a created interface so it is not suitable for this scenario.
To support such scenarios, add a new function
wifi_get_chip_feature_set which returns a set of chip-global
features which are independent of any created interface.

Bug: 146922967
Test: atest VtsHalWifiV1_0TargetTest VtsHalWifiNanV1_0TargetTest VtsHalWifiApV1_0TargetTest \
            VtsHalWifiV1_1TargetTest \
            VtsHalWifiV1_2TargetTest VtsHalWifiNanV1_2TargetTest \
            VtsHalWifiV1_3TargetTest \
            VtsHalWifiApV1_4TargetTest VtsHalWifiNanV1_4TargetTest VtsHalWifiRttV1_4TargetTest
Change-Id: If0b4934002c5687024c9fc2e65e15c466f94acd2
2020-08-11 14:18:39 +08:00
Ahmed ElArabawy
87805a2f0d Wifi: Add a vendor function to set subsystem restart handler
This commit adds a method to set the handler for wifi subsystem
restart callback.

Bug: 159367026
Test: force a firmware restart and make sure Wifi is recovered.
Change-Id: Id125b85a697a0cdd5cf2677abb0006c85053fd43
2020-07-02 17:36:02 +00:00
Glenn Kasten
241bea678f Merge "Include what you use: <cutils/bitops.h> for popcount" am: a44935a15e am: f1c3aef751
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware_legacy/+/1353827

Change-Id: I5081765a1f7067786819df994029cd37a56ec570
2020-07-01 23:11:01 +00:00
Glenn Kasten
75957b03d2 Include what you use: <cutils/bitops.h> for popcount
Test: builds OK
Change-Id: Ia469ef1b53b96e14a348405f269009c93394661e
2020-07-01 12:18:21 -07:00
Ahmed ElArabawy
22f7050574 Wifi: Add support for mapping DSCP to Wifi AC
This commit adds the needed enum and methods to handle the mapping
of DSCP into wifi access categories.

Bug: 141500691
Bug: 141550272
Test: Manual
Change-Id: If532a6dc34f4a2c61fc4601cb1b83d2fec053ea5
2020-02-19 16:52:07 -08:00
Purushottam Kushwaha
d619c41ebd wifi-hal: Add support for interface create/delete.
This adds new API to create/delete additional interface through
wifi vendor hal.

Bug: 146539882
Bug: 121156971
Test: Basic wifi sanity test.
Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
Change-Id: I8d2e4c51a1feedba65c88435cd10f2a8f6541e1b
2020-02-03 22:49:10 -08:00
Kumar Anand
536d0779dc wifi: thermal hal api
global handle instead of interface handle as thermal
mitigation is not interface specific.

Bug: 112471991
Test: atest FrameworksWifiTests
Change-Id: I40b8d85156b7a4561a4ef6db9e4655824c10b5ba
2020-01-23 22:26:06 +00:00
Kumar Anand
c97ac315eb Merge "Wifi: Vendor Hal Thermal Mitigation API" 2020-01-07 22:12:23 +00:00
Kumar Anand
3f3fa98701 Wifi: Vendor Hal Thermal Mitigation API
Bug: 140311866
Test: Manual
Change-Id: I0f546c51fc306540514590f6cd0da1217b893ff9
2020-01-02 14:19:41 -08:00
Ahmed ElArabawy
05ac8776ea Wifi: Remove capability for 6GHz
It was decided to base device capability for support of 6GHz band
on overlay configs rather than HAL capability bitmask.
Hence, this commit removes the 6GHz feature flag.

Bug: 145936758
Bug: 139354972
Test: Manual
Change-Id: I0c72161a31452bd0fab226f9f92f0aa859d3f5e4
2019-12-11 09:08:16 -08:00
Ahmed ElArabawy
45b0a7322a Wifi: Add WLAN_MAC_6_0_BAND to the list of bands
This commit adds to the wlan_mac_band enum, the value for 6 GHz.

Bug: 139354972
Test: Manual
Change-Id: I7679223fd491110a77c1507d2c14fe9c83e62005
2019-12-04 17:58:18 -08:00
Ahmed ElArabawy
1bc3c577ac Use uint64 instead of long for better portability
This commit forces the features and feature_set to be 64 bit
for better portability.

Bug: 144576287
Test: Builds passes successfully
Change-Id: I93c74d9f1802520c9bd0aa7f8f15cec4e30ce2ba
2019-11-15 12:44:45 -08:00
Ahmed ElArabawy
a1ce7dc8f0 Wifi: Support check on device capability for 6GHZ
This commit implements support of checking whether device supports 6GHz band.
To accomodate the new feature as well as any future features, feature_set type
was changed from int (32 bits) to long (64 bits).

Bug: 139354972
Test: Manual
Change-Id: If002d8efb854d50af314794926fbdfdc4fb08a5e
2019-11-12 19:04:13 -08:00
Ahmed ElArabawy
063fe291bd Wifi: Add 802.11ax support to RTT
This CL makes modidfication to support Wifi 802.11ax to RTT procedures.
This includes adding support for the 11ax preamble

Bug: 139354972
Test: Manual
Change-Id: I2aca64edcb4bc2ee267db4e4011da246c540a4b8
2019-11-03 00:02:11 -07:00
Tri Vo
2843fd5f4a Merge "libpower: RAII wake lock implementation" am: a53a8a7193
am: aac0a1f5d3

Change-Id: Ie501bc93adbeb28fb364772b92d47427c46ad677
2019-06-26 19:43:16 -07:00
Tri Vo
934f175a42 libpower: RAII wake lock implementation
Main motivation is to prevent wake lock leaks, e.g. b/133175847.

Changing power.h header breaks downstream vendor code that does C
linkage to that header b/135730848. Introduce new wakelock.h header.

Bug: 133175847
Test: boot blueline
Test: device suspends if left alone
Change-Id: I477123938ab20e954ce4d55b8588c0a116ed3882
2019-06-26 13:01:39 -07:00
Ruslan Tkhakokhov
f830e916a0 Merge "Merged-In Revert "libpower: RAII wake lock implementation"" am: 6e5d1db64b
am: 44e3795879

Change-Id: I58743ca5f63430eda716b15e72debb6cba4fb858
2019-06-21 08:27:52 -07:00
Ruslan Tkhakokhov
acf23a23e7 Merged-In Revert "libpower: RAII wake lock implementation"
This reverts commit 23009bb199.

Reason for revert: Breaks the build

Change-Id: I347928c4d444f4b1ce9d79f855c171626c0214c0
2019-06-21 10:32:57 +00:00
Tri Vo
9fcd627425 Merge "libpower: RAII wake lock implementation" am: cc685232f7
am: 8fbabc2d9a

Change-Id: I17e83309955abb6c3ebdb9b6f270a1a4d94ded10
2019-06-20 15:57:49 -07:00
Tri Vo
23009bb199 libpower: RAII wake lock implementation
Bug: 133175847
Test: boot blueline
Test: device suspends if left alone
Change-Id: I5a63fedabb18a9dcd510ca76303f54ec6c0b7f8c
2019-06-20 09:02:16 -07:00
Ahmed ElArabawy
86d26ee18d Merge "Wifi: Update the wifi_sar_scenario enum" 2019-04-03 14:54:00 +00:00