aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2012-11-19 10:05:09 -0500
committerJohannes Berg <johannes.berg@intel.com>2012-11-19 10:20:37 -0500
commit49884568628db47a1f8c1f596c6ab3b8db81b73c (patch)
treec5fb7a7c9c5a4ea3c91b201f5f0bb692eaa8afe1
parent3475b0946bd2057497628790d4b4fce4bfdcc304 (diff)
mac80211: make remain_on_channel() op pass vif param
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>
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/mac80211.c1
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c1
-rw-r--r--include/net/mac80211.h1
-rw-r--r--net/mac80211/cfg.c6
-rw-r--r--net/mac80211/driver-ops.h7
-rw-r--r--net/mac80211/offchannel.c2
-rw-r--r--net/mac80211/trace.h13
7 files changed, 21 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
index ff8162d4c454..e75d80341f28 100644
--- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
@@ -1032,6 +1032,7 @@ done:
1032} 1032}
1033 1033
1034static int iwlagn_mac_remain_on_channel(struct ieee80211_hw *hw, 1034static int iwlagn_mac_remain_on_channel(struct ieee80211_hw *hw,
1035 struct ieee80211_vif *vif,
1035 struct ieee80211_channel *channel, 1036 struct ieee80211_channel *channel,
1036 enum nl80211_channel_type channel_type, 1037 enum nl80211_channel_type channel_type,
1037 int duration) 1038 int duration)
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index c242f5a9b8bc..3baa51f1bb83 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1453,6 +1453,7 @@ static void hw_roc_done(struct work_struct *work)
1453} 1453}
1454 1454
1455static int mac80211_hwsim_roc(struct ieee80211_hw *hw, 1455static int mac80211_hwsim_roc(struct ieee80211_hw *hw,
1456 struct ieee80211_vif *vif,
1456 struct ieee80211_channel *chan, 1457 struct ieee80211_channel *chan,
1457 enum nl80211_channel_type channel_type, 1458 enum nl80211_channel_type channel_type,
1458 int duration) 1459 int duration)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index dd08fbb3cf28..d11037b5b854 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2530,6 +2530,7 @@ struct ieee80211_ops {
2530 int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); 2530 int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
2531 2531
2532 int (*remain_on_channel)(struct ieee80211_hw *hw, 2532 int (*remain_on_channel)(struct ieee80211_hw *hw,
2533 struct ieee80211_vif *vif,
2533 struct ieee80211_channel *chan, 2534 struct ieee80211_channel *chan,
2534 enum nl80211_channel_type channel_type, 2535 enum nl80211_channel_type channel_type,
2535 int duration); 2536 int duration);
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 80e0618b25ba..18926aea480c 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2287,7 +2287,8 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
2287 if (!duration) 2287 if (!duration)
2288 duration = 10; 2288 duration = 10;
2289 2289
2290 ret = drv_remain_on_channel(local, channel, channel_type, duration); 2290 ret = drv_remain_on_channel(local, sdata, channel, channel_type,
2291 duration);
2291 if (ret) { 2292 if (ret) {
2292 kfree(roc); 2293 kfree(roc);
2293 return ret; 2294 return ret;
@@ -2298,7 +2299,8 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
2298 2299
2299 out_check_combine: 2300 out_check_combine:
2300 list_for_each_entry(tmp, &local->roc_list, list) { 2301 list_for_each_entry(tmp, &local->roc_list, list) {
2301 if (tmp->chan != channel || tmp->chan_type != channel_type) 2302 if (tmp->chan != channel || tmp->chan_type != channel_type ||
2303 tmp->sdata != sdata)
2302 continue; 2304 continue;
2303 2305
2304 /* 2306 /*
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 4dc2577886ff..284dd02385e4 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -704,6 +704,7 @@ static inline int drv_get_antenna(struct ieee80211_local *local,
704} 704}
705 705
706static inline int drv_remain_on_channel(struct ieee80211_local *local, 706static inline int drv_remain_on_channel(struct ieee80211_local *local,
707 struct ieee80211_sub_if_data *sdata,
707 struct ieee80211_channel *chan, 708 struct ieee80211_channel *chan,
708 enum nl80211_channel_type chantype, 709 enum nl80211_channel_type chantype,
709 unsigned int duration) 710 unsigned int duration)
@@ -712,9 +713,9 @@ static inline int drv_remain_on_channel(struct ieee80211_local *local,
712 713
713 might_sleep(); 714 might_sleep();
714 715
715 trace_drv_remain_on_channel(local, chan, chantype, duration); 716 trace_drv_remain_on_channel(local, sdata, chan, chantype, duration);
716 ret = local->ops->remain_on_channel(&local->hw, chan, chantype, 717 ret = local->ops->remain_on_channel(&local->hw, &sdata->vif,
717 duration); 718 chan, chantype, duration);
718 trace_drv_return_int(local, ret); 719 trace_drv_return_int(local, ret);
719 720
720 return ret; 721 return ret;
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 0cd42d52880c..7f8a36510813 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -283,7 +283,7 @@ void ieee80211_start_next_roc(struct ieee80211_local *local)
283 if (!duration) 283 if (!duration)
284 duration = 10; 284 duration = 10;
285 285
286 ret = drv_remain_on_channel(local, roc->chan, 286 ret = drv_remain_on_channel(local, roc->sdata, roc->chan,
287 roc->chan_type, 287 roc->chan_type,
288 duration); 288 duration);
289 289
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 758836c85a80..e9579b7a2cd0 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -1019,13 +1019,16 @@ TRACE_EVENT(drv_get_antenna,
1019); 1019);
1020 1020
1021TRACE_EVENT(drv_remain_on_channel, 1021TRACE_EVENT(drv_remain_on_channel,
1022 TP_PROTO(struct ieee80211_local *local, struct ieee80211_channel *chan, 1022 TP_PROTO(struct ieee80211_local *local,
1023 struct ieee80211_sub_if_data *sdata,
1024 struct ieee80211_channel *chan,
1023 enum nl80211_channel_type chantype, unsigned int duration), 1025 enum nl80211_channel_type chantype, unsigned int duration),
1024 1026
1025 TP_ARGS(local, chan, chantype, duration), 1027 TP_ARGS(local, sdata, chan, chantype, duration),
1026 1028
1027 TP_STRUCT__entry( 1029 TP_STRUCT__entry(
1028 LOCAL_ENTRY 1030 LOCAL_ENTRY
1031 VIF_ENTRY
1029 __field(int, center_freq) 1032 __field(int, center_freq)
1030 __field(int, channel_type) 1033 __field(int, channel_type)
1031 __field(unsigned int, duration) 1034 __field(unsigned int, duration)
@@ -1033,14 +1036,16 @@ TRACE_EVENT(drv_remain_on_channel,
1033 1036
1034 TP_fast_assign( 1037 TP_fast_assign(
1035 LOCAL_ASSIGN; 1038 LOCAL_ASSIGN;
1039 VIF_ASSIGN;
1036 __entry->center_freq = chan->center_freq; 1040 __entry->center_freq = chan->center_freq;
1037 __entry->channel_type = chantype; 1041 __entry->channel_type = chantype;
1038 __entry->duration = duration; 1042 __entry->duration = duration;
1039 ), 1043 ),
1040 1044
1041 TP_printk( 1045 TP_printk(
1042 LOCAL_PR_FMT " freq:%dMHz duration:%dms", 1046 LOCAL_PR_FMT VIF_PR_FMT " freq:%dMHz duration:%dms",
1043 LOCAL_PR_ARG, __entry->center_freq, __entry->duration 1047 LOCAL_PR_ARG, VIF_PR_ARG,
1048 __entry->center_freq, __entry->duration
1044 ) 1049 )
1045); 1050);
1046 1051