diff options
author | Luciano Coelho <luciano.coelho@intel.com> | 2014-10-08 02:48:40 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-10-09 05:30:09 -0400 |
commit | 0f791eb47f8222fd594e6f8a090632344ef23924 (patch) | |
tree | ec3771ef78ebd391e7c4e90472b5e8246f083703 /net | |
parent | 0c21e6320f6ea7c4bd2fc0a8c1d8577b372f92d2 (diff) |
mac80211: allow channel switch with multiple channel contexts
Channel switch with multiple channel contexts should now work fine.
Remove check that disallows switches when multiple contexts are in
use.
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/driver-ops.h | 7 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 26 | ||||
-rw-r--r-- | net/mac80211/trace.h | 9 |
3 files changed, 20 insertions, 22 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 0a6090644769..1bbb0790264f 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h | |||
@@ -764,12 +764,13 @@ static inline void drv_flush(struct ieee80211_local *local, | |||
764 | } | 764 | } |
765 | 765 | ||
766 | static inline void drv_channel_switch(struct ieee80211_local *local, | 766 | static inline void drv_channel_switch(struct ieee80211_local *local, |
767 | struct ieee80211_channel_switch *ch_switch) | 767 | struct ieee80211_sub_if_data *sdata, |
768 | struct ieee80211_channel_switch *ch_switch) | ||
768 | { | 769 | { |
769 | might_sleep(); | 770 | might_sleep(); |
770 | 771 | ||
771 | trace_drv_channel_switch(local, ch_switch); | 772 | trace_drv_channel_switch(local, sdata, ch_switch); |
772 | local->ops->channel_switch(&local->hw, ch_switch); | 773 | local->ops->channel_switch(&local->hw, &sdata->vif, ch_switch); |
773 | trace_drv_return_void(local); | 774 | trace_drv_return_void(local); |
774 | } | 775 | } |
775 | 776 | ||
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 148253c1bd78..fb6561509caf 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1134,21 +1134,15 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, | |||
1134 | 1134 | ||
1135 | chanctx = container_of(conf, struct ieee80211_chanctx, conf); | 1135 | chanctx = container_of(conf, struct ieee80211_chanctx, conf); |
1136 | 1136 | ||
1137 | if (local->use_chanctx) { | 1137 | if (local->use_chanctx && |
1138 | u32 num_chanctx = 0; | 1138 | !(local->hw.flags & IEEE80211_HW_CHANCTX_STA_CSA)) { |
1139 | list_for_each_entry(chanctx, &local->chanctx_list, list) | 1139 | sdata_info(sdata, |
1140 | num_chanctx++; | 1140 | "driver doesn't support chan-switch with channel contexts\n"); |
1141 | 1141 | ieee80211_queue_work(&local->hw, | |
1142 | if (num_chanctx > 1 || | 1142 | &ifmgd->csa_connection_drop_work); |
1143 | !(local->hw.flags & IEEE80211_HW_CHANCTX_STA_CSA)) { | 1143 | mutex_unlock(&local->chanctx_mtx); |
1144 | sdata_info(sdata, | 1144 | mutex_unlock(&local->mtx); |
1145 | "not handling chan-switch with channel contexts\n"); | 1145 | return; |
1146 | ieee80211_queue_work(&local->hw, | ||
1147 | &ifmgd->csa_connection_drop_work); | ||
1148 | mutex_unlock(&local->chanctx_mtx); | ||
1149 | mutex_unlock(&local->mtx); | ||
1150 | return; | ||
1151 | } | ||
1152 | } | 1146 | } |
1153 | 1147 | ||
1154 | ch_switch.timestamp = timestamp; | 1148 | ch_switch.timestamp = timestamp; |
@@ -1192,7 +1186,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, | |||
1192 | 1186 | ||
1193 | if (local->ops->channel_switch) { | 1187 | if (local->ops->channel_switch) { |
1194 | /* use driver's channel switch callback */ | 1188 | /* use driver's channel switch callback */ |
1195 | drv_channel_switch(local, &ch_switch); | 1189 | drv_channel_switch(local, sdata, &ch_switch); |
1196 | return; | 1190 | return; |
1197 | } | 1191 | } |
1198 | 1192 | ||
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index ca0e12dd23c0..976606aebac9 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h | |||
@@ -987,12 +987,14 @@ TRACE_EVENT(drv_flush, | |||
987 | 987 | ||
988 | TRACE_EVENT(drv_channel_switch, | 988 | TRACE_EVENT(drv_channel_switch, |
989 | TP_PROTO(struct ieee80211_local *local, | 989 | TP_PROTO(struct ieee80211_local *local, |
990 | struct ieee80211_sub_if_data *sdata, | ||
990 | struct ieee80211_channel_switch *ch_switch), | 991 | struct ieee80211_channel_switch *ch_switch), |
991 | 992 | ||
992 | TP_ARGS(local, ch_switch), | 993 | TP_ARGS(local, sdata, ch_switch), |
993 | 994 | ||
994 | TP_STRUCT__entry( | 995 | TP_STRUCT__entry( |
995 | LOCAL_ENTRY | 996 | LOCAL_ENTRY |
997 | VIF_ENTRY | ||
996 | CHANDEF_ENTRY | 998 | CHANDEF_ENTRY |
997 | __field(u64, timestamp) | 999 | __field(u64, timestamp) |
998 | __field(u32, device_timestamp) | 1000 | __field(u32, device_timestamp) |
@@ -1002,6 +1004,7 @@ TRACE_EVENT(drv_channel_switch, | |||
1002 | 1004 | ||
1003 | TP_fast_assign( | 1005 | TP_fast_assign( |
1004 | LOCAL_ASSIGN; | 1006 | LOCAL_ASSIGN; |
1007 | VIF_ASSIGN; | ||
1005 | CHANDEF_ASSIGN(&ch_switch->chandef) | 1008 | CHANDEF_ASSIGN(&ch_switch->chandef) |
1006 | __entry->timestamp = ch_switch->timestamp; | 1009 | __entry->timestamp = ch_switch->timestamp; |
1007 | __entry->device_timestamp = ch_switch->device_timestamp; | 1010 | __entry->device_timestamp = ch_switch->device_timestamp; |
@@ -1010,8 +1013,8 @@ TRACE_EVENT(drv_channel_switch, | |||
1010 | ), | 1013 | ), |
1011 | 1014 | ||
1012 | TP_printk( | 1015 | TP_printk( |
1013 | LOCAL_PR_FMT " new " CHANDEF_PR_FMT " count:%d", | 1016 | LOCAL_PR_FMT VIF_PR_FMT " new " CHANDEF_PR_FMT " count:%d", |
1014 | LOCAL_PR_ARG, CHANDEF_PR_ARG, __entry->count | 1017 | LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG, __entry->count |
1015 | ) | 1018 | ) |
1016 | ); | 1019 | ); |
1017 | 1020 | ||