aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00.h
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-08-04 10:37:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-22 16:29:58 -0400
commit2bb057d07a0bc17475a7bf897fc41667ab08b73f (patch)
tree55461e52caa34a45a67aaf9e3f1c608f96c77d59 /drivers/net/wireless/rt2x00/rt2x00.h
parent8e7cdbb6333ef7654e708bd60e50a123688dcd7b (diff)
rt2x00: Implement HW encryption
Various rt2x00 devices support hardware encryption. Most of them require the IV/EIV to be generated by mac80211, but require it to be provided seperately instead of within the frame itself. This means that rt2x00lib should extract the data from the frame and place it in the frame descriptor. During RX the IV/EIV is provided in the descriptor by the hardware which means that it should be inserted into the frame by rt2x00lib. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h39
1 files changed, 37 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 82c28dcc471d..0ffd972bb856 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -452,6 +452,23 @@ struct rt2x00lib_erp {
452}; 452};
453 453
454/* 454/*
455 * Configuration structure for hardware encryption.
456 */
457struct rt2x00lib_crypto {
458 enum cipher cipher;
459
460 enum set_key_cmd cmd;
461 const u8 *address;
462
463 u32 bssidx;
464 u32 aid;
465
466 u8 key[16];
467 u8 tx_mic[8];
468 u8 rx_mic[8];
469};
470
471/*
455 * Configuration structure wrapper around the 472 * Configuration structure wrapper around the
456 * rt2x00 interface configuration handler. 473 * rt2x00 interface configuration handler.
457 */ 474 */
@@ -547,6 +564,12 @@ struct rt2x00lib_ops {
547 /* 564 /*
548 * Configuration handlers. 565 * Configuration handlers.
549 */ 566 */
567 int (*config_shared_key) (struct rt2x00_dev *rt2x00dev,
568 struct rt2x00lib_crypto *crypto,
569 struct ieee80211_key_conf *key);
570 int (*config_pairwise_key) (struct rt2x00_dev *rt2x00dev,
571 struct rt2x00lib_crypto *crypto,
572 struct ieee80211_key_conf *key);
550 void (*config_filter) (struct rt2x00_dev *rt2x00dev, 573 void (*config_filter) (struct rt2x00_dev *rt2x00dev,
551 const unsigned int filter_flags); 574 const unsigned int filter_flags);
552 void (*config_intf) (struct rt2x00_dev *rt2x00dev, 575 void (*config_intf) (struct rt2x00_dev *rt2x00dev,
@@ -609,7 +632,7 @@ enum rt2x00_flags {
609 DEVICE_DIRTY_CONFIG, 632 DEVICE_DIRTY_CONFIG,
610 633
611 /* 634 /*
612 * Driver features 635 * Driver requirements
613 */ 636 */
614 DRIVER_REQUIRE_FIRMWARE, 637 DRIVER_REQUIRE_FIRMWARE,
615 DRIVER_REQUIRE_BEACON_GUARD, 638 DRIVER_REQUIRE_BEACON_GUARD,
@@ -618,9 +641,14 @@ enum rt2x00_flags {
618 DRIVER_REQUIRE_DMA, 641 DRIVER_REQUIRE_DMA,
619 642
620 /* 643 /*
621 * Driver configuration 644 * Driver features
622 */ 645 */
623 CONFIG_SUPPORT_HW_BUTTON, 646 CONFIG_SUPPORT_HW_BUTTON,
647 CONFIG_SUPPORT_HW_CRYPTO,
648
649 /*
650 * Driver configuration
651 */
624 CONFIG_FRAME_TYPE, 652 CONFIG_FRAME_TYPE,
625 CONFIG_RF_SEQUENCE, 653 CONFIG_RF_SEQUENCE,
626 CONFIG_EXTERNAL_LNA_A, 654 CONFIG_EXTERNAL_LNA_A,
@@ -966,6 +994,13 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
966 unsigned int changed_flags, 994 unsigned int changed_flags,
967 unsigned int *total_flags, 995 unsigned int *total_flags,
968 int mc_count, struct dev_addr_list *mc_list); 996 int mc_count, struct dev_addr_list *mc_list);
997#ifdef CONFIG_RT2X00_LIB_CRYPTO
998int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
999 const u8 *local_address, const u8 *address,
1000 struct ieee80211_key_conf *key);
1001#else
1002#define rt2x00mac_set_key NULL
1003#endif /* CONFIG_RT2X00_LIB_CRYPTO */
969int rt2x00mac_get_stats(struct ieee80211_hw *hw, 1004int rt2x00mac_get_stats(struct ieee80211_hw *hw,
970 struct ieee80211_low_level_stats *stats); 1005 struct ieee80211_low_level_stats *stats);
971int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw, 1006int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw,