diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-04-19 12:17:34 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-19 12:17:34 -0400 |
commit | cf816ecb533ab96b883dfdc0db174598b5b5c4d2 (patch) | |
tree | 1b7705db288ae2917105e624b01fdf81e0882bf1 /include/net/mac80211.h | |
parent | adf6d34e460387ee3e8f1e1875d52bff51212c7d (diff) | |
parent | 15f7d677ccff6f0f5de8a1ee43a792567e9f9de9 (diff) |
Merge branch 'merge-fixes' into devel
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 560 |
1 files changed, 341 insertions, 219 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 9083bafb63ca..4a80d74975e8 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -38,7 +38,11 @@ | |||
38 | * called in hardware interrupt context. The low-level driver must not call any | 38 | * called in hardware interrupt context. The low-level driver must not call any |
39 | * other functions in hardware interrupt context. If there is a need for such | 39 | * other functions in hardware interrupt context. If there is a need for such |
40 | * call, the low-level driver should first ACK the interrupt and perform the | 40 | * call, the low-level driver should first ACK the interrupt and perform the |
41 | * IEEE 802.11 code call after this, e.g. from a scheduled workqueue function. | 41 | * IEEE 802.11 code call after this, e.g. from a scheduled workqueue or even |
42 | * tasklet function. | ||
43 | * | ||
44 | * NOTE: If the driver opts to use the _irqsafe() functions, it may not also | ||
45 | * use the non-irqsafe functions! | ||
42 | */ | 46 | */ |
43 | 47 | ||
44 | /** | 48 | /** |
@@ -69,93 +73,12 @@ | |||
69 | * not do so then mac80211 may add this under certain circumstances. | 73 | * not do so then mac80211 may add this under certain circumstances. |
70 | */ | 74 | */ |
71 | 75 | ||
72 | #define IEEE80211_CHAN_W_SCAN 0x00000001 | ||
73 | #define IEEE80211_CHAN_W_ACTIVE_SCAN 0x00000002 | ||
74 | #define IEEE80211_CHAN_W_IBSS 0x00000004 | ||
75 | |||
76 | /* Channel information structure. Low-level driver is expected to fill in chan, | ||
77 | * freq, and val fields. Other fields will be filled in by 80211.o based on | ||
78 | * hostapd information and low-level driver does not need to use them. The | ||
79 | * limits for each channel will be provided in 'struct ieee80211_conf' when | ||
80 | * configuring the low-level driver with hw->config callback. If a device has | ||
81 | * a default regulatory domain, IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED | ||
82 | * can be set to let the driver configure all fields */ | ||
83 | struct ieee80211_channel { | ||
84 | short chan; /* channel number (IEEE 802.11) */ | ||
85 | short freq; /* frequency in MHz */ | ||
86 | int val; /* hw specific value for the channel */ | ||
87 | int flag; /* flag for hostapd use (IEEE80211_CHAN_*) */ | ||
88 | unsigned char power_level; | ||
89 | unsigned char antenna_max; | ||
90 | }; | ||
91 | |||
92 | #define IEEE80211_RATE_ERP 0x00000001 | ||
93 | #define IEEE80211_RATE_BASIC 0x00000002 | ||
94 | #define IEEE80211_RATE_PREAMBLE2 0x00000004 | ||
95 | #define IEEE80211_RATE_SUPPORTED 0x00000010 | ||
96 | #define IEEE80211_RATE_OFDM 0x00000020 | ||
97 | #define IEEE80211_RATE_CCK 0x00000040 | ||
98 | #define IEEE80211_RATE_MANDATORY 0x00000100 | ||
99 | |||
100 | #define IEEE80211_RATE_CCK_2 (IEEE80211_RATE_CCK | IEEE80211_RATE_PREAMBLE2) | ||
101 | #define IEEE80211_RATE_MODULATION(f) \ | ||
102 | (f & (IEEE80211_RATE_CCK | IEEE80211_RATE_OFDM)) | ||
103 | |||
104 | /* Low-level driver should set PREAMBLE2, OFDM and CCK flags. | ||
105 | * BASIC, SUPPORTED, ERP, and MANDATORY flags are set in 80211.o based on the | ||
106 | * configuration. */ | ||
107 | struct ieee80211_rate { | ||
108 | int rate; /* rate in 100 kbps */ | ||
109 | int val; /* hw specific value for the rate */ | ||
110 | int flags; /* IEEE80211_RATE_ flags */ | ||
111 | int val2; /* hw specific value for the rate when using short preamble | ||
112 | * (only when IEEE80211_RATE_PREAMBLE2 flag is set, i.e., for | ||
113 | * 2, 5.5, and 11 Mbps) */ | ||
114 | signed char min_rssi_ack; | ||
115 | unsigned char min_rssi_ack_delta; | ||
116 | |||
117 | /* following fields are set by 80211.o and need not be filled by the | ||
118 | * low-level driver */ | ||
119 | int rate_inv; /* inverse of the rate (LCM(all rates) / rate) for | ||
120 | * optimizing channel utilization estimates */ | ||
121 | }; | ||
122 | |||
123 | /** | 76 | /** |
124 | * enum ieee80211_phymode - PHY modes | 77 | * enum ieee80211_notification_type - Low level driver notification |
125 | * | 78 | * @IEEE80211_NOTIFY_RE_ASSOC: start the re-association sequence |
126 | * @MODE_IEEE80211A: 5GHz as defined by 802.11a/802.11h | ||
127 | * @MODE_IEEE80211B: 2.4 GHz as defined by 802.11b | ||
128 | * @MODE_IEEE80211G: 2.4 GHz as defined by 802.11g (with OFDM), | ||
129 | * backwards compatible with 11b mode | ||
130 | * @NUM_IEEE80211_MODES: internal | ||
131 | */ | 79 | */ |
132 | enum ieee80211_phymode { | 80 | enum ieee80211_notification_types { |
133 | MODE_IEEE80211A, | 81 | IEEE80211_NOTIFY_RE_ASSOC, |
134 | MODE_IEEE80211B, | ||
135 | MODE_IEEE80211G, | ||
136 | |||
137 | /* keep last */ | ||
138 | NUM_IEEE80211_MODES | ||
139 | }; | ||
140 | |||
141 | /** | ||
142 | * struct ieee80211_ht_info - describing STA's HT capabilities | ||
143 | * | ||
144 | * This structure describes most essential parameters needed | ||
145 | * to describe 802.11n HT capabilities for an STA. | ||
146 | * | ||
147 | * @ht_supported: is HT supported by STA, 0: no, 1: yes | ||
148 | * @cap: HT capabilities map as described in 802.11n spec | ||
149 | * @ampdu_factor: Maximum A-MPDU length factor | ||
150 | * @ampdu_density: Minimum A-MPDU spacing | ||
151 | * @supp_mcs_set: Supported MCS set as described in 802.11n spec | ||
152 | */ | ||
153 | struct ieee80211_ht_info { | ||
154 | u8 ht_supported; | ||
155 | u16 cap; /* use IEEE80211_HT_CAP_ */ | ||
156 | u8 ampdu_factor; | ||
157 | u8 ampdu_density; | ||
158 | u8 supp_mcs_set[16]; | ||
159 | }; | 82 | }; |
160 | 83 | ||
161 | /** | 84 | /** |
@@ -175,46 +98,22 @@ struct ieee80211_ht_bss_info { | |||
175 | }; | 98 | }; |
176 | 99 | ||
177 | /** | 100 | /** |
178 | * struct ieee80211_hw_mode - PHY mode definition | ||
179 | * | ||
180 | * This structure describes the capabilities supported by the device | ||
181 | * in a single PHY mode. | ||
182 | * | ||
183 | * @list: internal | ||
184 | * @channels: pointer to array of supported channels | ||
185 | * @rates: pointer to array of supported bitrates | ||
186 | * @mode: the PHY mode for this definition | ||
187 | * @num_channels: number of supported channels | ||
188 | * @num_rates: number of supported bitrates | ||
189 | * @ht_info: PHY's 802.11n HT abilities for this mode | ||
190 | */ | ||
191 | struct ieee80211_hw_mode { | ||
192 | struct list_head list; | ||
193 | struct ieee80211_channel *channels; | ||
194 | struct ieee80211_rate *rates; | ||
195 | enum ieee80211_phymode mode; | ||
196 | int num_channels; | ||
197 | int num_rates; | ||
198 | struct ieee80211_ht_info ht_info; | ||
199 | }; | ||
200 | |||
201 | /** | ||
202 | * struct ieee80211_tx_queue_params - transmit queue configuration | 101 | * struct ieee80211_tx_queue_params - transmit queue configuration |
203 | * | 102 | * |
204 | * The information provided in this structure is required for QoS | 103 | * The information provided in this structure is required for QoS |
205 | * transmit queue configuration. | 104 | * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29. |
206 | * | 105 | * |
207 | * @aifs: arbitration interface space [0..255, -1: use default] | 106 | * @aifs: arbitration interface space [0..255, -1: use default] |
208 | * @cw_min: minimum contention window [will be a value of the form | 107 | * @cw_min: minimum contention window [will be a value of the form |
209 | * 2^n-1 in the range 1..1023; 0: use default] | 108 | * 2^n-1 in the range 1..1023; 0: use default] |
210 | * @cw_max: maximum contention window [like @cw_min] | 109 | * @cw_max: maximum contention window [like @cw_min] |
211 | * @burst_time: maximum burst time in units of 0.1ms, 0 meaning disabled | 110 | * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled |
212 | */ | 111 | */ |
213 | struct ieee80211_tx_queue_params { | 112 | struct ieee80211_tx_queue_params { |
214 | int aifs; | 113 | s16 aifs; |
215 | int cw_min; | 114 | u16 cw_min; |
216 | int cw_max; | 115 | u16 cw_max; |
217 | int burst_time; | 116 | u16 txop; |
218 | }; | 117 | }; |
219 | 118 | ||
220 | /** | 119 | /** |
@@ -246,6 +145,7 @@ struct ieee80211_tx_queue_stats_data { | |||
246 | * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be | 145 | * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be |
247 | * sent after a beacon | 146 | * sent after a beacon |
248 | * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames | 147 | * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames |
148 | * @NUM_TX_DATA_QUEUES_AMPDU: adding more queues for A-MPDU | ||
249 | */ | 149 | */ |
250 | enum ieee80211_tx_queue { | 150 | enum ieee80211_tx_queue { |
251 | IEEE80211_TX_QUEUE_DATA0, | 151 | IEEE80211_TX_QUEUE_DATA0, |
@@ -261,11 +161,12 @@ enum ieee80211_tx_queue { | |||
261 | * this struct need to have fixed values. As soon as it is removed, we can | 161 | * this struct need to have fixed values. As soon as it is removed, we can |
262 | * fix these entries. */ | 162 | * fix these entries. */ |
263 | IEEE80211_TX_QUEUE_AFTER_BEACON = 6, | 163 | IEEE80211_TX_QUEUE_AFTER_BEACON = 6, |
264 | IEEE80211_TX_QUEUE_BEACON = 7 | 164 | IEEE80211_TX_QUEUE_BEACON = 7, |
165 | NUM_TX_DATA_QUEUES_AMPDU = 16 | ||
265 | }; | 166 | }; |
266 | 167 | ||
267 | struct ieee80211_tx_queue_stats { | 168 | struct ieee80211_tx_queue_stats { |
268 | struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES]; | 169 | struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES_AMPDU]; |
269 | }; | 170 | }; |
270 | 171 | ||
271 | struct ieee80211_low_level_stats { | 172 | struct ieee80211_low_level_stats { |
@@ -285,11 +186,13 @@ struct ieee80211_low_level_stats { | |||
285 | * also implies a change in the AID. | 186 | * also implies a change in the AID. |
286 | * @BSS_CHANGED_ERP_CTS_PROT: CTS protection changed | 187 | * @BSS_CHANGED_ERP_CTS_PROT: CTS protection changed |
287 | * @BSS_CHANGED_ERP_PREAMBLE: preamble changed | 188 | * @BSS_CHANGED_ERP_PREAMBLE: preamble changed |
189 | * @BSS_CHANGED_HT: 802.11n parameters changed | ||
288 | */ | 190 | */ |
289 | enum ieee80211_bss_change { | 191 | enum ieee80211_bss_change { |
290 | BSS_CHANGED_ASSOC = 1<<0, | 192 | BSS_CHANGED_ASSOC = 1<<0, |
291 | BSS_CHANGED_ERP_CTS_PROT = 1<<1, | 193 | BSS_CHANGED_ERP_CTS_PROT = 1<<1, |
292 | BSS_CHANGED_ERP_PREAMBLE = 1<<2, | 194 | BSS_CHANGED_ERP_PREAMBLE = 1<<2, |
195 | BSS_CHANGED_HT = 1<<4, | ||
293 | }; | 196 | }; |
294 | 197 | ||
295 | /** | 198 | /** |
@@ -302,6 +205,12 @@ enum ieee80211_bss_change { | |||
302 | * @aid: association ID number, valid only when @assoc is true | 205 | * @aid: association ID number, valid only when @assoc is true |
303 | * @use_cts_prot: use CTS protection | 206 | * @use_cts_prot: use CTS protection |
304 | * @use_short_preamble: use 802.11b short preamble | 207 | * @use_short_preamble: use 802.11b short preamble |
208 | * @timestamp: beacon timestamp | ||
209 | * @beacon_int: beacon interval | ||
210 | * @assoc_capability: capabbilities taken from assoc resp | ||
211 | * @assoc_ht: association in HT mode | ||
212 | * @ht_conf: ht capabilities | ||
213 | * @ht_bss_conf: ht extended capabilities | ||
305 | */ | 214 | */ |
306 | struct ieee80211_bss_conf { | 215 | struct ieee80211_bss_conf { |
307 | /* association related data */ | 216 | /* association related data */ |
@@ -310,6 +219,69 @@ struct ieee80211_bss_conf { | |||
310 | /* erp related data */ | 219 | /* erp related data */ |
311 | bool use_cts_prot; | 220 | bool use_cts_prot; |
312 | bool use_short_preamble; | 221 | bool use_short_preamble; |
222 | u16 beacon_int; | ||
223 | u16 assoc_capability; | ||
224 | u64 timestamp; | ||
225 | /* ht related data */ | ||
226 | bool assoc_ht; | ||
227 | struct ieee80211_ht_info *ht_conf; | ||
228 | struct ieee80211_ht_bss_info *ht_bss_conf; | ||
229 | }; | ||
230 | |||
231 | /** | ||
232 | * enum mac80211_tx_control_flags - flags to describe Tx configuration for | ||
233 | * the Tx frame | ||
234 | * | ||
235 | * These flags are used with the @flags member of &ieee80211_tx_control | ||
236 | * | ||
237 | * @IEEE80211_TXCTL_REQ_TX_STATUS: request TX status callback for this frame. | ||
238 | * @IEEE80211_TXCTL_DO_NOT_ENCRYPT: send this frame without encryption; | ||
239 | * e.g., for EAPOL frame | ||
240 | * @IEEE80211_TXCTL_USE_RTS_CTS: use RTS-CTS before sending frame | ||
241 | * @IEEE80211_TXCTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g., | ||
242 | * for combined 802.11g / 802.11b networks) | ||
243 | * @IEEE80211_TXCTL_NO_ACK: tell the low level not to wait for an ack | ||
244 | * @IEEE80211_TXCTL_RATE_CTRL_PROBE | ||
245 | * @EEE80211_TXCTL_CLEAR_PS_FILT: clear powersave filter | ||
246 | * for destination station | ||
247 | * @IEEE80211_TXCTL_REQUEUE: | ||
248 | * @IEEE80211_TXCTL_FIRST_FRAGMENT: this is a first fragment of the frame | ||
249 | * @IEEE80211_TXCTL_LONG_RETRY_LIMIT: this frame should be send using the | ||
250 | * through set_retry_limit configured long | ||
251 | * retry value | ||
252 | * @IEEE80211_TXCTL_EAPOL_FRAME: internal to mac80211 | ||
253 | * @IEEE80211_TXCTL_SEND_AFTER_DTIM: send this frame after DTIM beacon | ||
254 | * @IEEE80211_TXCTL_AMPDU: this frame should be sent as part of an A-MPDU | ||
255 | * @IEEE80211_TXCTL_OFDM_HT: this frame can be sent in HT OFDM rates. number | ||
256 | * of streams when this flag is on can be extracted | ||
257 | * from antenna_sel_tx, so if 1 antenna is marked | ||
258 | * use SISO, 2 antennas marked use MIMO, n antennas | ||
259 | * marked use MIMO_n. | ||
260 | * @IEEE80211_TXCTL_GREEN_FIELD: use green field protection for this frame | ||
261 | * @IEEE80211_TXCTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width | ||
262 | * @IEEE80211_TXCTL_DUP_DATA: duplicate data frame on both 20 Mhz channels | ||
263 | * @IEEE80211_TXCTL_SHORT_GI: send this frame using short guard interval | ||
264 | */ | ||
265 | enum mac80211_tx_control_flags { | ||
266 | IEEE80211_TXCTL_REQ_TX_STATUS = (1<<0), | ||
267 | IEEE80211_TXCTL_DO_NOT_ENCRYPT = (1<<1), | ||
268 | IEEE80211_TXCTL_USE_RTS_CTS = (1<<2), | ||
269 | IEEE80211_TXCTL_USE_CTS_PROTECT = (1<<3), | ||
270 | IEEE80211_TXCTL_NO_ACK = (1<<4), | ||
271 | IEEE80211_TXCTL_RATE_CTRL_PROBE = (1<<5), | ||
272 | IEEE80211_TXCTL_CLEAR_PS_FILT = (1<<6), | ||
273 | IEEE80211_TXCTL_REQUEUE = (1<<7), | ||
274 | IEEE80211_TXCTL_FIRST_FRAGMENT = (1<<8), | ||
275 | IEEE80211_TXCTL_SHORT_PREAMBLE = (1<<9), | ||
276 | IEEE80211_TXCTL_LONG_RETRY_LIMIT = (1<<10), | ||
277 | IEEE80211_TXCTL_EAPOL_FRAME = (1<<11), | ||
278 | IEEE80211_TXCTL_SEND_AFTER_DTIM = (1<<12), | ||
279 | IEEE80211_TXCTL_AMPDU = (1<<13), | ||
280 | IEEE80211_TXCTL_OFDM_HT = (1<<14), | ||
281 | IEEE80211_TXCTL_GREEN_FIELD = (1<<15), | ||
282 | IEEE80211_TXCTL_40_MHZ_WIDTH = (1<<16), | ||
283 | IEEE80211_TXCTL_DUP_DATA = (1<<17), | ||
284 | IEEE80211_TXCTL_SHORT_GI = (1<<18), | ||
313 | }; | 285 | }; |
314 | 286 | ||
315 | /* Transmit control fields. This data structure is passed to low-level driver | 287 | /* Transmit control fields. This data structure is passed to low-level driver |
@@ -318,57 +290,27 @@ struct ieee80211_bss_conf { | |||
318 | 290 | ||
319 | struct ieee80211_tx_control { | 291 | struct ieee80211_tx_control { |
320 | struct ieee80211_vif *vif; | 292 | struct ieee80211_vif *vif; |
321 | int tx_rate; /* Transmit rate, given as the hw specific value for the | 293 | struct ieee80211_rate *tx_rate; |
322 | * rate (from struct ieee80211_rate) */ | 294 | |
323 | int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw | 295 | /* Transmit rate for RTS/CTS frame */ |
324 | * specific value for the rate (from | 296 | struct ieee80211_rate *rts_cts_rate; |
325 | * struct ieee80211_rate) */ | 297 | |
326 | 298 | /* retry rate for the last retries */ | |
327 | #define IEEE80211_TXCTL_REQ_TX_STATUS (1<<0)/* request TX status callback for | 299 | struct ieee80211_rate *alt_retry_rate; |
328 | * this frame */ | 300 | |
329 | #define IEEE80211_TXCTL_DO_NOT_ENCRYPT (1<<1) /* send this frame without | 301 | u32 flags; /* tx control flags defined above */ |
330 | * encryption; e.g., for EAPOL | ||
331 | * frames */ | ||
332 | #define IEEE80211_TXCTL_USE_RTS_CTS (1<<2) /* use RTS-CTS before sending | ||
333 | * frame */ | ||
334 | #define IEEE80211_TXCTL_USE_CTS_PROTECT (1<<3) /* use CTS protection for the | ||
335 | * frame (e.g., for combined | ||
336 | * 802.11g / 802.11b networks) */ | ||
337 | #define IEEE80211_TXCTL_NO_ACK (1<<4) /* tell the low level not to | ||
338 | * wait for an ack */ | ||
339 | #define IEEE80211_TXCTL_RATE_CTRL_PROBE (1<<5) | ||
340 | #define IEEE80211_TXCTL_CLEAR_DST_MASK (1<<6) | ||
341 | #define IEEE80211_TXCTL_REQUEUE (1<<7) | ||
342 | #define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of | ||
343 | * the frame */ | ||
344 | #define IEEE80211_TXCTL_LONG_RETRY_LIMIT (1<<10) /* this frame should be send | ||
345 | * using the through | ||
346 | * set_retry_limit configured | ||
347 | * long retry value */ | ||
348 | #define IEEE80211_TXCTL_EAPOL_FRAME (1<<11) /* internal to mac80211 */ | ||
349 | #define IEEE80211_TXCTL_SEND_AFTER_DTIM (1<<12) /* send this frame after DTIM | ||
350 | * beacon */ | ||
351 | u32 flags; /* tx control flags defined | ||
352 | * above */ | ||
353 | u8 key_idx; /* keyidx from hw->set_key(), undefined if | 302 | u8 key_idx; /* keyidx from hw->set_key(), undefined if |
354 | * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ | 303 | * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ |
355 | u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. | 304 | u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. |
356 | * This could be used when set_retry_limit | 305 | * This could be used when set_retry_limit |
357 | * is not implemented by the driver */ | 306 | * is not implemented by the driver */ |
358 | u8 power_level; /* per-packet transmit power level, in dBm */ | 307 | u8 antenna_sel_tx; /* 0 = default/diversity, otherwise bit |
359 | u8 antenna_sel_tx; /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */ | 308 | * position represents antenna number used */ |
360 | u8 icv_len; /* length of the ICV/MIC field in octets */ | 309 | u8 icv_len; /* length of the ICV/MIC field in octets */ |
361 | u8 iv_len; /* length of the IV field in octets */ | 310 | u8 iv_len; /* length of the IV field in octets */ |
362 | u8 queue; /* hardware queue to use for this frame; | 311 | u8 queue; /* hardware queue to use for this frame; |
363 | * 0 = highest, hw->queues-1 = lowest */ | 312 | * 0 = highest, hw->queues-1 = lowest */ |
364 | struct ieee80211_rate *rate; /* internal 80211.o rate */ | 313 | u16 aid; /* Station AID */ |
365 | struct ieee80211_rate *rts_rate; /* internal 80211.o rate | ||
366 | * for RTS/CTS */ | ||
367 | int alt_retry_rate; /* retry rate for the last retries, given as the | ||
368 | * hw specific value for the rate (from | ||
369 | * struct ieee80211_rate). To be used to limit | ||
370 | * packet dropping when probing higher rates, if hw | ||
371 | * supports multiple retry rates. -1 = not used */ | ||
372 | int type; /* internal */ | 314 | int type; /* internal */ |
373 | }; | 315 | }; |
374 | 316 | ||
@@ -391,7 +333,8 @@ struct ieee80211_tx_control { | |||
391 | * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on | 333 | * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on |
392 | * the frame. | 334 | * the frame. |
393 | * @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field) | 335 | * @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field) |
394 | * is valid. | 336 | * is valid. This is useful in monitor mode and necessary for beacon frames |
337 | * to enable IBSS merging. | ||
395 | */ | 338 | */ |
396 | enum mac80211_rx_flags { | 339 | enum mac80211_rx_flags { |
397 | RX_FLAG_MMIC_ERROR = 1<<0, | 340 | RX_FLAG_MMIC_ERROR = 1<<0, |
@@ -410,27 +353,26 @@ enum mac80211_rx_flags { | |||
410 | * The low-level driver should provide this information (the subset | 353 | * The low-level driver should provide this information (the subset |
411 | * supported by hardware) to the 802.11 code with each received | 354 | * supported by hardware) to the 802.11 code with each received |
412 | * frame. | 355 | * frame. |
413 | * @mactime: MAC timestamp as defined by 802.11 | 356 | * @mactime: value in microseconds of the 64-bit Time Synchronization Function |
357 | * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. | ||
358 | * @band: the active band when this frame was received | ||
414 | * @freq: frequency the radio was tuned to when receiving this frame, in MHz | 359 | * @freq: frequency the radio was tuned to when receiving this frame, in MHz |
415 | * @channel: channel the radio was tuned to | ||
416 | * @phymode: active PHY mode | ||
417 | * @ssi: signal strength when receiving this frame | 360 | * @ssi: signal strength when receiving this frame |
418 | * @signal: used as 'qual' in statistics reporting | 361 | * @signal: used as 'qual' in statistics reporting |
419 | * @noise: PHY noise when receiving this frame | 362 | * @noise: PHY noise when receiving this frame |
420 | * @antenna: antenna used | 363 | * @antenna: antenna used |
421 | * @rate: data rate | 364 | * @rate_idx: index of data rate into band's supported rates |
422 | * @flag: %RX_FLAG_* | 365 | * @flag: %RX_FLAG_* |
423 | */ | 366 | */ |
424 | struct ieee80211_rx_status { | 367 | struct ieee80211_rx_status { |
425 | u64 mactime; | 368 | u64 mactime; |
369 | enum ieee80211_band band; | ||
426 | int freq; | 370 | int freq; |
427 | int channel; | ||
428 | enum ieee80211_phymode phymode; | ||
429 | int ssi; | 371 | int ssi; |
430 | int signal; | 372 | int signal; |
431 | int noise; | 373 | int noise; |
432 | int antenna; | 374 | int antenna; |
433 | int rate; | 375 | int rate_idx; |
434 | int flag; | 376 | int flag; |
435 | }; | 377 | }; |
436 | 378 | ||
@@ -441,12 +383,14 @@ struct ieee80211_rx_status { | |||
441 | * | 383 | * |
442 | * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted | 384 | * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted |
443 | * because the destination STA was in powersave mode. | 385 | * because the destination STA was in powersave mode. |
444 | * | ||
445 | * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged | 386 | * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged |
387 | * @IEEE80211_TX_STATUS_AMPDU: The frame was aggregated, so status | ||
388 | * is for the whole aggregation. | ||
446 | */ | 389 | */ |
447 | enum ieee80211_tx_status_flags { | 390 | enum ieee80211_tx_status_flags { |
448 | IEEE80211_TX_STATUS_TX_FILTERED = 1<<0, | 391 | IEEE80211_TX_STATUS_TX_FILTERED = 1<<0, |
449 | IEEE80211_TX_STATUS_ACK = 1<<1, | 392 | IEEE80211_TX_STATUS_ACK = 1<<1, |
393 | IEEE80211_TX_STATUS_AMPDU = 1<<2, | ||
450 | }; | 394 | }; |
451 | 395 | ||
452 | /** | 396 | /** |
@@ -457,24 +401,25 @@ enum ieee80211_tx_status_flags { | |||
457 | * | 401 | * |
458 | * @control: a copy of the &struct ieee80211_tx_control passed to the driver | 402 | * @control: a copy of the &struct ieee80211_tx_control passed to the driver |
459 | * in the tx() callback. | 403 | * in the tx() callback. |
460 | * | ||
461 | * @flags: transmit status flags, defined above | 404 | * @flags: transmit status flags, defined above |
462 | * | 405 | * @retry_count: number of retries |
463 | * @ack_signal: signal strength of the ACK frame | ||
464 | * | ||
465 | * @excessive_retries: set to 1 if the frame was retried many times | 406 | * @excessive_retries: set to 1 if the frame was retried many times |
466 | * but not acknowledged | 407 | * but not acknowledged |
467 | * | 408 | * @ampdu_ack_len: number of aggregated frames. |
468 | * @retry_count: number of retries | 409 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. |
469 | * | 410 | * @ampdu_ack_map: block ack bit map for the aggregation. |
411 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
412 | * @ack_signal: signal strength of the ACK frame | ||
470 | * @queue_length: ?? REMOVE | 413 | * @queue_length: ?? REMOVE |
471 | * @queue_number: ?? REMOVE | 414 | * @queue_number: ?? REMOVE |
472 | */ | 415 | */ |
473 | struct ieee80211_tx_status { | 416 | struct ieee80211_tx_status { |
474 | struct ieee80211_tx_control control; | 417 | struct ieee80211_tx_control control; |
475 | u8 flags; | 418 | u8 flags; |
476 | bool excessive_retries; | ||
477 | u8 retry_count; | 419 | u8 retry_count; |
420 | bool excessive_retries; | ||
421 | u8 ampdu_ack_len; | ||
422 | u64 ampdu_ack_map; | ||
478 | int ack_signal; | 423 | int ack_signal; |
479 | int queue_length; | 424 | int queue_length; |
480 | int queue_number; | 425 | int queue_number; |
@@ -502,41 +447,29 @@ enum ieee80211_conf_flags { | |||
502 | * | 447 | * |
503 | * @radio_enabled: when zero, driver is required to switch off the radio. | 448 | * @radio_enabled: when zero, driver is required to switch off the radio. |
504 | * TODO make a flag | 449 | * TODO make a flag |
505 | * @channel: IEEE 802.11 channel number | ||
506 | * @freq: frequency in MHz | ||
507 | * @channel_val: hardware specific channel value for the channel | ||
508 | * @phymode: PHY mode to activate (REMOVE) | ||
509 | * @chan: channel to switch to, pointer to the channel information | ||
510 | * @mode: pointer to mode definition | ||
511 | * @regulatory_domain: ?? | ||
512 | * @beacon_int: beacon interval (TODO make interface config) | 450 | * @beacon_int: beacon interval (TODO make interface config) |
513 | * @flags: configuration flags defined above | 451 | * @flags: configuration flags defined above |
514 | * @power_level: transmit power limit for current regulatory domain in dBm | 452 | * @power_level: requested transmit power (in dBm) |
515 | * @antenna_max: maximum antenna gain | 453 | * @max_antenna_gain: maximum antenna gain (in dBi) |
516 | * @antenna_sel_tx: transmit antenna selection, 0: default/diversity, | 454 | * @antenna_sel_tx: transmit antenna selection, 0: default/diversity, |
517 | * 1/2: antenna 0/1 | 455 | * 1/2: antenna 0/1 |
518 | * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx | 456 | * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx |
519 | * @ht_conf: describes current self configuration of 802.11n HT capabilies | 457 | * @ht_conf: describes current self configuration of 802.11n HT capabilies |
520 | * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters | 458 | * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters |
459 | * @channel: the channel to tune to | ||
521 | */ | 460 | */ |
522 | struct ieee80211_conf { | 461 | struct ieee80211_conf { |
523 | int channel; /* IEEE 802.11 channel number */ | ||
524 | int freq; /* MHz */ | ||
525 | int channel_val; /* hw specific value for the channel */ | ||
526 | |||
527 | enum ieee80211_phymode phymode; | ||
528 | struct ieee80211_channel *chan; | ||
529 | struct ieee80211_hw_mode *mode; | ||
530 | unsigned int regulatory_domain; | ||
531 | int radio_enabled; | 462 | int radio_enabled; |
532 | 463 | ||
533 | int beacon_int; | 464 | int beacon_int; |
534 | u32 flags; | 465 | u32 flags; |
535 | u8 power_level; | 466 | int power_level; |
536 | u8 antenna_max; | 467 | int max_antenna_gain; |
537 | u8 antenna_sel_tx; | 468 | u8 antenna_sel_tx; |
538 | u8 antenna_sel_rx; | 469 | u8 antenna_sel_rx; |
539 | 470 | ||
471 | struct ieee80211_channel *channel; | ||
472 | |||
540 | struct ieee80211_ht_info ht_conf; | 473 | struct ieee80211_ht_info ht_conf; |
541 | struct ieee80211_ht_bss_info ht_bss_conf; | 474 | struct ieee80211_ht_bss_info ht_bss_conf; |
542 | }; | 475 | }; |
@@ -555,12 +488,14 @@ struct ieee80211_conf { | |||
555 | * @IEEE80211_IF_TYPE_WDS: interface in WDS mode. | 488 | * @IEEE80211_IF_TYPE_WDS: interface in WDS mode. |
556 | * @IEEE80211_IF_TYPE_VLAN: VLAN interface bound to an AP, drivers | 489 | * @IEEE80211_IF_TYPE_VLAN: VLAN interface bound to an AP, drivers |
557 | * will never see this type. | 490 | * will never see this type. |
491 | * @IEEE80211_IF_TYPE_MESH_POINT: 802.11s mesh point | ||
558 | */ | 492 | */ |
559 | enum ieee80211_if_types { | 493 | enum ieee80211_if_types { |
560 | IEEE80211_IF_TYPE_INVALID, | 494 | IEEE80211_IF_TYPE_INVALID, |
561 | IEEE80211_IF_TYPE_AP, | 495 | IEEE80211_IF_TYPE_AP, |
562 | IEEE80211_IF_TYPE_STA, | 496 | IEEE80211_IF_TYPE_STA, |
563 | IEEE80211_IF_TYPE_IBSS, | 497 | IEEE80211_IF_TYPE_IBSS, |
498 | IEEE80211_IF_TYPE_MESH_POINT, | ||
564 | IEEE80211_IF_TYPE_MNTR, | 499 | IEEE80211_IF_TYPE_MNTR, |
565 | IEEE80211_IF_TYPE_WDS, | 500 | IEEE80211_IF_TYPE_WDS, |
566 | IEEE80211_IF_TYPE_VLAN, | 501 | IEEE80211_IF_TYPE_VLAN, |
@@ -582,6 +517,14 @@ struct ieee80211_vif { | |||
582 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | 517 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); |
583 | }; | 518 | }; |
584 | 519 | ||
520 | static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | ||
521 | { | ||
522 | #ifdef CONFIG_MAC80211_MESH | ||
523 | return vif->type == IEEE80211_IF_TYPE_MESH_POINT; | ||
524 | #endif | ||
525 | return false; | ||
526 | } | ||
527 | |||
585 | /** | 528 | /** |
586 | * struct ieee80211_if_init_conf - initial configuration of an interface | 529 | * struct ieee80211_if_init_conf - initial configuration of an interface |
587 | * | 530 | * |
@@ -725,6 +668,21 @@ enum sta_notify_cmd { | |||
725 | }; | 668 | }; |
726 | 669 | ||
727 | /** | 670 | /** |
671 | * enum ieee80211_tkip_key_type - get tkip key | ||
672 | * | ||
673 | * Used by drivers which need to get a tkip key for skb. Some drivers need a | ||
674 | * phase 1 key, others need a phase 2 key. A single function allows the driver | ||
675 | * to get the key, this enum indicates what type of key is required. | ||
676 | * | ||
677 | * @IEEE80211_TKIP_P1_KEY: the driver needs a phase 1 key | ||
678 | * @IEEE80211_TKIP_P2_KEY: the driver needs a phase 2 key | ||
679 | */ | ||
680 | enum ieee80211_tkip_key_type { | ||
681 | IEEE80211_TKIP_P1_KEY, | ||
682 | IEEE80211_TKIP_P2_KEY, | ||
683 | }; | ||
684 | |||
685 | /** | ||
728 | * enum ieee80211_hw_flags - hardware flags | 686 | * enum ieee80211_hw_flags - hardware flags |
729 | * | 687 | * |
730 | * These flags are used to indicate hardware capabilities to | 688 | * These flags are used to indicate hardware capabilities to |
@@ -757,15 +715,19 @@ enum sta_notify_cmd { | |||
757 | * %IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is also not set because | 715 | * %IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is also not set because |
758 | * otherwise the stack will not know when the DTIM beacon was sent. | 716 | * otherwise the stack will not know when the DTIM beacon was sent. |
759 | * | 717 | * |
760 | * @IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED: | 718 | * @IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE: |
761 | * Channels are already configured to the default regulatory domain | 719 | * Hardware is not capable of short slot operation on the 2.4 GHz band. |
762 | * specified in the device's EEPROM | 720 | * |
721 | * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE: | ||
722 | * Hardware is not capable of receiving frames with short preamble on | ||
723 | * the 2.4 GHz band. | ||
763 | */ | 724 | */ |
764 | enum ieee80211_hw_flags { | 725 | enum ieee80211_hw_flags { |
765 | IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, | 726 | IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, |
766 | IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, | 727 | IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, |
767 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, | 728 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, |
768 | IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED = 1<<3, | 729 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, |
730 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, | ||
769 | }; | 731 | }; |
770 | 732 | ||
771 | /** | 733 | /** |
@@ -777,7 +739,8 @@ enum ieee80211_hw_flags { | |||
777 | * @wiphy: This points to the &struct wiphy allocated for this | 739 | * @wiphy: This points to the &struct wiphy allocated for this |
778 | * 802.11 PHY. You must fill in the @perm_addr and @dev | 740 | * 802.11 PHY. You must fill in the @perm_addr and @dev |
779 | * members of this structure using SET_IEEE80211_DEV() | 741 | * members of this structure using SET_IEEE80211_DEV() |
780 | * and SET_IEEE80211_PERM_ADDR(). | 742 | * and SET_IEEE80211_PERM_ADDR(). Additionally, all supported |
743 | * bands (with channels, bitrates) are registered here. | ||
781 | * | 744 | * |
782 | * @conf: &struct ieee80211_conf, device configuration, don't use. | 745 | * @conf: &struct ieee80211_conf, device configuration, don't use. |
783 | * | 746 | * |
@@ -888,6 +851,16 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr) | |||
888 | * parameter is guaranteed to be valid until another call to set_key() | 851 | * parameter is guaranteed to be valid until another call to set_key() |
889 | * removes it, but it can only be used as a cookie to differentiate | 852 | * removes it, but it can only be used as a cookie to differentiate |
890 | * keys. | 853 | * keys. |
854 | * | ||
855 | * In TKIP some HW need to be provided a phase 1 key, for RX decryption | ||
856 | * acceleration (i.e. iwlwifi). Those drivers should provide update_tkip_key | ||
857 | * handler. | ||
858 | * The update_tkip_key() call updates the driver with the new phase 1 key. | ||
859 | * This happens everytime the iv16 wraps around (every 65536 packets). The | ||
860 | * set_key() call will happen only once for each key (unless the AP did | ||
861 | * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is | ||
862 | * provided by udpate_tkip_key only. The trigger that makes mac80211 call this | ||
863 | * handler is software decryption with wrap around of iv16. | ||
891 | */ | 864 | */ |
892 | 865 | ||
893 | /** | 866 | /** |
@@ -913,8 +886,18 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr) | |||
913 | * parameter to see whether multicast frames should be accepted | 886 | * parameter to see whether multicast frames should be accepted |
914 | * or dropped. | 887 | * or dropped. |
915 | * | 888 | * |
916 | * All unsupported flags in @total_flags must be cleared, i.e. you | 889 | * All unsupported flags in @total_flags must be cleared. |
917 | * should clear all bits except those you honoured. | 890 | * Hardware does not support a flag if it is incapable of _passing_ |
891 | * the frame to the stack. Otherwise the driver must ignore | ||
892 | * the flag, but not clear it. | ||
893 | * You must _only_ clear the flag (announce no support for the | ||
894 | * flag to mac80211) if you are not able to pass the packet type | ||
895 | * to the stack (so the hardware always filters it). | ||
896 | * So for example, you should clear @FIF_CONTROL, if your hardware | ||
897 | * always filters control frames. If your hardware always passes | ||
898 | * control frames to the kernel and is incapable of filtering them, | ||
899 | * you do _not_ clear the @FIF_CONTROL flag. | ||
900 | * This rule applies to all other FIF flags as well. | ||
918 | */ | 901 | */ |
919 | 902 | ||
920 | /** | 903 | /** |
@@ -967,10 +950,14 @@ enum ieee80211_filter_flags { | |||
967 | * &struct ieee80211_ops to indicate which action is needed. | 950 | * &struct ieee80211_ops to indicate which action is needed. |
968 | * @IEEE80211_AMPDU_RX_START: start Rx aggregation | 951 | * @IEEE80211_AMPDU_RX_START: start Rx aggregation |
969 | * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation | 952 | * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation |
953 | * @IEEE80211_AMPDU_TX_START: start Tx aggregation | ||
954 | * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation | ||
970 | */ | 955 | */ |
971 | enum ieee80211_ampdu_mlme_action { | 956 | enum ieee80211_ampdu_mlme_action { |
972 | IEEE80211_AMPDU_RX_START, | 957 | IEEE80211_AMPDU_RX_START, |
973 | IEEE80211_AMPDU_RX_STOP, | 958 | IEEE80211_AMPDU_RX_STOP, |
959 | IEEE80211_AMPDU_TX_START, | ||
960 | IEEE80211_AMPDU_TX_STOP, | ||
974 | }; | 961 | }; |
975 | 962 | ||
976 | /** | 963 | /** |
@@ -1033,8 +1020,7 @@ enum ieee80211_ampdu_mlme_action { | |||
1033 | * level driver (e.g. assoc/disassoc status, erp parameters). | 1020 | * level driver (e.g. assoc/disassoc status, erp parameters). |
1034 | * This function should not be used if no BSS has been set, unless | 1021 | * This function should not be used if no BSS has been set, unless |
1035 | * for association indication. The @changed parameter indicates which | 1022 | * for association indication. The @changed parameter indicates which |
1036 | * of the bss parameters has changed when a call is made. This callback | 1023 | * of the bss parameters has changed when a call is made. |
1037 | * has to be atomic. | ||
1038 | * | 1024 | * |
1039 | * @configure_filter: Configure the device's RX filter. | 1025 | * @configure_filter: Configure the device's RX filter. |
1040 | * See the section "Frame filtering" for more information. | 1026 | * See the section "Frame filtering" for more information. |
@@ -1050,8 +1036,14 @@ enum ieee80211_ampdu_mlme_action { | |||
1050 | * and remove_interface calls, i.e. while the interface with the | 1036 | * and remove_interface calls, i.e. while the interface with the |
1051 | * given local_address is enabled. | 1037 | * given local_address is enabled. |
1052 | * | 1038 | * |
1039 | * @update_tkip_key: See the section "Hardware crypto acceleration" | ||
1040 | * This callback will be called in the context of Rx. Called for drivers | ||
1041 | * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY. | ||
1042 | * | ||
1053 | * @hw_scan: Ask the hardware to service the scan request, no need to start | 1043 | * @hw_scan: Ask the hardware to service the scan request, no need to start |
1054 | * the scan state machine in stack. | 1044 | * the scan state machine in stack. The scan must honour the channel |
1045 | * configuration done by the regulatory agent in the wiphy's registered | ||
1046 | * bands. | ||
1055 | * | 1047 | * |
1056 | * @get_stats: return low-level statistics | 1048 | * @get_stats: return low-level statistics |
1057 | * | 1049 | * |
@@ -1111,7 +1103,8 @@ enum ieee80211_ampdu_mlme_action { | |||
1111 | * The RA/TID combination determines the destination and TID we want | 1103 | * The RA/TID combination determines the destination and TID we want |
1112 | * the ampdu action to be performed for. The action is defined through | 1104 | * the ampdu action to be performed for. The action is defined through |
1113 | * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn) | 1105 | * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn) |
1114 | * is the first frame we expect to perform the action on. | 1106 | * is the first frame we expect to perform the action on. notice |
1107 | * that TX/RX_STOP can pass NULL for this parameter. | ||
1115 | */ | 1108 | */ |
1116 | struct ieee80211_ops { | 1109 | struct ieee80211_ops { |
1117 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb, | 1110 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb, |
@@ -1138,6 +1131,9 @@ struct ieee80211_ops { | |||
1138 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 1131 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
1139 | const u8 *local_address, const u8 *address, | 1132 | const u8 *local_address, const u8 *address, |
1140 | struct ieee80211_key_conf *key); | 1133 | struct ieee80211_key_conf *key); |
1134 | void (*update_tkip_key)(struct ieee80211_hw *hw, | ||
1135 | struct ieee80211_key_conf *conf, const u8 *address, | ||
1136 | u32 iv32, u16 *phase1key); | ||
1141 | int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len); | 1137 | int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len); |
1142 | int (*get_stats)(struct ieee80211_hw *hw, | 1138 | int (*get_stats)(struct ieee80211_hw *hw, |
1143 | struct ieee80211_low_level_stats *stats); | 1139 | struct ieee80211_low_level_stats *stats); |
@@ -1159,10 +1155,9 @@ struct ieee80211_ops { | |||
1159 | struct sk_buff *skb, | 1155 | struct sk_buff *skb, |
1160 | struct ieee80211_tx_control *control); | 1156 | struct ieee80211_tx_control *control); |
1161 | int (*tx_last_beacon)(struct ieee80211_hw *hw); | 1157 | int (*tx_last_beacon)(struct ieee80211_hw *hw); |
1162 | int (*conf_ht)(struct ieee80211_hw *hw, struct ieee80211_conf *conf); | ||
1163 | int (*ampdu_action)(struct ieee80211_hw *hw, | 1158 | int (*ampdu_action)(struct ieee80211_hw *hw, |
1164 | enum ieee80211_ampdu_mlme_action action, | 1159 | enum ieee80211_ampdu_mlme_action action, |
1165 | const u8 *ra, u16 tid, u16 ssn); | 1160 | const u8 *addr, u16 tid, u16 *ssn); |
1166 | }; | 1161 | }; |
1167 | 1162 | ||
1168 | /** | 1163 | /** |
@@ -1183,8 +1178,9 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
1183 | /** | 1178 | /** |
1184 | * ieee80211_register_hw - Register hardware device | 1179 | * ieee80211_register_hw - Register hardware device |
1185 | * | 1180 | * |
1186 | * You must call this function before any other functions | 1181 | * You must call this function before any other functions in |
1187 | * except ieee80211_register_hwmode. | 1182 | * mac80211. Note that before a hardware can be registered, you |
1183 | * need to fill the contained wiphy's information. | ||
1188 | * | 1184 | * |
1189 | * @hw: the device to register as returned by ieee80211_alloc_hw() | 1185 | * @hw: the device to register as returned by ieee80211_alloc_hw() |
1190 | */ | 1186 | */ |
@@ -1272,10 +1268,6 @@ static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw) | |||
1272 | #endif | 1268 | #endif |
1273 | } | 1269 | } |
1274 | 1270 | ||
1275 | /* Register a new hardware PHYMODE capability to the stack. */ | ||
1276 | int ieee80211_register_hwmode(struct ieee80211_hw *hw, | ||
1277 | struct ieee80211_hw_mode *mode); | ||
1278 | |||
1279 | /** | 1271 | /** |
1280 | * ieee80211_unregister_hw - Unregister a hardware device | 1272 | * ieee80211_unregister_hw - Unregister a hardware device |
1281 | * | 1273 | * |
@@ -1308,7 +1300,10 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1308 | * buffer in @skb must start with an IEEE 802.11 header or a radiotap | 1300 | * buffer in @skb must start with an IEEE 802.11 header or a radiotap |
1309 | * header if %RX_FLAG_RADIOTAP is set in the @status flags. | 1301 | * header if %RX_FLAG_RADIOTAP is set in the @status flags. |
1310 | * | 1302 | * |
1311 | * This function may not be called in IRQ context. | 1303 | * This function may not be called in IRQ context. Calls to this function |
1304 | * for a single hardware must be synchronized against each other. Calls | ||
1305 | * to this function and ieee80211_rx_irqsafe() may not be mixed for a | ||
1306 | * single hardware. | ||
1312 | * | 1307 | * |
1313 | * @hw: the hardware this frame came in on | 1308 | * @hw: the hardware this frame came in on |
1314 | * @skb: the buffer to receive, owned by mac80211 after this call | 1309 | * @skb: the buffer to receive, owned by mac80211 after this call |
@@ -1325,7 +1320,10 @@ static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
1325 | * ieee80211_rx_irqsafe - receive frame | 1320 | * ieee80211_rx_irqsafe - receive frame |
1326 | * | 1321 | * |
1327 | * Like ieee80211_rx() but can be called in IRQ context | 1322 | * Like ieee80211_rx() but can be called in IRQ context |
1328 | * (internally defers to a workqueue.) | 1323 | * (internally defers to a tasklet.) |
1324 | * | ||
1325 | * Calls to this function and ieee80211_rx() may not be mixed for a | ||
1326 | * single hardware. | ||
1329 | * | 1327 | * |
1330 | * @hw: the hardware this frame came in on | 1328 | * @hw: the hardware this frame came in on |
1331 | * @skb: the buffer to receive, owned by mac80211 after this call | 1329 | * @skb: the buffer to receive, owned by mac80211 after this call |
@@ -1344,6 +1342,11 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, | |||
1344 | * transmitted. It is permissible to not call this function for | 1342 | * transmitted. It is permissible to not call this function for |
1345 | * multicast frames but this can affect statistics. | 1343 | * multicast frames but this can affect statistics. |
1346 | * | 1344 | * |
1345 | * This function may not be called in IRQ context. Calls to this function | ||
1346 | * for a single hardware must be synchronized against each other. Calls | ||
1347 | * to this function and ieee80211_tx_status_irqsafe() may not be mixed | ||
1348 | * for a single hardware. | ||
1349 | * | ||
1347 | * @hw: the hardware the frame was transmitted by | 1350 | * @hw: the hardware the frame was transmitted by |
1348 | * @skb: the frame that was transmitted, owned by mac80211 after this call | 1351 | * @skb: the frame that was transmitted, owned by mac80211 after this call |
1349 | * @status: status information for this frame; the status pointer need not | 1352 | * @status: status information for this frame; the status pointer need not |
@@ -1353,6 +1356,22 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, | |||
1353 | void ieee80211_tx_status(struct ieee80211_hw *hw, | 1356 | void ieee80211_tx_status(struct ieee80211_hw *hw, |
1354 | struct sk_buff *skb, | 1357 | struct sk_buff *skb, |
1355 | struct ieee80211_tx_status *status); | 1358 | struct ieee80211_tx_status *status); |
1359 | |||
1360 | /** | ||
1361 | * ieee80211_tx_status_irqsafe - irq-safe transmit status callback | ||
1362 | * | ||
1363 | * Like ieee80211_tx_status() but can be called in IRQ context | ||
1364 | * (internally defers to a tasklet.) | ||
1365 | * | ||
1366 | * Calls to this function and ieee80211_tx_status() may not be mixed for a | ||
1367 | * single hardware. | ||
1368 | * | ||
1369 | * @hw: the hardware the frame was transmitted by | ||
1370 | * @skb: the frame that was transmitted, owned by mac80211 after this call | ||
1371 | * @status: status information for this frame; the status pointer need not | ||
1372 | * be valid after this function returns and is not freed by mac80211, | ||
1373 | * it is recommended that it points to a stack area | ||
1374 | */ | ||
1356 | void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, | 1375 | void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, |
1357 | struct sk_buff *skb, | 1376 | struct sk_buff *skb, |
1358 | struct ieee80211_tx_status *status); | 1377 | struct ieee80211_tx_status *status); |
@@ -1449,7 +1468,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, | |||
1449 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 1468 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
1450 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1469 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
1451 | * @frame_len: the length of the frame. | 1470 | * @frame_len: the length of the frame. |
1452 | * @rate: the rate (in 100kbps) at which the frame is going to be transmitted. | 1471 | * @rate: the rate at which the frame is going to be transmitted. |
1453 | * | 1472 | * |
1454 | * Calculate the duration field of some generic frame, given its | 1473 | * Calculate the duration field of some generic frame, given its |
1455 | * length and transmission rate (in 100kbps). | 1474 | * length and transmission rate (in 100kbps). |
@@ -1457,7 +1476,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, | |||
1457 | __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, | 1476 | __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, |
1458 | struct ieee80211_vif *vif, | 1477 | struct ieee80211_vif *vif, |
1459 | size_t frame_len, | 1478 | size_t frame_len, |
1460 | int rate); | 1479 | struct ieee80211_rate *rate); |
1461 | 1480 | ||
1462 | /** | 1481 | /** |
1463 | * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames | 1482 | * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames |
@@ -1507,6 +1526,21 @@ int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); | |||
1507 | int ieee80211_get_hdrlen(u16 fc); | 1526 | int ieee80211_get_hdrlen(u16 fc); |
1508 | 1527 | ||
1509 | /** | 1528 | /** |
1529 | * ieee80211_get_tkip_key - get a TKIP rc4 for skb | ||
1530 | * | ||
1531 | * This function computes a TKIP rc4 key for an skb. It computes | ||
1532 | * a phase 1 key if needed (iv16 wraps around). This function is to | ||
1533 | * be used by drivers which can do HW encryption but need to compute | ||
1534 | * to phase 1/2 key in SW. | ||
1535 | * | ||
1536 | * @keyconf: the parameter passed with the set key | ||
1537 | * @skb: the skb for which the key is needed | ||
1538 | * @rc4key: a buffer to which the key will be written | ||
1539 | */ | ||
1540 | void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, | ||
1541 | struct sk_buff *skb, | ||
1542 | enum ieee80211_tkip_key_type type, u8 *key); | ||
1543 | /** | ||
1510 | * ieee80211_wake_queue - wake specific queue | 1544 | * ieee80211_wake_queue - wake specific queue |
1511 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 1545 | * @hw: pointer as obtained from ieee80211_alloc_hw(). |
1512 | * @queue: queue number (counted from zero). | 1546 | * @queue: queue number (counted from zero). |
@@ -1574,4 +1608,92 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | |||
1574 | struct ieee80211_vif *vif), | 1608 | struct ieee80211_vif *vif), |
1575 | void *data); | 1609 | void *data); |
1576 | 1610 | ||
1611 | /** | ||
1612 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. | ||
1613 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | ||
1614 | * @ra: receiver address of the BA session recipient | ||
1615 | * @tid: the TID to BA on. | ||
1616 | * @return: success if addBA request was sent, failure otherwise | ||
1617 | * | ||
1618 | * Although mac80211/low level driver/user space application can estimate | ||
1619 | * the need to start aggregation on a certain RA/TID, the session level | ||
1620 | * will be managed by the mac80211. | ||
1621 | */ | ||
1622 | int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid); | ||
1623 | |||
1624 | /** | ||
1625 | * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. | ||
1626 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | ||
1627 | * @ra: receiver address of the BA session recipient. | ||
1628 | * @tid: the TID to BA on. | ||
1629 | * | ||
1630 | * This function must be called by low level driver once it has | ||
1631 | * finished with preparations for the BA session. | ||
1632 | */ | ||
1633 | void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid); | ||
1634 | |||
1635 | /** | ||
1636 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. | ||
1637 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | ||
1638 | * @ra: receiver address of the BA session recipient. | ||
1639 | * @tid: the TID to BA on. | ||
1640 | * | ||
1641 | * This function must be called by low level driver once it has | ||
1642 | * finished with preparations for the BA session. | ||
1643 | * This version of the function is irq safe. | ||
1644 | */ | ||
1645 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | ||
1646 | u16 tid); | ||
1647 | |||
1648 | /** | ||
1649 | * ieee80211_stop_tx_ba_session - Stop a Block Ack session. | ||
1650 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | ||
1651 | * @ra: receiver address of the BA session recipient | ||
1652 | * @tid: the TID to stop BA. | ||
1653 | * @initiator: if indicates initiator DELBA frame will be sent. | ||
1654 | * @return: error if no sta with matching da found, success otherwise | ||
1655 | * | ||
1656 | * Although mac80211/low level driver/user space application can estimate | ||
1657 | * the need to stop aggregation on a certain RA/TID, the session level | ||
1658 | * will be managed by the mac80211. | ||
1659 | */ | ||
1660 | int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw, | ||
1661 | u8 *ra, u16 tid, | ||
1662 | enum ieee80211_back_parties initiator); | ||
1663 | |||
1664 | /** | ||
1665 | * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. | ||
1666 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | ||
1667 | * @ra: receiver address of the BA session recipient. | ||
1668 | * @tid: the desired TID to BA on. | ||
1669 | * | ||
1670 | * This function must be called by low level driver once it has | ||
1671 | * finished with preparations for the BA session tear down. | ||
1672 | */ | ||
1673 | void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid); | ||
1674 | |||
1675 | /** | ||
1676 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. | ||
1677 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | ||
1678 | * @ra: receiver address of the BA session recipient. | ||
1679 | * @tid: the desired TID to BA on. | ||
1680 | * | ||
1681 | * This function must be called by low level driver once it has | ||
1682 | * finished with preparations for the BA session tear down. | ||
1683 | * This version of the function is irq safe. | ||
1684 | */ | ||
1685 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | ||
1686 | u16 tid); | ||
1687 | |||
1688 | /** | ||
1689 | * ieee80211_notify_mac - low level driver notification | ||
1690 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | ||
1691 | * @notification_types: enum ieee80211_notification_types | ||
1692 | * | ||
1693 | * This function must be called by low level driver to inform mac80211 of | ||
1694 | * low level driver status change or force mac80211 to re-assoc for low | ||
1695 | * level driver internal error that require re-assoc. | ||
1696 | */ | ||
1697 | void ieee80211_notify_mac(struct ieee80211_hw *hw, | ||
1698 | enum ieee80211_notification_types notif_type); | ||
1577 | #endif /* MAC80211_H */ | 1699 | #endif /* MAC80211_H */ |