diff options
-rw-r--r-- | net/mac80211/ibss.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 5bcde4c3fba1..c2a708e3a18c 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -454,6 +454,9 @@ static int ieee80211_sta_active_ibss(struct ieee80211_sub_if_data *sdata) | |||
454 | return active; | 454 | return active; |
455 | } | 455 | } |
456 | 456 | ||
457 | /* | ||
458 | * This function is called with state == IEEE80211_IBSS_MLME_JOINED | ||
459 | */ | ||
457 | 460 | ||
458 | static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata) | 461 | static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata) |
459 | { | 462 | { |
@@ -519,6 +522,10 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) | |||
519 | capability, 0); | 522 | capability, 0); |
520 | } | 523 | } |
521 | 524 | ||
525 | /* | ||
526 | * This function is called with state == IEEE80211_IBSS_MLME_SEARCH | ||
527 | */ | ||
528 | |||
522 | static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | 529 | static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) |
523 | { | 530 | { |
524 | struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; | 531 | struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; |
@@ -575,18 +582,14 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
575 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 582 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
576 | 583 | ||
577 | /* Selected IBSS not found in current scan results - try to scan */ | 584 | /* Selected IBSS not found in current scan results - try to scan */ |
578 | if (ifibss->state == IEEE80211_IBSS_MLME_JOINED && | 585 | 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)) { | 586 | IEEE80211_SCAN_INTERVAL)) { |
584 | printk(KERN_DEBUG "%s: Trigger new scan to find an IBSS to " | 587 | printk(KERN_DEBUG "%s: Trigger new scan to find an IBSS to " |
585 | "join\n", sdata->name); | 588 | "join\n", sdata->name); |
586 | 589 | ||
587 | ieee80211_request_internal_scan(sdata, ifibss->ssid, | 590 | ieee80211_request_internal_scan(sdata, ifibss->ssid, |
588 | ifibss->ssid_len); | 591 | ifibss->ssid_len); |
589 | } else if (ifibss->state != IEEE80211_IBSS_MLME_JOINED) { | 592 | } else { |
590 | int interval = IEEE80211_SCAN_INTERVAL; | 593 | int interval = IEEE80211_SCAN_INTERVAL; |
591 | 594 | ||
592 | if (time_after(jiffies, ifibss->ibss_join_req + | 595 | if (time_after(jiffies, ifibss->ibss_join_req + |
@@ -604,7 +607,6 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
604 | interval = IEEE80211_SCAN_INTERVAL_SLOW; | 607 | interval = IEEE80211_SCAN_INTERVAL_SLOW; |
605 | } | 608 | } |
606 | 609 | ||
607 | ifibss->state = IEEE80211_IBSS_MLME_SEARCH; | ||
608 | mod_timer(&ifibss->timer, | 610 | mod_timer(&ifibss->timer, |
609 | round_jiffies(jiffies + interval)); | 611 | round_jiffies(jiffies + interval)); |
610 | } | 612 | } |