FreeBSD kernel usb device Code
if_uralvar.h
Go to the documentation of this file.
1/* $FreeBSD$ */
3/*-
4 * Copyright (c) 2005
5 * Damien Bergamini <damien.bergamini@free.fr>
6 *
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.
10 *
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.
18 */
19
20#define RAL_TX_LIST_COUNT 8
21#define RAL_TX_MINFREE 2
22
23#define URAL_SCAN_START 1
24#define URAL_SCAN_END 2
25#define URAL_SET_CHANNEL 3
26
28 struct ieee80211_radiotap_header wr_ihdr;
29 uint8_t wr_flags;
30 uint8_t wr_rate;
31 uint16_t wr_chan_freq;
32 uint16_t wr_chan_flags;
35 uint8_t wr_antenna;
37
38#define RAL_RX_RADIOTAP_PRESENT \
39 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
40 (1 << IEEE80211_RADIOTAP_RATE) | \
41 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
42 (1 << IEEE80211_RADIOTAP_ANTENNA) | \
43 (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \
44 (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE))
45
47 struct ieee80211_radiotap_header wt_ihdr;
48 uint8_t wt_flags;
49 uint8_t wt_rate;
50 uint16_t wt_chan_freq;
51 uint16_t wt_chan_flags;
52 uint8_t wt_antenna;
54
55#define RAL_TX_RADIOTAP_PRESENT \
56 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
57 (1 << IEEE80211_RADIOTAP_RATE) | \
58 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
59 (1 << IEEE80211_RADIOTAP_ANTENNA))
60
61struct ural_softc;
62
65 struct ural_softc *sc;
67 struct mbuf *m;
68 struct ieee80211_node *ni;
69 int rate;
70};
71typedef STAILQ_HEAD(, ural_tx_data) ural_txdhead;
72
73struct ural_vap {
74 struct ieee80211vap vap;
75
77 struct task ratectl_task;
78
79 int (*newstate)(struct ieee80211vap *,
80 enum ieee80211_state, int);
81};
82#define URAL_VAP(vap) ((struct ural_vap *)(vap))
83
84enum {
88};
89
90struct ural_softc {
91 struct ieee80211com sc_ic;
92 struct ieee80211_ratectl_tx_stats sc_txs;
93 struct mbufq sc_snd;
94 device_t sc_dev;
96
97 uint32_t asic_rev;
98 uint8_t rf_rev;
99
101
103 ural_txdhead tx_q;
104 ural_txdhead tx_free;
107
108 struct mtx sc_mtx;
109
110 uint16_t sta[11];
111 uint32_t rf_regs[4];
112 uint8_t txpow[14];
113 u_int sc_detached:1,
115
116 uint8_t sc_bssid[IEEE80211_ADDR_LEN];
117
118 struct {
119 uint8_t val;
120 uint8_t reg;
122
128
131};
132
133#define RAL_LOCK(sc) mtx_lock(&(sc)->sc_mtx)
134#define RAL_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx)
135#define RAL_LOCK_ASSERT(sc, t) mtx_assert(&(sc)->sc_mtx, t)
struct ehci_itd * next
Definition: ehci.h:29
typedef STAILQ_HEAD(, ural_tx_data) ural_txdhead
#define RAL_TX_LIST_COUNT
Definition: if_uralvar.h:20
struct ural_tx_radiotap_header __packed
@ URAL_BULK_WR
Definition: if_uralvar.h:85
@ URAL_BULK_RD
Definition: if_uralvar.h:86
@ URAL_N_TRANSFER
Definition: if_uralvar.h:87
struct ural_rx_radiotap_header __aligned(8)
struct ieee80211_radiotap_header wr_ihdr
Definition: if_uralvar.h:28
uint8_t sc_bssid[IEEE80211_ADDR_LEN]
Definition: if_uralvar.h:116
struct ieee80211_ratectl_tx_stats sc_txs
Definition: if_uralvar.h:92
struct mbufq sc_snd
Definition: if_uralvar.h:93
u_int sc_running
Definition: if_uralvar.h:114
struct mtx sc_mtx
Definition: if_uralvar.h:108
struct ural_tx_radiotap_header sc_txtap
Definition: if_uralvar.h:130
uint8_t txpow[14]
Definition: if_uralvar.h:112
struct usb_xfer * sc_xfer[URAL_N_TRANSFER]
Definition: if_uralvar.h:100
uint8_t rf_rev
Definition: if_uralvar.h:98
uint32_t asic_rev
Definition: if_uralvar.h:97
uint32_t rf_regs[4]
Definition: if_uralvar.h:111
ural_txdhead tx_free
Definition: if_uralvar.h:104
uint16_t sta[11]
Definition: if_uralvar.h:110
struct ural_tx_data tx_data[RAL_TX_LIST_COUNT]
Definition: if_uralvar.h:102
int led_mode
Definition: if_uralvar.h:123
int hw_radio
Definition: if_uralvar.h:124
struct usb_device * sc_udev
Definition: if_uralvar.h:95
device_t sc_dev
Definition: if_uralvar.h:94
int tx_nfree
Definition: if_uralvar.h:105
uint8_t reg
Definition: if_uralvar.h:120
struct ural_rx_radiotap_header sc_rxtap
Definition: if_uralvar.h:129
ural_txdhead tx_q
Definition: if_uralvar.h:103
uint8_t val
Definition: if_uralvar.h:119
struct ural_softc::@126 bbp_prom[16]
struct ural_rx_desc sc_rx_desc
Definition: if_uralvar.h:106
struct ieee80211com sc_ic
Definition: if_uralvar.h:91
u_int sc_detached
Definition: if_uralvar.h:113
struct ural_tx_desc desc
Definition: if_uralvar.h:66
struct ieee80211_node * ni
Definition: if_uralvar.h:68
struct mbuf * m
Definition: if_uralvar.h:67
STAILQ_ENTRY(ural_tx_data) next
struct ural_softc * sc
Definition: if_uralvar.h:65
struct ieee80211_radiotap_header wt_ihdr
Definition: if_uralvar.h:47
struct usb_callout ratectl_ch
Definition: if_uralvar.h:76
struct task ratectl_task
Definition: if_uralvar.h:77
struct ieee80211vap vap
Definition: if_uralvar.h:74
int(* newstate)(struct ieee80211vap *, enum ieee80211_state, int)
Definition: if_uralvar.h:79