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
34178354Ssamstruct ieee80211_dfs_state {
35186107Ssam	int		nol_event[IEEE80211_CHAN_MAX];
36178354Ssam	struct callout	nol_timer;		/* NOL list processing */
37178354Ssam	struct callout	cac_timer;		/* CAC timer */
38178354Ssam	struct timeval	lastevent;		/* time of last radar event */
39178354Ssam	int		cureps;			/* current events/second */
40178354Ssam	const struct ieee80211_channel *lastchan;/* chan w/ last radar event */
41178354Ssam	struct ieee80211_channel *newchan;	/* chan selected next */
42178354Ssam};
43178354Ssam
44178354Ssamvoid	ieee80211_dfs_attach(struct ieee80211com *);
45178354Ssamvoid	ieee80211_dfs_detach(struct ieee80211com *);
46178354Ssam
47178354Ssamvoid	ieee80211_dfs_reset(struct ieee80211com *);
48178354Ssam
49178354Ssamvoid	ieee80211_dfs_cac_start(struct ieee80211vap *);
50178354Ssamvoid	ieee80211_dfs_cac_stop(struct ieee80211vap *);
51178354Ssamvoid	ieee80211_dfs_cac_clear(struct ieee80211com *,
52178354Ssam		const struct ieee80211_channel *);
53178354Ssam
54178354Ssamvoid	ieee80211_dfs_notify_radar(struct ieee80211com *,
55178354Ssam		struct ieee80211_channel *);
56178354Ssamstruct ieee80211_channel *ieee80211_dfs_pickchannel(struct ieee80211com *);
57178354Ssam#endif /* _NET80211_IEEE80211_DFS_H_ */
58