Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97919
b: refs/heads/master
c: be038b3
h: refs/heads/master
i:
  97917: dc13d71
  97915: 56e043d
  97911: d5a3ed5
  97903: 59468b3
  97887: cdc9290
  97855: 2a18671
  97791: 9c65fb1
v: v3
  • Loading branch information
Assaf Krauss authored and John W. Linville committed Jun 9, 2008
1 parent 1c8ac66 commit cce120f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 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: 872ba53395b2a8be08c3ea2d39e225e5b4a8cb40
refs/heads/master: be038b376465953c358d675cb38a611898a49dc2
2 changes: 1 addition & 1 deletion trunk/net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ extern const struct iw_handler_def ieee80211_iw_handler_def;


/* ieee80211_ioctl.c */
int ieee80211_set_freq(struct ieee80211_local *local, int freq);
int ieee80211_set_freq(struct net_device *dev, int freq);
/* ieee80211_sta.c */
void ieee80211_sta_timer(unsigned long data);
void ieee80211_sta_work(struct work_struct *work);
Expand Down
11 changes: 4 additions & 7 deletions trunk/net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -2359,13 +2359,10 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
sdata->drop_unencrypted = bss->capability &
WLAN_CAPABILITY_PRIVACY ? 1 : 0;

res = ieee80211_set_freq(local, bss->freq);
res = ieee80211_set_freq(dev, bss->freq);

if (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS) {
printk(KERN_DEBUG "%s: IBSS not allowed on frequency "
"%d MHz\n", dev->name, local->oper_channel->center_freq);
return -1;
}
if (res)
return res;

/* Set beacon template */
skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);
Expand Down Expand Up @@ -3491,7 +3488,7 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
spin_unlock_bh(&local->sta_bss_lock);

if (selected) {
ieee80211_set_freq(local, selected->freq);
ieee80211_set_freq(dev, selected->freq);
if (!(ifsta->flags & IEEE80211_STA_SSID_SET))
ieee80211_sta_set_ssid(dev, selected->ssid,
selected->ssid_len);
Expand Down
15 changes: 11 additions & 4 deletions trunk/net/mac80211/wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,22 @@ static int ieee80211_ioctl_giwmode(struct net_device *dev,
return 0;
}

int ieee80211_set_freq(struct ieee80211_local *local, int freqMHz)
int ieee80211_set_freq(struct net_device *dev, int freqMHz)
{
int ret = -EINVAL;
struct ieee80211_channel *chan;
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);

chan = ieee80211_get_channel(local->hw.wiphy, freqMHz);

if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS &&
chan->flags & IEEE80211_CHAN_NO_IBSS) {
printk(KERN_DEBUG "%s: IBSS not allowed on frequency "
"%d MHz\n", dev->name, chan->center_freq);
return ret;
}
local->oper_channel = chan;

if (local->sta_sw_scanning || local->sta_hw_scanning)
Expand All @@ -315,7 +323,6 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra)
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type == IEEE80211_IF_TYPE_STA)
Expand All @@ -329,14 +336,14 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev,
IEEE80211_STA_AUTO_CHANNEL_SEL;
return 0;
} else
return ieee80211_set_freq(local,
return ieee80211_set_freq(dev,
ieee80211_channel_to_frequency(freq->m));
} else {
int i, div = 1000000;
for (i = 0; i < freq->e; i++)
div /= 10;
if (div > 0)
return ieee80211_set_freq(local, freq->m / div);
return ieee80211_set_freq(dev, freq->m / div);
else
return -EINVAL;
}
Expand Down

0 comments on commit cce120f

Please sign in to comment.