brcmfmac: move scheduled scan wiphy param setting to pno module
authorArend Van Spriel <arend.vanspriel@broadcom.com>
Fri, 21 Apr 2017 12:05:05 +0000 (13:05 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 18 May 2017 13:36:05 +0000 (16:36 +0300)
As pno module is providing scheduled scan functionality have it taking
care of setting related wiphy parameters as well.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.h

index cd1d6730eab73d514db5a1b88d442607c7834e3d..2bf76bd765bdcc30a8c8cd646b2f7328009bf035 100644 (file)
@@ -6378,16 +6378,6 @@ err:
        return -ENOMEM;
 }
 
-static void brcmf_wiphy_pno_params(struct wiphy *wiphy)
-{
-       /* scheduled scan settings */
-       wiphy->max_sched_scan_reqs = 1;
-       wiphy->max_sched_scan_ssids = BRCMF_PNO_MAX_PFN_COUNT;
-       wiphy->max_match_sets = BRCMF_PNO_MAX_PFN_COUNT;
-       wiphy->max_sched_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX;
-       wiphy->max_sched_scan_plan_interval = BRCMF_PNO_SCHED_SCAN_MAX_PERIOD;
-}
-
 #ifdef CONFIG_PM
 static const struct wiphy_wowlan_support brcmf_wowlan_support = {
        .flags = WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT,
@@ -6434,6 +6424,7 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp)
        const struct ieee80211_iface_combination *combo;
        struct ieee80211_supported_band *band;
        u16 max_interfaces = 0;
+       bool gscan;
        __le32 bandlist[3];
        u32 n_bands;
        int err, i;
@@ -6483,9 +6474,10 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp)
                wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM;
        wiphy->mgmt_stypes = brcmf_txrx_stypes;
        wiphy->max_remain_on_channel_duration = 5000;
-       if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_PNO))
-               brcmf_wiphy_pno_params(wiphy);
-
+       if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_PNO)) {
+               gscan = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_GSCAN);
+               brcmf_pno_wiphy_params(wiphy, gscan);
+       }
        /* vendor commands/events support */
        wiphy->vendor_commands = brcmf_vendor_cmds;
        wiphy->n_vendor_commands = BRCMF_VNDR_CMDS_LAST - 1;
index 8f19d95d4175da0742fbecb17c3fd6fc19453dff..a1c2e0af1774e5b43d6d330ccefa4601b99f9f1f 100644 (file)
@@ -24,6 +24,8 @@
 #include "fwil_types.h"
 #include "p2p.h"
 
+#define BRCMF_SCAN_IE_LEN_MAX          2048
+
 #define WL_NUM_SCAN_MAX                        10
 #define WL_TLV_INFO_MAX                        1024
 #define WL_BSS_INFO_MAX                        2048
index 6c3bde83d07085e46a5418673f09df5a5790a1aa..a473445ed7c4709e85c691a8551d6a72c465353d 100644 (file)
@@ -239,3 +239,13 @@ int brcmf_pno_start_sched_scan(struct brcmf_if *ifp,
        return ret;
 }
 
+void brcmf_pno_wiphy_params(struct wiphy *wiphy, bool gscan)
+{
+       /* scheduled scan settings */
+       wiphy->max_sched_scan_reqs = gscan ? 2 : 1;
+       wiphy->max_sched_scan_ssids = BRCMF_PNO_MAX_PFN_COUNT;
+       wiphy->max_match_sets = BRCMF_PNO_MAX_PFN_COUNT;
+       wiphy->max_sched_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX;
+       wiphy->max_sched_scan_plan_interval = BRCMF_PNO_SCHED_SCAN_MAX_PERIOD;
+}
+
index bae55b2af78c027b975c20e5e486ea6047511ab1..07ec51f6bec131d55e185fe225fe84bcd04b34e6 100644 (file)
@@ -37,4 +37,12 @@ int brcmf_pno_clean(struct brcmf_if *ifp);
 int brcmf_pno_start_sched_scan(struct brcmf_if *ifp,
                               struct cfg80211_sched_scan_request *req);
 
+/**
+ * brcmf_pno_wiphy_params - fill scheduled scan parameters in wiphy instance.
+ *
+ * @wiphy: wiphy instance to be used.
+ * @gscan: indicates whether the device has support for g-scan feature.
+ */
+void brcmf_pno_wiphy_params(struct wiphy *wiphy, bool gscan);
+
 #endif /* _BRCMF_PNO_H */