diff options
| author | Dustin Brown <dustinb@codeaurora.org> | 2017-08-16 12:10:55 -0700 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappara@codeaurora.org> | 2017-09-07 23:08:37 -0700 |
| commit | d97a0c121e75f75866f84cdd71da4cbf9da71705 (patch) | |
| tree | 5f6d43ada47fcb5bd1c62219dd49a3c56d4dbe60 | |
| parent | 0b91cf92ae0d73b3b098e78cf659ee402414514b (diff) | |
qcacld-3.0: Add a wrapper for WIPHY_FLAG_SUPPORTS_SCHED_SCAN
WIPHY_FLAG_SUPPORTS_SCHED_SCAN is removed in Linux kernel versions 4.12+
in favor of proper multiple scheduled scan support. Add conditional
compilation to set the appropriate wiphy state based on which kernel
version is being compiled against.
Change-Id: I5e688f085b1c13fec0b4f42c5da82411eae08c03
CRs-Fixed: 2093945
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg80211.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index b9cef3cd8f10..eaa19f402010 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -11743,6 +11743,23 @@ static void wlan_hdd_cfg80211_add_connected_pno_support(struct wiphy *wiphy) } #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) +static inline void +hdd_wiphy_set_max_sched_scans(struct wiphy *wiphy, uint8_t max_scans) +{ + if (max_scans == 0) + wiphy->flags &= ~WIPHY_FLAG_SUPPORTS_SCHED_SCAN; + else + wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; +} +#else +static inline void +hdd_wiphy_set_max_sched_scans(struct wiphy *wiphy, uint8_t max_scans) +{ + wiphy->max_sched_scan_reqs = max_scans; +} +#endif /* KERNEL_VERSION(4, 12, 0) */ + #if ((LINUX_VERSION_CODE > KERNEL_VERSION(4, 4, 0)) || \ defined(CFG80211_MULTI_SCAN_PLAN_BACKPORT)) && \ defined(FEATURE_WLAN_SCAN_PNO) @@ -11757,7 +11774,7 @@ static void hdd_config_sched_scan_plans_to_wiphy(struct wiphy *wiphy, struct hdd_config *config) { if (config->configPNOScanSupport) { - wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; + hdd_wiphy_set_max_sched_scans(wiphy, 1); wiphy->max_sched_scan_ssids = SIR_PNO_MAX_SUPP_NETWORKS; wiphy->max_match_sets = SIR_PNO_MAX_SUPP_NETWORKS; wiphy->max_sched_scan_ie_len = SIR_MAC_MAX_IE_LENGTH; @@ -12327,7 +12344,7 @@ void wlan_hdd_cfg80211_update_wiphy_caps(struct wiphy *wiphy) * control comes here. Here just we need to clear it if firmware doesn't * have PNO support. */ if (!pCfg->PnoOffload) { - wiphy->flags &= ~WIPHY_FLAG_SUPPORTS_SCHED_SCAN; + hdd_wiphy_set_max_sched_scans(wiphy, 0); wiphy->max_sched_scan_ssids = 0; wiphy->max_match_sets = 0; wiphy->max_sched_scan_ie_len = 0; |
