blob: 5287a3e56e7c129a15a5f29f06a084ea45daca0e [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 Berg04a773a2009-04-19 21:24:32 +0200661 * struct cfg80211_ibss_params - IBSS parameters
662 *
663 * This structure defines the IBSS parameters for the join_ibss()
664 * method.
665 *
666 * @ssid: The SSID, will always be non-null.
667 * @ssid_len: The length of the SSID, will always be non-zero.
668 * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not
669 * search for IBSSs with a different BSSID.
670 * @channel: The channel to use if no IBSS can be found to join.
671 * @channel_fixed: The channel should be fixed -- do not search for
672 * IBSSs to join on other channels.
673 * @ie: information element(s) to include in the beacon
674 * @ie_len: length of that
675 */
676struct cfg80211_ibss_params {
677 u8 *ssid;
678 u8 *bssid;
679 struct ieee80211_channel *channel;
680 u8 *ie;
681 u8 ssid_len, ie_len;
682 bool channel_fixed;
683};
684
685/**
Johannes Berg704232c2007-04-23 12:20:05 -0700686 * struct cfg80211_ops - backend description for wireless configuration
687 *
688 * This struct is registered by fullmac card drivers and/or wireless stacks
689 * in order to handle configuration requests on their interfaces.
690 *
691 * All callbacks except where otherwise noted should return 0
692 * on success or a negative error code.
693 *
Johannes Berg43fb45cb2007-04-24 14:07:27 -0700694 * All operations are currently invoked under rtnl for consistency with the
695 * wireless extensions but this is subject to reevaluation as soon as this
696 * code is used more widely and we have a first user without wext.
697 *
Johannes Berg0378b3f2009-01-19 11:20:52 -0500698 * @suspend: wiphy device needs to be suspended
699 * @resume: wiphy device needs to be resumed
700 *
Johannes Berg60719ff2008-09-16 14:55:09 +0200701 * @add_virtual_intf: create a new virtual interface with the given name,
702 * must set the struct wireless_dev's iftype.
Johannes Berg704232c2007-04-23 12:20:05 -0700703 *
704 * @del_virtual_intf: remove the virtual interface determined by ifindex.
Johannes Berg55682962007-09-20 13:09:35 -0400705 *
Johannes Berg60719ff2008-09-16 14:55:09 +0200706 * @change_virtual_intf: change type/configuration of virtual interface,
707 * keep the struct wireless_dev's iftype updated.
Johannes Berg55682962007-09-20 13:09:35 -0400708 *
Johannes Berg41ade002007-12-19 02:03:29 +0100709 * @add_key: add a key with the given parameters. @mac_addr will be %NULL
710 * when adding a group key.
711 *
712 * @get_key: get information about the key with the given parameters.
713 * @mac_addr will be %NULL when requesting information for a group
714 * key. All pointers given to the @callback function need not be valid
715 * after it returns.
716 *
717 * @del_key: remove a key given the @mac_addr (%NULL for a group key)
718 * and @key_index
719 *
720 * @set_default_key: set the default key on an interface
Johannes Berged1b6cc2007-12-19 02:03:32 +0100721 *
Jouni Malinen3cfcf6ac2009-01-08 13:32:02 +0200722 * @set_default_mgmt_key: set the default management frame key on an interface
723 *
Johannes Berged1b6cc2007-12-19 02:03:32 +0100724 * @add_beacon: Add a beacon with given parameters, @head, @interval
725 * and @dtim_period will be valid, @tail is optional.
726 * @set_beacon: Change the beacon parameters for an access point mode
727 * interface. This should reject the call when no beacon has been
728 * configured.
729 * @del_beacon: Remove beacon configuration and stop sending the beacon.
Johannes Berg5727ef12007-12-19 02:03:34 +0100730 *
731 * @add_station: Add a new station.
732 *
733 * @del_station: Remove a station; @mac may be NULL to remove all stations.
734 *
735 * @change_station: Modify a given station.
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100736 *
colin@cozybit.com93da9cc2008-10-21 12:03:48 -0700737 * @get_mesh_params: Put the current mesh parameters into *params
738 *
739 * @set_mesh_params: Set mesh parameters.
740 * The mask is a bitfield which tells us which parameters to
741 * set, and which to leave alone.
742 *
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100743 * @set_mesh_cfg: set mesh parameters (by now, just mesh id)
Jouni Malinen9f1ba902008-08-07 20:07:01 +0300744 *
745 * @change_bss: Modify parameters for a given BSS.
Jouni Malinen31888482008-10-30 16:59:24 +0200746 *
747 * @set_txq_params: Set TX queue parameters
Jouni Malinen72bdcf32008-11-26 16:15:24 +0200748 *
749 * @set_channel: Set channel
Jouni Malinen9aed3cc2009-01-13 16:03:29 +0200750 *
Johannes Berg2a519312009-02-10 21:25:55 +0100751 * @scan: Request to do a scan. If returning zero, the scan request is given
752 * the driver, and will be valid until passed to cfg80211_scan_done().
753 * For scan results, call cfg80211_inform_bss(); you can call this outside
754 * the scan/scan_done bracket too.
Jouni Malinen636a5d32009-03-19 13:39:22 +0200755 *
756 * @auth: Request to authenticate with the specified peer
757 * @assoc: Request to (re)associate with the specified peer
758 * @deauth: Request to deauthenticate from the specified peer
759 * @disassoc: Request to disassociate from the specified peer
Johannes Berg04a773a2009-04-19 21:24:32 +0200760 *
761 * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call
762 * cfg80211_ibss_joined(), also call that function when changing BSSID due
763 * to a merge.
764 * @leave_ibss: Leave the IBSS.
Johannes Berg704232c2007-04-23 12:20:05 -0700765 */
766struct cfg80211_ops {
Johannes Berg0378b3f2009-01-19 11:20:52 -0500767 int (*suspend)(struct wiphy *wiphy);
768 int (*resume)(struct wiphy *wiphy);
769
Johannes Berg704232c2007-04-23 12:20:05 -0700770 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100771 enum nl80211_iftype type, u32 *flags,
772 struct vif_params *params);
Johannes Berg704232c2007-04-23 12:20:05 -0700773 int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex);
Johannes Berg55682962007-09-20 13:09:35 -0400774 int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex,
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100775 enum nl80211_iftype type, u32 *flags,
776 struct vif_params *params);
Johannes Berg41ade002007-12-19 02:03:29 +0100777
778 int (*add_key)(struct wiphy *wiphy, struct net_device *netdev,
779 u8 key_index, u8 *mac_addr,
780 struct key_params *params);
781 int (*get_key)(struct wiphy *wiphy, struct net_device *netdev,
782 u8 key_index, u8 *mac_addr, void *cookie,
783 void (*callback)(void *cookie, struct key_params*));
784 int (*del_key)(struct wiphy *wiphy, struct net_device *netdev,
785 u8 key_index, u8 *mac_addr);
786 int (*set_default_key)(struct wiphy *wiphy,
787 struct net_device *netdev,
788 u8 key_index);
Jouni Malinen3cfcf6ac2009-01-08 13:32:02 +0200789 int (*set_default_mgmt_key)(struct wiphy *wiphy,
790 struct net_device *netdev,
791 u8 key_index);
Johannes Berged1b6cc2007-12-19 02:03:32 +0100792
793 int (*add_beacon)(struct wiphy *wiphy, struct net_device *dev,
794 struct beacon_parameters *info);
795 int (*set_beacon)(struct wiphy *wiphy, struct net_device *dev,
796 struct beacon_parameters *info);
797 int (*del_beacon)(struct wiphy *wiphy, struct net_device *dev);
Johannes Berg5727ef12007-12-19 02:03:34 +0100798
799
800 int (*add_station)(struct wiphy *wiphy, struct net_device *dev,
801 u8 *mac, struct station_parameters *params);
802 int (*del_station)(struct wiphy *wiphy, struct net_device *dev,
803 u8 *mac);
804 int (*change_station)(struct wiphy *wiphy, struct net_device *dev,
805 u8 *mac, struct station_parameters *params);
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100806 int (*get_station)(struct wiphy *wiphy, struct net_device *dev,
Luis Carlos Cobo2ec600d2008-02-23 15:17:06 +0100807 u8 *mac, struct station_info *sinfo);
808 int (*dump_station)(struct wiphy *wiphy, struct net_device *dev,
809 int idx, u8 *mac, struct station_info *sinfo);
810
811 int (*add_mpath)(struct wiphy *wiphy, struct net_device *dev,
812 u8 *dst, u8 *next_hop);
813 int (*del_mpath)(struct wiphy *wiphy, struct net_device *dev,
814 u8 *dst);
815 int (*change_mpath)(struct wiphy *wiphy, struct net_device *dev,
816 u8 *dst, u8 *next_hop);
817 int (*get_mpath)(struct wiphy *wiphy, struct net_device *dev,
818 u8 *dst, u8 *next_hop,
819 struct mpath_info *pinfo);
820 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev,
821 int idx, u8 *dst, u8 *next_hop,
822 struct mpath_info *pinfo);
colin@cozybit.com93da9cc2008-10-21 12:03:48 -0700823 int (*get_mesh_params)(struct wiphy *wiphy,
824 struct net_device *dev,
825 struct mesh_config *conf);
826 int (*set_mesh_params)(struct wiphy *wiphy,
827 struct net_device *dev,
828 const struct mesh_config *nconf, u32 mask);
Jouni Malinen9f1ba902008-08-07 20:07:01 +0300829 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
830 struct bss_parameters *params);
Jouni Malinen31888482008-10-30 16:59:24 +0200831
832 int (*set_txq_params)(struct wiphy *wiphy,
833 struct ieee80211_txq_params *params);
Jouni Malinen72bdcf32008-11-26 16:15:24 +0200834
835 int (*set_channel)(struct wiphy *wiphy,
836 struct ieee80211_channel *chan,
Sujith094d05d2008-12-12 11:57:43 +0530837 enum nl80211_channel_type channel_type);
Jouni Malinen9aed3cc2009-01-13 16:03:29 +0200838
Johannes Berg2a519312009-02-10 21:25:55 +0100839 int (*scan)(struct wiphy *wiphy, struct net_device *dev,
840 struct cfg80211_scan_request *request);
Jouni Malinen636a5d32009-03-19 13:39:22 +0200841
842 int (*auth)(struct wiphy *wiphy, struct net_device *dev,
843 struct cfg80211_auth_request *req);
844 int (*assoc)(struct wiphy *wiphy, struct net_device *dev,
845 struct cfg80211_assoc_request *req);
846 int (*deauth)(struct wiphy *wiphy, struct net_device *dev,
847 struct cfg80211_deauth_request *req);
848 int (*disassoc)(struct wiphy *wiphy, struct net_device *dev,
849 struct cfg80211_disassoc_request *req);
Johannes Berg04a773a2009-04-19 21:24:32 +0200850
851 int (*join_ibss)(struct wiphy *wiphy, struct net_device *dev,
852 struct cfg80211_ibss_params *params);
853 int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev);
Johannes Berg704232c2007-04-23 12:20:05 -0700854};
855
Johannes Bergfee52672008-11-26 22:36:31 +0100856/* temporary wext handlers */
857int cfg80211_wext_giwname(struct net_device *dev,
858 struct iw_request_info *info,
859 char *name, char *extra);
Johannes Berge60c7742008-11-26 23:31:40 +0100860int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
861 u32 *mode, char *extra);
862int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info,
863 u32 *mode, char *extra);
Johannes Berg2a519312009-02-10 21:25:55 +0100864int cfg80211_wext_siwscan(struct net_device *dev,
865 struct iw_request_info *info,
866 union iwreq_data *wrqu, char *extra);
867int cfg80211_wext_giwscan(struct net_device *dev,
868 struct iw_request_info *info,
869 struct iw_point *data, char *extra);
Johannes Berg691597c2009-04-19 19:57:45 +0200870int cfg80211_wext_siwmlme(struct net_device *dev,
871 struct iw_request_info *info,
872 struct iw_point *data, char *extra);
Johannes Berg4aa188e2009-02-18 19:32:08 +0100873int cfg80211_wext_giwrange(struct net_device *dev,
874 struct iw_request_info *info,
875 struct iw_point *data, char *extra);
Johannes Berg04a773a2009-04-19 21:24:32 +0200876int cfg80211_ibss_wext_siwfreq(struct net_device *dev,
877 struct iw_request_info *info,
878 struct iw_freq *freq, char *extra);
879int cfg80211_ibss_wext_giwfreq(struct net_device *dev,
880 struct iw_request_info *info,
881 struct iw_freq *freq, char *extra);
882int cfg80211_ibss_wext_siwessid(struct net_device *dev,
883 struct iw_request_info *info,
884 struct iw_point *data, char *ssid);
885int cfg80211_ibss_wext_giwessid(struct net_device *dev,
886 struct iw_request_info *info,
887 struct iw_point *data, char *ssid);
888int cfg80211_ibss_wext_siwap(struct net_device *dev,
889 struct iw_request_info *info,
890 struct sockaddr *ap_addr, char *extra);
891int cfg80211_ibss_wext_giwap(struct net_device *dev,
892 struct iw_request_info *info,
893 struct sockaddr *ap_addr, char *extra);
894
895/* wext helper for now (to be removed) */
896struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
897 struct iw_freq *freq);
Johannes Berg2a519312009-02-10 21:25:55 +0100898
899/**
900 * cfg80211_scan_done - notify that scan finished
901 *
902 * @request: the corresponding scan request
903 * @aborted: set to true if the scan was aborted for any reason,
904 * userspace will be notified of that
905 */
906void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted);
907
908/**
909 * cfg80211_inform_bss - inform cfg80211 of a new BSS
910 *
911 * @wiphy: the wiphy reporting the BSS
912 * @bss: the found BSS
Johannes Berg77965c92009-02-18 18:45:06 +0100913 * @signal: the signal strength, type depends on the wiphy's signal_type
Johannes Berg2a519312009-02-10 21:25:55 +0100914 * @gfp: context flags
915 *
916 * This informs cfg80211 that BSS information was found and
917 * the BSS should be updated/added.
918 */
919struct cfg80211_bss*
920cfg80211_inform_bss_frame(struct wiphy *wiphy,
921 struct ieee80211_channel *channel,
922 struct ieee80211_mgmt *mgmt, size_t len,
Johannes Berg77965c92009-02-18 18:45:06 +0100923 s32 signal, gfp_t gfp);
Johannes Berg2a519312009-02-10 21:25:55 +0100924
Jussi Kivilinna06aa7af2009-03-26 23:40:09 +0200925struct cfg80211_bss*
926cfg80211_inform_bss(struct wiphy *wiphy,
927 struct ieee80211_channel *channel,
928 const u8 *bssid,
929 u64 timestamp, u16 capability, u16 beacon_interval,
930 const u8 *ie, size_t ielen,
931 s32 signal, gfp_t gfp);
932
Johannes Berg2a519312009-02-10 21:25:55 +0100933struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
934 struct ieee80211_channel *channel,
935 const u8 *bssid,
Johannes Berg79420f02009-02-10 21:25:59 +0100936 const u8 *ssid, size_t ssid_len,
937 u16 capa_mask, u16 capa_val);
938static inline struct cfg80211_bss *
939cfg80211_get_ibss(struct wiphy *wiphy,
940 struct ieee80211_channel *channel,
941 const u8 *ssid, size_t ssid_len)
942{
943 return cfg80211_get_bss(wiphy, channel, NULL, ssid, ssid_len,
944 WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
945}
946
Johannes Berg2a519312009-02-10 21:25:55 +0100947struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy,
948 struct ieee80211_channel *channel,
949 const u8 *meshid, size_t meshidlen,
950 const u8 *meshcfg);
951void cfg80211_put_bss(struct cfg80211_bss *bss);
Johannes Bergd491af12009-02-10 21:25:58 +0100952/**
953 * cfg80211_unlink_bss - unlink BSS from internal data structures
954 * @wiphy: the wiphy
955 * @bss: the bss to remove
956 *
957 * This function removes the given BSS from the internal data structures
958 * thereby making it no longer show up in scan results etc. Use this
959 * function when you detect a BSS is gone. Normally BSSes will also time
960 * out, so it is not necessary to use this function at all.
961 */
962void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
Johannes Bergfee52672008-11-26 22:36:31 +0100963
Jouni Malinen6039f6d2009-03-19 13:39:21 +0200964/**
965 * cfg80211_send_rx_auth - notification of processed authentication
966 * @dev: network device
967 * @buf: authentication frame (header + body)
968 * @len: length of the frame data
969 *
970 * This function is called whenever an authentication has been processed in
971 * station mode.
972 */
973void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
974
975/**
976 * cfg80211_send_rx_assoc - notification of processed association
977 * @dev: network device
978 * @buf: (re)association response frame (header + body)
979 * @len: length of the frame data
980 *
981 * This function is called whenever a (re)association response has been
982 * processed in station mode.
983 */
984void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len);
985
986/**
Jouni Malinen53b46b82009-03-27 20:53:56 +0200987 * cfg80211_send_deauth - notification of processed deauthentication
Jouni Malinen6039f6d2009-03-19 13:39:21 +0200988 * @dev: network device
989 * @buf: deauthentication frame (header + body)
990 * @len: length of the frame data
991 *
992 * This function is called whenever deauthentication has been processed in
Jouni Malinen53b46b82009-03-27 20:53:56 +0200993 * station mode. This includes both received deauthentication frames and
994 * locally generated ones.
Jouni Malinen6039f6d2009-03-19 13:39:21 +0200995 */
Jouni Malinen53b46b82009-03-27 20:53:56 +0200996void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
Jouni Malinen6039f6d2009-03-19 13:39:21 +0200997
998/**
Jouni Malinen53b46b82009-03-27 20:53:56 +0200999 * cfg80211_send_disassoc - notification of processed disassociation
Jouni Malinen6039f6d2009-03-19 13:39:21 +02001000 * @dev: network device
1001 * @buf: disassociation response frame (header + body)
1002 * @len: length of the frame data
1003 *
1004 * This function is called whenever disassociation has been processed in
Jouni Malinen53b46b82009-03-27 20:53:56 +02001005 * station mode. This includes both received disassociation frames and locally
1006 * generated ones.
Jouni Malinen6039f6d2009-03-19 13:39:21 +02001007 */
Jouni Malinen53b46b82009-03-27 20:53:56 +02001008void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
Jouni Malinen6039f6d2009-03-19 13:39:21 +02001009
Kalle Valoa08c1c12009-03-22 21:57:28 +02001010/**
1011 * cfg80211_hold_bss - exclude bss from expiration
1012 * @bss: bss which should not expire
1013 *
1014 * In a case when the BSS is not updated but it shouldn't expire this
1015 * function can be used to mark the BSS to be excluded from expiration.
1016 */
1017void cfg80211_hold_bss(struct cfg80211_bss *bss);
1018
1019/**
1020 * cfg80211_unhold_bss - remove expiration exception from the BSS
1021 * @bss: bss which can expire again
1022 *
1023 * This function marks the BSS to be expirable again.
1024 */
1025void cfg80211_unhold_bss(struct cfg80211_bss *bss);
1026
Jouni Malinena3b8b052009-03-27 21:59:49 +02001027/**
1028 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)
1029 * @dev: network device
1030 * @addr: The source MAC address of the frame
1031 * @key_type: The key type that the received frame used
1032 * @key_id: Key identifier (0..3)
1033 * @tsc: The TSC value of the frame that generated the MIC failure (6 octets)
1034 *
1035 * This function is called whenever the local MAC detects a MIC failure in a
1036 * received frame. This matches with MLME-MICHAELMICFAILURE.indication()
1037 * primitive.
1038 */
1039void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
1040 enum nl80211_key_type key_type, int key_id,
1041 const u8 *tsc);
1042
Johannes Berg04a773a2009-04-19 21:24:32 +02001043/**
1044 * cfg80211_ibss_joined - notify cfg80211 that device joined an IBSS
1045 *
1046 * @dev: network device
1047 * @bssid: the BSSID of the IBSS joined
1048 * @gfp: allocation flags
1049 *
1050 * This function notifies cfg80211 that the device joined an IBSS or
1051 * switched to a different BSSID. Before this function can be called,
1052 * either a beacon has to have been received from the IBSS, or one of
1053 * the cfg80211_inform_bss{,_frame} functions must have been called
1054 * with the locally generated beacon -- this guarantees that there is
1055 * always a scan result for this IBSS. cfg80211 will handle the rest.
1056 */
1057void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp);
1058
Johannes Berg704232c2007-04-23 12:20:05 -07001059#endif /* __NET_CFG80211_H */