mac80211: pass the vif to cancel_remain_on_channel
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 23 Jul 2019 18:00:01 +0000 (21:00 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 26 Jul 2019 11:08:28 +0000 (13:08 +0200)
This low level driver can find it useful to get the vif
when a remain on channel session is cancelled.

iwlwifi will need this soon.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://lore.kernel.org/r/20190723180001.5828-1-emmanuel.grumbach@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/mac80211_hwsim.c
drivers/net/wireless/rsi/rsi_91x_mac80211.c
drivers/net/wireless/ti/wlcore/main.c
include/net/mac80211.h
net/mac80211/driver-ops.h
net/mac80211/offchannel.c
net/mac80211/trace.h

index 0606416dc97122f79cf3e36fa469fac043e33e37..12dad659bf6867c5b3785909ac4ce888db73febc 100644 (file)
@@ -6970,7 +6970,8 @@ exit:
        return ret;
 }
 
-static int ath10k_cancel_remain_on_channel(struct ieee80211_hw *hw)
+static int ath10k_cancel_remain_on_channel(struct ieee80211_hw *hw,
+                                          struct ieee80211_vif *vif)
 {
        struct ath10k *ar = hw->priv;
 
index f23cb2f3d296a0205c07296b212d3805ce35a330..34121fbf32e37a9a3931b81fa384fe3e8e67408a 100644 (file)
@@ -2392,7 +2392,8 @@ out:
        return ret;
 }
 
-static int ath9k_cancel_remain_on_channel(struct ieee80211_hw *hw)
+static int ath9k_cancel_remain_on_channel(struct ieee80211_hw *hw,
+                                         struct ieee80211_vif *vif)
 {
        struct ath_softc *sc = hw->priv;
        struct ath_common *common = ath9k_hw_common(sc->sc_ah);
index 55cd49ccbf0b7a309286692cef45cc7bbddd4fa0..e63623251d61615856ee4c2fe2558e0adc54da2e 100644 (file)
@@ -4010,7 +4010,8 @@ out_unlock:
        return ret;
 }
 
-static int iwl_mvm_cancel_roc(struct ieee80211_hw *hw)
+static int iwl_mvm_cancel_roc(struct ieee80211_hw *hw,
+                             struct ieee80211_vif *vif)
 {
        struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
 
index c4611eb4eb86fedb9850cdef8f94723b0dce7bbf..0869f924e60cccfac3429e90c48a142faaefab8c 100644 (file)
@@ -2216,7 +2216,8 @@ static int mac80211_hwsim_roc(struct ieee80211_hw *hw,
        return 0;
 }
 
-static int mac80211_hwsim_croc(struct ieee80211_hw *hw)
+static int mac80211_hwsim_croc(struct ieee80211_hw *hw,
+                              struct ieee80211_vif *vif)
 {
        struct mac80211_hwsim_data *hwsim = hw->priv;
 
index 49df3bb08d41fbfd58bc6d2b2869ace910a191cf..ce5e92d82efc8038dc02bd777a7805add811860a 100644 (file)
@@ -1818,7 +1818,8 @@ out:
        return status;
 }
 
-static int rsi_mac80211_cancel_roc(struct ieee80211_hw *hw)
+static int rsi_mac80211_cancel_roc(struct ieee80211_hw *hw,
+                                  struct ieee80211_vif *vif)
 {
        struct rsi_hw *adapter = hw->priv;
        struct rsi_common *common = adapter->priv;
index b74dc8bc97553dc70d48d427ff55b5258284c729..547ad538d8b6647b0c701879e364b4599001d96b 100644 (file)
@@ -5749,7 +5749,8 @@ static void wlcore_roc_complete_work(struct work_struct *work)
                ieee80211_remain_on_channel_expired(wl->hw);
 }
 
-static int wlcore_op_cancel_remain_on_channel(struct ieee80211_hw *hw)
+static int wlcore_op_cancel_remain_on_channel(struct ieee80211_hw *hw,
+                                             struct ieee80211_vif *vif)
 {
        struct wl1271 *wl = hw->priv;
 
index d26da013f7c097197ba41cdeac06ddb33356571f..e39bf85ae4c2eb5ab7c1d4c819568f99b0bddcc9 100644 (file)
@@ -3914,7 +3914,8 @@ struct ieee80211_ops {
                                 struct ieee80211_channel *chan,
                                 int duration,
                                 enum ieee80211_roc_type type);
-       int (*cancel_remain_on_channel)(struct ieee80211_hw *hw);
+       int (*cancel_remain_on_channel)(struct ieee80211_hw *hw,
+                                       struct ieee80211_vif *vif);
        int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx);
        void (*get_ringparam)(struct ieee80211_hw *hw,
                              u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max);
index c2d8b5451a5ec6c52245ed306d5e0d4e607b3c67..2c9b3eb8b6525e7591837818d00d2dedf6f2412a 100644 (file)
@@ -692,14 +692,16 @@ static inline int drv_remain_on_channel(struct ieee80211_local *local,
        return ret;
 }
 
-static inline int drv_cancel_remain_on_channel(struct ieee80211_local *local)
+static inline int
+drv_cancel_remain_on_channel(struct ieee80211_local *local,
+                            struct ieee80211_sub_if_data *sdata)
 {
        int ret;
 
        might_sleep();
 
-       trace_drv_cancel_remain_on_channel(local);
-       ret = local->ops->cancel_remain_on_channel(&local->hw);
+       trace_drv_cancel_remain_on_channel(local, sdata);
+       ret = local->ops->cancel_remain_on_channel(&local->hw, &sdata->vif);
        trace_drv_return_int(local, ret);
 
        return ret;
index 60ef8972b254a6a96a607821a4c64cfff756cb6a..c710504ccf1aa3990ac41aa6895d8dbf32a5fa56 100644 (file)
@@ -8,6 +8,7 @@
  * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
  * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
  * Copyright 2009      Johannes Berg <johannes@sipsolutions.net>
+ * Copyright (C) 2019 Intel Corporation
  */
 #include <linux/export.h>
 #include <net/mac80211.h>
@@ -732,7 +733,7 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,
        }
 
        if (local->ops->remain_on_channel) {
-               ret = drv_cancel_remain_on_channel(local);
+               ret = drv_cancel_remain_on_channel(local, roc->sdata);
                if (WARN_ON_ONCE(ret)) {
                        mutex_unlock(&local->mtx);
                        return ret;
@@ -991,7 +992,7 @@ void ieee80211_roc_purge(struct ieee80211_local *local,
                if (roc->started) {
                        if (local->ops->remain_on_channel) {
                                /* can race, so ignore return value */
-                               drv_cancel_remain_on_channel(local);
+                               drv_cancel_remain_on_channel(local, sdata);
                                ieee80211_roc_notify_destroy(roc);
                        } else {
                                roc->abort = true;
index 3bb4459b52c780ef7cc5a645661337f4c78417a0..4768322dc2028bcf65e4f3e590252a926865a083 100644 (file)
@@ -1242,9 +1242,10 @@ TRACE_EVENT(drv_remain_on_channel,
        )
 );
 
-DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
-       TP_PROTO(struct ieee80211_local *local),
-       TP_ARGS(local)
+DEFINE_EVENT(local_sdata_evt, drv_cancel_remain_on_channel,
+       TP_PROTO(struct ieee80211_local *local,
+                struct ieee80211_sub_if_data *sdata),
+       TP_ARGS(local, sdata)
 );
 
 TRACE_EVENT(drv_set_ringparam,