rt2x00lib.h revision b239bd759869a82bbb8ecf94ff10634b6829313d
1/*
2	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
3	<http://rt2x00.serialmonkey.com>
4
5	This program is free software; you can redistribute it and/or modify
6	it under the terms of the GNU General Public License as published by
7	the Free Software Foundation; either version 2 of the License, or
8	(at your option) any later version.
9
10	This program is distributed in the hope that it will be useful,
11	but WITHOUT ANY WARRANTY; without even the implied warranty of
12	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13	GNU General Public License for more details.
14
15	You should have received a copy of the GNU General Public License
16	along with this program; if not, write to the
17	Free Software Foundation, Inc.,
18	59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21/*
22	Module: rt2x00lib
23	Abstract: Data structures and definitions for the rt2x00lib module.
24 */
25
26#ifndef RT2X00LIB_H
27#define RT2X00LIB_H
28
29/*
30 * Interval defines
31 * Both the link tuner as the rfkill will be called once per second.
32 */
33#define LINK_TUNE_INTERVAL	( round_jiffies_relative(HZ) )
34#define RFKILL_POLL_INTERVAL	( 1000 )
35
36/*
37 * Radio control handlers.
38 */
39int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev);
40void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev);
41void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, enum dev_state state);
42void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev);
43
44/*
45 * Initialization handlers.
46 */
47int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev);
48void rt2x00lib_uninitialize(struct rt2x00_dev *rt2x00dev);
49
50/*
51 * Configuration handlers.
52 */
53void rt2x00lib_config_mac_addr(struct rt2x00_dev *rt2x00dev, u8 *mac);
54void rt2x00lib_config_bssid(struct rt2x00_dev *rt2x00dev, u8 *bssid);
55void rt2x00lib_config_type(struct rt2x00_dev *rt2x00dev, const int type);
56void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
57		      struct ieee80211_conf *conf, const int force_config);
58
59/*
60 * Firmware handlers.
61 */
62#ifdef CONFIG_RT2X00_LIB_FIRMWARE
63int rt2x00lib_load_firmware(struct rt2x00_dev *rt2x00dev);
64void rt2x00lib_free_firmware(struct rt2x00_dev *rt2x00dev);
65#else
66static inline int rt2x00lib_load_firmware(struct rt2x00_dev *rt2x00dev)
67{
68	return 0;
69}
70static inline void rt2x00lib_free_firmware(struct rt2x00_dev *rt2x00dev)
71{
72}
73#endif /* CONFIG_RT2X00_LIB_FIRMWARE */
74
75/*
76 * Debugfs handlers.
77 */
78#ifdef CONFIG_RT2X00_LIB_DEBUGFS
79void rt2x00debug_register(struct rt2x00_dev *rt2x00dev);
80void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev);
81#else
82static inline void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
83{
84}
85
86static inline void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev)
87{
88}
89#endif /* CONFIG_RT2X00_LIB_DEBUGFS */
90
91/*
92 * RFkill handlers.
93 */
94#ifdef CONFIG_RT2X00_LIB_RFKILL
95int rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev);
96void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev);
97int rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev);
98void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev);
99#else
100static inline int rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev)
101{
102	return 0;
103}
104
105static inline void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev)
106{
107}
108
109static inline int rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev)
110{
111	return 0;
112}
113
114static inline void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev)
115{
116}
117#endif /* CONFIG_RT2X00_LIB_RFKILL */
118
119#endif /* RT2X00LIB_H */
120