Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315197
b: refs/heads/master
c: a69b40a
h: refs/heads/master
i:
  315195: 435bbe9
v: v3
  • Loading branch information
Michal Kazior authored and Johannes Berg committed Jun 29, 2012
1 parent e4721c8 commit ba61815
Show file tree
Hide file tree
Showing 2 changed files with 32 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: b78e8ceac23655e1e06b30aa95ab11742d1ac7c0
refs/heads/master: a69b40a95b121c4bfc52a20cccd28708ae550af1
31 changes: 31 additions & 0 deletions trunk/net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,35 @@ static struct device_type wiphy_type = {
.name = "wlan",
};

static struct ieee80211_channel *
cfg80211_get_any_chan(struct cfg80211_registered_device *rdev)
{
struct ieee80211_supported_band *sband;
int i;

for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
sband = rdev->wiphy.bands[i];
if (sband && sband->n_channels > 0)
return &sband->channels[0];
}

return NULL;
}

static void cfg80211_init_mon_chan(struct cfg80211_registered_device *rdev)
{
struct ieee80211_channel *chan;

chan = cfg80211_get_any_chan(rdev);
if (WARN_ON(!chan))
return;

mutex_lock(&rdev->devlist_mtx);
WARN_ON(cfg80211_set_monitor_channel(rdev, chan->center_freq,
NL80211_CHAN_NO_HT));
mutex_unlock(&rdev->devlist_mtx);
}

void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
enum nl80211_iftype iftype, int num)
{
Expand All @@ -737,6 +766,8 @@ void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
if (!has_monitors_only_new) {
rdev->monitor_channel = NULL;
rdev->monitor_channel_type = NL80211_CHAN_NO_HT;
} else {
cfg80211_init_mon_chan(rdev);
}
}
}
Expand Down

0 comments on commit ba61815

Please sign in to comment.