diff options
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index d7c371e36bf0..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 | ||
@@ -606,7 +607,6 @@ void ieee80211_sta_tx(struct net_device *dev, struct sk_buff *skb, | |||
606 | int encrypt) | 607 | int encrypt) |
607 | { | 608 | { |
608 | struct ieee80211_sub_if_data *sdata; | 609 | struct ieee80211_sub_if_data *sdata; |
609 | struct ieee80211_tx_info *info; | ||
610 | 610 | ||
611 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 611 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
612 | skb->dev = sdata->local->mdev; | 612 | skb->dev = sdata->local->mdev; |
@@ -614,11 +614,8 @@ void ieee80211_sta_tx(struct net_device *dev, struct sk_buff *skb, | |||
614 | skb_set_network_header(skb, 0); | 614 | skb_set_network_header(skb, 0); |
615 | skb_set_transport_header(skb, 0); | 615 | skb_set_transport_header(skb, 0); |
616 | 616 | ||
617 | info = IEEE80211_SKB_CB(skb); | 617 | skb->iif = sdata->dev->ifindex; |
618 | memset(info, 0, sizeof(struct ieee80211_tx_info)); | 618 | skb->do_not_encrypt = !encrypt; |
619 | info->control.ifindex = sdata->dev->ifindex; | ||
620 | if (!encrypt) | ||
621 | info->flags |= IEEE80211_TX_CTL_DO_NOT_ENCRYPT; | ||
622 | 619 | ||
623 | dev_queue_xmit(skb); | 620 | dev_queue_xmit(skb); |
624 | } | 621 | } |
@@ -777,7 +774,8 @@ static void ieee80211_send_assoc(struct net_device *dev, | |||
777 | mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, | 774 | mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, |
778 | IEEE80211_STYPE_REASSOC_REQ); | 775 | IEEE80211_STYPE_REASSOC_REQ); |
779 | mgmt->u.reassoc_req.capab_info = cpu_to_le16(capab); | 776 | mgmt->u.reassoc_req.capab_info = cpu_to_le16(capab); |
780 | 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); | ||
781 | memcpy(mgmt->u.reassoc_req.current_ap, ifsta->prev_bssid, | 779 | memcpy(mgmt->u.reassoc_req.current_ap, ifsta->prev_bssid, |
782 | ETH_ALEN); | 780 | ETH_ALEN); |
783 | } else { | 781 | } else { |
@@ -785,7 +783,8 @@ static void ieee80211_send_assoc(struct net_device *dev, | |||
785 | mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, | 783 | mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, |
786 | IEEE80211_STYPE_ASSOC_REQ); | 784 | IEEE80211_STYPE_ASSOC_REQ); |
787 | mgmt->u.assoc_req.capab_info = cpu_to_le16(capab); | 785 | mgmt->u.assoc_req.capab_info = cpu_to_le16(capab); |
788 | 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); | ||
789 | } | 788 | } |
790 | 789 | ||
791 | /* SSID */ | 790 | /* SSID */ |
@@ -2692,6 +2691,16 @@ static void ieee80211_rx_bss_info(struct net_device *dev, | |||
2692 | bss->beacon_int = le16_to_cpu(mgmt->u.beacon.beacon_int); | 2691 | bss->beacon_int = le16_to_cpu(mgmt->u.beacon.beacon_int); |
2693 | bss->capability = le16_to_cpu(mgmt->u.beacon.capab_info); | 2692 | bss->capability = le16_to_cpu(mgmt->u.beacon.capab_info); |
2694 | 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 | |||
2695 | bss->supp_rates_len = 0; | 2704 | bss->supp_rates_len = 0; |
2696 | if (elems->supp_rates) { | 2705 | if (elems->supp_rates) { |
2697 | clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; | 2706 | clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; |
@@ -3303,6 +3312,7 @@ void ieee80211_start_mesh(struct net_device *dev) | |||
3303 | ifsta = &sdata->u.sta; | 3312 | ifsta = &sdata->u.sta; |
3304 | ifsta->state = IEEE80211_MESH_UP; | 3313 | ifsta->state = IEEE80211_MESH_UP; |
3305 | ieee80211_sta_timer((unsigned long)sdata); | 3314 | ieee80211_sta_timer((unsigned long)sdata); |
3315 | ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON); | ||
3306 | } | 3316 | } |
3307 | #endif | 3317 | #endif |
3308 | 3318 | ||
@@ -3653,11 +3663,21 @@ static int ieee80211_sta_find_ibss(struct net_device *dev, | |||
3653 | "%s\n", print_mac(mac, bssid), | 3663 | "%s\n", print_mac(mac, bssid), |
3654 | print_mac(mac2, ifsta->bssid)); | 3664 | print_mac(mac2, ifsta->bssid)); |
3655 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 3665 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
3656 | if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0 && | 3666 | |
3657 | (bss = ieee80211_rx_bss_get(dev, bssid, | 3667 | if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) { |
3658 | local->hw.conf.channel->center_freq, | ||
3659 | ifsta->ssid, ifsta->ssid_len))) { | ||
3660 | 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 | |||
3661 | printk(KERN_DEBUG "%s: Selected IBSS BSSID %s" | 3681 | printk(KERN_DEBUG "%s: Selected IBSS BSSID %s" |
3662 | " based on configured SSID\n", | 3682 | " based on configured SSID\n", |
3663 | dev->name, print_mac(mac, bssid)); | 3683 | dev->name, print_mac(mac, bssid)); |
@@ -3665,6 +3685,8 @@ static int ieee80211_sta_find_ibss(struct net_device *dev, | |||
3665 | ieee80211_rx_bss_put(local, bss); | 3685 | ieee80211_rx_bss_put(local, bss); |
3666 | return ret; | 3686 | return ret; |
3667 | } | 3687 | } |
3688 | |||
3689 | dont_join: | ||
3668 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 3690 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
3669 | printk(KERN_DEBUG " did not try to join ibss\n"); | 3691 | printk(KERN_DEBUG " did not try to join ibss\n"); |
3670 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 3692 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
@@ -3898,7 +3920,7 @@ done: | |||
3898 | if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 3920 | if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { |
3899 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | 3921 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; |
3900 | if (!(ifsta->flags & IEEE80211_STA_BSSID_SET) || | 3922 | if (!(ifsta->flags & IEEE80211_STA_BSSID_SET) || |
3901 | (!ifsta->state == IEEE80211_IBSS_JOINED && | 3923 | (!(ifsta->state == IEEE80211_IBSS_JOINED) && |
3902 | !ieee80211_sta_active_ibss(dev))) | 3924 | !ieee80211_sta_active_ibss(dev))) |
3903 | ieee80211_sta_find_ibss(dev, ifsta); | 3925 | ieee80211_sta_find_ibss(dev, ifsta); |
3904 | } | 3926 | } |