aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index c3a22ab2ad2e..cf0b820a0eaa 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -612,3 +612,31 @@ void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb,
612 612
613 dev_queue_xmit(skb); 613 dev_queue_xmit(skb);
614} 614}
615
616int ieee80211_set_freq(struct ieee80211_sub_if_data *sdata, int freqMHz)
617{
618 int ret = -EINVAL;
619 struct ieee80211_channel *chan;
620 struct ieee80211_local *local = sdata->local;
621
622 chan = ieee80211_get_channel(local->hw.wiphy, freqMHz);
623
624 if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
625 if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS &&
626 chan->flags & IEEE80211_CHAN_NO_IBSS) {
627 printk(KERN_DEBUG "%s: IBSS not allowed on frequency "
628 "%d MHz\n", sdata->dev->name, chan->center_freq);
629 return ret;
630 }
631 local->oper_channel = chan;
632
633 if (local->sta_sw_scanning || local->sta_hw_scanning)
634 ret = 0;
635 else
636 ret = ieee80211_hw_config(local);
637
638 rate_control_clear(local);
639 }
640
641 return ret;
642}