aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-05-19 06:17:12 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-02 16:13:27 -0400
commit252aa631f88080920a7083ac5a5844ffc5463629 (patch)
treee1482e9cf7c7230acb9ed33c8a24687e48dc7aa1 /net/mac80211
parent4f424867dd4752d457458fec29ca57ce5d7dc4ac (diff)
cfg80211: make action channel type optional
When sending action frames, we want to verify that we do that on the correct channel. However, checking the channel type in addition can get in the way, since the channel type could change on the fly during an association, and it's not useful to have the channel type anyway since it has no effect on the transmission. Therefore, make it optional to specify so that if wanted, it can still be checked, but is not required. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/cfg.c4
-rw-r--r--net/mac80211/ieee80211_i.h1
-rw-r--r--net/mac80211/mlme.c9
3 files changed, 10 insertions, 4 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index c7000a6ca37..f8c49c5ad8a 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1554,10 +1554,12 @@ static int ieee80211_cancel_remain_on_channel(struct wiphy *wiphy,
1554static int ieee80211_action(struct wiphy *wiphy, struct net_device *dev, 1554static int ieee80211_action(struct wiphy *wiphy, struct net_device *dev,
1555 struct ieee80211_channel *chan, 1555 struct ieee80211_channel *chan,
1556 enum nl80211_channel_type channel_type, 1556 enum nl80211_channel_type channel_type,
1557 bool channel_type_valid,
1557 const u8 *buf, size_t len, u64 *cookie) 1558 const u8 *buf, size_t len, u64 *cookie)
1558{ 1559{
1559 return ieee80211_mgd_action(IEEE80211_DEV_TO_SUB_IF(dev), chan, 1560 return ieee80211_mgd_action(IEEE80211_DEV_TO_SUB_IF(dev), chan,
1560 channel_type, buf, len, cookie); 1561 channel_type, channel_type_valid,
1562 buf, len, cookie);
1561} 1563}
1562 1564
1563struct cfg80211_ops mac80211_config_ops = { 1565struct cfg80211_ops mac80211_config_ops = {
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 1a9e2da37a9..d4677efd3a3 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -988,6 +988,7 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
988int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata, 988int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata,
989 struct ieee80211_channel *chan, 989 struct ieee80211_channel *chan,
990 enum nl80211_channel_type channel_type, 990 enum nl80211_channel_type channel_type,
991 bool channel_type_valid,
991 const u8 *buf, size_t len, u64 *cookie); 992 const u8 *buf, size_t len, u64 *cookie);
992ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata, 993ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata,
993 struct sk_buff *skb); 994 struct sk_buff *skb);
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 31e3386b8d4..29c3a75a7ad 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2308,6 +2308,7 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
2308int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata, 2308int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata,
2309 struct ieee80211_channel *chan, 2309 struct ieee80211_channel *chan,
2310 enum nl80211_channel_type channel_type, 2310 enum nl80211_channel_type channel_type,
2311 bool channel_type_valid,
2311 const u8 *buf, size_t len, u64 *cookie) 2312 const u8 *buf, size_t len, u64 *cookie)
2312{ 2313{
2313 struct ieee80211_local *local = sdata->local; 2314 struct ieee80211_local *local = sdata->local;
@@ -2315,9 +2316,11 @@ int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata,
2315 struct sk_buff *skb; 2316 struct sk_buff *skb;
2316 2317
2317 /* Check that we are on the requested channel for transmission */ 2318 /* Check that we are on the requested channel for transmission */
2318 if ((chan != local->tmp_channel || 2319 if (chan != local->tmp_channel &&
2319 channel_type != local->tmp_channel_type) && 2320 chan != local->oper_channel)
2320 (chan != local->oper_channel || 2321 return -EBUSY;
2322 if (channel_type_valid &&
2323 (channel_type != local->tmp_channel_type &&
2321 channel_type != local->_oper_channel_type)) 2324 channel_type != local->_oper_channel_type))
2322 return -EBUSY; 2325 return -EBUSY;
2323 2326