diff options
author | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2022-01-25 19:47:04 +0530 |
---|---|---|
committer | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2022-06-05 10:31:16 +0000 |
commit | 2e3ce0312b332dfc579a2a4db597e9f59d4868b4 (patch) | |
tree | c37831204c4476edcfd635ee62e41afc552c7c6b | |
parent | 9b790f6cbc68b004df162d09e8427adbdf649b77 (diff) | |
download | wlan-2e3ce0312b332dfc579a2a4db597e9f59d4868b4.tar.gz |
WifiHal: Map coex restriction iface mask to nl iface mask
Map wifi restriction iface bit mask to nl iface bit mask while
sending wifi coex unsafe channels to driver.
Bug: 232681785
Test: halutil -coex
CRs-Fixed: 3117432
Change-Id: I9015bcc0a0780fc97c90669eda44649b12bab6bd
-rw-r--r-- | qcwcn/wifi_hal/wifi_hal.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp index ee53256..c27e603 100644 --- a/qcwcn/wifi_hal/wifi_hal.cpp +++ b/qcwcn/wifi_hal/wifi_hal.cpp @@ -542,6 +542,22 @@ failure: return freq; } +static u32 get_nl_ifmask_from_coex_restriction_mask(u32 in_mask) +{ + u32 op_mask = 0; + + if (!in_mask) + return op_mask; + if (in_mask & SOFTAP) + op_mask |= BIT(NL80211_IFTYPE_AP); + if (in_mask & WIFI_DIRECT) + op_mask |= BIT(NL80211_IFTYPE_P2P_GO); + if (in_mask & WIFI_AWARE) + op_mask |= BIT(NL80211_IFTYPE_NAN); + + return op_mask; +} + wifi_error wifi_set_coex_unsafe_channels(wifi_handle handle, u32 num_channels, wifi_coex_unsafe_channel *unsafeChannels, u32 restrictions) @@ -690,7 +706,7 @@ wifi_error wifi_set_coex_unsafe_channels(wifi_handle handle, u32 num_channels, cmd->attr_end(nl_attr_unsafe_chan); if (num_channels > 0) { ret = cmd->put_u32(QCA_WLAN_VENDOR_ATTR_AVOID_FREQUENCY_IFACES_BITMASK, - restrictions); + get_nl_ifmask_from_coex_restriction_mask(restrictions)); if (ret != WIFI_SUCCESS) { ALOGE("%s: Failed to put restrictions mask, ret:%d", __FUNCTION__, ret); |