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/if_ralvar.h,v 1.2.2.1 2006/01/29 15:21:46 damien Exp $
18 * $DragonFly: src/sys/dev/netif/ral/Attic/if_ralvar.h,v 1.1 2006/05/20 09:13:09 sephe Exp $
21 struct ral_rx_radiotap_header {
22 struct ieee80211_radiotap_header wr_ihdr;
26 uint16_t wr_chan_freq;
27 uint16_t wr_chan_flags;
32 #define RAL_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 ral_tx_radiotap_header {
41 struct ieee80211_radiotap_header wt_ihdr;
44 uint16_t wt_chan_freq;
45 uint16_t wt_chan_flags;
49 #define RAL_TX_RADIOTAP_PRESENT \
50 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
51 (1 << IEEE80211_RADIOTAP_RATE) | \
52 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
53 (1 << IEEE80211_RADIOTAP_ANTENNA))
58 struct ieee80211_node *ni;
59 struct ral_rssdesc id;
63 bus_dma_tag_t desc_dmat;
64 bus_dma_tag_t data_dmat;
65 bus_dmamap_t desc_map;
67 struct ral_tx_desc *desc;
68 struct ral_tx_data *data;
84 bus_dma_tag_t desc_dmat;
85 bus_dma_tag_t data_dmat;
86 bus_dmamap_t desc_map;
88 struct ral_rx_desc *desc;
89 struct ral_rx_data *data;
97 struct ieee80211_node ni;
98 struct ral_rssadapt rssadapt;
102 struct ifnet *sc_ifp;
103 struct ieee80211com sc_ic;
104 int (*sc_newstate)(struct ieee80211com *,
105 enum ieee80211_state, int);
110 struct callout scan_ch;
111 struct callout rssadapt_ch;
115 struct resource *irq;
116 struct resource *mem;
117 bus_space_tag_t sc_st;
118 bus_space_handle_t sc_sh;
127 struct ral_tx_ring txq;
128 struct ral_tx_ring prioq;
129 struct ral_tx_ring atimq;
130 struct ral_tx_ring bcnq;
131 struct ral_rx_ring rxq;
133 struct ieee80211_beacon_offsets sc_bo;
151 struct bpf_if *sc_drvbpf;
154 struct ral_rx_radiotap_header th;
157 #define sc_rxtap sc_rxtapu.th
161 struct ral_tx_radiotap_header th;
164 #define sc_txtap sc_txtapu.th
168 extern devclass_t ral_devclass;
170 int ral_attach(device_t);
171 int ral_detach(device_t);
172 void ral_shutdown(device_t);
173 int ral_alloc(device_t, int);
174 void ral_free(device_t);
175 void ral_stop(void *);
177 #define RAL_LOCK(sc) mtx_lock(&(sc)->sc_mtx)
178 #define RAL_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx)