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 ieee80211vap vap;
72 struct ieee80211_beacon_offsets bo;
73 struct usb_callout ratectl_ch;
74 struct task ratectl_task;
76 int (*newstate)(struct ieee80211vap *,
77 enum ieee80211_state, int);
79 #define RUM_VAP(vap) ((struct rum_vap *)(vap))
90 struct usb_device *sc_udev;
92 struct usb_xfer *sc_xfer[RUM_N_TRANSFER];
97 struct rum_tx_data tx_data[RUM_TX_LIST_COUNT];
101 struct rum_rx_desc sc_rx_desc;
114 } __packed bbp_prom[16];
126 struct rum_rx_radiotap_header sc_rxtap;
129 struct rum_tx_radiotap_header sc_txtap;
133 #define RUM_LOCK(sc) mtx_lock(&(sc)->sc_mtx)
134 #define RUM_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx)
135 #define RUM_LOCK_ASSERT(sc, t) mtx_assert(&(sc)->sc_mtx, t)