1 /* $NetBSD: rt2661var.h,v 1.7 2007/12/09 20:27:59 jmcneill Exp $ */
2 /* $OpenBSD: rt2661var.h,v 1.4 2006/02/25 12:56:47 damien Exp $ */
6 * Damien Bergamini <damien.bergamini@free.fr>
8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies.
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 struct rt2661_rx_radiotap_header
{
22 struct ieee80211_radiotap_header wr_ihdr
;
26 uint16_t wr_chan_freq
;
27 uint16_t wr_chan_flags
;
31 #define RT2661_RX_RADIOTAP_PRESENT \
32 ((1 << IEEE80211_RADIOTAP_TSFT) | \
33 (1 << IEEE80211_RADIOTAP_FLAGS) | \
34 (1 << IEEE80211_RADIOTAP_RATE) | \
35 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
36 (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL))
38 struct rt2661_tx_radiotap_header
{
39 struct ieee80211_radiotap_header wt_ihdr
;
42 uint16_t wt_chan_freq
;
43 uint16_t wt_chan_flags
;
46 #define RT2661_TX_RADIOTAP_PRESENT \
47 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
48 (1 << IEEE80211_RADIOTAP_RATE) | \
49 (1 << IEEE80211_RADIOTAP_CHANNEL))
51 struct rt2661_tx_data
{
54 struct ieee80211_node
*ni
;
57 struct rt2661_tx_ring
{
59 bus_dma_segment_t seg
;
61 struct rt2661_tx_desc
*desc
;
62 struct rt2661_tx_data
*data
;
70 struct rt2661_rx_data
{
75 struct rt2661_rx_ring
{
77 bus_dma_segment_t seg
;
79 struct rt2661_rx_desc
*desc
;
80 struct rt2661_rx_data
*data
;
87 struct ieee80211_node ni
;
88 struct ieee80211_amrr_node amn
;
94 struct ieee80211com sc_ic
;
95 int (*sc_newstate
)(struct ieee80211com
*,
96 enum ieee80211_state
, int);
98 int (*sc_enable
)(struct rt2661_softc
*);
99 void (*sc_disable
)(struct rt2661_softc
*);
101 bus_dma_tag_t sc_dmat
;
102 bus_space_tag_t sc_st
;
103 bus_space_handle_t sc_sh
;
105 struct ethercom sc_ec
;
107 struct callout scan_ch
;
108 struct callout amrr_ch
;
112 #define RT2661_ENABLED (1 << 0)
113 #define RT2661_FWLOADED (1 << 1)
114 #define RT2661_UPDATE_SLOT (1 << 2)
115 #define RT2661_SET_SLOTTIME (1 << 3)
119 struct ieee80211_channel
*sc_curchan
;
120 struct ieee80211_amrr amrr
;
127 struct rt2661_tx_ring txq
[5];
128 struct rt2661_tx_ring mgtq
;
129 struct rt2661_rx_ring rxq
;
165 struct rt2661_rx_radiotap_header th
;
168 #define sc_rxtap sc_rxtapu.th
172 struct rt2661_tx_radiotap_header th
;
175 #define sc_txtap sc_txtapu.th
180 #define sc_if sc_ec.ec_if
182 int rt2661_attach(void *, int);
183 int rt2661_detach(void *);
184 int rt2661_intr(void *);