On Thu, Aug 7, 2008 at 3:50 PM, Tomas Winkler <tomas.winkler@xxxxxxxxx> wrote: > From: Ron Rindjunsky <ron.rindjunsky@xxxxxxxxx> > > This patch fixes noticed problem in noisy environments of 50+ APs > that scan fails to find the requested AP on first try, which > leads to connection refusal. second scan has empirically proven to fix > this problem in almost all cases. > > Signed-off-by: Ron Rindjunsky <ron.rindjunsky@xxxxxxxxx> > Signed-off-by: Esti Kummer <ester.kummer@xxxxxxxxx> > Signed-off-by: Tomas Winkler <tomas.winkler@xxxxxxxxx> > --- > net/mac80211/ieee80211_i.h | 4 +++- > net/mac80211/mlme.c | 9 +++++++-- > 2 files changed, 10 insertions(+), 3 deletions(-) > > diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h > index d19f67e..f71785e 100644 > --- a/net/mac80211/ieee80211_i.h > +++ b/net/mac80211/ieee80211_i.h > @@ -369,7 +369,9 @@ struct ieee80211_if_sta { > > struct sk_buff_head skb_queue; > > - int auth_tries, assoc_tries; > + int assoc_scan_tries; /* number of scans done pre-association */ > + int auth_tries; /* retries for auth req */ > + int assoc_tries; /* retries for assoc req */ This last variable seems unused. > @@ -3544,7 +3548,8 @@ static int ieee80211_sta_config_auth(struct net_device *dev, > ieee80211_sta_reset_auth(dev, ifsta); > return 0; > } else { > - if (ifsta->state != IEEE80211_STA_MLME_AUTHENTICATE) { > + if (ifsta->assoc_scan_tries < IEEE80211_ASSOC_SCANS_MAX_TRIES) { > + ifsta->assoc_scan_tries++; > if (ifsta->flags & IEEE80211_STA_AUTO_SSID_SEL) > ieee80211_sta_start_scan(dev, NULL, 0); > else Interesting, is there a race then? Luis -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html