xref: /freebsd/sys/net80211/ieee80211_dfs.h (revision b032f27c365b992e9d8e42214183b39acfb8c6ac)
1b032f27cSSam Leffler /*-
2b032f27cSSam Leffler  * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
3b032f27cSSam Leffler  * All rights reserved.
4b032f27cSSam Leffler  *
5b032f27cSSam Leffler  * Redistribution and use in source and binary forms, with or without
6b032f27cSSam Leffler  * modification, are permitted provided that the following conditions
7b032f27cSSam Leffler  * are met:
8b032f27cSSam Leffler  * 1. Redistributions of source code must retain the above copyright
9b032f27cSSam Leffler  *    notice, this list of conditions and the following disclaimer.
10b032f27cSSam Leffler  * 2. Redistributions in binary form must reproduce the above copyright
11b032f27cSSam Leffler  *    notice, this list of conditions and the following disclaimer in the
12b032f27cSSam Leffler  *    documentation and/or other materials provided with the distribution.
13b032f27cSSam Leffler  *
14b032f27cSSam Leffler  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15b032f27cSSam Leffler  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16b032f27cSSam Leffler  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17b032f27cSSam Leffler  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18b032f27cSSam Leffler  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19b032f27cSSam Leffler  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20b032f27cSSam Leffler  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21b032f27cSSam Leffler  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22b032f27cSSam Leffler  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23b032f27cSSam Leffler  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24b032f27cSSam Leffler  *
25b032f27cSSam Leffler  * $FreeBSD$
26b032f27cSSam Leffler  */
27b032f27cSSam Leffler #ifndef _NET80211_IEEE80211_DFS_H_
28b032f27cSSam Leffler #define _NET80211_IEEE80211_DFS_H_
29b032f27cSSam Leffler 
30b032f27cSSam Leffler /*
31b032f27cSSam Leffler  * 802.11h/DFS definitions.
32b032f27cSSam Leffler  */
33b032f27cSSam Leffler 
34b032f27cSSam Leffler struct ieee80211_dfs_state {
35b032f27cSSam Leffler 	int		nol_event[IEEE80211_CHAN_MAX+1];
36b032f27cSSam Leffler 	struct callout	nol_timer;		/* NOL list processing */
37b032f27cSSam Leffler 	struct callout	cac_timer;		/* CAC timer */
38b032f27cSSam Leffler 	struct timeval	lastevent;		/* time of last radar event */
39b032f27cSSam Leffler 	int		cureps;			/* current events/second */
40b032f27cSSam Leffler 	const struct ieee80211_channel *lastchan;/* chan w/ last radar event */
41b032f27cSSam Leffler 	struct ieee80211_channel *newchan;	/* chan selected next */
42b032f27cSSam Leffler };
43b032f27cSSam Leffler 
44b032f27cSSam Leffler void	ieee80211_dfs_attach(struct ieee80211com *);
45b032f27cSSam Leffler void	ieee80211_dfs_detach(struct ieee80211com *);
46b032f27cSSam Leffler 
47b032f27cSSam Leffler void	ieee80211_dfs_reset(struct ieee80211com *);
48b032f27cSSam Leffler 
49b032f27cSSam Leffler void	ieee80211_dfs_cac_start(struct ieee80211vap *);
50b032f27cSSam Leffler void	ieee80211_dfs_cac_stop(struct ieee80211vap *);
51b032f27cSSam Leffler void	ieee80211_dfs_cac_clear(struct ieee80211com *,
52b032f27cSSam Leffler 		const struct ieee80211_channel *);
53b032f27cSSam Leffler 
54b032f27cSSam Leffler void	ieee80211_dfs_notify_radar(struct ieee80211com *,
55b032f27cSSam Leffler 		struct ieee80211_channel *);
56b032f27cSSam Leffler struct ieee80211_channel *ieee80211_dfs_pickchannel(struct ieee80211com *);
57b032f27cSSam Leffler #endif /* _NET80211_IEEE80211_DFS_H_ */
58