aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 7cfd12e0d1e2..4d2b582dd055 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -44,7 +44,7 @@
44#define IEEE80211_RETRY_AUTH_INTERVAL (1 * HZ) 44#define IEEE80211_RETRY_AUTH_INTERVAL (1 * HZ)
45#define IEEE80211_SCAN_INTERVAL (2 * HZ) 45#define IEEE80211_SCAN_INTERVAL (2 * HZ)
46#define IEEE80211_SCAN_INTERVAL_SLOW (15 * HZ) 46#define IEEE80211_SCAN_INTERVAL_SLOW (15 * HZ)
47#define IEEE80211_IBSS_JOIN_TIMEOUT (20 * HZ) 47#define IEEE80211_IBSS_JOIN_TIMEOUT (7 * HZ)
48 48
49#define IEEE80211_PROBE_DELAY (HZ / 33) 49#define IEEE80211_PROBE_DELAY (HZ / 33)
50#define IEEE80211_CHANNEL_TIME (HZ / 33) 50#define IEEE80211_CHANNEL_TIME (HZ / 33)
@@ -1325,7 +1325,7 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev,
1325 1325
1326 /* prepare reordering buffer */ 1326 /* prepare reordering buffer */
1327 tid_agg_rx->reorder_buf = 1327 tid_agg_rx->reorder_buf =
1328 kmalloc(buf_size * sizeof(struct sk_buf *), GFP_ATOMIC); 1328 kmalloc(buf_size * sizeof(struct sk_buff *), GFP_ATOMIC);
1329 if (!tid_agg_rx->reorder_buf) { 1329 if (!tid_agg_rx->reorder_buf) {
1330 if (net_ratelimit()) 1330 if (net_ratelimit())
1331 printk(KERN_ERR "can not allocate reordering buffer " 1331 printk(KERN_ERR "can not allocate reordering buffer "
@@ -1334,7 +1334,7 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev,
1334 goto end; 1334 goto end;
1335 } 1335 }
1336 memset(tid_agg_rx->reorder_buf, 0, 1336 memset(tid_agg_rx->reorder_buf, 0,
1337 buf_size * sizeof(struct sk_buf *)); 1337 buf_size * sizeof(struct sk_buff *));
1338 1338
1339 if (local->ops->ampdu_action) 1339 if (local->ops->ampdu_action)
1340 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START, 1340 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START,
@@ -1614,7 +1614,7 @@ void sta_addba_resp_timer_expired(unsigned long data)
1614 * only one argument, and both sta_info and TID are needed, so init 1614 * only one argument, and both sta_info and TID are needed, so init
1615 * flow in sta_info_create gives the TID as data, while the timer_to_id 1615 * flow in sta_info_create gives the TID as data, while the timer_to_id
1616 * array gives the sta through container_of */ 1616 * array gives the sta through container_of */
1617 u16 tid = *(int *)data; 1617 u16 tid = *(u8 *)data;
1618 struct sta_info *temp_sta = container_of((void *)data, 1618 struct sta_info *temp_sta = container_of((void *)data,
1619 struct sta_info, timer_to_tid[tid]); 1619 struct sta_info, timer_to_tid[tid]);
1620 1620
@@ -1662,7 +1662,7 @@ timer_expired_exit:
1662void sta_rx_agg_session_timer_expired(unsigned long data) 1662void sta_rx_agg_session_timer_expired(unsigned long data)
1663{ 1663{
1664 /* not an elegant detour, but there is no choice as the timer passes 1664 /* not an elegant detour, but there is no choice as the timer passes
1665 * only one argument, and verious sta_info are needed here, so init 1665 * only one argument, and various sta_info are needed here, so init
1666 * flow in sta_info_create gives the TID as data, while the timer_to_id 1666 * flow in sta_info_create gives the TID as data, while the timer_to_id
1667 * array gives the sta through container_of */ 1667 * array gives the sta through container_of */
1668 u8 *ptid = (u8 *)data; 1668 u8 *ptid = (u8 *)data;
@@ -2336,6 +2336,7 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
2336 u8 *pos; 2336 u8 *pos;
2337 struct ieee80211_sub_if_data *sdata; 2337 struct ieee80211_sub_if_data *sdata;
2338 struct ieee80211_supported_band *sband; 2338 struct ieee80211_supported_band *sband;
2339 union iwreq_data wrqu;
2339 2340
2340 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 2341 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
2341 2342
@@ -2358,13 +2359,10 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
2358 sdata->drop_unencrypted = bss->capability & 2359 sdata->drop_unencrypted = bss->capability &
2359 WLAN_CAPABILITY_PRIVACY ? 1 : 0; 2360 WLAN_CAPABILITY_PRIVACY ? 1 : 0;
2360 2361
2361 res = ieee80211_set_freq(local, bss->freq); 2362 res = ieee80211_set_freq(dev, bss->freq);
2362 2363
2363 if (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS) { 2364 if (res)
2364 printk(KERN_DEBUG "%s: IBSS not allowed on frequency " 2365 return res;
2365 "%d MHz\n", dev->name, local->oper_channel->center_freq);
2366 return -1;
2367 }
2368 2366
2369 /* Set beacon template */ 2367 /* Set beacon template */
2370 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400); 2368 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);
@@ -2479,7 +2477,9 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
2479 ifsta->state = IEEE80211_IBSS_JOINED; 2477 ifsta->state = IEEE80211_IBSS_JOINED;
2480 mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL); 2478 mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL);
2481 2479
2482 ieee80211_rx_bss_put(dev, bss); 2480 memset(&wrqu, 0, sizeof(wrqu));
2481 memcpy(wrqu.ap_addr.sa_data, bss->bssid, ETH_ALEN);
2482 wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
2483 2483
2484 return res; 2484 return res;
2485} 2485}
@@ -3488,7 +3488,7 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
3488 spin_unlock_bh(&local->sta_bss_lock); 3488 spin_unlock_bh(&local->sta_bss_lock);
3489 3489
3490 if (selected) { 3490 if (selected) {
3491 ieee80211_set_freq(local, selected->freq); 3491 ieee80211_set_freq(dev, selected->freq);
3492 if (!(ifsta->flags & IEEE80211_STA_SSID_SET)) 3492 if (!(ifsta->flags & IEEE80211_STA_SSID_SET))
3493 ieee80211_sta_set_ssid(dev, selected->ssid, 3493 ieee80211_sta_set_ssid(dev, selected->ssid,
3494 selected->ssid_len); 3494 selected->ssid_len);
@@ -3523,6 +3523,7 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
3523 struct ieee80211_supported_band *sband; 3523 struct ieee80211_supported_band *sband;
3524 u8 bssid[ETH_ALEN], *pos; 3524 u8 bssid[ETH_ALEN], *pos;
3525 int i; 3525 int i;
3526 int ret;
3526 DECLARE_MAC_BUF(mac); 3527 DECLARE_MAC_BUF(mac);
3527 3528
3528#if 0 3529#if 0
@@ -3567,7 +3568,9 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
3567 *pos++ = (u8) (rate / 5); 3568 *pos++ = (u8) (rate / 5);
3568 } 3569 }
3569 3570
3570 return ieee80211_sta_join_ibss(dev, ifsta, bss); 3571 ret = ieee80211_sta_join_ibss(dev, ifsta, bss);
3572 ieee80211_rx_bss_put(dev, bss);
3573 return ret;
3571} 3574}
3572 3575
3573 3576
@@ -3615,10 +3618,13 @@ static int ieee80211_sta_find_ibss(struct net_device *dev,
3615 (bss = ieee80211_rx_bss_get(dev, bssid, 3618 (bss = ieee80211_rx_bss_get(dev, bssid,
3616 local->hw.conf.channel->center_freq, 3619 local->hw.conf.channel->center_freq,
3617 ifsta->ssid, ifsta->ssid_len))) { 3620 ifsta->ssid, ifsta->ssid_len))) {
3621 int ret;
3618 printk(KERN_DEBUG "%s: Selected IBSS BSSID %s" 3622 printk(KERN_DEBUG "%s: Selected IBSS BSSID %s"
3619 " based on configured SSID\n", 3623 " based on configured SSID\n",
3620 dev->name, print_mac(mac, bssid)); 3624 dev->name, print_mac(mac, bssid));
3621 return ieee80211_sta_join_ibss(dev, ifsta, bss); 3625 ret = ieee80211_sta_join_ibss(dev, ifsta, bss);
3626 ieee80211_rx_bss_put(dev, bss);
3627 return ret;
3622 } 3628 }
3623#ifdef CONFIG_MAC80211_IBSS_DEBUG 3629#ifdef CONFIG_MAC80211_IBSS_DEBUG
3624 printk(KERN_DEBUG " did not try to join ibss\n"); 3630 printk(KERN_DEBUG " did not try to join ibss\n");
@@ -4095,18 +4101,17 @@ ieee80211_sta_scan_result(struct net_device *dev,
4095 4101
4096 memset(&iwe, 0, sizeof(iwe)); 4102 memset(&iwe, 0, sizeof(iwe));
4097 iwe.cmd = SIOCGIWFREQ; 4103 iwe.cmd = SIOCGIWFREQ;
4098 iwe.u.freq.m = bss->freq; 4104 iwe.u.freq.m = ieee80211_frequency_to_channel(bss->freq);
4099 iwe.u.freq.e = 6; 4105 iwe.u.freq.e = 0;
4100 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 4106 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
4101 IW_EV_FREQ_LEN); 4107 IW_EV_FREQ_LEN);
4102 4108
4103 memset(&iwe, 0, sizeof(iwe)); 4109 memset(&iwe, 0, sizeof(iwe));
4104 iwe.cmd = SIOCGIWFREQ; 4110 iwe.cmd = SIOCGIWFREQ;
4105 iwe.u.freq.m = ieee80211_frequency_to_channel(bss->freq); 4111 iwe.u.freq.m = bss->freq;
4106 iwe.u.freq.e = 0; 4112 iwe.u.freq.e = 6;
4107 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 4113 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
4108 IW_EV_FREQ_LEN); 4114 IW_EV_FREQ_LEN);
4109
4110 memset(&iwe, 0, sizeof(iwe)); 4115 memset(&iwe, 0, sizeof(iwe));
4111 iwe.cmd = IWEVQUAL; 4116 iwe.cmd = IWEVQUAL;
4112 iwe.u.qual.qual = bss->signal; 4117 iwe.u.qual.qual = bss->signal;