1 /* $NetBSD: rt2560var.h,v 1.5 2007/03/04 06:02:00 christos Exp $ */
2 /* $OpenBSD: rt2560var.h,v 1.2 2006/01/14 12:43:27 damien Exp $ */
5 * Copyright (c) 2005, 2006
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 rt2560_rx_radiotap_header
{
22 struct ieee80211_radiotap_header wr_ihdr
;
26 uint16_t wr_chan_freq
;
27 uint16_t wr_chan_flags
;
32 #define RT2560_RX_RADIOTAP_PRESENT \
33 ((1 << IEEE80211_RADIOTAP_TSFT) | \
34 (1 << IEEE80211_RADIOTAP_FLAGS) | \
35 (1 << IEEE80211_RADIOTAP_RATE) | \
36 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
37 (1 << IEEE80211_RADIOTAP_ANTENNA) | \
38 (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL))
40 struct rt2560_tx_radiotap_header
{
41 struct ieee80211_radiotap_header wt_ihdr
;
44 uint16_t wt_chan_freq
;
45 uint16_t wt_chan_flags
;
49 #define RT2560_TX_RADIOTAP_PRESENT \
50 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
51 (1 << IEEE80211_RADIOTAP_RATE) | \
52 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
53 (1 << IEEE80211_RADIOTAP_ANTENNA))
55 struct rt2560_tx_data
{
58 struct ieee80211_node
*ni
;
59 struct ieee80211_rssdesc id
;
62 struct rt2560_tx_ring
{
64 bus_dma_segment_t seg
;
66 struct rt2560_tx_desc
*desc
;
67 struct rt2560_tx_data
*data
;
76 struct rt2560_rx_data
{
82 struct rt2560_rx_ring
{
84 bus_dma_segment_t seg
;
86 struct rt2560_rx_desc
*desc
;
87 struct rt2560_rx_data
*data
;
95 struct ieee80211_node ni
;
96 struct ieee80211_rssadapt rssadapt
;
100 struct device sc_dev
;
102 struct ieee80211com sc_ic
;
103 int (*sc_newstate
)(struct ieee80211com
*,
104 enum ieee80211_state
, int);
106 int (*sc_enable
)(struct rt2560_softc
*);
107 void (*sc_disable
)(struct rt2560_softc
*);
109 bus_dma_tag_t sc_dmat
;
110 bus_space_tag_t sc_st
;
111 bus_space_handle_t sc_sh
;
113 struct sysctllog
*sc_sysctllog
;
115 struct ethercom sc_ec
;
117 struct callout scan_ch
;
118 struct callout rssadapt_ch
;
121 #define RT2560_ENABLED (1 << 0)
128 struct rt2560_tx_ring txq
;
129 struct rt2560_tx_ring prioq
;
130 struct rt2560_tx_ring atimq
;
131 struct rt2560_tx_ring bcnq
;
132 struct rt2560_rx_ring rxq
;
134 struct ieee80211_beacon_offsets sc_bo
;
156 struct rt2560_rx_radiotap_header th
;
159 #define sc_rxtap sc_rxtapu.th
163 struct rt2560_tx_radiotap_header th
;
166 #define sc_txtap sc_txtapu.th
171 #define sc_if sc_ec.ec_if
173 int rt2560_attach(void *, int);
174 int rt2560_detach(void *);
175 int rt2560_intr(void *);