1 /* $FreeBSD: src/sys/dev/usb/if_uralvar.h,v 1.3.2.3 2006/01/29 14:16:36 damien Exp $ */
2 /* $DragonFly: src/sys/dev/netif/ural/if_uralvar.h,v 1.5 2007/05/27 10:53:29 sephe Exp $ */
5 * Copyright (c) 2005, 2006
6 * Damien Bergamini <damien.bergamini@free.fr>
8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies.
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 #define RAL_RX_LIST_COUNT 1
22 #define RAL_TX_LIST_COUNT 1
24 struct ural_rx_radiotap_header
{
25 struct ieee80211_radiotap_header wr_ihdr
;
28 uint16_t wr_chan_freq
;
29 uint16_t wr_chan_flags
;
34 #define RAL_RX_RADIOTAP_PRESENT \
35 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
36 (1 << IEEE80211_RADIOTAP_RATE) | \
37 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
38 (1 << IEEE80211_RADIOTAP_ANTENNA) | \
39 (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL))
41 struct ural_tx_radiotap_header
{
42 struct ieee80211_radiotap_header wt_ihdr
;
45 uint16_t wt_chan_freq
;
46 uint16_t wt_chan_flags
;
50 #define RAL_TX_RADIOTAP_PRESENT \
51 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
52 (1 << IEEE80211_RADIOTAP_RATE) | \
53 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
54 (1 << IEEE80211_RADIOTAP_ANTENNA))
59 struct ural_softc
*sc
;
60 usbd_xfer_handle xfer
;
63 struct ieee80211_node
*ni
;
67 struct ural_softc
*sc
;
68 usbd_xfer_handle xfer
;
74 struct ieee80211com sc_ic
;
77 int (*sc_newstate
)(struct ieee80211com
*,
78 enum ieee80211_state
, int);
80 usbd_device_handle sc_udev
;
81 usbd_interface_handle sc_iface
;
89 usbd_xfer_handle stats_xfer
;
91 usbd_pipe_handle sc_rx_pipeh
;
92 usbd_pipe_handle sc_tx_pipeh
;
94 enum ieee80211_state sc_state
;
97 struct usb_task sc_task
;
99 struct ural_rx_data rx_data
[RAL_RX_LIST_COUNT
];
100 struct ural_tx_data tx_data
[RAL_TX_LIST_COUNT
];
103 struct ieee80211_beacon_offsets sc_bo
;
105 struct ieee80211_ratectl_stats sc_stats
;
108 struct callout scan_ch
;
109 struct callout stats_ch
;
120 } __packed bbp_prom
[16];
128 struct bpf_if
*sc_drvbpf
;
131 struct ural_rx_radiotap_header th
;
134 #define sc_rxtap sc_rxtapu.th
138 struct ural_tx_radiotap_header th
;
141 #define sc_txtap sc_txtapu.th
146 * Offsets into ural_softc.stap[]
149 * Counters located at RAL_TX_PKT_ are the numbers of packets successfully
150 * or unsuccessfully transmitted. Though you can calculate the number of
151 * transmissions from certain counter (e.g. NO_RETRY, ONE_RETRY and FAIL),
152 * the counters are NOT the number of transmissions (e.g. MULTI_RETRY).
154 #define RAL_TX_PKT_NO_RETRY 6
155 #define RAL_TX_PKT_ONE_RETRY 7
156 #define RAL_TX_PKT_MULTI_RETRY 8
157 #define RAL_TX_PKT_FAIL 9