Deleted Added
full compact
ieee80211_node.c (140440) ieee80211_node.c (140441)
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 17 unchanged lines hidden (view full) ---

26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 17 unchanged lines hidden (view full) ---

26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_node.c 140440 2005-01-18 19:52:36Z sam $");
34__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_node.c 140441 2005-01-18 19:59:40Z sam $");
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/mbuf.h>
39#include <sys/malloc.h>
40#include <sys/kernel.h>
41
42#include <sys/socket.h>

--- 522 unchanged lines hidden (view full) ---

565 IEEE80211_IS_CHAN_5GHZ(b->ni_chan))
566 return -1;
567 }
568 /* all things being equal, use signal level */
569 return rssia - rssib;
570}
571
572/*
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/mbuf.h>
39#include <sys/malloc.h>
40#include <sys/kernel.h>
41
42#include <sys/socket.h>

--- 522 unchanged lines hidden (view full) ---

565 IEEE80211_IS_CHAN_5GHZ(b->ni_chan))
566 return -1;
567 }
568 /* all things being equal, use signal level */
569 return rssia - rssib;
570}
571
572/*
573 * Mark an ongoing scan stopped.
574 */
575void
576ieee80211_cancel_scan(struct ieee80211com *ic)
577{
578
579 IEEE80211_DPRINTF(ic, IEEE80211_MSG_SCAN, "%s: end %s scan\n",
580 __func__,
581 (ic->ic_flags & IEEE80211_F_ASCAN) ? "active" : "passive");
582
583 ic->ic_flags &= ~(IEEE80211_F_SCAN | IEEE80211_F_ASCAN);
584}
585
586/*
573 * Complete a scan of potential channels.
574 */
575void
576ieee80211_end_scan(struct ieee80211com *ic)
577{
578 struct ieee80211_node *ni, *nextbs, *selbs;
579 struct ieee80211_node_table *nt;
580
587 * Complete a scan of potential channels.
588 */
589void
590ieee80211_end_scan(struct ieee80211com *ic)
591{
592 struct ieee80211_node *ni, *nextbs, *selbs;
593 struct ieee80211_node_table *nt;
594
581 IEEE80211_DPRINTF(ic, IEEE80211_MSG_SCAN, "end %s scan\n",
582 (ic->ic_flags & IEEE80211_F_ASCAN) ? "active" : "passive");
595 ieee80211_cancel_scan(ic);
596 ieee80211_notify_scan_done(ic);
583
597
584 ic->ic_flags &= ~(IEEE80211_F_SCAN | IEEE80211_F_ASCAN);
585 nt = &ic->ic_scan;
586 ni = TAILQ_FIRST(&nt->nt_node);
587
598 nt = &ic->ic_scan;
599 ni = TAILQ_FIRST(&nt->nt_node);
600
588 ieee80211_notify_scan_done(ic);
589
590 if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
591 u_int8_t maxrssi[IEEE80211_CHAN_MAX]; /* XXX off stack? */
592 int i, bestchan;
593 u_int8_t rssi;
594
595 /*
596 * The passive scan to look for existing AP's completed,
597 * select a channel to camp on. Identify the channels

--- 1311 unchanged lines hidden ---
601 if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
602 u_int8_t maxrssi[IEEE80211_CHAN_MAX]; /* XXX off stack? */
603 int i, bestchan;
604 u_int8_t rssi;
605
606 /*
607 * The passive scan to look for existing AP's completed,
608 * select a channel to camp on. Identify the channels

--- 1311 unchanged lines hidden ---