5 * Damien Bergamini <damien.bergamini@free.fr>
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #define RAL_TX_LIST_COUNT 8
21 #define RAL_TX_MINFREE 2
23 #define URAL_SCAN_START 1
24 #define URAL_SCAN_END 2
25 #define URAL_SET_CHANNEL 3
28 struct ural_rx_radiotap_header {
29 struct ieee80211_radiotap_header wr_ihdr;
32 uint16_t wr_chan_freq;
33 uint16_t wr_chan_flags;
39 #define RAL_RX_RADIOTAP_PRESENT \
40 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
41 (1 << IEEE80211_RADIOTAP_RATE) | \
42 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
43 (1 << IEEE80211_RADIOTAP_ANTENNA) | \
44 (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \
45 (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE))
47 struct ural_tx_radiotap_header {
48 struct ieee80211_radiotap_header wt_ihdr;
51 uint16_t wt_chan_freq;
52 uint16_t wt_chan_flags;
56 #define RAL_TX_RADIOTAP_PRESENT \
57 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
58 (1 << IEEE80211_RADIOTAP_RATE) | \
59 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
60 (1 << IEEE80211_RADIOTAP_ANTENNA))
65 STAILQ_ENTRY(ural_tx_data) next;
66 struct ural_softc *sc;
67 struct ural_tx_desc desc;
69 struct ieee80211_node *ni;
72 typedef STAILQ_HEAD(, ural_tx_data) ural_txdhead;
75 struct ieee80211vap vap;
76 struct ieee80211_beacon_offsets bo;
77 struct usb_callout ratectl_ch;
78 struct task ratectl_task;
80 int (*newstate)(struct ieee80211vap *,
81 enum ieee80211_state, int);
83 #define URAL_VAP(vap) ((struct ural_vap *)(vap))
94 struct usb_device *sc_udev;
99 struct usb_xfer *sc_xfer[URAL_N_TRANSFER];
101 struct ural_tx_data tx_data[RAL_TX_LIST_COUNT];
103 ural_txdhead tx_free;
105 struct ural_rx_desc sc_rx_desc;
117 } __packed bbp_prom[16];
125 struct ural_rx_radiotap_header sc_rxtap;
128 struct ural_tx_radiotap_header sc_txtap;
132 #define RAL_LOCK(sc) mtx_lock(&(sc)->sc_mtx)
133 #define RAL_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx)
134 #define RAL_LOCK_ASSERT(sc, t) mtx_assert(&(sc)->sc_mtx, t)