blob: 019a41efa0bbc5809e79a0629e2da0ef38070e60 [file] [log] [blame]
Johannes Berg704232c2007-04-23 12:20:05 -07001#ifndef __NET_CFG80211_H
2#define __NET_CFG80211_H
3
4#include <linux/netlink.h>
5#include <linux/skbuff.h>
Johannes Berg55682962007-09-20 13:09:35 -04006#include <linux/nl80211.h>
Johannes Berg2a519312009-02-10 21:25:55 +01007#include <linux/if_ether.h>
8#include <linux/ieee80211.h>
9#include <linux/wireless.h>
10#include <net/iw_handler.h>
Johannes Berg704232c2007-04-23 12:20:05 -070011#include <net/genetlink.h>
Johannes Bergfee52672008-11-26 22:36:31 +010012/* remove once we remove the wext stuff */
Johannes Berg704232c2007-04-23 12:20:05 -070013
14/*
15 * 802.11 configuration in-kernel interface
16 *
Johannes Berg55682962007-09-20 13:09:35 -040017 * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
Johannes Berg704232c2007-04-23 12:20:05 -070018 */
19
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +010020/**
21 * struct vif_params - describes virtual interface parameters
22 * @mesh_id: mesh ID to use
23 * @mesh_id_len: length of the mesh ID
24 */
25struct vif_params {
26 u8 *mesh_id;
27 int mesh_id_len;
28};
29
Andy Green179f8312007-07-10 19:29:38 +020030/* Radiotap header iteration
31 * implemented in net/wireless/radiotap.c
32 * docs in Documentation/networking/radiotap-headers.txt
33 */
34/**
35 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
36 * @rtheader: pointer to the radiotap header we are walking through
37 * @max_length: length of radiotap header in cpu byte ordering
38 * @this_arg_index: IEEE80211_RADIOTAP_... index of current arg
39 * @this_arg: pointer to current radiotap arg
40 * @arg_index: internal next argument index
41 * @arg: internal next argument pointer
42 * @next_bitmap: internal pointer to next present u32
43 * @bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
44 */
45
46struct ieee80211_radiotap_iterator {
47 struct ieee80211_radiotap_header *rtheader;
48 int max_length;
49 int this_arg_index;
50 u8 *this_arg;
51
52 int arg_index;
53 u8 *arg;
54 __le32 *next_bitmap;
55 u32 bitmap_shifter;
56};
57
58extern int ieee80211_radiotap_iterator_init(
59 struct ieee80211_radiotap_iterator *iterator,
60 struct ieee80211_radiotap_header *radiotap_header,
61 int max_length);
62
63extern int ieee80211_radiotap_iterator_next(
64 struct ieee80211_radiotap_iterator *iterator);
65
66
Johannes Berg41ade002007-12-19 02:03:29 +010067 /**
68 * struct key_params - key information
69 *
70 * Information about a key
71 *
72 * @key: key material
73 * @key_len: length of key material
74 * @cipher: cipher suite selector
75 * @seq: sequence counter (IV/PN) for TKIP and CCMP keys, only used
76 * with the get_key() callback, must be in little endian,
77 * length given by @seq_len.
78 */
79struct key_params {
80 u8 *key;
81 u8 *seq;
82 int key_len;
83 int seq_len;
84 u32 cipher;
85};
86
Johannes Berged1b6cc2007-12-19 02:03:32 +010087/**
88 * struct beacon_parameters - beacon parameters
89 *
90 * Used to configure the beacon for an interface.
91 *
92 * @head: head portion of beacon (before TIM IE)
93 * or %NULL if not changed
94 * @tail: tail portion of beacon (after TIM IE)
95 * or %NULL if not changed
96 * @interval: beacon interval or zero if not changed
97 * @dtim_period: DTIM period or zero if not changed
98 * @head_len: length of @head
99 * @tail_len: length of @tail
100 */
101struct beacon_parameters {
102 u8 *head, *tail;
103 int interval, dtim_period;
104 int head_len, tail_len;
105};
106
Johannes Berg5727ef12007-12-19 02:03:34 +0100107/**
108 * enum station_flags - station flags
109 *
110 * Station capability flags. Note that these must be the bits
111 * according to the nl80211 flags.
112 *
113 * @STATION_FLAG_CHANGED: station flags were changed
114 * @STATION_FLAG_AUTHORIZED: station is authorized to send frames (802.1X)
115 * @STATION_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
116 * with short preambles
117 * @STATION_FLAG_WME: station is WME/QoS capable
Jouni Malinen5394af42009-01-08 13:31:59 +0200118 * @STATION_FLAG_MFP: station uses management frame protection
Johannes Berg5727ef12007-12-19 02:03:34 +0100119 */
120enum station_flags {
121 STATION_FLAG_CHANGED = 1<<0,
122 STATION_FLAG_AUTHORIZED = 1<<NL80211_STA_FLAG_AUTHORIZED,
123 STATION_FLAG_SHORT_PREAMBLE = 1<<NL80211_STA_FLAG_SHORT_PREAMBLE,
124 STATION_FLAG_WME = 1<<NL80211_STA_FLAG_WME,
Jouni Malinen5394af42009-01-08 13:31:59 +0200125 STATION_FLAG_MFP = 1<<NL80211_STA_FLAG_MFP,
Johannes Berg5727ef12007-12-19 02:03:34 +0100126};
127
128/**
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100129 * enum plink_action - actions to perform in mesh peers
130 *
131 * @PLINK_ACTION_INVALID: action 0 is reserved
132 * @PLINK_ACTION_OPEN: start mesh peer link establishment
133 * @PLINK_ACTION_BLOCL: block traffic from this mesh peer
134 */
135enum plink_actions {
136 PLINK_ACTION_INVALID,
137 PLINK_ACTION_OPEN,
138 PLINK_ACTION_BLOCK,
139};
140
141/**
Johannes Berg5727ef12007-12-19 02:03:34 +0100142 * struct station_parameters - station parameters
143 *
144 * Used to change and create a new station.
145 *
146 * @vlan: vlan interface station should belong to
147 * @supported_rates: supported rates in IEEE 802.11 format
148 * (or NULL for no change)
149 * @supported_rates_len: number of supported rates
150 * @station_flags: station flags (see &enum station_flags)
151 * @listen_interval: listen interval or -1 for no change
152 * @aid: AID or zero for no change
153 */
154struct station_parameters {
155 u8 *supported_rates;
156 struct net_device *vlan;
157 u32 station_flags;
158 int listen_interval;
159 u16 aid;
160 u8 supported_rates_len;
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100161 u8 plink_action;
Jouni Malinen36aedc92008-08-25 11:58:58 +0300162 struct ieee80211_ht_cap *ht_capa;
Johannes Berg5727ef12007-12-19 02:03:34 +0100163};
164
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100165/**
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100166 * enum station_info_flags - station information flags
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100167 *
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100168 * Used by the driver to indicate which info in &struct station_info
169 * it has filled in during get_station() or dump_station().
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100170 *
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100171 * @STATION_INFO_INACTIVE_TIME: @inactive_time filled
172 * @STATION_INFO_RX_BYTES: @rx_bytes filled
173 * @STATION_INFO_TX_BYTES: @tx_bytes filled
174 * @STATION_INFO_LLID: @llid filled
175 * @STATION_INFO_PLID: @plid filled
176 * @STATION_INFO_PLINK_STATE: @plink_state filled
Henning Rogge420e7fa2008-12-11 22:04:19 +0100177 * @STATION_INFO_SIGNAL: @signal filled
178 * @STATION_INFO_TX_BITRATE: @tx_bitrate fields are filled
179 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs)
Jouni Malinen98c8a60a2009-02-17 13:24:57 +0200180 * @STATION_INFO_RX_PACKETS: @rx_packets filled
181 * @STATION_INFO_TX_PACKETS: @tx_packets filled
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100182 */
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100183enum station_info_flags {
184 STATION_INFO_INACTIVE_TIME = 1<<0,
185 STATION_INFO_RX_BYTES = 1<<1,
186 STATION_INFO_TX_BYTES = 1<<2,
187 STATION_INFO_LLID = 1<<3,
188 STATION_INFO_PLID = 1<<4,
189 STATION_INFO_PLINK_STATE = 1<<5,
Henning Rogge420e7fa2008-12-11 22:04:19 +0100190 STATION_INFO_SIGNAL = 1<<6,
191 STATION_INFO_TX_BITRATE = 1<<7,
Jouni Malinen98c8a60a2009-02-17 13:24:57 +0200192 STATION_INFO_RX_PACKETS = 1<<8,
193 STATION_INFO_TX_PACKETS = 1<<9,
Henning Rogge420e7fa2008-12-11 22:04:19 +0100194};
195
196/**
197 * enum station_info_rate_flags - bitrate info flags
198 *
199 * Used by the driver to indicate the specific rate transmission
200 * type for 802.11n transmissions.
201 *
202 * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled
203 * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission
204 * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval
205 */
206enum rate_info_flags {
207 RATE_INFO_FLAGS_MCS = 1<<0,
208 RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1,
209 RATE_INFO_FLAGS_SHORT_GI = 1<<2,
210};
211
212/**
213 * struct rate_info - bitrate information
214 *
215 * Information about a receiving or transmitting bitrate
216 *
217 * @flags: bitflag of flags from &enum rate_info_flags
218 * @mcs: mcs index if struct describes a 802.11n bitrate
219 * @legacy: bitrate in 100kbit/s for 802.11abg
220 */
221struct rate_info {
222 u8 flags;
223 u8 mcs;
224 u16 legacy;
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100225};
226
227/**
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100228 * struct station_info - station information
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100229 *
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100230 * Station information filled by driver for get_station() and dump_station.
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100231 *
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100232 * @filled: bitflag of flags from &enum station_info_flags
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100233 * @inactive_time: time since last station activity (tx/rx) in milliseconds
234 * @rx_bytes: bytes received from this station
235 * @tx_bytes: bytes transmitted to this station
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100236 * @llid: mesh local link id
237 * @plid: mesh peer link id
238 * @plink_state: mesh peer link state
Henning Rogge420e7fa2008-12-11 22:04:19 +0100239 * @signal: signal strength of last received packet in dBm
240 * @txrate: current unicast bitrate to this station
Jouni Malinen98c8a60a2009-02-17 13:24:57 +0200241 * @rx_packets: packets received from this station
242 * @tx_packets: packets transmitted to this station
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100243 */
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100244struct station_info {
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100245 u32 filled;
246 u32 inactive_time;
247 u32 rx_bytes;
248 u32 tx_bytes;
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100249 u16 llid;
250 u16 plid;
251 u8 plink_state;
Henning Rogge420e7fa2008-12-11 22:04:19 +0100252 s8 signal;
253 struct rate_info txrate;
Jouni Malinen98c8a60a2009-02-17 13:24:57 +0200254 u32 rx_packets;
255 u32 tx_packets;
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100256};
257
Michael Wu66f7ac52008-01-31 19:48:22 +0100258/**
259 * enum monitor_flags - monitor flags
260 *
261 * Monitor interface configuration flags. Note that these must be the bits
262 * according to the nl80211 flags.
263 *
264 * @MONITOR_FLAG_FCSFAIL: pass frames with bad FCS
265 * @MONITOR_FLAG_PLCPFAIL: pass frames with bad PLCP
266 * @MONITOR_FLAG_CONTROL: pass control frames
267 * @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering
268 * @MONITOR_FLAG_COOK_FRAMES: report frames after processing
269 */
270enum monitor_flags {
271 MONITOR_FLAG_FCSFAIL = 1<<NL80211_MNTR_FLAG_FCSFAIL,
272 MONITOR_FLAG_PLCPFAIL = 1<<NL80211_MNTR_FLAG_PLCPFAIL,
273 MONITOR_FLAG_CONTROL = 1<<NL80211_MNTR_FLAG_CONTROL,
274 MONITOR_FLAG_OTHER_BSS = 1<<NL80211_MNTR_FLAG_OTHER_BSS,
275 MONITOR_FLAG_COOK_FRAMES = 1<<NL80211_MNTR_FLAG_COOK_FRAMES,
276};
277
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100278/**
279 * enum mpath_info_flags - mesh path information flags
280 *
281 * Used by the driver to indicate which info in &struct mpath_info it has filled
282 * in during get_station() or dump_station().
283 *
284 * MPATH_INFO_FRAME_QLEN: @frame_qlen filled
285 * MPATH_INFO_DSN: @dsn filled
286 * MPATH_INFO_METRIC: @metric filled
287 * MPATH_INFO_EXPTIME: @exptime filled
288 * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled
289 * MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled
290 * MPATH_INFO_FLAGS: @flags filled
291 */
292enum mpath_info_flags {
293 MPATH_INFO_FRAME_QLEN = BIT(0),
294 MPATH_INFO_DSN = BIT(1),
295 MPATH_INFO_METRIC = BIT(2),
296 MPATH_INFO_EXPTIME = BIT(3),
297 MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4),
298 MPATH_INFO_DISCOVERY_RETRIES = BIT(5),
299 MPATH_INFO_FLAGS = BIT(6),
300};
301
302/**
303 * struct mpath_info - mesh path information
304 *
305 * Mesh path information filled by driver for get_mpath() and dump_mpath().
306 *
307 * @filled: bitfield of flags from &enum mpath_info_flags
308 * @frame_qlen: number of queued frames for this destination
309 * @dsn: destination sequence number
310 * @metric: metric (cost) of this mesh path
311 * @exptime: expiration time for the mesh path from now, in msecs
312 * @flags: mesh path flags
313 * @discovery_timeout: total mesh path discovery timeout, in msecs
314 * @discovery_retries: mesh path discovery retries
315 */
316struct mpath_info {
317 u32 filled;
318 u32 frame_qlen;
319 u32 dsn;
320 u32 metric;
321 u32 exptime;
322 u32 discovery_timeout;
323 u8 discovery_retries;
324 u8 flags;
325};
326
Jouni Malinen9f1ba902008-08-07 20:07:01 +0300327/**
328 * struct bss_parameters - BSS parameters
329 *
330 * Used to change BSS parameters (mainly for AP mode).
331 *
332 * @use_cts_prot: Whether to use CTS protection
333 * (0 = no, 1 = yes, -1 = do not change)
334 * @use_short_preamble: Whether the use of short preambles is allowed
335 * (0 = no, 1 = yes, -1 = do not change)
336 * @use_short_slot_time: Whether the use of short slot time is allowed
337 * (0 = no, 1 = yes, -1 = do not change)
Jouni Malinen90c97a02008-10-30 16:59:22 +0200338 * @basic_rates: basic rates in IEEE 802.11 format
339 * (or NULL for no change)
340 * @basic_rates_len: number of basic rates
Jouni Malinen9f1ba902008-08-07 20:07:01 +0300341 */
342struct bss_parameters {
343 int use_cts_prot;
344 int use_short_preamble;
345 int use_short_slot_time;
Jouni Malinen90c97a02008-10-30 16:59:22 +0200346 u8 *basic_rates;
347 u8 basic_rates_len;
Jouni Malinen9f1ba902008-08-07 20:07:01 +0300348};
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100349
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -0700350/**
Luis R. Rodriguez716f9392009-01-22 15:05:51 -0800351 * enum environment_cap - Environment parsed from country IE
352 * @ENVIRON_ANY: indicates country IE applies to both indoor and
Luis R. Rodriguez7db90f42009-03-09 22:07:41 -0400353 * outdoor operation.
Luis R. Rodriguez716f9392009-01-22 15:05:51 -0800354 * @ENVIRON_INDOOR: indicates country IE applies only to indoor operation
355 * @ENVIRON_OUTDOOR: indicates country IE applies only to outdoor operation
356 */
357enum environment_cap {
358 ENVIRON_ANY,
359 ENVIRON_INDOOR,
360 ENVIRON_OUTDOOR,
361};
362
363/**
Luis R. Rodriguez806a9e32009-02-21 00:04:26 -0500364 * struct regulatory_request - used to keep track of regulatory requests
Luis R. Rodriguez716f9392009-01-22 15:05:51 -0800365 *
Luis R. Rodriguez806a9e32009-02-21 00:04:26 -0500366 * @wiphy_idx: this is set if this request's initiator is
Luis R. Rodriguez716f9392009-01-22 15:05:51 -0800367 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This
368 * can be used by the wireless core to deal with conflicts
369 * and potentially inform users of which devices specifically
370 * cased the conflicts.
371 * @initiator: indicates who sent this request, could be any of
Luis R. Rodriguez7db90f42009-03-09 22:07:41 -0400372 * of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*)
Luis R. Rodriguez716f9392009-01-22 15:05:51 -0800373 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested
374 * regulatory domain. We have a few special codes:
375 * 00 - World regulatory domain
376 * 99 - built by driver but a specific alpha2 cannot be determined
377 * 98 - result of an intersection between two regulatory domains
378 * @intersect: indicates whether the wireless core should intersect
379 * the requested regulatory domain with the presently set regulatory
380 * domain.
381 * @country_ie_checksum: checksum of the last processed and accepted
382 * country IE
383 * @country_ie_env: lets us know if the AP is telling us we are outdoor,
384 * indoor, or if it doesn't matter
Luis R. Rodriguezfe33eb32009-02-21 00:04:30 -0500385 * @list: used to insert into the reg_requests_list linked list
Luis R. Rodriguez716f9392009-01-22 15:05:51 -0800386 */
387struct regulatory_request {
Luis R. Rodriguez806a9e32009-02-21 00:04:26 -0500388 int wiphy_idx;
Luis R. Rodriguez7db90f42009-03-09 22:07:41 -0400389 enum nl80211_reg_initiator initiator;
Luis R. Rodriguez716f9392009-01-22 15:05:51 -0800390 char alpha2[2];
391 bool intersect;
392 u32 country_ie_checksum;
393 enum environment_cap country_ie_env;
Luis R. Rodriguezfe33eb32009-02-21 00:04:30 -0500394 struct list_head list;
Luis R. Rodriguez716f9392009-01-22 15:05:51 -0800395};
396
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -0700397struct ieee80211_freq_range {
398 u32 start_freq_khz;
399 u32 end_freq_khz;
400 u32 max_bandwidth_khz;
401};
402
403struct ieee80211_power_rule {
404 u32 max_antenna_gain;
405 u32 max_eirp;
406};
407
408struct ieee80211_reg_rule {
409 struct ieee80211_freq_range freq_range;
410 struct ieee80211_power_rule power_rule;
411 u32 flags;
412};
413
414struct ieee80211_regdomain {
415 u32 n_reg_rules;
416 char alpha2[2];
417 struct ieee80211_reg_rule reg_rules[];
418};
419
Luis R. Rodriguezb219cee2008-10-30 13:33:55 -0700420#define MHZ_TO_KHZ(freq) ((freq) * 1000)
421#define KHZ_TO_MHZ(freq) ((freq) / 1000)
422#define DBI_TO_MBI(gain) ((gain) * 100)
423#define MBI_TO_DBI(gain) ((gain) / 100)
424#define DBM_TO_MBM(gain) ((gain) * 100)
425#define MBM_TO_DBM(gain) ((gain) / 100)
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -0700426
427#define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \
Luis R. Rodriguezb219cee2008-10-30 13:33:55 -0700428 .freq_range.start_freq_khz = MHZ_TO_KHZ(start), \
429 .freq_range.end_freq_khz = MHZ_TO_KHZ(end), \
430 .freq_range.max_bandwidth_khz = MHZ_TO_KHZ(bw), \
431 .power_rule.max_antenna_gain = DBI_TO_MBI(gain), \
432 .power_rule.max_eirp = DBM_TO_MBM(eirp), \
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -0700433 .flags = reg_flags, \
434 }
435
colin@cozybit.com93da9cc2008-10-21 12:03:48 -0700436struct mesh_config {
437 /* Timeouts in ms */
438 /* Mesh plink management parameters */
439 u16 dot11MeshRetryTimeout;
440 u16 dot11MeshConfirmTimeout;
441 u16 dot11MeshHoldingTimeout;
442 u16 dot11MeshMaxPeerLinks;
443 u8 dot11MeshMaxRetries;
444 u8 dot11MeshTTL;
445 bool auto_open_plinks;
446 /* HWMP parameters */
447 u8 dot11MeshHWMPmaxPREQretries;
448 u32 path_refresh_time;
449 u16 min_discovery_timeout;
450 u32 dot11MeshHWMPactivePathTimeout;
451 u16 dot11MeshHWMPpreqMinInterval;
452 u16 dot11MeshHWMPnetDiameterTraversalTime;
453};
454
Jouni Malinen31888482008-10-30 16:59:24 +0200455/**
456 * struct ieee80211_txq_params - TX queue parameters
457 * @queue: TX queue identifier (NL80211_TXQ_Q_*)
458 * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled
459 * @cwmin: Minimum contention window [a value of the form 2^n-1 in the range
460 * 1..32767]
461 * @cwmax: Maximum contention window [a value of the form 2^n-1 in the range
462 * 1..32767]
463 * @aifs: Arbitration interframe space [0..255]
464 */
465struct ieee80211_txq_params {
466 enum nl80211_txq_q queue;
467 u16 txop;
468 u16 cwmin;
469 u16 cwmax;
470 u8 aifs;
471};
472
Johannes Berg704232c2007-04-23 12:20:05 -0700473/* from net/wireless.h */
474struct wiphy;
475
Jouni Malinen72bdcf32008-11-26 16:15:24 +0200476/* from net/ieee80211.h */
477struct ieee80211_channel;
478
Johannes Berg704232c2007-04-23 12:20:05 -0700479/**
Johannes Berg2a519312009-02-10 21:25:55 +0100480 * struct cfg80211_ssid - SSID description
481 * @ssid: the SSID
482 * @ssid_len: length of the ssid
483 */
484struct cfg80211_ssid {
485 u8 ssid[IEEE80211_MAX_SSID_LEN];
486 u8 ssid_len;
487};
488
489/**
490 * struct cfg80211_scan_request - scan request description
491 *
492 * @ssids: SSIDs to scan for (active scan only)
493 * @n_ssids: number of SSIDs
494 * @channels: channels to scan on.
495 * @n_channels: number of channels for each band
Jouni Malinen70692ad2009-02-16 19:39:13 +0200496 * @ie: optional information element(s) to add into Probe Request or %NULL
497 * @ie_len: length of ie in octets
Johannes Berg2a519312009-02-10 21:25:55 +0100498 * @wiphy: the wiphy this was for
499 * @ifidx: the interface index
500 */
501struct cfg80211_scan_request {
502 struct cfg80211_ssid *ssids;
503 int n_ssids;
504 struct ieee80211_channel **channels;
505 u32 n_channels;
Johannes Bergde95a542009-04-01 11:58:36 +0200506 const u8 *ie;
Jouni Malinen70692ad2009-02-16 19:39:13 +0200507 size_t ie_len;
Johannes Berg2a519312009-02-10 21:25:55 +0100508
509 /* internal */
510 struct wiphy *wiphy;
511 int ifidx;
512};
513
514/**
515 * enum cfg80211_signal_type - signal type
516 *
517 * @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available
518 * @CFG80211_SIGNAL_TYPE_MBM: signal strength in mBm (100*dBm)
519 * @CFG80211_SIGNAL_TYPE_UNSPEC: signal strength, increasing from 0 through 100
520 */
521enum cfg80211_signal_type {
522 CFG80211_SIGNAL_TYPE_NONE,
523 CFG80211_SIGNAL_TYPE_MBM,
524 CFG80211_SIGNAL_TYPE_UNSPEC,
525};
526
527/**
528 * struct cfg80211_bss - BSS description
529 *
530 * This structure describes a BSS (which may also be a mesh network)
531 * for use in scan results and similar.
532 *
533 * @bssid: BSSID of the BSS
534 * @tsf: timestamp of last received update
535 * @beacon_interval: the beacon interval as from the frame
536 * @capability: the capability field in host byte order
537 * @information_elements: the information elements (Note that there
538 * is no guarantee that these are well-formed!)
539 * @len_information_elements: total length of the information elements
Johannes Berg77965c92009-02-18 18:45:06 +0100540 * @signal: signal strength value (type depends on the wiphy's signal_type)
Kalle Valoa08c1c12009-03-22 21:57:28 +0200541 * @hold: BSS should not expire
Johannes Berg78c1c7e2009-02-10 21:25:57 +0100542 * @free_priv: function pointer to free private data
Johannes Berg2a519312009-02-10 21:25:55 +0100543 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
544 */
545struct cfg80211_bss {
546 struct ieee80211_channel *channel;
547
548 u8 bssid[ETH_ALEN];
549 u64 tsf;
550 u16 beacon_interval;
551 u16 capability;
552 u8 *information_elements;
553 size_t len_information_elements;
554
555 s32 signal;
Johannes Berg2a519312009-02-10 21:25:55 +0100556
Johannes Berg78c1c7e2009-02-10 21:25:57 +0100557 void (*free_priv)(struct cfg80211_bss *bss);
Johannes Berg2a519312009-02-10 21:25:55 +0100558 u8 priv[0] __attribute__((__aligned__(sizeof(void *))));
559};
560
561/**
Jouni Malinen636a5d32009-03-19 13:39:22 +0200562 * struct cfg80211_auth_request - Authentication request data
563 *
564 * This structure provides information needed to complete IEEE 802.11
565 * authentication.
566 * NOTE: This structure will likely change when more code from mac80211 is
567 * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too.
568 * Before using this in a driver that does not use mac80211, it would be better
569 * to check the status of that work and better yet, volunteer to work on it.
570 *
571 * @chan: The channel to use or %NULL if not specified (auto-select based on
572 * scan results)
573 * @peer_addr: The address of the peer STA (AP BSSID in infrastructure case);
574 * this field is required to be present; if the driver wants to help with
575 * BSS selection, it should use (yet to be added) MLME event to allow user
576 * space SME to be notified of roaming candidate, so that the SME can then
577 * use the authentication request with the recommended BSSID and whatever
578 * other data may be needed for authentication/association
579 * @ssid: SSID or %NULL if not yet available
580 * @ssid_len: Length of ssid in octets
581 * @auth_type: Authentication type (algorithm)
582 * @ie: Extra IEs to add to Authentication frame or %NULL
583 * @ie_len: Length of ie buffer in octets
584 */
585struct cfg80211_auth_request {
586 struct ieee80211_channel *chan;
587 u8 *peer_addr;
588 const u8 *ssid;
589 size_t ssid_len;
590 enum nl80211_auth_type auth_type;
591 const u8 *ie;
592 size_t ie_len;
593};
594
595/**
596 * struct cfg80211_assoc_request - (Re)Association request data
597 *
598 * This structure provides information needed to complete IEEE 802.11
599 * (re)association.
600 * NOTE: This structure will likely change when more code from mac80211 is
601 * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too.
602 * Before using this in a driver that does not use mac80211, it would be better
603 * to check the status of that work and better yet, volunteer to work on it.
604 *
605 * @chan: The channel to use or %NULL if not specified (auto-select based on
606 * scan results)
607 * @peer_addr: The address of the peer STA (AP BSSID); this field is required
608 * to be present and the STA must be in State 2 (authenticated) with the
609 * peer STA
610 * @ssid: SSID
611 * @ssid_len: Length of ssid in octets
612 * @ie: Extra IEs to add to (Re)Association Request frame or %NULL
613 * @ie_len: Length of ie buffer in octets
614 */
615struct cfg80211_assoc_request {
616 struct ieee80211_channel *chan;
617 u8 *peer_addr;
618 const u8 *ssid;
619 size_t ssid_len;
620 const u8 *ie;
621 size_t ie_len;
622};
623
624/**
625 * struct cfg80211_deauth_request - Deauthentication request data
626 *
627 * This structure provides information needed to complete IEEE 802.11
628 * deauthentication.
629 *
630 * @peer_addr: The address of the peer STA (AP BSSID); this field is required
631 * to be present and the STA must be authenticated with the peer STA
632 * @ie: Extra IEs to add to Deauthentication frame or %NULL
633 * @ie_len: Length of ie buffer in octets
634 */
635struct cfg80211_deauth_request {
636 u8 *peer_addr;
637 u16 reason_code;
638 const u8 *ie;
639 size_t ie_len;
640};
641
642/**
643 * struct cfg80211_disassoc_request - Disassociation request data
644 *
645 * This structure provides information needed to complete IEEE 802.11
646 * disassocation.
647 *
648 * @peer_addr: The address of the peer STA (AP BSSID); this field is required
649 * to be present and the STA must be associated with the peer STA
650 * @ie: Extra IEs to add to Disassociation frame or %NULL
651 * @ie_len: Length of ie buffer in octets
652 */
653struct cfg80211_disassoc_request {
654 u8 *peer_addr;
655 u16 reason_code;
656 const u8 *ie;
657 size_t ie_len;
658};
659
660/**
Johannes Berg704232c2007-04-23 12:20:05 -0700661 * struct cfg80211_ops - backend description for wireless configuration
662 *
663 * This struct is registered by fullmac card drivers and/or wireless stacks
664 * in order to handle configuration requests on their interfaces.
665 *
666 * All callbacks except where otherwise noted should return 0
667 * on success or a negative error code.
668 *
Johannes Berg43fb45cb2007-04-24 14:07:27 -0700669 * All operations are currently invoked under rtnl for consistency with the
670 * wireless extensions but this is subject to reevaluation as soon as this
671 * code is used more widely and we have a first user without wext.
672 *
Johannes Berg0378b3f2009-01-19 11:20:52 -0500673 * @suspend: wiphy device needs to be suspended
674 * @resume: wiphy device needs to be resumed
675 *
Johannes Berg60719ff2008-09-16 14:55:09 +0200676 * @add_virtual_intf: create a new virtual interface with the given name,
677 * must set the struct wireless_dev's iftype.
Johannes Berg704232c2007-04-23 12:20:05 -0700678 *
679 * @del_virtual_intf: remove the virtual interface determined by ifindex.
Johannes Berg55682962007-09-20 13:09:35 -0400680 *
Johannes Berg60719ff2008-09-16 14:55:09 +0200681 * @change_virtual_intf: change type/configuration of virtual interface,
682 * keep the struct wireless_dev's iftype updated.
Johannes Berg55682962007-09-20 13:09:35 -0400683 *
Johannes Berg41ade002007-12-19 02:03:29 +0100684 * @add_key: add a key with the given parameters. @mac_addr will be %NULL
685 * when adding a group key.
686 *
687 * @get_key: get information about the key with the given parameters.
688 * @mac_addr will be %NULL when requesting information for a group
689 * key. All pointers given to the @callback function need not be valid
690 * after it returns.
691 *
692 * @del_key: remove a key given the @mac_addr (%NULL for a group key)
693 * and @key_index
694 *
695 * @set_default_key: set the default key on an interface
Johannes Berged1b6cc2007-12-19 02:03:32 +0100696 *
Jouni Malinen3cfcf6ac2009-01-08 13:32:02 +0200697 * @set_default_mgmt_key: set the default management frame key on an interface
698 *
Johannes Berged1b6cc2007-12-19 02:03:32 +0100699 * @add_beacon: Add a beacon with given parameters, @head, @interval
700 * and @dtim_period will be valid, @tail is optional.
701 * @set_beacon: Change the beacon parameters for an access point mode
702 * interface. This should reject the call when no beacon has been
703 * configured.
704 * @del_beacon: Remove beacon configuration and stop sending the beacon.
Johannes Berg5727ef12007-12-19 02:03:34 +0100705 *
706 * @add_station: Add a new station.
707 *
708 * @del_station: Remove a station; @mac may be NULL to remove all stations.
709 *
710 * @change_station: Modify a given station.
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100711 *
colin@cozybit.com93da9cc2008-10-21 12:03:48 -0700712 * @get_mesh_params: Put the current mesh parameters into *params
713 *
714 * @set_mesh_params: Set mesh parameters.
715 * The mask is a bitfield which tells us which parameters to
716 * set, and which to leave alone.
717 *
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100718 * @set_mesh_cfg: set mesh parameters (by now, just mesh id)
Jouni Malinen9f1ba902008-08-07 20:07:01 +0300719 *
720 * @change_bss: Modify parameters for a given BSS.
Jouni Malinen31888482008-10-30 16:59:24 +0200721 *
722 * @set_txq_params: Set TX queue parameters
Jouni Malinen72bdcf32008-11-26 16:15:24 +0200723 *
724 * @set_channel: Set channel
Jouni Malinen9aed3cc2009-01-13 16:03:29 +0200725 *
Johannes Berg2a519312009-02-10 21:25:55 +0100726 * @scan: Request to do a scan. If returning zero, the scan request is given
727 * the driver, and will be valid until passed to cfg80211_scan_done().
728 * For scan results, call cfg80211_inform_bss(); you can call this outside
729 * the scan/scan_done bracket too.
Jouni Malinen636a5d32009-03-19 13:39:22 +0200730 *
731 * @auth: Request to authenticate with the specified peer
732 * @assoc: Request to (re)associate with the specified peer
733 * @deauth: Request to deauthenticate from the specified peer
734 * @disassoc: Request to disassociate from the specified peer
Johannes Berg704232c2007-04-23 12:20:05 -0700735 */
736struct cfg80211_ops {
Johannes Berg0378b3f2009-01-19 11:20:52 -0500737 int (*suspend)(struct wiphy *wiphy);
738 int (*resume)(struct wiphy *wiphy);
739
Johannes Berg704232c2007-04-23 12:20:05 -0700740 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100741 enum nl80211_iftype type, u32 *flags,
742 struct vif_params *params);
Johannes Berg704232c2007-04-23 12:20:05 -0700743 int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex);
Johannes Berg55682962007-09-20 13:09:35 -0400744 int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex,
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100745 enum nl80211_iftype type, u32 *flags,
746 struct vif_params *params);
Johannes Berg41ade002007-12-19 02:03:29 +0100747
748 int (*add_key)(struct wiphy *wiphy, struct net_device *netdev,
749 u8 key_index, u8 *mac_addr,
750 struct key_params *params);
751 int (*get_key)(struct wiphy *wiphy, struct net_device *netdev,
752 u8 key_index, u8 *mac_addr, void *cookie,
753 void (*callback)(void *cookie, struct key_params*));
754 int (*del_key)(struct wiphy *wiphy, struct net_device *netdev,
755 u8 key_index, u8 *mac_addr);
756 int (*set_default_key)(struct wiphy *wiphy,
757 struct net_device *netdev,
758 u8 key_index);
Jouni Malinen3cfcf6ac2009-01-08 13:32:02 +0200759 int (*set_default_mgmt_key)(struct wiphy *wiphy,
760 struct net_device *netdev,
761 u8 key_index);
Johannes Berged1b6cc2007-12-19 02:03:32 +0100762
763 int (*add_beacon)(struct wiphy *wiphy, struct net_device *dev,
764 struct beacon_parameters *info);
765 int (*set_beacon)(struct wiphy *wiphy, struct net_device *dev,
766 struct beacon_parameters *info);
767 int (*del_beacon)(struct wiphy *wiphy, struct net_device *dev);
Johannes Berg5727ef12007-12-19 02:03:34 +0100768
769
770 int (*add_station)(struct wiphy *wiphy, struct net_device *dev,
771 u8 *mac, struct station_parameters *params);
772 int (*del_station)(struct wiphy *wiphy, struct net_device *dev,
773 u8 *mac);
774 int (*change_station)(struct wiphy *wiphy, struct net_device *dev,
775 u8 *mac, struct station_parameters *params);
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100776 int (*get_station)(struct wiphy *wiphy, struct net_device *dev,
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100777 u8 *mac, struct station_info *sinfo);
778 int (*dump_station)(struct wiphy *wiphy, struct net_device *dev,
779 int idx, u8 *mac, struct station_info *sinfo);
780
781 int (*add_mpath)(struct wiphy *wiphy, struct net_device *dev,
782 u8 *dst, u8 *next_hop);
783 int (*del_mpath)(struct wiphy *wiphy, struct net_device *dev,
784 u8 *dst);
785 int (*change_mpath)(struct wiphy *wiphy, struct net_device *dev,
786 u8 *dst, u8 *next_hop);
787 int (*get_mpath)(struct wiphy *wiphy, struct net_device *dev,
788 u8 *dst, u8 *next_hop,
789 struct mpath_info *pinfo);
790 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev,
791 int idx, u8 *dst, u8 *next_hop,
792 struct mpath_info *pinfo);
colin@cozybit.com93da9cc2008-10-21 12:03:48 -0700793 int (*get_mesh_params)(struct wiphy *wiphy,
794 struct net_device *dev,
795 struct mesh_config *conf);
796 int (*set_mesh_params)(struct wiphy *wiphy,
797 struct net_device *dev,
798 const struct mesh_config *nconf, u32 mask);
Jouni Malinen9f1ba902008-08-07 20:07:01 +0300799 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
800 struct bss_parameters *params);
Jouni Malinen31888482008-10-30 16:59:24 +0200801
802 int (*set_txq_params)(struct wiphy *wiphy,
803 struct ieee80211_txq_params *params);
Jouni Malinen72bdcf32008-11-26 16:15:24 +0200804
805 int (*set_channel)(struct wiphy *wiphy,
806 struct ieee80211_channel *chan,
Sujith094d05d2008-12-12 11:57:43 +0530807 enum nl80211_channel_type channel_type);
Jouni Malinen9aed3cc2009-01-13 16:03:29 +0200808
Johannes Berg2a519312009-02-10 21:25:55 +0100809 int (*scan)(struct wiphy *wiphy, struct net_device *dev,
810 struct cfg80211_scan_request *request);
Jouni Malinen636a5d32009-03-19 13:39:22 +0200811
812 int (*auth)(struct wiphy *wiphy, struct net_device *dev,
813 struct cfg80211_auth_request *req);
814 int (*assoc)(struct wiphy *wiphy, struct net_device *dev,
815 struct cfg80211_assoc_request *req);
816 int (*deauth)(struct wiphy *wiphy, struct net_device *dev,
817 struct cfg80211_deauth_request *req);
818 int (*disassoc)(struct wiphy *wiphy, struct net_device *dev,
819 struct cfg80211_disassoc_request *req);
Johannes Berg704232c2007-04-23 12:20:05 -0700820};
821
Johannes Bergfee52672008-11-26 22:36:31 +0100822/* temporary wext handlers */
823int cfg80211_wext_giwname(struct net_device *dev,
824 struct iw_request_info *info,
825 char *name, char *extra);
Johannes Berge60c7742008-11-26 23:31:40 +0100826int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
827 u32 *mode, char *extra);
828int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info,
829 u32 *mode, char *extra);
Johannes Berg2a519312009-02-10 21:25:55 +0100830int cfg80211_wext_siwscan(struct net_device *dev,
831 struct iw_request_info *info,
832 union iwreq_data *wrqu, char *extra);
833int cfg80211_wext_giwscan(struct net_device *dev,
834 struct iw_request_info *info,
835 struct iw_point *data, char *extra);
Johannes Berg691597c2009-04-19 19:57:45 +0200836int cfg80211_wext_siwmlme(struct net_device *dev,
837 struct iw_request_info *info,
838 struct iw_point *data, char *extra);
Johannes Berg4aa188e2009-02-18 19:32:08 +0100839int cfg80211_wext_giwrange(struct net_device *dev,
840 struct iw_request_info *info,
841 struct iw_point *data, char *extra);
Johannes Berg2a519312009-02-10 21:25:55 +0100842
843/**
844 * cfg80211_scan_done - notify that scan finished
845 *
846 * @request: the corresponding scan request
847 * @aborted: set to true if the scan was aborted for any reason,
848 * userspace will be notified of that
849 */
850void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted);
851
852/**
853 * cfg80211_inform_bss - inform cfg80211 of a new BSS
854 *
855 * @wiphy: the wiphy reporting the BSS
856 * @bss: the found BSS
Johannes Berg77965c92009-02-18 18:45:06 +0100857 * @signal: the signal strength, type depends on the wiphy's signal_type
Johannes Berg2a519312009-02-10 21:25:55 +0100858 * @gfp: context flags
859 *
860 * This informs cfg80211 that BSS information was found and
861 * the BSS should be updated/added.
862 */
863struct cfg80211_bss*
864cfg80211_inform_bss_frame(struct wiphy *wiphy,
865 struct ieee80211_channel *channel,
866 struct ieee80211_mgmt *mgmt, size_t len,
Johannes Berg77965c92009-02-18 18:45:06 +0100867 s32 signal, gfp_t gfp);
Johannes Berg2a519312009-02-10 21:25:55 +0100868
Jussi Kivilinna06aa7af2009-03-26 23:40:09 +0200869struct cfg80211_bss*
870cfg80211_inform_bss(struct wiphy *wiphy,
871 struct ieee80211_channel *channel,
872 const u8 *bssid,
873 u64 timestamp, u16 capability, u16 beacon_interval,
874 const u8 *ie, size_t ielen,
875 s32 signal, gfp_t gfp);
876
Johannes Berg2a519312009-02-10 21:25:55 +0100877struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
878 struct ieee80211_channel *channel,
879 const u8 *bssid,
Johannes Berg79420f02009-02-10 21:25:59 +0100880 const u8 *ssid, size_t ssid_len,
881 u16 capa_mask, u16 capa_val);
882static inline struct cfg80211_bss *
883cfg80211_get_ibss(struct wiphy *wiphy,
884 struct ieee80211_channel *channel,
885 const u8 *ssid, size_t ssid_len)
886{
887 return cfg80211_get_bss(wiphy, channel, NULL, ssid, ssid_len,
888 WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
889}
890
Johannes Berg2a519312009-02-10 21:25:55 +0100891struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy,
892 struct ieee80211_channel *channel,
893 const u8 *meshid, size_t meshidlen,
894 const u8 *meshcfg);
895void cfg80211_put_bss(struct cfg80211_bss *bss);
Johannes Bergd491af12009-02-10 21:25:58 +0100896/**
897 * cfg80211_unlink_bss - unlink BSS from internal data structures
898 * @wiphy: the wiphy
899 * @bss: the bss to remove
900 *
901 * This function removes the given BSS from the internal data structures
902 * thereby making it no longer show up in scan results etc. Use this
903 * function when you detect a BSS is gone. Normally BSSes will also time
904 * out, so it is not necessary to use this function at all.
905 */
906void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
Johannes Bergfee52672008-11-26 22:36:31 +0100907
Jouni Malinen6039f6d2009-03-19 13:39:21 +0200908/**
909 * cfg80211_send_rx_auth - notification of processed authentication
910 * @dev: network device
911 * @buf: authentication frame (header + body)
912 * @len: length of the frame data
913 *
914 * This function is called whenever an authentication has been processed in
915 * station mode.
916 */
917void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
918
919/**
920 * cfg80211_send_rx_assoc - notification of processed association
921 * @dev: network device
922 * @buf: (re)association response frame (header + body)
923 * @len: length of the frame data
924 *
925 * This function is called whenever a (re)association response has been
926 * processed in station mode.
927 */
928void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len);
929
930/**
Jouni Malinen53b46b82009-03-27 20:53:56 +0200931 * cfg80211_send_deauth - notification of processed deauthentication
Jouni Malinen6039f6d2009-03-19 13:39:21 +0200932 * @dev: network device
933 * @buf: deauthentication frame (header + body)
934 * @len: length of the frame data
935 *
936 * This function is called whenever deauthentication has been processed in
Jouni Malinen53b46b82009-03-27 20:53:56 +0200937 * station mode. This includes both received deauthentication frames and
938 * locally generated ones.
Jouni Malinen6039f6d2009-03-19 13:39:21 +0200939 */
Jouni Malinen53b46b82009-03-27 20:53:56 +0200940void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
Jouni Malinen6039f6d2009-03-19 13:39:21 +0200941
942/**
Jouni Malinen53b46b82009-03-27 20:53:56 +0200943 * cfg80211_send_disassoc - notification of processed disassociation
Jouni Malinen6039f6d2009-03-19 13:39:21 +0200944 * @dev: network device
945 * @buf: disassociation response frame (header + body)
946 * @len: length of the frame data
947 *
948 * This function is called whenever disassociation has been processed in
Jouni Malinen53b46b82009-03-27 20:53:56 +0200949 * station mode. This includes both received disassociation frames and locally
950 * generated ones.
Jouni Malinen6039f6d2009-03-19 13:39:21 +0200951 */
Jouni Malinen53b46b82009-03-27 20:53:56 +0200952void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
Jouni Malinen6039f6d2009-03-19 13:39:21 +0200953
Kalle Valoa08c1c12009-03-22 21:57:28 +0200954/**
955 * cfg80211_hold_bss - exclude bss from expiration
956 * @bss: bss which should not expire
957 *
958 * In a case when the BSS is not updated but it shouldn't expire this
959 * function can be used to mark the BSS to be excluded from expiration.
960 */
961void cfg80211_hold_bss(struct cfg80211_bss *bss);
962
963/**
964 * cfg80211_unhold_bss - remove expiration exception from the BSS
965 * @bss: bss which can expire again
966 *
967 * This function marks the BSS to be expirable again.
968 */
969void cfg80211_unhold_bss(struct cfg80211_bss *bss);
970
Jouni Malinena3b8b052009-03-27 21:59:49 +0200971/**
972 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)
973 * @dev: network device
974 * @addr: The source MAC address of the frame
975 * @key_type: The key type that the received frame used
976 * @key_id: Key identifier (0..3)
977 * @tsc: The TSC value of the frame that generated the MIC failure (6 octets)
978 *
979 * This function is called whenever the local MAC detects a MIC failure in a
980 * received frame. This matches with MLME-MICHAELMICFAILURE.indication()
981 * primitive.
982 */
983void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
984 enum nl80211_key_type key_type, int key_id,
985 const u8 *tsc);
986
Johannes Berg704232c2007-04-23 12:20:05 -0700987#endif /* __NET_CFG80211_H */