1/*- 2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 10 unchanged lines hidden (view full) --- 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> |
27__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_scan.c 184210 2008-10-23 19:57:13Z des $"); |
28 29/* 30 * IEEE 802.11 scanning support. 31 */ 32#include "opt_wlan.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> --- 55 unchanged lines hidden (view full) --- 91 92MALLOC_DEFINE(M_80211_SCAN, "80211scan", "802.11 scan state"); 93 94void 95ieee80211_scan_attach(struct ieee80211com *ic) 96{ 97 struct scan_state *ss; 98 |
99 MALLOC(ss, struct scan_state *, sizeof(struct scan_state), |
100 M_80211_SCAN, M_NOWAIT | M_ZERO); 101 if (ss == NULL) { 102 ic->ic_scan = NULL; 103 return; 104 } 105 callout_init_mtx(&ss->ss_scan_timer, IEEE80211_LOCK_OBJ(ic), 0); 106 ic->ic_scan = &ss->base; 107 --- 9 unchanged lines hidden (view full) --- 117 if (ss != NULL) { 118 callout_drain(&SCAN_PRIVATE(ss)->ss_scan_timer); 119 if (ss->ss_ops != NULL) { 120 ss->ss_ops->scan_detach(ss); 121 ss->ss_ops = NULL; 122 } 123 ic->ic_flags &= ~IEEE80211_F_SCAN; 124 ic->ic_scan = NULL; |
125 FREE(SCAN_PRIVATE(ss), M_80211_SCAN); |
126 } 127} 128 129static __inline void 130setparams(struct ieee80211_roamparam *rp, int8_t rssi, uint8_t txrate) 131{ 132 rp->rssi = rssi; 133 rp->rate = txrate; --- 1100 unchanged lines hidden --- |