aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-06-10 05:22:26 -0400
committerDavid S. Miller <davem@davemloft.net>2008-06-10 05:22:26 -0400
commit65b53e4cc90e59936733b3b95b9451d2ca47528d (patch)
tree29932718192962671c48c3fd1ea017a6112459e8 /net/mac80211/mlme.c
parent788c0a53164c05c5ccdb1472474372b72ba74644 (diff)
parent2e761e0532a784816e7e822dbaaece8c5d4be14d (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/tg3.c drivers/net/wireless/rt2x00/rt2x00dev.c net/mac80211/ieee80211_i.h
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 adbc1c804dd3..7f05820dc629 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)
@@ -1337,7 +1337,7 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev,
1337 1337
1338 /* prepare reordering buffer */ 1338 /* prepare reordering buffer */
1339 tid_agg_rx->reorder_buf = 1339 tid_agg_rx->reorder_buf =
1340 kmalloc(buf_size * sizeof(struct sk_buf *), GFP_ATOMIC); 1340 kmalloc(buf_size * sizeof(struct sk_buff *), GFP_ATOMIC);
1341 if (!tid_agg_rx->reorder_buf) { 1341 if (!tid_agg_rx->reorder_buf) {
1342 if (net_ratelimit()) 1342 if (net_ratelimit())
1343 printk(KERN_ERR "can not allocate reordering buffer " 1343 printk(KERN_ERR "can not allocate reordering buffer "
@@ -1346,7 +1346,7 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev,
1346 goto end; 1346 goto end;
1347 } 1347 }
1348 memset(tid_agg_rx->reorder_buf, 0, 1348 memset(tid_agg_rx->reorder_buf, 0,
1349 buf_size * sizeof(struct sk_buf *)); 1349 buf_size * sizeof(struct sk_buff *));
1350 1350
1351 if (local->ops->ampdu_action) 1351 if (local->ops->ampdu_action)
1352 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START, 1352 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START,
@@ -1625,7 +1625,7 @@ void sta_addba_resp_timer_expired(unsigned long data)
1625 * only one argument, and both sta_info and TID are needed, so init 1625 * only one argument, and both sta_info and TID are needed, so init
1626 * flow in sta_info_create gives the TID as data, while the timer_to_id 1626 * flow in sta_info_create gives the TID as data, while the timer_to_id
1627 * array gives the sta through container_of */ 1627 * array gives the sta through container_of */
1628 u16 tid = *(int *)data; 1628 u16 tid = *(u8 *)data;
1629 struct sta_info *temp_sta = container_of((void *)data, 1629 struct sta_info *temp_sta = container_of((void *)data,
1630 struct sta_info, timer_to_tid[tid]); 1630 struct sta_info, timer_to_tid[tid]);
1631 1631
@@ -1673,7 +1673,7 @@ timer_expired_exit:
1673static void sta_rx_agg_session_timer_expired(unsigned long data) 1673static void sta_rx_agg_session_timer_expired(unsigned long data)
1674{ 1674{
1675 /* not an elegant detour, but there is no choice as the timer passes 1675 /* not an elegant detour, but there is no choice as the timer passes
1676 * only one argument, and verious sta_info are needed here, so init 1676 * only one argument, and various sta_info are needed here, so init
1677 * flow in sta_info_create gives the TID as data, while the timer_to_id 1677 * flow in sta_info_create gives the TID as data, while the timer_to_id
1678 * array gives the sta through container_of */ 1678 * array gives the sta through container_of */
1679 u8 *ptid = (u8 *)data; 1679 u8 *ptid = (u8 *)data;
@@ -2348,6 +2348,7 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
2348 u8 *pos; 2348 u8 *pos;
2349 struct ieee80211_sub_if_data *sdata; 2349 struct ieee80211_sub_if_data *sdata;
2350 struct ieee80211_supported_band *sband; 2350 struct ieee80211_supported_band *sband;
2351 union iwreq_data wrqu;
2351 2352
2352 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 2353 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
2353 2354
@@ -2370,13 +2371,10 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
2370 sdata->drop_unencrypted = bss->capability & 2371 sdata->drop_unencrypted = bss->capability &
2371 WLAN_CAPABILITY_PRIVACY ? 1 : 0; 2372 WLAN_CAPABILITY_PRIVACY ? 1 : 0;
2372 2373
2373 res = ieee80211_set_freq(local, bss->freq); 2374 res = ieee80211_set_freq(dev, bss->freq);
2374 2375
2375 if (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS) { 2376 if (res)
2376 printk(KERN_DEBUG "%s: IBSS not allowed on frequency " 2377 return res;
2377 "%d MHz\n", dev->name, local->oper_channel->center_freq);
2378 return -1;
2379 }
2380 2378
2381 /* Set beacon template */ 2379 /* Set beacon template */
2382 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400); 2380 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);
@@ -2491,7 +2489,9 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
2491 ifsta->state = IEEE80211_IBSS_JOINED; 2489 ifsta->state = IEEE80211_IBSS_JOINED;
2492 mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL); 2490 mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL);
2493 2491
2494 ieee80211_rx_bss_put(dev, bss); 2492 memset(&wrqu, 0, sizeof(wrqu));
2493 memcpy(wrqu.ap_addr.sa_data, bss->bssid, ETH_ALEN);
2494 wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
2495 2495
2496 return res; 2496 return res;
2497} 2497}
@@ -3518,7 +3518,7 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
3518 spin_unlock_bh(&local->sta_bss_lock); 3518 spin_unlock_bh(&local->sta_bss_lock);
3519 3519
3520 if (selected) { 3520 if (selected) {
3521 ieee80211_set_freq(local, selected->freq); 3521 ieee80211_set_freq(dev, selected->freq);
3522 if (!(ifsta->flags & IEEE80211_STA_SSID_SET)) 3522 if (!(ifsta->flags & IEEE80211_STA_SSID_SET))
3523 ieee80211_sta_set_ssid(dev, selected->ssid, 3523 ieee80211_sta_set_ssid(dev, selected->ssid,
3524 selected->ssid_len); 3524 selected->ssid_len);
@@ -3553,6 +3553,7 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
3553 struct ieee80211_supported_band *sband; 3553 struct ieee80211_supported_band *sband;
3554 u8 bssid[ETH_ALEN], *pos; 3554 u8 bssid[ETH_ALEN], *pos;
3555 int i; 3555 int i;
3556 int ret;
3556 DECLARE_MAC_BUF(mac); 3557 DECLARE_MAC_BUF(mac);
3557 3558
3558#if 0 3559#if 0
@@ -3599,7 +3600,9 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
3599 *pos++ = (u8) (rate / 5); 3600 *pos++ = (u8) (rate / 5);
3600 } 3601 }
3601 3602
3602 return ieee80211_sta_join_ibss(dev, ifsta, bss); 3603 ret = ieee80211_sta_join_ibss(dev, ifsta, bss);
3604 ieee80211_rx_bss_put(dev, bss);
3605 return ret;
3603} 3606}
3604 3607
3605 3608
@@ -3647,10 +3650,13 @@ static int ieee80211_sta_find_ibss(struct net_device *dev,
3647 (bss = ieee80211_rx_bss_get(dev, bssid, 3650 (bss = ieee80211_rx_bss_get(dev, bssid,
3648 local->hw.conf.channel->center_freq, 3651 local->hw.conf.channel->center_freq,
3649 ifsta->ssid, ifsta->ssid_len))) { 3652 ifsta->ssid, ifsta->ssid_len))) {
3653 int ret;
3650 printk(KERN_DEBUG "%s: Selected IBSS BSSID %s" 3654 printk(KERN_DEBUG "%s: Selected IBSS BSSID %s"
3651 " based on configured SSID\n", 3655 " based on configured SSID\n",
3652 dev->name, print_mac(mac, bssid)); 3656 dev->name, print_mac(mac, bssid));
3653 return ieee80211_sta_join_ibss(dev, ifsta, bss); 3657 ret = ieee80211_sta_join_ibss(dev, ifsta, bss);
3658 ieee80211_rx_bss_put(dev, bss);
3659 return ret;
3654 } 3660 }
3655#ifdef CONFIG_MAC80211_IBSS_DEBUG 3661#ifdef CONFIG_MAC80211_IBSS_DEBUG
3656 printk(KERN_DEBUG " did not try to join ibss\n"); 3662 printk(KERN_DEBUG " did not try to join ibss\n");
@@ -4127,18 +4133,17 @@ ieee80211_sta_scan_result(struct net_device *dev,
4127 4133
4128 memset(&iwe, 0, sizeof(iwe)); 4134 memset(&iwe, 0, sizeof(iwe));
4129 iwe.cmd = SIOCGIWFREQ; 4135 iwe.cmd = SIOCGIWFREQ;
4130 iwe.u.freq.m = bss->freq; 4136 iwe.u.freq.m = ieee80211_frequency_to_channel(bss->freq);
4131 iwe.u.freq.e = 6; 4137 iwe.u.freq.e = 0;
4132 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 4138 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
4133 IW_EV_FREQ_LEN); 4139 IW_EV_FREQ_LEN);
4134 4140
4135 memset(&iwe, 0, sizeof(iwe)); 4141 memset(&iwe, 0, sizeof(iwe));
4136 iwe.cmd = SIOCGIWFREQ; 4142 iwe.cmd = SIOCGIWFREQ;
4137 iwe.u.freq.m = ieee80211_frequency_to_channel(bss->freq); 4143 iwe.u.freq.m = bss->freq;
4138 iwe.u.freq.e = 0; 4144 iwe.u.freq.e = 6;
4139 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 4145 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
4140 IW_EV_FREQ_LEN); 4146 IW_EV_FREQ_LEN);
4141
4142 memset(&iwe, 0, sizeof(iwe)); 4147 memset(&iwe, 0, sizeof(iwe));
4143 iwe.cmd = IWEVQUAL; 4148 iwe.cmd = IWEVQUAL;
4144 iwe.u.qual.qual = bss->qual; 4149 iwe.u.qual.qual = bss->qual;