aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-09-14 11:10:25 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:49:29 -0400
commit7ac1bd6aecc92cfe6ec11891819dd4c26f2f7879 (patch)
treebfe1ee77b34bdba864e1f4077d9c2d4f0d4a4c88 /include/net/mac80211.h
parentc15a205070fac9fab0d9d4642b9342677b67f933 (diff)
[MAC80211]: some more documentation
This patch formats some documentation in mac80211.h into kerneldoc and also adds some more explanations for hardware crypto. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h148
1 files changed, 105 insertions, 43 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 8f22b7384805..950a4827507f 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -224,24 +224,56 @@ struct ieee80211_tx_control {
224 int ifindex; /* internal */ 224 int ifindex; /* internal */
225}; 225};
226 226
227/* Receive status. The low-level driver should provide this information 227
228 * (the subset supported by hardware) to the 802.11 code with each received 228/**
229 * frame. */ 229 * enum mac80211_rx_flags - receive flags
230 *
231 * These flags are used with the @flag member of &struct ieee80211_rx_status.
232 * @RX_FLAG_MMIC_ERROR: Michael MIC error was reported on this frame.
233 * Use together with %RX_FLAG_MMIC_STRIPPED.
234 * @RX_FLAG_DECRYPTED: This frame was decrypted in hardware.
235 * @RX_FLAG_RADIOTAP: This frame starts with a radiotap header.
236 * @RX_FLAG_MMIC_STRIPPED: the Michael MIC is stripped off this frame,
237 * verification has been done by the hardware.
238 * @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame.
239 * If this flag is set, the stack cannot do any replay detection
240 * hence the driver or hardware will have to do that.
241 */
242enum mac80211_rx_flags {
243 RX_FLAG_MMIC_ERROR = 1<<0,
244 RX_FLAG_DECRYPTED = 1<<1,
245 RX_FLAG_RADIOTAP = 1<<2,
246 RX_FLAG_MMIC_STRIPPED = 1<<3,
247 RX_FLAG_IV_STRIPPED = 1<<4,
248};
249
250/**
251 * struct ieee80211_rx_status - receive status
252 *
253 * The low-level driver should provide this information (the subset
254 * supported by hardware) to the 802.11 code with each received
255 * frame.
256 * @mactime: MAC timestamp as defined by 802.11
257 * @freq: frequency the radio was tuned to when receiving this frame, in MHz
258 * @channel: channel the radio was tuned to
259 * @phymode: active PHY mode
260 * @ssi: signal strength when receiving this frame
261 * @signal: used as 'qual' in statistics reporting
262 * @noise: PHY noise when receiving this frame
263 * @antenna: antenna used
264 * @rate: data rate
265 * @flag: %RX_FLAG_*
266 */
230struct ieee80211_rx_status { 267struct ieee80211_rx_status {
231 u64 mactime; 268 u64 mactime;
232 int freq; /* receive frequency in Mhz */ 269 int freq;
233 int channel; 270 int channel;
234 int phymode; 271 int phymode;
235 int ssi; 272 int ssi;
236 int signal; /* used as qual in statistics reporting */ 273 int signal;
237 int noise; 274 int noise;
238 int antenna; 275 int antenna;
239 int rate; 276 int rate;
240#define RX_FLAG_MMIC_ERROR (1<<0)
241#define RX_FLAG_DECRYPTED (1<<1)
242#define RX_FLAG_RADIOTAP (1<<2)
243#define RX_FLAG_MMIC_STRIPPED (1<<3)
244#define RX_FLAG_IV_STRIPPED (1<<4)
245 int flag; 277 int flag;
246}; 278};
247 279
@@ -391,62 +423,87 @@ struct ieee80211_if_conf {
391 struct ieee80211_tx_control *beacon_control; 423 struct ieee80211_tx_control *beacon_control;
392}; 424};
393 425
394typedef enum { 426/**
427 * enum ieee80211_key_alg - key algorithm
428 * @ALG_NONE: Unset key algorithm, will never be passed to the driver
429 * @ALG_WEP: WEP40 or WEP104
430 * @ALG_TKIP: TKIP
431 * @ALG_CCMP: CCMP (AES)
432 */
433typedef enum ieee80211_key_alg {
395 ALG_NONE, 434 ALG_NONE,
396 ALG_WEP, 435 ALG_WEP,
397 ALG_TKIP, 436 ALG_TKIP,
398 ALG_CCMP, 437 ALG_CCMP,
399} ieee80211_key_alg; 438} ieee80211_key_alg;
400 439
401/* 440
402 * This flag indiciates that the station this key is being 441/**
403 * configured for may use QoS. If your hardware cannot handle 442 * enum ieee80211_key_flags - key flags
404 * that situation it should reject that key. 443 *
405 */ 444 * These flags are used for communication about keys between the driver
406#define IEEE80211_KEY_FLAG_WMM_STA (1<<0) 445 * and mac80211, with the @flags parameter of &struct ieee80211_key_conf.
407/* 446 *
408 * This flag should be set by the driver if it requires 447 * @IEEE80211_KEY_FLAG_WMM_STA: Set by mac80211, this flag indicates
409 * IV generation in software for this key. 448 * that the STA this key will be used with could be using QoS.
410 */ 449 * @IEEE80211_KEY_FLAG_GENERATE_IV: This flag should be set by the
411#define IEEE80211_KEY_FLAG_GENERATE_IV (1<<1) 450 * driver to indicate that it requires IV generation for this
412/* 451 * particular key.
413 * This flag should be set by the driver if it requires 452 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
414 * MMIC generation in software for this key. 453 * the driver for a TKIP key if it requires Michael MIC
454 * generation in software.
415 */ 455 */
416#define IEEE80211_KEY_FLAG_GENERATE_MMIC (1<<2) 456enum ieee80211_key_flags {
457 IEEE80211_KEY_FLAG_WMM_STA = 1<<0,
458 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1,
459 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
460};
417 461
462/**
463 * struct ieee80211_key_conf - key information
464 *
465 * This key information is given by mac80211 to the driver by
466 * the set_key() callback in &struct ieee80211_ops.
467 *
468 * @hw_key_idx: To be set by the driver, this is the key index the driver
469 * wants to be given when a frame is transmitted and needs to be
470 * encrypted in hardware. It defaults to %HW_KEY_IDX_INVALID which
471 * the driver may not use.
472 * @alg: The key algorithm.
473 * @flags: key flags, see &enum ieee80211_key_flags.
474 * @keyidx: the key index (0-3)
475 * @keylen: key material length
476 * @key: key material
477 */
418struct ieee80211_key_conf { 478struct ieee80211_key_conf {
419 /*
420 * To be set by the driver to the key index it would like to
421 * get in the ieee80211_tx_control.key_idx which defaults
422 * to HW_KEY_IDX_INVALID so that shouldn't be used.
423 */
424 int hw_key_idx; 479 int hw_key_idx;
425
426 /* key algorithm, ALG_NONE should never be seen by the driver */
427 ieee80211_key_alg alg; 480 ieee80211_key_alg alg;
428
429 /* key flags, see above */
430 u8 flags; 481 u8 flags;
431
432 /* key index: 0-3 */
433 s8 keyidx; 482 s8 keyidx;
434
435 /* length of key material */
436 u8 keylen; 483 u8 keylen;
437
438 /* the key material */
439 u8 key[0]; 484 u8 key[0];
440}; 485};
441 486
442#define IEEE80211_SEQ_COUNTER_RX 0 487#define IEEE80211_SEQ_COUNTER_RX 0
443#define IEEE80211_SEQ_COUNTER_TX 1 488#define IEEE80211_SEQ_COUNTER_TX 1
444 489
445typedef enum { 490/**
491 * enum set_key_cmd - key command
492 *
493 * Used with the set_key() callback in &struct ieee80211_ops, this
494 * indicates whether a key is being removed or added.
495 *
496 * @SET_KEY: a key is set
497 * @DISABLE_KEY: a key must be disabled
498 */
499typedef enum set_key_cmd {
446 SET_KEY, DISABLE_KEY, 500 SET_KEY, DISABLE_KEY,
447} set_key_cmd; 501} set_key_cmd;
448 502
449/* This is driver-visible part of the per-hw state the stack keeps. */ 503/**
504 * struct ieee80211_hw - hardware information and state
505 * TODO: move documentation into kernel-doc format
506 */
450struct ieee80211_hw { 507struct ieee80211_hw {
451 /* points to the cfg80211 wiphy for this piece. Note 508 /* points to the cfg80211 wiphy for this piece. Note
452 * that you must fill in the perm_addr and dev fields 509 * that you must fill in the perm_addr and dev fields
@@ -633,6 +690,11 @@ struct ieee80211_ops {
633 * assigned to something other than HW_KEY_IDX_INVALID. When the cmd 690 * assigned to something other than HW_KEY_IDX_INVALID. When the cmd
634 * is DISABLE_KEY then it must succeed. 691 * is DISABLE_KEY then it must succeed.
635 * 692 *
693 * Note that it is permissible to not decrypt a frame even if a key
694 * for it has been uploaded to hardware, the stack will not make any
695 * decision based on whether a key has been uploaded or not but rather
696 * based on the receive flags.
697 *
636 * This callback can sleep, and is only called between add_interface 698 * This callback can sleep, and is only called between add_interface
637 * and remove_interface calls, i.e. while the interface with the 699 * and remove_interface calls, i.e. while the interface with the
638 * given local_address is enabled. 700 * given local_address is enabled.