/*-
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
+ * Copyright (c) 2005 Matt Mackall <mpm@selenic.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
/*
* IEEE 802.11 ap scanning support.
*/
-#ifndef AUTOCONF_INCLUDED
+#if !defined(AUTOCONF_INCLUDED) && !defined(CONFIG_LOCALVERSION)
#include <linux/config.h>
#endif
#include <linux/version.h>
#include <linux/netdevice.h>
#include <linux/init.h>
#include <linux/delay.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
-#include "sort.c"
-#else
#include <linux/sort.h>
-#endif
#include "if_media.h"
sort(chans, ss_last, sizeof(*chans), pc_cmp, pc_swap);
+#ifdef IEEE80211_DEBUG
for (i = 0; i < ss_last; i++) {
int chan = ieee80211_chan2ieee(ic, chans[i].chan);
-
IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: channel %u, "
"rssi %d, radar %d, cn %d, km %d\n",
__func__, chan, as->as_maxrssi[chan],
!!IEEE80211_ARE_CHANS_SAME_MODE(chans[i].chan,
ic->ic_bsschan));
}
+#endif /* IEEE80211_DEBUG */
best = NULL;
best_rssi = 0xff; /* If signal is bigger than 0xff, we'd be melting. */
continue;
/* Verify channel is not marked for non-occupancy */
- if (IEEE80211_IS_CHAN_RADAR(c->chan))
+ if (IEEE80211_IS_CHAN_RADAR(c->chan) &&
+ (ic->ic_flags & IEEE80211_F_DOTH))
continue;
/* Do not select 802.11a ST if mode is specified and is not
continue;
/* Verify mode matches any fixed mode specified */
- if((c->chan->ic_flags & as->as_required_mode) !=
+ if ((c->chan->ic_flags & as->as_required_mode) !=
as->as_required_mode)
continue;
/* break the loop as the subsequent chans won't be
* better */
break;
+
+ if (!IEEE80211_ARE_CHANS_SAME_MODE(c->chan,
+ ic->ic_bsschan))
+ /* break the loop as the subsequent chans won't be
+ * better */
+ break;
}
if (sta_assoc != 0) {