diff options
author | Quang Luong <qal@google.com> | 2020-12-14 13:01:32 -0800 |
---|---|---|
committer | Quang Luong <qal@google.com> | 2020-12-15 09:43:36 -0800 |
commit | ab70a83b053f00834e12ccfb14b572f2c1cf55c4 (patch) | |
tree | 3c7c1c788b34fb61ea724100dc463c99a33e82f5 /wifi/1.5/default/wifi_chip.cpp | |
parent | 2288f9735a0996f33c229808cec07e8400d5a5dc (diff) |
[WifiCoex] Add enum for wifi coex restrictions
Add custom enum for wifi coex restrictions since IfaceType is not
suitable for use as a bitmask flag since it does not represent bit
positions.
Bug: 153651001
Test: build
Change-Id: I15575ea12784a778a3b358eea1b05b75319aa95b
Diffstat (limited to 'wifi/1.5/default/wifi_chip.cpp')
-rw-r--r-- | wifi/1.5/default/wifi_chip.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/wifi/1.5/default/wifi_chip.cpp b/wifi/1.5/default/wifi_chip.cpp index 1b0353b353..44cd5cf61f 100644 --- a/wifi/1.5/default/wifi_chip.cpp +++ b/wifi/1.5/default/wifi_chip.cpp @@ -724,7 +724,7 @@ Return<void> WifiChip::setMultiStaUseCase( Return<void> WifiChip::setCoexUnsafeChannels( const hidl_vec<CoexUnsafeChannel>& unsafeChannels, - hidl_bitfield<IfaceType> restrictions, + hidl_bitfield<CoexRestriction> restrictions, setCoexUnsafeChannels_cb hidl_status_cb) { return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, &WifiChip::setCoexUnsafeChannelsInternal, @@ -1463,8 +1463,18 @@ WifiStatus WifiChip::setCoexUnsafeChannelsInternal( unsafe_channels, &legacy_unsafe_channels)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } + uint32_t legacy_restrictions = 0; + if (restrictions & CoexRestriction::WIFI_DIRECT) { + legacy_restrictions |= legacy_hal::wifi_coex_restriction::WIFI_DIRECT; + } + if (restrictions & CoexRestriction::SOFTAP) { + legacy_restrictions |= legacy_hal::wifi_coex_restriction::SOFTAP; + } + if (restrictions & CoexRestriction::WIFI_AWARE) { + legacy_restrictions |= legacy_hal::wifi_coex_restriction::WIFI_AWARE; + } auto legacy_status = legacy_hal_.lock()->setCoexUnsafeChannels( - legacy_unsafe_channels, restrictions); + legacy_unsafe_channels, legacy_restrictions); return createWifiStatusFromLegacyError(legacy_status); } |