diff options
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r-- | net/mac80211/ibss.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 5bcde4c3fba1..f95750b423e3 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -293,12 +293,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
293 | 293 | ||
294 | /* check if we need to merge IBSS */ | 294 | /* check if we need to merge IBSS */ |
295 | 295 | ||
296 | /* merge only on beacons (???) */ | ||
297 | if (!beacon) | ||
298 | goto put_bss; | ||
299 | |||
300 | /* we use a fixed BSSID */ | 296 | /* we use a fixed BSSID */ |
301 | if (sdata->u.ibss.bssid) | 297 | if (sdata->u.ibss.fixed_bssid) |
302 | goto put_bss; | 298 | goto put_bss; |
303 | 299 | ||
304 | /* not an IBSS */ | 300 | /* not an IBSS */ |
@@ -454,6 +450,9 @@ static int ieee80211_sta_active_ibss(struct ieee80211_sub_if_data *sdata) | |||
454 | return active; | 450 | return active; |
455 | } | 451 | } |
456 | 452 | ||
453 | /* | ||
454 | * This function is called with state == IEEE80211_IBSS_MLME_JOINED | ||
455 | */ | ||
457 | 456 | ||
458 | static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata) | 457 | static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata) |
459 | { | 458 | { |
@@ -519,6 +518,10 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) | |||
519 | capability, 0); | 518 | capability, 0); |
520 | } | 519 | } |
521 | 520 | ||
521 | /* | ||
522 | * This function is called with state == IEEE80211_IBSS_MLME_SEARCH | ||
523 | */ | ||
524 | |||
522 | static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | 525 | static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) |
523 | { | 526 | { |
524 | struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; | 527 | struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; |
@@ -575,18 +578,14 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
575 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 578 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
576 | 579 | ||
577 | /* Selected IBSS not found in current scan results - try to scan */ | 580 | /* Selected IBSS not found in current scan results - try to scan */ |
578 | if (ifibss->state == IEEE80211_IBSS_MLME_JOINED && | 581 | if (time_after(jiffies, ifibss->last_scan_completed + |
579 | !ieee80211_sta_active_ibss(sdata)) { | ||
580 | mod_timer(&ifibss->timer, | ||
581 | round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL)); | ||
582 | } else if (time_after(jiffies, ifibss->last_scan_completed + | ||
583 | IEEE80211_SCAN_INTERVAL)) { | 582 | IEEE80211_SCAN_INTERVAL)) { |
584 | printk(KERN_DEBUG "%s: Trigger new scan to find an IBSS to " | 583 | printk(KERN_DEBUG "%s: Trigger new scan to find an IBSS to " |
585 | "join\n", sdata->name); | 584 | "join\n", sdata->name); |
586 | 585 | ||
587 | ieee80211_request_internal_scan(sdata, ifibss->ssid, | 586 | ieee80211_request_internal_scan(sdata, ifibss->ssid, |
588 | ifibss->ssid_len); | 587 | ifibss->ssid_len); |
589 | } else if (ifibss->state != IEEE80211_IBSS_MLME_JOINED) { | 588 | } else { |
590 | int interval = IEEE80211_SCAN_INTERVAL; | 589 | int interval = IEEE80211_SCAN_INTERVAL; |
591 | 590 | ||
592 | if (time_after(jiffies, ifibss->ibss_join_req + | 591 | if (time_after(jiffies, ifibss->ibss_join_req + |
@@ -604,7 +603,6 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
604 | interval = IEEE80211_SCAN_INTERVAL_SLOW; | 603 | interval = IEEE80211_SCAN_INTERVAL_SLOW; |
605 | } | 604 | } |
606 | 605 | ||
607 | ifibss->state = IEEE80211_IBSS_MLME_SEARCH; | ||
608 | mod_timer(&ifibss->timer, | 606 | mod_timer(&ifibss->timer, |
609 | round_jiffies(jiffies + interval)); | 607 | round_jiffies(jiffies + interval)); |
610 | } | 608 | } |