blob: f6789fdaaf6e6ec210b08eeaafedff2a7945b64e [file] [log] [blame]
Ivo van Doorn95ea3622007-09-25 17:57:13 -07001/*
Ivo van Doorn811aa9c2008-02-03 15:42:53 +01002 Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
Ivo van Doorn95ea3622007-09-25 17:57:13 -07003 <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
Ivo van Doorn81873e92007-10-06 14:14:06 +020031 * Both the link tuner as the rfkill will be called once per second.
Ivo van Doorn95ea3622007-09-25 17:57:13 -070032 */
Anton Blanchardb239bd72007-10-15 00:40:34 -050033#define LINK_TUNE_INTERVAL ( round_jiffies_relative(HZ) )
Ivo van Doorn81873e92007-10-06 14:14:06 +020034#define RFKILL_POLL_INTERVAL ( 1000 )
Ivo van Doorn95ea3622007-09-25 17:57:13 -070035
36/*
37 * Radio control handlers.
38 */
39int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev);
40void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev);
Ivo van Doorn5cbf8302007-10-06 14:16:09 +020041void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, enum dev_state state);
Ivo van Doorn95ea3622007-09-25 17:57:13 -070042void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev);
43
44/*
45 * Initialization handlers.
46 */
Ivo van Doorne37ea212008-01-06 23:40:07 +010047int rt2x00lib_start(struct rt2x00_dev *rt2x00dev);
48void rt2x00lib_stop(struct rt2x00_dev *rt2x00dev);
Ivo van Doorn95ea3622007-09-25 17:57:13 -070049
50/*
51 * Configuration handlers.
52 */
Ivo van Doorn6bb40dd2008-02-03 15:49:59 +010053void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev,
54 struct rt2x00_intf *intf,
55 enum ieee80211_if_types type,
56 u8 *mac, u8 *bssid);
57void rt2x00lib_config_preamble(struct rt2x00_dev *rt2x00dev,
58 struct rt2x00_intf *intf,
59 const unsigned int short_preamble);
Ivo van Doorn69f81a22007-10-13 16:26:36 +020060void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
61 enum antenna rx, enum antenna tx);
Ivo van Doorn066cb632007-09-25 20:55:39 +020062void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
63 struct ieee80211_conf *conf, const int force_config);
Ivo van Doorn95ea3622007-09-25 17:57:13 -070064
65/*
Ivo van Doorn181d6902008-02-05 16:42:23 -050066 * Queue handlers.
67 */
68void rt2x00queue_init_rx(struct rt2x00_dev *rt2x00dev);
69void rt2x00queue_init_tx(struct rt2x00_dev *rt2x00dev);
70int rt2x00queue_initialize(struct rt2x00_dev *rt2x00dev);
71void rt2x00queue_uninitialize(struct rt2x00_dev *rt2x00dev);
72int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev);
73void rt2x00queue_free(struct rt2x00_dev *rt2x00dev);
74
75/*
Ivo van Doorn95ea3622007-09-25 17:57:13 -070076 * Firmware handlers.
77 */
78#ifdef CONFIG_RT2X00_LIB_FIRMWARE
79int rt2x00lib_load_firmware(struct rt2x00_dev *rt2x00dev);
80void rt2x00lib_free_firmware(struct rt2x00_dev *rt2x00dev);
81#else
82static inline int rt2x00lib_load_firmware(struct rt2x00_dev *rt2x00dev)
83{
84 return 0;
85}
86static inline void rt2x00lib_free_firmware(struct rt2x00_dev *rt2x00dev)
87{
88}
89#endif /* CONFIG_RT2X00_LIB_FIRMWARE */
90
91/*
92 * Debugfs handlers.
93 */
94#ifdef CONFIG_RT2X00_LIB_DEBUGFS
95void rt2x00debug_register(struct rt2x00_dev *rt2x00dev);
96void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev);
Ivo van Doorn4d8dd662007-11-27 21:49:29 +010097void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);
Ivo van Doorn95ea3622007-09-25 17:57:13 -070098#else
99static inline void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
100{
101}
102
103static inline void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev)
104{
105}
Ivo van Doorn4d8dd662007-11-27 21:49:29 +0100106
107static inline void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
John W. Linville2b1ea592007-12-04 17:24:35 -0500108 struct sk_buff *skb)
Ivo van Doorn4d8dd662007-11-27 21:49:29 +0100109{
110}
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700111#endif /* CONFIG_RT2X00_LIB_DEBUGFS */
112
113/*
114 * RFkill handlers.
115 */
116#ifdef CONFIG_RT2X00_LIB_RFKILL
117int rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev);
118void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev);
119int rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev);
120void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev);
121#else
122static inline int rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev)
123{
Ivo van Doorn95ea3622007-09-25 17:57:13 -0700124 return 0;
125}
126
127static inline void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev)
128{
129}
130
131static inline int rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev)
132{
133 return 0;
134}
135
136static inline void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev)
137{
138}
139#endif /* CONFIG_RT2X00_LIB_RFKILL */
140
141#endif /* RT2X00LIB_H */