Add rt2x00-mac80211 snapshot (#1916)
[openwrt/svn-archive/archive.git] / package / rt2x00 / src / rt2x00lib.h
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 for the rt2x00lib module.
24 Supported chipsets: RT2460, RT2560, RT2570,
25 rt2561, rt2561s, rt2661, rt2571W & rt2671.
26 */
27
28 #ifndef RT2X00LIB_H
29 #define RT2X00LIB_H
30
31 struct rt2x00_dev;
32 struct data_desc;
33 struct data_entry_desc;
34 struct data_entry;
35
36 /*
37 * Details about the supported modes, rates and channels
38 * of a particular chipset. This is used by rt2x00lib
39 * to build the ieee80211_hw_mode array for mac80211.
40 */
41 struct hw_mode_spec {
42 /*
43 * Default mac address.
44 */
45 char *mac_addr;
46
47 /*
48 * Number of modes, rates and channels.
49 */
50 int num_modes;
51 int num_rates;
52 int num_channels;
53
54 /*
55 * txpower values.
56 */
57 const u8 *tx_power_a;
58 const u8 *tx_power_bg;
59 u8 tx_power_default;
60
61 /*
62 * Device/chipset specific value.
63 */
64 const u32 *chan_val_a;
65 const u32 *chan_val_bg;
66 };
67
68 /*
69 * Driver allocation handlers.
70 */
71 int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev);
72 void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev);
73
74 /*
75 * Driver status handlers.
76 */
77 int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev, pm_message_t state);
78 int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev);
79
80 /*
81 * Interrupt context handlers.
82 */
83 void rt2x00lib_txdone(struct data_entry *entry,
84 const int status, const int retry);
85 void rt2x00lib_rxdone(struct data_entry *entry, char *data,
86 const int size, const int signal, const int rssi, const int ofdm);
87
88 /*
89 * TX descriptor initializer
90 */
91 void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
92 struct data_entry *entry, struct data_desc *txd,
93 struct ieee80211_hdr *ieee80211hdr, unsigned int length,
94 struct ieee80211_tx_control *control);
95
96 /*
97 * mac80211 handlers.
98 */
99 int rt2x00lib_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
100 struct ieee80211_tx_control *control);
101 int rt2x00lib_reset(struct ieee80211_hw *hw);
102 int rt2x00lib_open(struct ieee80211_hw *hw);
103 int rt2x00lib_stop(struct ieee80211_hw *hw);
104 int rt2x00lib_add_interface(struct ieee80211_hw *hw,
105 struct ieee80211_if_init_conf *conf);
106 void rt2x00lib_remove_interface(struct ieee80211_hw *hw,
107 struct ieee80211_if_init_conf *conf);
108 int rt2x00lib_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
109 int rt2x00lib_config_interface(struct ieee80211_hw *hw, int if_id,
110 struct ieee80211_if_conf *conf);
111 void rt2x00lib_set_multicast_list(struct ieee80211_hw *hw,
112 unsigned short flags, int mc_count);
113 int rt2x00lib_get_tx_stats(struct ieee80211_hw *hw,
114 struct ieee80211_tx_queue_stats *stats);
115 int rt2x00lib_conf_tx(struct ieee80211_hw *hw, int queue,
116 const struct ieee80211_tx_queue_params *params);
117
118 #endif /* RT2X00LIB_H */