aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_cmd.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_cmd.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_cmd.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 2a4351ff54d..1ee1b2b4dfa 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -228,6 +228,10 @@ int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type, u8 dtim_interval,
228 228
229 join->ctrl |= wl->session_counter << WL1271_JOIN_CMD_TX_SESSION_OFFSET; 229 join->ctrl |= wl->session_counter << WL1271_JOIN_CMD_TX_SESSION_OFFSET;
230 230
231 /* reset TX security counters */
232 wl->tx_security_last_seq = 0;
233 wl->tx_security_seq_16 = 0;
234 wl->tx_security_seq_32 = 0;
231 235
232 ret = wl1271_cmd_send(wl, CMD_START_JOIN, join, sizeof(*join)); 236 ret = wl1271_cmd_send(wl, CMD_START_JOIN, join, sizeof(*join));
233 if (ret < 0) { 237 if (ret < 0) {
@@ -759,7 +763,8 @@ out:
759} 763}
760 764
761int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, 765int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
762 u8 key_size, const u8 *key, const u8 *addr) 766 u8 key_size, const u8 *key, const u8 *addr,
767 u32 tx_seq_32, u16 tx_seq_16)
763{ 768{
764 struct wl1271_cmd_set_keys *cmd; 769 struct wl1271_cmd_set_keys *cmd;
765 int ret = 0; 770 int ret = 0;
@@ -777,12 +782,14 @@ int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
777 cmd->key_size = key_size; 782 cmd->key_size = key_size;
778 cmd->key_type = key_type; 783 cmd->key_type = key_type;
779 784
785 cmd->ac_seq_num16[0] = tx_seq_16;
786 cmd->ac_seq_num32[0] = tx_seq_32;
787
780 /* we have only one SSID profile */ 788 /* we have only one SSID profile */
781 cmd->ssid_profile = 0; 789 cmd->ssid_profile = 0;
782 790
783 cmd->id = id; 791 cmd->id = id;
784 792
785 /* FIXME: this is from wl1251, needs to be checked */
786 if (key_type == KEY_TKIP) { 793 if (key_type == KEY_TKIP) {
787 /* 794 /*
788 * We get the key in the following form: 795 * We get the key in the following form: