correctly handle AP scanning result when there are no APs

This commit is contained in:
dbj 2002-03-04 01:30:04 +00:00
parent 6e4b27cd49
commit 918b9d4dec

View File

@ -1,4 +1,4 @@
/* $NetBSD: wi.c,v 1.46 2002/03/04 01:21:07 dbj Exp $ */ /* $NetBSD: wi.c,v 1.47 2002/03/04 01:30:04 dbj Exp $ */
/* /*
* Copyright (c) 1997, 1998, 1999 * Copyright (c) 1997, 1998, 1999
@ -70,7 +70,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.46 2002/03/04 01:21:07 dbj Exp $"); __KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.47 2002/03/04 01:30:04 dbj Exp $");
#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */ #define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */
#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ #define WI_HERMES_STATS_WAR /* Work around stats counter bug. */
@ -493,9 +493,9 @@ void wi_update_stats(sc)
switch (gen.wi_type) { switch (gen.wi_type) {
case WI_INFO_SCAN_RESULTS: case WI_INFO_SCAN_RESULTS:
if (gen.wi_len <= 3) if (gen.wi_len <= 3) {
break; sc->wi_naps = 0;
if (sc->sc_prism2) { /* Prism2 chip */ } else if (sc->sc_prism2) { /* Prism2 chip */
naps = 2 * (gen.wi_len - 3) / sizeof(ap2); naps = 2 * (gen.wi_len - 3) / sizeof(ap2);
naps = naps > MAXAPINFO ? MAXAPINFO : naps; naps = naps > MAXAPINFO ? MAXAPINFO : naps;
sc->wi_naps = naps; sc->wi_naps = naps;