cfg80211: add request id parameter to .sched_scan_stop() signature
authorArend Van Spriel <arend.vanspriel@broadcom.com>
Fri, 21 Apr 2017 12:05:02 +0000 (13:05 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 26 Apr 2017 21:17:40 +0000 (23:17 +0200)
For multiple scheduled scan support the driver needs to know which
scheduled scan request is being stopped. Pass the request id in the
.sched_scan_stop() callback.

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: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/ath/ath6kl/cfg80211.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
drivers/net/wireless/marvell/mwifiex/cfg80211.c
include/net/cfg80211.h
net/mac80211/cfg.c
net/wireless/rdev-ops.h
net/wireless/scan.c
net/wireless/trace.h

index 1906412afa70bf663edb469a4499c322c0bc1f01..fd53ffb1f0143782843bf70b4cf9ad3f110073f1 100644 (file)
@@ -3352,7 +3352,7 @@ static int ath6kl_cfg80211_sscan_start(struct wiphy *wiphy,
 }
 
 static int ath6kl_cfg80211_sscan_stop(struct wiphy *wiphy,
-                                     struct net_device *dev)
+                                     struct net_device *dev, u64 reqid)
 {
        struct ath6kl_vif *vif = netdev_priv(dev);
        bool stopped;
index c71173dc9965cca6574ea8ad76fc7f24efe46226..130f0d4eda067a6a4856b433b5238245eef2dfc4 100644 (file)
@@ -3405,7 +3405,7 @@ brcmf_cfg80211_sched_scan_start(struct wiphy *wiphy,
 }
 
 static int brcmf_cfg80211_sched_scan_stop(struct wiphy *wiphy,
-                                         struct net_device *ndev)
+                                         struct net_device *ndev, u64 reqid)
 {
        struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
        struct brcmf_if *ifp = netdev_priv(ndev);
@@ -3607,7 +3607,7 @@ static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
                                      cfg->wowl.pre_pmmode);
                cfg->wowl.active = false;
                if (cfg->wowl.nd_enabled) {
-                       brcmf_cfg80211_sched_scan_stop(cfg->wiphy, ifp->ndev);
+                       brcmf_cfg80211_sched_scan_stop(cfg->wiphy, ifp->ndev, 0);
                        brcmf_fweh_unregister(cfg->pub, BRCMF_E_PFN_NET_FOUND);
                        brcmf_fweh_register(cfg->pub, BRCMF_E_PFN_NET_FOUND,
                                            brcmf_notify_sched_scan_results);
@@ -3691,7 +3691,7 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
 
        /* Stop scheduled scan */
        if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_PNO))
-               brcmf_cfg80211_sched_scan_stop(wiphy, ndev);
+               brcmf_cfg80211_sched_scan_stop(wiphy, ndev, 0);
 
        /* end any scanning */
        if (test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status))
