From 7da129ba965cebce6f11a26da41de4d41ea9d815 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 10 Jan 2006 18:56:32 +0100 Subject: [PATCH] --- yaml --- r: 23290 b: refs/heads/master c: 78e4f36e053b4d2c4623fdc1f6ac63f33d5b7c81 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/ieee80211/softmac/ieee80211softmac_assoc.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 50db03830d9a..c65934d4bdcc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 51da28a847027fdf80e55a2a0d7bd0f7a8617d3d +refs/heads/master: 78e4f36e053b4d2c4623fdc1f6ac63f33d5b7c81 diff --git a/trunk/net/ieee80211/softmac/ieee80211softmac_assoc.c b/trunk/net/ieee80211/softmac/ieee80211softmac_assoc.c index 700244c3af82..9fd409099b53 100644 --- a/trunk/net/ieee80211/softmac/ieee80211softmac_assoc.c +++ b/trunk/net/ieee80211/softmac/ieee80211softmac_assoc.c @@ -167,6 +167,8 @@ ieee80211softmac_assoc_work(void *d) /* Search the ieee80211 networks for this network if we didn't find it */ if (!found) { + s8 rssi = -128; /* if I don't initialise, gcc emits an invalid warning + because it cannot follow the best pointer logic. */ spin_lock_irqsave(&mac->ieee->lock, flags); list_for_each_entry(net, &mac->ieee->network_list, list) { /* we're supposed to find the network with @@ -174,7 +176,7 @@ ieee80211softmac_assoc_work(void *d) * any network with a specific ESSID, and many * different ones could have that. * - * I'll for now implement just finding one at all + * I'll for now just go with the reported rssi. * * We also should take into account the rateset * here to find the best BSSID to try. @@ -182,15 +184,17 @@ ieee80211softmac_assoc_work(void *d) if (network_matches_request(mac, net)) { if (!best) { best = net; + rssi = best->stats.rssi; continue; } /* we already had a matching network, so * compare their properties to get the * better of the two ... (see above) */ - /* TODO */ - /* for now, just */ - break; + if (rssi < net->stats.rssi) { + best = net; + rssi = best->stats.rssi; + } } } /* if we unlock here, we might get interrupted and the `best'