4 * Copyright (c) 2005, 2006 Damien Bergamini <damien.bergamini@free.fr>
5 * Copyright (c) 2006 Niall O'Higgins <niallo@openbsd.org>
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 RUM_TX_LIST_COUNT 8
21 #define RUM_TX_MINFREE 2
23 struct rum_rx_radiotap_header {
24 struct ieee80211_radiotap_header wr_ihdr;
27 uint16_t wr_chan_freq;
28 uint16_t wr_chan_flags;
34 #define RT2573_RX_RADIOTAP_PRESENT \
35 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
36 (1 << IEEE80211_RADIOTAP_RATE) | \
37 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
38 (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \
39 (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | \
40 (1 << IEEE80211_RADIOTAP_ANTENNA) | \
43 struct rum_tx_radiotap_header {
44 struct ieee80211_radiotap_header wt_ihdr;
47 uint16_t wt_chan_freq;
48 uint16_t wt_chan_flags;
52 #define RT2573_TX_RADIOTAP_PRESENT \
53 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
54 (1 << IEEE80211_RADIOTAP_RATE) | \
55 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
56 (1 << IEEE80211_RADIOTAP_ANTENNA))
61 STAILQ_ENTRY(rum_tx_data) next;
63 struct rum_tx_desc desc;
65 struct ieee80211_node *ni;
68 typedef STAILQ_HEAD(, rum_tx_data) rum_txdhead;
71 struct ieee80211_node ni;
72 struct ieee80211_amrr_node amn;
74 #define RUM_NODE(ni) ((struct rum_node *)(ni))
77 struct ieee80211vap vap;
78 struct ieee80211_beacon_offsets bo;
79 struct ieee80211_amrr amrr;
80 struct usb_callout amrr_ch;
81 struct task amrr_task;
83 int (*newstate)(struct ieee80211vap *,
84 enum ieee80211_state, int);
86 #define RUM_VAP(vap) ((struct rum_vap *)(vap))
97 struct usb_device *sc_udev;
99 struct usb_xfer *sc_xfer[RUM_N_TRANSFER];
104 struct rum_tx_data tx_data[RUM_TX_LIST_COUNT];
108 struct rum_rx_desc sc_rx_desc;
120 } __packed bbp_prom[16];
132 struct rum_rx_radiotap_header sc_rxtap;
135 struct rum_tx_radiotap_header sc_txtap;
139 #define RUM_LOCK(sc) mtx_lock(&(sc)->sc_mtx)
140 #define RUM_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx)
141 #define RUM_LOCK_ASSERT(sc, t) mtx_assert(&(sc)->sc_mtx, t)