diff options
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 59 |
1 files changed, 48 insertions, 11 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 3437fa16eea5..ec8c7393956b 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -399,19 +399,34 @@ typedef enum { | |||
399 | ALG_CCMP, | 399 | ALG_CCMP, |
400 | } ieee80211_key_alg; | 400 | } ieee80211_key_alg; |
401 | 401 | ||
402 | /* | ||
403 | * This flag indiciates that the station this key is being | ||
404 | * configured for may use QoS. If your hardware cannot handle | ||
405 | * that situation it should reject that key. | ||
406 | */ | ||
407 | #define IEEE80211_KEY_FLAG_WMM_STA (1<<0) | ||
408 | |||
402 | struct ieee80211_key_conf { | 409 | struct ieee80211_key_conf { |
403 | /* shall be changed by the driver to anything but HW_KEY_IDX_INVALID */ | 410 | /* |
411 | * To be set by the driver to the key index it would like to | ||
412 | * get in the ieee80211_tx_control.key_idx which defaults | ||
413 | * to HW_KEY_IDX_INVALID so that shouldn't be used. | ||
414 | */ | ||
404 | int hw_key_idx; | 415 | int hw_key_idx; |
405 | 416 | ||
417 | /* key algorithm, ALG_NONE should never be seen by the driver */ | ||
406 | ieee80211_key_alg alg; | 418 | ieee80211_key_alg alg; |
407 | 419 | ||
408 | int keylen; | 420 | /* key flags, see above */ |
421 | u8 flags; | ||
422 | |||
423 | /* key index: 0-3 */ | ||
424 | s8 keyidx; | ||
409 | 425 | ||
410 | #define IEEE80211_KEY_FORCE_SW_ENCRYPT (1<<0) /* to be cleared by low-level | 426 | /* length of key material */ |
411 | driver */ | 427 | u8 keylen; |
412 | u32 flags; /* key configuration flags defined above */ | ||
413 | 428 | ||
414 | s8 keyidx; /* WEP key index */ | 429 | /* the key material */ |
415 | u8 key[0]; | 430 | u8 key[0]; |
416 | }; | 431 | }; |
417 | 432 | ||
@@ -419,7 +434,7 @@ struct ieee80211_key_conf { | |||
419 | #define IEEE80211_SEQ_COUNTER_TX 1 | 434 | #define IEEE80211_SEQ_COUNTER_TX 1 |
420 | 435 | ||
421 | typedef enum { | 436 | typedef enum { |
422 | SET_KEY, DISABLE_KEY, REMOVE_ALL_KEYS, | 437 | SET_KEY, DISABLE_KEY, |
423 | } set_key_cmd; | 438 | } set_key_cmd; |
424 | 439 | ||
425 | /* This is driver-visible part of the per-hw state the stack keeps. */ | 440 | /* This is driver-visible part of the per-hw state the stack keeps. */ |
@@ -492,8 +507,7 @@ struct ieee80211_hw { | |||
492 | 507 | ||
493 | /* hole at 6 */ | 508 | /* hole at 6 */ |
494 | 509 | ||
495 | /* Force software encryption for TKIP packets if WMM is enabled. */ | 510 | /* hole at 7 */ |
496 | #define IEEE80211_HW_NO_TKIP_WMM_HWACCEL (1<<7) | ||
497 | 511 | ||
498 | /* | 512 | /* |
499 | * Some devices handle Michael MIC internally and do not include MIC in | 513 | * Some devices handle Michael MIC internally and do not include MIC in |
@@ -627,12 +641,31 @@ struct ieee80211_ops { | |||
627 | * | 641 | * |
628 | * This is called to enable hardware acceleration of encryption and | 642 | * This is called to enable hardware acceleration of encryption and |
629 | * decryption. The address will be the broadcast address for default | 643 | * decryption. The address will be the broadcast address for default |
630 | * keys and the other station's hardware address for individual keys. | 644 | * keys, the other station's hardware address for individual keys or |
645 | * the zero address for keys that will be used only for transmission. | ||
646 | * | ||
647 | * The local_address parameter will always be set to our own address, | ||
648 | * this is only relevant if you support multiple local addresses. | ||
649 | * | ||
631 | * When transmitting, the TX control data will use the hw_key_idx | 650 | * When transmitting, the TX control data will use the hw_key_idx |
632 | * selected by the low-level driver. | 651 | * selected by the low-level driver. |
652 | * | ||
653 | * Return 0 if the key is now in use, -EOPNOTSUPP or -ENOSPC if it | ||
654 | * couldn't be added; if you return 0 then hw_key_idx must be | ||
655 | * assigned to something other than HW_KEY_IDX_INVALID. When the cmd | ||
656 | * is DISABLE_KEY then it must succeed. | ||
657 | * | ||
658 | * This callback can sleep, and is only called between add_interface | ||
659 | * and remove_interface calls, i.e. while the interface with the | ||
660 | * given local_address is enabled. | ||
661 | * | ||
662 | * The ieee80211_key_conf structure pointed to by the key parameter | ||
663 | * is guaranteed to be valid until another call to set_key removes | ||
664 | * it, but it can only be used as a cookie to differentiate keys. | ||
633 | */ | 665 | */ |
634 | int (*set_key)(struct ieee80211_hw *hw, set_key_cmd cmd, | 666 | int (*set_key)(struct ieee80211_hw *hw, set_key_cmd cmd, |
635 | u8 *address, struct ieee80211_key_conf *key); | 667 | const u8 *local_address, const u8 *address, |
668 | struct ieee80211_key_conf *key); | ||
636 | 669 | ||
637 | /* | 670 | /* |
638 | * Set TX key index for default/broadcast keys. This is needed in cases | 671 | * Set TX key index for default/broadcast keys. This is needed in cases |
@@ -640,6 +673,10 @@ struct ieee80211_ops { | |||
640 | * is not set), in other cases, this function pointer can be set to | 673 | * is not set), in other cases, this function pointer can be set to |
641 | * NULL since the IEEE 802.11 module takes care of selecting the key | 674 | * NULL since the IEEE 802.11 module takes care of selecting the key |
642 | * index for each TX frame. | 675 | * index for each TX frame. |
676 | * | ||
677 | * TODO: If you use this callback in your driver tell us if you need | ||
678 | * any other information from it to make it easier, like the | ||
679 | * key_conf instead. | ||
643 | */ | 680 | */ |
644 | int (*set_key_idx)(struct ieee80211_hw *hw, int idx); | 681 | int (*set_key_idx)(struct ieee80211_hw *hw, int idx); |
645 | 682 | ||