1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #define RUM_RX_LIST_COUNT 1
21 #define RUM_TX_LIST_COUNT 8
22
23 struct rum_rx_radiotap_header {
24 struct ieee80211_radiotap_header wr_ihdr;
25 uint8_t wr_flags;
26 uint8_t wr_rate;
27 uint16_t wr_chan_freq;
28 uint16_t wr_chan_flags;
29 uint8_t wr_antenna;
30 uint8_t wr_antsignal;
31 } __packed;
32
33 #define RT2573_RX_RADIOTAP_PRESENT \
34 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
35 (1 << IEEE80211_RADIOTAP_RATE) | \
36 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
37 (1 << IEEE80211_RADIOTAP_ANTENNA) | \
38 (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL))
39
40 struct rum_tx_radiotap_header {
41 struct ieee80211_radiotap_header wt_ihdr;
42 uint8_t wt_flags;
43 uint8_t wt_rate;
44 uint16_t wt_chan_freq;
45 uint16_t wt_chan_flags;
46 uint8_t wt_antenna;
47 } __packed;
48
49 #define RT2573_TX_RADIOTAP_PRESENT \
50 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
51 (1 << IEEE80211_RADIOTAP_RATE) | \
52 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
53 (1 << IEEE80211_RADIOTAP_ANTENNA))
54
55 struct rum_softc;
56
57 struct rum_tx_data {
58 struct rum_softc *sc;
59 usbd_xfer_handle xfer;
60 uint8_t *buf;
61 struct ieee80211_node *ni;
62 };
63
64 struct rum_rx_data {
65 struct rum_softc *sc;
66 usbd_xfer_handle xfer;
67 uint8_t *buf;
68 struct mbuf *m;
69 };
70
71 struct rum_softc {
72 struct device sc_dev;
73 struct ieee80211com sc_ic;
74 int (*sc_newstate)(struct ieee80211com *,
75 enum ieee80211_state, int);
76
77 usbd_device_handle sc_udev;
78 usbd_interface_handle sc_iface;
79
80 struct ieee80211_channel *sc_curchan;
81
82 int sc_rx_no;
83 int sc_tx_no;
84
85 uint16_t macbbp_rev;
86 uint8_t rf_rev;
87 uint8_t rffreq;
88
89 usbd_xfer_handle amrr_xfer;
90
91 usbd_pipe_handle sc_rx_pipeh;
92 usbd_pipe_handle sc_tx_pipeh;
93
94 enum ieee80211_state sc_state;
95 int sc_arg;
96 struct usb_task sc_task;
97
98 struct ieee80211_amrr amrr;
99 struct ieee80211_amrr_node amn;
100
101 struct rum_rx_data rx_data[RUM_RX_LIST_COUNT];
102 struct rum_tx_data tx_data[RUM_TX_LIST_COUNT];
103 int tx_queued;
104 int tx_cur;
105
106 struct timeout scan_to;
107 struct timeout amrr_to;
108
109 int sc_tx_timer;
110
111 uint32_t sta[6];
112 uint32_t rf_regs[4];
113 uint8_t txpow[44];
114
115 struct {
116 uint8_t val;
117 uint8_t reg;
118 } __packed bbp_prom[16];
119
120 int hw_radio;
121 int rx_ant;
122 int tx_ant;
123 int nb_ant;
124 int ext_2ghz_lna;
125 int ext_5ghz_lna;
126 int rssi_2ghz_corr;
127 int rssi_5ghz_corr;
128 int sifs;
129 uint8_t bbp17;
130
131 #if NBPFILTER > 0
132 caddr_t sc_drvbpf;
133
134 union {
135 struct rum_rx_radiotap_header th;
136 uint8_t pad[64];
137 } sc_rxtapu;
138 #define sc_rxtap sc_rxtapu.th
139 int sc_rxtap_len;
140
141 union {
142 struct rum_tx_radiotap_header th;
143 uint8_t pad[64];
144 } sc_txtapu;
145 #define sc_txtap sc_txtapu.th
146 int sc_txtap_len;
147 #endif
148 };