diff options
author | Felix Fietkau <nbd@openwrt.org> | 2008-07-25 22:37:50 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2008-07-25 22:37:50 +0000 |
commit | 22a637325e37c8dfac6c17bb1b26aa5564df8ff9 (patch) | |
tree | 5cda1469dfe061fa6dc9b63955b04750711992d6 /package/wpa_supplicant/patches/140-quality.patch | |
parent | e7c5e724794e87c4a52a3d8c9ddc5261f1abb0a9 (diff) | |
download | upstream-22a637325e37c8dfac6c17bb1b26aa5564df8ff9.tar.gz upstream-22a637325e37c8dfac6c17bb1b26aa5564df8ff9.tar.bz2 upstream-22a637325e37c8dfac6c17bb1b26aa5564df8ff9.zip |
wpa_supplicant: sort scan results by link quality to improve supplicant-controlled roaming
SVN-Revision: 11931
Diffstat (limited to 'package/wpa_supplicant/patches/140-quality.patch')
-rw-r--r-- | package/wpa_supplicant/patches/140-quality.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/package/wpa_supplicant/patches/140-quality.patch b/package/wpa_supplicant/patches/140-quality.patch new file mode 100644 index 0000000000..e5e8397c85 --- /dev/null +++ b/package/wpa_supplicant/patches/140-quality.patch @@ -0,0 +1,35 @@ +Index: wpa_supplicant-0.6.3/wpa_supplicant/wpa_supplicant.c +=================================================================== +--- wpa_supplicant-0.6.3.orig/wpa_supplicant/wpa_supplicant.c 2008-07-24 16:28:58.000000000 +0200 ++++ wpa_supplicant-0.6.3/wpa_supplicant/wpa_supplicant.c 2008-07-24 16:47:40.000000000 +0200 +@@ -1182,7 +1182,7 @@ + { + #define SCAN_AP_LIMIT 128 + struct wpa_scan_result *results; +- int num, i; ++ int num, i, j; + struct wpa_scan_results *res; + + results = os_malloc(SCAN_AP_LIMIT * sizeof(struct wpa_scan_result)); +@@ -1279,6 +1279,21 @@ + res->res[res->num++] = r; + } + ++ /* sort scan results by quality */ ++ for(i = 0; i < num - 1; i++) { ++ for(j = i + 1; j < num; j++) { ++ struct wpa_scan_result tmp; ++ ++ if (results[i].qual > results[j].qual) ++ continue; ++ ++ os_memcpy(&tmp, &results[i], sizeof(tmp)); ++ os_memcpy(&results[i], &results[j], sizeof(tmp)); ++ os_memcpy(&results[j], &tmp, sizeof(tmp)); ++ } ++ } ++ ++ + os_free(results); + wpa_s->scan_res = res; + |