1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 struct iwi_rx_radiotap_header {
31 struct ieee80211_radiotap_header wr_ihdr;
32 uint8_t wr_flags;
33 uint8_t wr_rate;
34 uint16_t wr_chan_freq;
35 uint16_t wr_chan_flags;
36 uint8_t wr_antsignal;
37 uint8_t wr_antenna;
38 } __packed;
39
40 #define IWI_RX_RADIOTAP_PRESENT \
41 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
42 (1 << IEEE80211_RADIOTAP_RATE) | \
43 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
44 (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \
45 (1 << IEEE80211_RADIOTAP_ANTENNA))
46
47 struct iwi_tx_radiotap_header {
48 struct ieee80211_radiotap_header wt_ihdr;
49 uint8_t wt_flags;
50 uint16_t wt_chan_freq;
51 uint16_t wt_chan_flags;
52 } __packed;
53
54 #define IWI_TX_RADIOTAP_PRESENT \
55 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
56 (1 << IEEE80211_RADIOTAP_CHANNEL))
57
58
59 struct iwi_cmd_ring {
60 bus_dmamap_t map;
61 bus_dma_segment_t seg;
62 struct iwi_cmd_desc desc[IWI_CMD_RING_COUNT];
63 int queued;
64 int cur;
65 int next;
66 };
67
68 struct iwi_tx_data {
69 bus_dmamap_t map;
70 struct mbuf *m;
71 struct ieee80211_node *ni;
72 };
73
74 struct iwi_tx_ring {
75 bus_dmamap_t map;
76 bus_dma_segment_t seg;
77 bus_size_t csr_ridx;
78 bus_size_t csr_widx;
79 struct iwi_tx_desc *desc;
80 struct iwi_tx_data data[IWI_TX_RING_COUNT];
81 int queued;
82 int cur;
83 int next;
84 };
85
86 struct iwi_rx_data {
87 bus_dmamap_t map;
88 struct mbuf *m;
89 uint32_t reg;
90 };
91
92 struct iwi_rx_ring {
93 struct iwi_rx_data data[IWI_RX_RING_COUNT];
94 int cur;
95 };
96
97 struct iwi_softc {
98 struct device sc_dev;
99
100 struct ieee80211com sc_ic;
101 int (*sc_newstate)(struct ieee80211com *,
102 enum ieee80211_state, int);
103
104 uint32_t flags;
105 #define IWI_FLAG_FW_INITED (1 << 0)
106
107 bus_dma_tag_t sc_dmat;
108
109 struct iwi_cmd_ring cmdq;
110 struct iwi_tx_ring txq[4];
111 struct iwi_rx_ring rxq;
112
113 #define IWI_MAX_NODE 32
114 uint8_t sta[IWI_MAX_NODE][IEEE80211_ADDR_LEN];
115 uint8_t nsta;
116
117 bus_space_tag_t sc_st;
118 bus_space_handle_t sc_sh;
119 void *sc_ih;
120 pci_chipset_tag_t sc_pct;
121 pcitag_t sc_pcitag;
122 bus_size_t sc_sz;
123
124 int sc_tx_timer;
125
126 void *powerhook;
127
128 #if NBPFILTER > 0
129 caddr_t sc_drvbpf;
130
131 union {
132 struct iwi_rx_radiotap_header th;
133 uint8_t pad[64];
134 } sc_rxtapu;
135 #define sc_rxtap sc_rxtapu.th
136 int sc_rxtap_len;
137
138 union {
139 struct iwi_tx_radiotap_header th;
140 uint8_t pad[64];
141 } sc_txtapu;
142 #define sc_txtap sc_txtapu.th
143 int sc_txtap_len;
144 #endif
145 };