mac80211: make remain_on_channel() op pass vif param
authorEliad Peller <eliad@wizery.com>
Mon, 19 Nov 2012 15:05:09 +0000 (17:05 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 19 Nov 2012 15:20:37 +0000 (16:20 +0100)
Drivers (e.g. wl12xx) might need to know the vif
to roc on (mainly in order to configure the
rx filters correctly).

Add the vif to the op params, and update the current
users (iwlwifi) to use the new api.

Signed-off-by: Eliad Peller <eliad@wizery.com>
[fix hwsim]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/dvm/mac80211.c
drivers/net/wireless/mac80211_hwsim.c
include/net/mac80211.h
net/mac80211/cfg.c
net/mac80211/driver-ops.h
net/mac80211/offchannel.c
net/mac80211/trace.h

index ff8162d4c4543d3d2976c964ed2f790a8f7cb6a1..e75d80341f288bb8a770678a08714807a7cb7d78 100644 (file)
@@ -1032,6 +1032,7 @@ done:
 }
 
 static int iwlagn_mac_remain_on_channel(struct ieee80211_hw *hw,
+                                    struct ieee80211_vif *vif,
                                     struct ieee80211_channel *channel,
                                     enum nl80211_channel_type channel_type,
                                     int duration)
index c242f5a9b8bc0c19dea5d50d5698a10daeaa812c..3baa51f1bb83a835419f5eb6ab86d084aef3eb00 100644 (file)
@@ -1453,6 +1453,7 @@ static void hw_roc_done(struct work_struct *work)
 }
 
 static int mac80211_hwsim_roc(struct ieee80211_hw *hw,
+                             struct ieee80211_vif *vif,
                              struct ieee80211_channel *chan,
                              enum nl80211_channel_type channel_type,
                              int duration)
index dd08fbb3cf280d41741d79d814e95ad0340ea7df..d11037b5b8549a46f7fcc1c7b1c57c093234725b 100644 (file)
@@ -2530,6 +2530,7 @@ struct ieee80211_ops {
        int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
 
        int (*remain_on_channel)(struct ieee80211_hw *hw,
+                                struct ieee80211_vif *vif,
                                 struct ieee80211_channel *chan,
                                 enum nl80211_channel_type channel_type,
                                 int duration);
index 80e0618b25ba47d7edfd2e5a27a6552ee0a88983..18926aea480cf890fd86807a08a02cda184c97cf 100644 (file)
@@ -2287,7 +2287,8 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
        if (!duration)
                duration = 10;
 
-       ret = drv_remain_on_channel(local, channel, channel_type, duration);
+       ret = drv_remain_on_channel(local, sdata, channel, channel_type,
+                                   duration);
        if (ret) {
                kfree(roc);
                return ret;
@@ -2298,7 +2299,8 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
 
  out_check_combine:
        list_for_each_entry(tmp, &local->roc_list, list) {
-               if (tmp->chan != channel || tmp->chan_type != channel_type)
+               if (tmp->chan != channel || tmp->chan_type != channel_type ||
+                   tmp->sdata != sdata)
                        continue;
 
                /*
index 4dc2577886ff0b5b2ac2973eab28cd6781d4879a..284dd02385e46393ec0f682c73c0d6b35cf22f1c 100644 (file)
@@ -704,6 +704,7 @@ static inline int drv_get_antenna(struct ieee80211_local *local,
 }
 
 static inline int drv_remain_on_channel(struct ieee80211_local *local,
+                                       struct ieee80211_sub_if_data *sdata,
                                        struct ieee80211_channel *chan,
                                        enum nl80211_channel_type chantype,
                                        unsigned int duration)
@@ -712,9 +713,9 @@ static inline int drv_remain_on_channel(struct ieee80211_local *local,
 
        might_sleep();
 
-       trace_drv_remain_on_channel(local, chan, chantype, duration);
-       ret = local->ops->remain_on_channel(&local->hw, chan, chantype,
-                                           duration);
+       trace_drv_remain_on_channel(local, sdata, chan, chantype, duration);
+       ret = local->ops->remain_on_channel(&local->hw, &sdata->vif,
+                                           chan, chantype, duration);
        trace_drv_return_int(local, ret);
 
        return ret;
index 0cd42d52880c7af617666bc783e17ded4088101b..7f8a36510813b1fb5a80ad383239ccfa51a7f751 100644 (file)
@@ -283,7 +283,7 @@ void ieee80211_start_next_roc(struct ieee80211_local *local)
                if (!duration)
                        duration = 10;
 
-               ret = drv_remain_on_channel(local, roc->chan,
+               ret = drv_remain_on_channel(local, roc->sdata, roc->chan,
                                            roc->chan_type,
                                            duration);
 
index 758836c85a8010e8eeae237ccab5e1b44197eeda..e9579b7a2cd037c0c7c9847727a2a68f18a63aa3 100644 (file)
@@ -1019,13 +1019,16 @@ TRACE_EVENT(drv_get_antenna,
 );
 
 TRACE_EVENT(drv_remain_on_channel,
-       TP_PROTO(struct ieee80211_local *local, struct ieee80211_channel *chan,
+       TP_PROTO(struct ieee80211_local *local,
+                struct ieee80211_sub_if_data *sdata,
+                struct ieee80211_channel *chan,
                 enum nl80211_channel_type chantype, unsigned int duration),
 
-       TP_ARGS(local, chan, chantype, duration),
+       TP_ARGS(local, sdata, chan, chantype, duration),
 
        TP_STRUCT__entry(
                LOCAL_ENTRY
+               VIF_ENTRY
                __field(int, center_freq)
                __field(int, channel_type)
                __field(unsigned int, duration)
@@ -1033,14 +1036,16 @@ TRACE_EVENT(drv_remain_on_channel,
 
        TP_fast_assign(
                LOCAL_ASSIGN;
+               VIF_ASSIGN;
                __entry->center_freq = chan->center_freq;
                __entry->channel_type = chantype;
                __entry->duration = duration;
        ),
 
        TP_printk(
-               LOCAL_PR_FMT " freq:%dMHz duration:%dms",
-               LOCAL_PR_ARG, __entry->center_freq, __entry->duration
+               LOCAL_PR_FMT  VIF_PR_FMT " freq:%dMHz duration:%dms",
+               LOCAL_PR_ARG, VIF_PR_ARG,
+               __entry->center_freq, __entry->duration
        )
 );