aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_main.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2009-10-08 14:56:19 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:47:48 -0400
commitac4e4ce54eb9cb4963a1d3d91fc65536d882ffb2 (patch)
tree7ce830794c7029ab65ecb00562e48d00acc98d87 /drivers/net/wireless/wl12xx/wl1271_main.c
parent3b4be9e08abd8c390d13001f5dd55f64afa5ab93 (diff)
wl1271: Security sequence number handling for TX (for WPA)
Add security sequence number handling to the driver TX data path needed by WPA. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_main.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 27298b19d5bd..bedd19b57499 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -592,6 +592,9 @@ static void wl1271_op_stop(struct ieee80211_hw *hw)
592 wl->tx_blocks_available = 0; 592 wl->tx_blocks_available = 0;
593 wl->tx_results_count = 0; 593 wl->tx_results_count = 0;
594 wl->tx_packets_count = 0; 594 wl->tx_packets_count = 0;
595 wl->tx_security_last_seq = 0;
596 wl->tx_security_seq_16 = 0;
597 wl->tx_security_seq_32 = 0;
595 wl->time_offset = 0; 598 wl->time_offset = 0;
596 wl->session_counter = 0; 599 wl->session_counter = 0;
597 for (i = 0; i < NUM_TX_QUEUES; i++) 600 for (i = 0; i < NUM_TX_QUEUES; i++)
@@ -823,6 +826,8 @@ static int wl1271_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
823 struct wl1271 *wl = hw->priv; 826 struct wl1271 *wl = hw->priv;
824 const u8 *addr; 827 const u8 *addr;
825 int ret; 828 int ret;
829 u32 tx_seq_32 = 0;
830 u16 tx_seq_16 = 0;
826 u8 key_type; 831 u8 key_type;
827 832
828 static const u8 bcast_addr[ETH_ALEN] = 833 static const u8 bcast_addr[ETH_ALEN] =
@@ -861,11 +866,15 @@ static int wl1271_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
861 key_type = KEY_TKIP; 866 key_type = KEY_TKIP;
862 867
863 key_conf->hw_key_idx = key_conf->keyidx; 868 key_conf->hw_key_idx = key_conf->keyidx;
869 tx_seq_32 = wl->tx_security_seq_32;
870 tx_seq_16 = wl->tx_security_seq_16;
864 break; 871 break;
865 case ALG_CCMP: 872 case ALG_CCMP:
866 key_type = KEY_AES; 873 key_type = KEY_AES;
867 874
868 key_conf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; 875 key_conf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
876 tx_seq_32 = wl->tx_security_seq_32;
877 tx_seq_16 = wl->tx_security_seq_16;
869 break; 878 break;
870 default: 879 default:
871 wl1271_error("Unknown key algo 0x%x", key_conf->alg); 880 wl1271_error("Unknown key algo 0x%x", key_conf->alg);
@@ -879,7 +888,7 @@ static int wl1271_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
879 ret = wl1271_cmd_set_key(wl, KEY_ADD_OR_REPLACE, 888 ret = wl1271_cmd_set_key(wl, KEY_ADD_OR_REPLACE,
880 key_conf->keyidx, key_type, 889 key_conf->keyidx, key_type,
881 key_conf->keylen, key_conf->key, 890 key_conf->keylen, key_conf->key,
882 addr); 891 addr, tx_seq_32, tx_seq_16);
883 if (ret < 0) { 892 if (ret < 0) {
884 wl1271_error("Could not add or replace key"); 893 wl1271_error("Could not add or replace key");
885 goto out_sleep; 894 goto out_sleep;
@@ -890,7 +899,7 @@ static int wl1271_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
890 ret = wl1271_cmd_set_key(wl, KEY_REMOVE, 899 ret = wl1271_cmd_set_key(wl, KEY_REMOVE,
891 key_conf->keyidx, key_type, 900 key_conf->keyidx, key_type,
892 key_conf->keylen, key_conf->key, 901 key_conf->keylen, key_conf->key,
893 addr); 902 addr, 0, 0);
894 if (ret < 0) { 903 if (ret < 0) {
895 wl1271_error("Could not remove key"); 904 wl1271_error("Could not remove key");
896 goto out_sleep; 905 goto out_sleep;