Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313994
b: refs/heads/master
c: d58e7e3
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jun 5, 2012
1 parent 1f5c937 commit 5e9833d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3d9e6e12077d2611749ba3145bc4934aae461425
refs/heads/master: d58e7e37aac0465b08527adadc8016421bd4060e
5 changes: 4 additions & 1 deletion trunk/include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -3359,11 +3359,14 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy,
const u8 *frame, size_t len,
int freq, int sig_dbm, gfp_t gfp);

/*
/**
* cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used
* @wiphy: the wiphy
* @chan: main channel
* @channel_type: HT mode
*
* This function returns true if there is no secondary channel or the secondary
* channel can be used for beaconing (i.e. is not a radar channel etc.)
*/
bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy,
struct ieee80211_channel *chan,
Expand Down
3 changes: 1 addition & 2 deletions trunk/net/mac80211/ibss.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,

local->oper_channel = chan;
channel_type = ifibss->channel_type;
if (channel_type > NL80211_CHAN_HT20 &&
!cfg80211_can_beacon_sec_chan(local->hw.wiphy, chan, channel_type))
if (!cfg80211_can_beacon_sec_chan(local->hw.wiphy, chan, channel_type))
channel_type = NL80211_CHAN_HT20;
if (!ieee80211_set_channel_type(local, sdata, channel_type)) {
/* can only fail due to HT40+/- mismatch */
Expand Down
22 changes: 6 additions & 16 deletions trunk/net/wireless/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy,
diff = -20;
break;
default:
return false;
return true;
}

sec_chan = ieee80211_get_channel(wiphy, chan->center_freq + diff);
Expand Down Expand Up @@ -107,21 +107,11 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
wdev->iftype == NL80211_IFTYPE_AP ||
wdev->iftype == NL80211_IFTYPE_AP_VLAN ||
wdev->iftype == NL80211_IFTYPE_MESH_POINT ||
wdev->iftype == NL80211_IFTYPE_P2P_GO)) {
switch (channel_type) {
case NL80211_CHAN_HT40PLUS:
case NL80211_CHAN_HT40MINUS:
if (!cfg80211_can_beacon_sec_chan(&rdev->wiphy, chan,
channel_type)) {
printk(KERN_DEBUG
"cfg80211: Secondary channel not "
"allowed to initiate communication\n");
return -EINVAL;
}
break;
default:
break;
}
wdev->iftype == NL80211_IFTYPE_P2P_GO) &&
!cfg80211_can_beacon_sec_chan(&rdev->wiphy, chan, channel_type)) {
printk(KERN_DEBUG
"cfg80211: Secondary channel not allowed to beacon\n");
return -EINVAL;
}

result = rdev->ops->set_channel(&rdev->wiphy,
Expand Down

0 comments on commit 5e9833d

Please sign in to comment.