index 9927bd5aac565a66f5807da2774ca577e343564b..0406a98f86f07ea8501495ffedb70f71b1be7145 100644 (file)
@@ -2720,7 +2720,7 @@ mwifiex_cfg80211_sched_scan_start(struct wiphy *wiphy,
  * previous bgscan configuration in the firmware
  */
 static int mwifiex_cfg80211_sched_scan_stop(struct wiphy *wiphy,
-                                           struct net_device *dev)
+                                           struct net_device *dev, u64 reqid)
 {
        struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
 
index 4058518e267a61099d580b62266fed7c0bbafd8c..aa663f70969ca83056f99f7025c37734ad90e40b 100644 (file)
@@ -2773,12 +2773,12 @@ struct cfg80211_nan_func {
  * @set_cqm_txe_config: Configure connection quality monitor TX error
  *     thresholds.
  * @sched_scan_start: Tell the driver to start a scheduled scan.
- * @sched_scan_stop: Tell the driver to stop an ongoing scheduled scan. This
- *     call must stop the scheduled scan and be ready for starting a new one
- *     before it returns, i.e. @sched_scan_start may be called immediately
- *     after that again and should not fail in that case. The driver should
- *     not call cfg80211_sched_scan_stopped() for a requested stop (when this
- *     method returns 0.)
+ * @sched_scan_stop: Tell the driver to stop an ongoing scheduled scan with
+ *     given request id. This call must stop the scheduled scan and be ready
+ *     for starting a new one before it returns, i.e. @sched_scan_start may be
+ *     called immediately after that again and should not fail in that case.
+ *     The driver should not call cfg80211_sched_scan_stopped() for a requested
+ *     stop (when this method returns 0).
  *
  * @mgmt_frame_register: Notify driver that a management frame type was
  *     registered. The callback is allowed to sleep.
@@ -3076,7 +3076,8 @@ struct cfg80211_ops {
        int     (*sched_scan_start)(struct wiphy *wiphy,
                                struct net_device *dev,
                                struct cfg80211_sched_scan_request *request);
-       int     (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev);
+       int     (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev,
+                                  u64 reqid);
 
        int     (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev,
                                  struct cfg80211_gtk_rekey_data *data);
index d041f78ecee60423482caf61b05e8602551470e9..038c31336167cd64f41ce869a581d91e721d33c2 100644 (file)
@@ -2242,7 +2242,8 @@ ieee80211_sched_scan_start(struct wiphy *wiphy,
 }
 
 static int
-ieee80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev)
+ieee80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev,
+                         u64 reqid)
 {
        struct ieee80211_local *local = wiphy_priv(wiphy);
 
index 783f89c3e504f4bbb2404c77b0f9ce5fa328dc1f..0598c1e5d0adbba6375beec2dcfb667fb4883192 100644 (file)
@@ -820,11 +820,11 @@ rdev_sched_scan_start(struct cfg80211_registered_device *rdev,
 }
 
 static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev,
-                                      struct net_device *dev)
+                                      struct net_device *dev, u64 reqid)
 {
        int ret;
-       trace_rdev_sched_scan_stop(&rdev->wiphy, dev);
-       ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev);
+       trace_rdev_sched_scan_stop(&rdev->wiphy, dev, reqid);
+       ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev, reqid);
        trace_rdev_return_int(&rdev->wiphy, ret);
        return ret;
 }
index bd9feed95c1e8883c5c9ff8f92198127df74e820..8d86f704bcf3db68b37cb4fac47423650a9c8514 100644 (file)
@@ -436,7 +436,7 @@ int cfg80211_stop_sched_scan_req(struct cfg80211_registered_device *rdev,
        ASSERT_RTNL();
 
        if (!driver_initiated) {
-               int err = rdev_sched_scan_stop(rdev, req->dev);
+               int err = rdev_sched_scan_stop(rdev, req->dev, req->reqid);
                if (err)
                        return err;
        }
index 52935c48b34213e3c25ec55613b10edc2f2f4491..8d8f6b462b1807df9847ded59029f5eef1500662 100644 (file)
@@ -576,11 +576,6 @@ DEFINE_EVENT(wiphy_netdev_evt, rdev_stop_ap,
        TP_ARGS(wiphy, netdev)
 );
 
-DEFINE_EVENT(wiphy_netdev_evt, rdev_sched_scan_stop,
-       TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
-       TP_ARGS(wiphy, netdev)
-);
-
 DEFINE_EVENT(wiphy_netdev_evt, rdev_set_rekey_data,
        TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
        TP_ARGS(wiphy, netdev)
@@ -1632,6 +1627,11 @@ DEFINE_EVENT(wiphy_netdev_id_evt, rdev_sched_scan_start,
        TP_ARGS(wiphy, netdev, id)
 );
 
+DEFINE_EVENT(wiphy_netdev_id_evt, rdev_sched_scan_stop,
+       TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u64 id),
+       TP_ARGS(wiphy, netdev, id)
+);
+
 TRACE_EVENT(rdev_tdls_mgmt,
        TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
                 u8 *peer, u8 action_code, u8 dialog_token,