if_rumvar.h revision 1.1.6.2 1 1.1.6.2 yamt /* $OpenBSD: if_rumvar.h,v 1.6 2006/08/18 15:11:12 damien Exp $ */
2 1.1.6.2 yamt
3 1.1.6.2 yamt /*-
4 1.1.6.2 yamt * Copyright (c) 2005, 2006 Damien Bergamini <damien.bergamini (at) free.fr>
5 1.1.6.2 yamt * Copyright (c) 2006 Niall O'Higgins <niallo (at) openbsd.org>
6 1.1.6.2 yamt *
7 1.1.6.2 yamt * Permission to use, copy, modify, and distribute this software for any
8 1.1.6.2 yamt * purpose with or without fee is hereby granted, provided that the above
9 1.1.6.2 yamt * copyright notice and this permission notice appear in all copies.
10 1.1.6.2 yamt *
11 1.1.6.2 yamt * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 1.1.6.2 yamt * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 1.1.6.2 yamt * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 1.1.6.2 yamt * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 1.1.6.2 yamt * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 1.1.6.2 yamt * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 1.1.6.2 yamt * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 1.1.6.2 yamt */
19 1.1.6.2 yamt
20 1.1.6.2 yamt #define RT2573_RX_LIST_COUNT 1
21 1.1.6.2 yamt #define RT2573_TX_LIST_COUNT 1
22 1.1.6.2 yamt
23 1.1.6.2 yamt struct rum_rx_radiotap_header {
24 1.1.6.2 yamt struct ieee80211_radiotap_header wr_ihdr;
25 1.1.6.2 yamt uint8_t wr_flags;
26 1.1.6.2 yamt uint8_t wr_rate;
27 1.1.6.2 yamt uint16_t wr_chan_freq;
28 1.1.6.2 yamt uint16_t wr_chan_flags;
29 1.1.6.2 yamt uint8_t wr_antenna;
30 1.1.6.2 yamt uint8_t wr_antsignal;
31 1.1.6.2 yamt } __packed;
32 1.1.6.2 yamt
33 1.1.6.2 yamt #define RT2573_RX_RADIOTAP_PRESENT \
34 1.1.6.2 yamt ((1 << IEEE80211_RADIOTAP_FLAGS) | \
35 1.1.6.2 yamt (1 << IEEE80211_RADIOTAP_RATE) | \
36 1.1.6.2 yamt (1 << IEEE80211_RADIOTAP_CHANNEL) | \
37 1.1.6.2 yamt (1 << IEEE80211_RADIOTAP_ANTENNA) | \
38 1.1.6.2 yamt (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL))
39 1.1.6.2 yamt
40 1.1.6.2 yamt struct rum_tx_radiotap_header {
41 1.1.6.2 yamt struct ieee80211_radiotap_header wt_ihdr;
42 1.1.6.2 yamt uint8_t wt_flags;
43 1.1.6.2 yamt uint8_t wt_rate;
44 1.1.6.2 yamt uint16_t wt_chan_freq;
45 1.1.6.2 yamt uint16_t wt_chan_flags;
46 1.1.6.2 yamt uint8_t wt_antenna;
47 1.1.6.2 yamt } __packed;
48 1.1.6.2 yamt
49 1.1.6.2 yamt #define RT2573_TX_RADIOTAP_PRESENT \
50 1.1.6.2 yamt ((1 << IEEE80211_RADIOTAP_FLAGS) | \
51 1.1.6.2 yamt (1 << IEEE80211_RADIOTAP_RATE) | \
52 1.1.6.2 yamt (1 << IEEE80211_RADIOTAP_CHANNEL) | \
53 1.1.6.2 yamt (1 << IEEE80211_RADIOTAP_ANTENNA))
54 1.1.6.2 yamt
55 1.1.6.2 yamt struct rum_softc;
56 1.1.6.2 yamt
57 1.1.6.2 yamt struct rum_tx_data {
58 1.1.6.2 yamt struct rum_softc *sc;
59 1.1.6.2 yamt usbd_xfer_handle xfer;
60 1.1.6.2 yamt uint8_t *buf;
61 1.1.6.2 yamt struct mbuf *m;
62 1.1.6.2 yamt struct ieee80211_node *ni;
63 1.1.6.2 yamt };
64 1.1.6.2 yamt
65 1.1.6.2 yamt struct rum_rx_data {
66 1.1.6.2 yamt struct rum_softc *sc;
67 1.1.6.2 yamt usbd_xfer_handle xfer;
68 1.1.6.2 yamt uint8_t *buf;
69 1.1.6.2 yamt struct mbuf *m;
70 1.1.6.2 yamt };
71 1.1.6.2 yamt
72 1.1.6.2 yamt struct rum_softc {
73 1.1.6.2 yamt USBBASEDEVICE sc_dev;
74 1.1.6.2 yamt struct ethercom sc_ec;
75 1.1.6.2 yamt #define sc_if sc_ec.ec_if
76 1.1.6.2 yamt struct ieee80211com sc_ic;
77 1.1.6.2 yamt int (*sc_newstate)(struct ieee80211com *,
78 1.1.6.2 yamt enum ieee80211_state, int);
79 1.1.6.2 yamt
80 1.1.6.2 yamt usbd_device_handle sc_udev;
81 1.1.6.2 yamt usbd_interface_handle sc_iface;
82 1.1.6.2 yamt int sc_flags;
83 1.1.6.2 yamt #define RT2573_FWLOADED (1 << 0)
84 1.1.6.2 yamt
85 1.1.6.2 yamt struct ieee80211_channel *sc_curchan;
86 1.1.6.2 yamt
87 1.1.6.2 yamt int sc_rx_no;
88 1.1.6.2 yamt int sc_tx_no;
89 1.1.6.2 yamt
90 1.1.6.2 yamt uint16_t macbbp_rev;
91 1.1.6.2 yamt uint8_t rf_rev;
92 1.1.6.2 yamt uint8_t rffreq;
93 1.1.6.2 yamt
94 1.1.6.2 yamt usbd_xfer_handle amrr_xfer;
95 1.1.6.2 yamt
96 1.1.6.2 yamt usbd_pipe_handle sc_rx_pipeh;
97 1.1.6.2 yamt usbd_pipe_handle sc_tx_pipeh;
98 1.1.6.2 yamt
99 1.1.6.2 yamt enum ieee80211_state sc_state;
100 1.1.6.2 yamt struct usb_task sc_task;
101 1.1.6.2 yamt
102 1.1.6.2 yamt struct ieee80211_amrr amrr;
103 1.1.6.2 yamt struct ieee80211_amrr_node amn;
104 1.1.6.2 yamt
105 1.1.6.2 yamt struct rum_rx_data rx_data[RT2573_RX_LIST_COUNT];
106 1.1.6.2 yamt struct rum_tx_data tx_data[RT2573_TX_LIST_COUNT];
107 1.1.6.2 yamt int tx_queued;
108 1.1.6.2 yamt
109 1.1.6.2 yamt struct ieee80211_beacon_offsets sc_bo;
110 1.1.6.2 yamt
111 1.1.6.2 yamt struct callout scan_ch;
112 1.1.6.2 yamt struct callout amrr_ch;
113 1.1.6.2 yamt
114 1.1.6.2 yamt int sc_tx_timer;
115 1.1.6.2 yamt
116 1.1.6.2 yamt uint32_t sta[6];
117 1.1.6.2 yamt uint32_t rf_regs[4];
118 1.1.6.2 yamt uint8_t txpow[44];
119 1.1.6.2 yamt
120 1.1.6.2 yamt struct {
121 1.1.6.2 yamt uint8_t val;
122 1.1.6.2 yamt uint8_t reg;
123 1.1.6.2 yamt } __packed bbp_prom[16];
124 1.1.6.2 yamt
125 1.1.6.2 yamt int hw_radio;
126 1.1.6.2 yamt int rx_ant;
127 1.1.6.2 yamt int tx_ant;
128 1.1.6.2 yamt int nb_ant;
129 1.1.6.2 yamt int ext_2ghz_lna;
130 1.1.6.2 yamt int ext_5ghz_lna;
131 1.1.6.2 yamt int rssi_2ghz_corr;
132 1.1.6.2 yamt int rssi_5ghz_corr;
133 1.1.6.2 yamt int sifs;
134 1.1.6.2 yamt uint8_t bbp17;
135 1.1.6.2 yamt
136 1.1.6.2 yamt #if NBPFILTER > 0
137 1.1.6.2 yamt caddr_t sc_drvbpf;
138 1.1.6.2 yamt
139 1.1.6.2 yamt union {
140 1.1.6.2 yamt struct rum_rx_radiotap_header th;
141 1.1.6.2 yamt uint8_t pad[64];
142 1.1.6.2 yamt } sc_rxtapu;
143 1.1.6.2 yamt #define sc_rxtap sc_rxtapu.th
144 1.1.6.2 yamt int sc_rxtap_len;
145 1.1.6.2 yamt
146 1.1.6.2 yamt union {
147 1.1.6.2 yamt struct rum_tx_radiotap_header th;
148 1.1.6.2 yamt uint8_t pad[64];
149 1.1.6.2 yamt } sc_txtapu;
150 1.1.6.2 yamt #define sc_txtap sc_txtapu.th
151 1.1.6.2 yamt int sc_txtap_len;
152 1.1.6.2 yamt #endif
153 1.1.6.2 yamt };
154