2 * Copyright (c) 2005, 2006
3 * Damien Bergamini <damien.bergamini@free.fr>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 * $FreeBSD: src/sys/dev/ral/rt2560var.h,v 1.1 2006/03/05 20:36:56 damien Exp $
18 * $DragonFly: src/sys/dev/netif/ral/rt2560var.h,v 1.9 2008/01/25 08:57:36 sephe Exp $
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
;
62 struct rt2560_tx_ring
{
63 bus_dma_tag_t desc_dmat
;
64 bus_dma_tag_t data_dmat
;
65 bus_dmamap_t desc_map
;
67 struct rt2560_tx_desc
*desc
;
68 struct rt2560_tx_data
*data
;
77 struct rt2560_rx_data
{
83 struct rt2560_rx_ring
{
84 bus_dma_tag_t desc_dmat
;
85 bus_dma_tag_t data_dmat
;
86 bus_dmamap_t desc_map
;
88 struct rt2560_rx_desc
*desc
;
89 struct rt2560_rx_data
*data
;
98 * NOTE: following four fields MUST be in the
99 * same order as in rt2661_softc
101 struct ieee80211com sc_ic
;
102 bus_space_tag_t sc_st
;
103 bus_space_handle_t sc_sh
;
107 struct resource
*sc_irq
;
110 int (*sc_newstate
)(struct ieee80211com
*,
111 enum ieee80211_state
, int);
113 struct callout scan_ch
;
114 struct callout calib_ch
;
119 uint32_t asic_rev
; /* RT2560_ASICREV_ */
124 struct rt2560_tx_ring txq
;
125 struct rt2560_tx_ring prioq
;
126 struct rt2560_tx_ring atimq
;
127 struct rt2560_tx_ring bcnq
;
128 struct rt2560_rx_ring rxq
;
130 struct ieee80211_beacon_offsets sc_bo
;
149 uint8_t sc_bbp17_dynmax
;
150 uint8_t sc_bbp17_dynmin
;
155 #define RT2560_RXSNS_MAX 0x50 /* inclusive */
157 struct bpf_if
*sc_drvbpf
;
160 struct rt2560_rx_radiotap_header th
;
163 #define sc_rxtap sc_rxtapu.th
167 struct rt2560_tx_radiotap_header th
;
170 #define sc_txtap sc_txtapu.th
173 struct sysctl_ctx_list sysctl_ctx
;
174 struct sysctl_oid
*sysctl_tree
;
176 struct ieee80211_onoe_param sc_onoe_param
;
177 struct ieee80211_sample_param sc_sample_param
;
181 #define RT2560_FLAG_RXSNS 0x1
183 #define RT2560_ASICREV_B 2
184 #define RT2560_ASICREV_C 3
185 #define RT2560_ASICREV_D 4
187 int rt2560_attach(device_t
, int);
188 int rt2560_detach(void *);
189 void rt2560_shutdown(void *);
190 void rt2560_suspend(void *);
191 void rt2560_resume(void *);