1178354Ssam/*- 2178354Ssam * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting 3178354Ssam * All rights reserved. 4178354Ssam * 5178354Ssam * Redistribution and use in source and binary forms, with or without 6178354Ssam * modification, are permitted provided that the following conditions 7178354Ssam * are met: 8178354Ssam * 1. Redistributions of source code must retain the above copyright 9178354Ssam * notice, this list of conditions and the following disclaimer. 10178354Ssam * 2. Redistributions in binary form must reproduce the above copyright 11178354Ssam * notice, this list of conditions and the following disclaimer in the 12178354Ssam * documentation and/or other materials provided with the distribution. 13178354Ssam * 14178354Ssam * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15178354Ssam * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16178354Ssam * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17178354Ssam * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18178354Ssam * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19178354Ssam * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20178354Ssam * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21178354Ssam * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22178354Ssam * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23178354Ssam * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24178354Ssam * 25178354Ssam * $FreeBSD$ 26178354Ssam */ 27178354Ssam#ifndef _NET80211_IEEE80211_DFS_H_ 28178354Ssam#define _NET80211_IEEE80211_DFS_H_ 29178354Ssam 30178354Ssam/* 31178354Ssam * 802.11h/DFS definitions. 32178354Ssam */ 33178354Ssam 34230793Sadriantypedef enum { 35230793Sadrian DFS_DBG_NONE = 0, 36230793Sadrian DFS_DBG_NONOL = 1, 37230793Sadrian DFS_DBG_NOCSANOL = 2 38230793Sadrian} dfs_debug_t; 39230793Sadrian 40178354Ssamstruct ieee80211_dfs_state { 41186107Ssam int nol_event[IEEE80211_CHAN_MAX]; 42178354Ssam struct callout nol_timer; /* NOL list processing */ 43178354Ssam struct callout cac_timer; /* CAC timer */ 44178354Ssam struct timeval lastevent; /* time of last radar event */ 45178354Ssam int cureps; /* current events/second */ 46178354Ssam const struct ieee80211_channel *lastchan;/* chan w/ last radar event */ 47178354Ssam struct ieee80211_channel *newchan; /* chan selected next */ 48178354Ssam}; 49178354Ssam 50178354Ssamvoid ieee80211_dfs_attach(struct ieee80211com *); 51178354Ssamvoid ieee80211_dfs_detach(struct ieee80211com *); 52178354Ssam 53178354Ssamvoid ieee80211_dfs_reset(struct ieee80211com *); 54178354Ssam 55178354Ssamvoid ieee80211_dfs_cac_start(struct ieee80211vap *); 56178354Ssamvoid ieee80211_dfs_cac_stop(struct ieee80211vap *); 57178354Ssamvoid ieee80211_dfs_cac_clear(struct ieee80211com *, 58178354Ssam const struct ieee80211_channel *); 59178354Ssam 60178354Ssamvoid ieee80211_dfs_notify_radar(struct ieee80211com *, 61178354Ssam struct ieee80211_channel *); 62178354Ssamstruct ieee80211_channel *ieee80211_dfs_pickchannel(struct ieee80211com *); 63178354Ssam#endif /* _NET80211_IEEE80211_DFS_H_ */ 64