diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 1 | ||||
-rw-r--r-- | net/mac80211/main.c | 5 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 39 |
3 files changed, 38 insertions, 7 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index a2e200f9811e..ec59345af65b 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -82,6 +82,7 @@ struct ieee80211_sta_bss { | |||
82 | 82 | ||
83 | u8 bssid[ETH_ALEN]; | 83 | u8 bssid[ETH_ALEN]; |
84 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 84 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
85 | u8 dtim_period; | ||
85 | u16 capability; /* host byte order */ | 86 | u16 capability; /* host byte order */ |
86 | enum ieee80211_band band; | 87 | enum ieee80211_band band; |
87 | int freq; | 88 | int freq; |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index a4c5b90de769..0c02c471bca2 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -1689,6 +1689,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
1689 | if (local->hw.conf.beacon_int < 10) | 1689 | if (local->hw.conf.beacon_int < 10) |
1690 | local->hw.conf.beacon_int = 100; | 1690 | local->hw.conf.beacon_int = 100; |
1691 | 1691 | ||
1692 | if (local->hw.max_listen_interval == 0) | ||
1693 | local->hw.max_listen_interval = 1; | ||
1694 | |||
1695 | local->hw.conf.listen_interval = local->hw.max_listen_interval; | ||
1696 | |||
1692 | local->wstats_flags |= local->hw.flags & (IEEE80211_HW_SIGNAL_UNSPEC | | 1697 | local->wstats_flags |= local->hw.flags & (IEEE80211_HW_SIGNAL_UNSPEC | |
1693 | IEEE80211_HW_SIGNAL_DB | | 1698 | IEEE80211_HW_SIGNAL_DB | |
1694 | IEEE80211_HW_SIGNAL_DBM) ? | 1699 | IEEE80211_HW_SIGNAL_DBM) ? |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index acb04133a95d..e1d11c9b6729 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -551,6 +551,7 @@ static void ieee80211_set_associated(struct net_device *dev, | |||
551 | /* set timing information */ | 551 | /* set timing information */ |
552 | sdata->bss_conf.beacon_int = bss->beacon_int; | 552 | sdata->bss_conf.beacon_int = bss->beacon_int; |
553 | sdata->bss_conf.timestamp = bss->timestamp; | 553 | sdata->bss_conf.timestamp = bss->timestamp; |
554 | sdata->bss_conf.dtim_period = bss->dtim_period; | ||
554 | 555 | ||
555 | changed |= ieee80211_handle_bss_capability(sdata, bss); | 556 | changed |= ieee80211_handle_bss_capability(sdata, bss); |
556 | 557 | ||
@@ -773,7 +774,8 @@ static void ieee80211_send_assoc(struct net_device *dev, | |||
773 | mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, | 774 | mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, |
774 | IEEE80211_STYPE_REASSOC_REQ); | 775 | IEEE80211_STYPE_REASSOC_REQ); |
775 | mgmt->u.reassoc_req.capab_info = cpu_to_le16(capab); | 776 | mgmt->u.reassoc_req.capab_info = cpu_to_le16(capab); |
776 | mgmt->u.reassoc_req.listen_interval = cpu_to_le16(1); | 777 | mgmt->u.reassoc_req.listen_interval = |
778 | cpu_to_le16(local->hw.conf.listen_interval); | ||
777 | memcpy(mgmt->u.reassoc_req.current_ap, ifsta->prev_bssid, | 779 | memcpy(mgmt->u.reassoc_req.current_ap, ifsta->prev_bssid, |
778 | ETH_ALEN); | 780 | ETH_ALEN); |
779 | } else { | 781 | } else { |
@@ -781,7 +783,8 @@ static void ieee80211_send_assoc(struct net_device *dev, | |||
781 | mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, | 783 | mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, |
782 | IEEE80211_STYPE_ASSOC_REQ); | 784 | IEEE80211_STYPE_ASSOC_REQ); |
783 | mgmt->u.assoc_req.capab_info = cpu_to_le16(capab); | 785 | mgmt->u.assoc_req.capab_info = cpu_to_le16(capab); |
784 | mgmt->u.assoc_req.listen_interval = cpu_to_le16(1); | 786 | mgmt->u.reassoc_req.listen_interval = |
787 | cpu_to_le16(local->hw.conf.listen_interval); | ||
785 | } | 788 | } |
786 | 789 | ||
787 | /* SSID */ | 790 | /* SSID */ |
@@ -2688,6 +2691,16 @@ static void ieee80211_rx_bss_info(struct net_device *dev, | |||
2688 | bss->beacon_int = le16_to_cpu(mgmt->u.beacon.beacon_int); | 2691 | bss->beacon_int = le16_to_cpu(mgmt->u.beacon.beacon_int); |
2689 | bss->capability = le16_to_cpu(mgmt->u.beacon.capab_info); | 2692 | bss->capability = le16_to_cpu(mgmt->u.beacon.capab_info); |
2690 | 2693 | ||
2694 | if (elems->tim) { | ||
2695 | struct ieee80211_tim_ie *tim_ie = | ||
2696 | (struct ieee80211_tim_ie *)elems->tim; | ||
2697 | bss->dtim_period = tim_ie->dtim_period; | ||
2698 | } | ||
2699 | |||
2700 | /* set default value for buggy APs */ | ||
2701 | if (!elems->tim || bss->dtim_period == 0) | ||
2702 | bss->dtim_period = 1; | ||
2703 | |||
2691 | bss->supp_rates_len = 0; | 2704 | bss->supp_rates_len = 0; |
2692 | if (elems->supp_rates) { | 2705 | if (elems->supp_rates) { |
2693 | clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; | 2706 | clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; |
@@ -3650,11 +3663,21 @@ static int ieee80211_sta_find_ibss(struct net_device *dev, | |||
3650 | "%s\n", print_mac(mac, bssid), | 3663 | "%s\n", print_mac(mac, bssid), |
3651 | print_mac(mac2, ifsta->bssid)); | 3664 | print_mac(mac2, ifsta->bssid)); |
3652 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 3665 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
3653 | if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0 && | 3666 | |
3654 | (bss = ieee80211_rx_bss_get(dev, bssid, | 3667 | if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) { |
3655 | local->hw.conf.channel->center_freq, | ||
3656 | ifsta->ssid, ifsta->ssid_len))) { | ||
3657 | int ret; | 3668 | int ret; |
3669 | int search_freq; | ||
3670 | |||
3671 | if (ifsta->flags & IEEE80211_STA_AUTO_CHANNEL_SEL) | ||
3672 | search_freq = bss->freq; | ||
3673 | else | ||
3674 | search_freq = local->hw.conf.channel->center_freq; | ||
3675 | |||
3676 | bss = ieee80211_rx_bss_get(dev, bssid, search_freq, | ||
3677 | ifsta->ssid, ifsta->ssid_len); | ||
3678 | if (!bss) | ||
3679 | goto dont_join; | ||
3680 | |||
3658 | printk(KERN_DEBUG "%s: Selected IBSS BSSID %s" | 3681 | printk(KERN_DEBUG "%s: Selected IBSS BSSID %s" |
3659 | " based on configured SSID\n", | 3682 | " based on configured SSID\n", |
3660 | dev->name, print_mac(mac, bssid)); | 3683 | dev->name, print_mac(mac, bssid)); |
@@ -3662,6 +3685,8 @@ static int ieee80211_sta_find_ibss(struct net_device *dev, | |||
3662 | ieee80211_rx_bss_put(local, bss); | 3685 | ieee80211_rx_bss_put(local, bss); |
3663 | return ret; | 3686 | return ret; |
3664 | } | 3687 | } |
3688 | |||
3689 | dont_join: | ||
3665 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 3690 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
3666 | printk(KERN_DEBUG " did not try to join ibss\n"); | 3691 | printk(KERN_DEBUG " did not try to join ibss\n"); |
3667 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 3692 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
@@ -3895,7 +3920,7 @@ done: | |||
3895 | if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 3920 | if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { |
3896 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | 3921 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; |
3897 | if (!(ifsta->flags & IEEE80211_STA_BSSID_SET) || | 3922 | if (!(ifsta->flags & IEEE80211_STA_BSSID_SET) || |
3898 | (!ifsta->state == IEEE80211_IBSS_JOINED && | 3923 | (!(ifsta->state == IEEE80211_IBSS_JOINED) && |
3899 | !ieee80211_sta_active_ibss(dev))) | 3924 | !ieee80211_sta_active_ibss(dev))) |
3900 | ieee80211_sta_find_ibss(dev, ifsta); | 3925 | ieee80211_sta_find_ibss(dev, ifsta); |
3901 | } | 3926 | } |