Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351758
b: refs/heads/master
c: 3ebfa6e
h: refs/heads/master
v: v3
  • Loading branch information
Luis R. Rodriguez authored and Johannes Berg committed Jan 3, 2013
1 parent 108d28b commit 653dab4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ad2d223aa900179031feb40273881e212941573d
refs/heads/master: 3ebfa6e76beab01e644e1facd5fdb84d4274043e
19 changes: 19 additions & 0 deletions trunk/net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1925,18 +1925,37 @@ static bool freq_is_chan_12_13_14(u16 freq)
return false;
}

static bool pending_reg_beacon(struct ieee80211_channel *beacon_chan)
{
struct reg_beacon *pending_beacon;

list_for_each_entry(pending_beacon, &reg_pending_beacons, list)
if (beacon_chan->center_freq ==
pending_beacon->chan.center_freq)
return true;
return false;
}

int regulatory_hint_found_beacon(struct wiphy *wiphy,
struct ieee80211_channel *beacon_chan,
gfp_t gfp)
{
struct reg_beacon *reg_beacon;
bool processing;

if (beacon_chan->beacon_found ||
beacon_chan->flags & IEEE80211_CHAN_RADAR ||
(beacon_chan->band == IEEE80211_BAND_2GHZ &&
!freq_is_chan_12_13_14(beacon_chan->center_freq)))
return 0;

spin_lock_bh(&reg_pending_beacons_lock);
processing = pending_reg_beacon(beacon_chan);
spin_unlock_bh(&reg_pending_beacons_lock);

if (processing)
return 0;

reg_beacon = kzalloc(sizeof(struct reg_beacon), gfp);
if (!reg_beacon)
return -ENOMEM;
Expand Down

0 comments on commit 653dab4

Please sign in to comment.