diff options
author | Oz Krakowski <ozk@ti.com> | 2011-06-26 03:36:02 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-07-05 14:33:19 -0400 |
commit | b992c68228a3ccdf73ea4f57519e1663839a9cbe (patch) | |
tree | f2f208489c15e63612d5d6fe86bbdfef125523c7 /drivers/net/wireless/wl12xx/main.c | |
parent | 95dac04f881322b510c45e5ae83f0dbee4f823a2 (diff) |
wl12xx: fix Tx security sequence number handling
Do not reset the security sequence number when issuing a join command or
interface is removed. Instead, reset the counter only during the unjoin
command.
Added the notion of counter wrap-around to the LSB number in
wl1271_tx_complete_packet.
Added post recovery padding to adjust for potential security number
progress during the recovery process by the firmware and avoid
potential interop issues in encrypted networks.
Signed-off-by: Oz Krakowski <ozk@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/main.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index a3734bdf5119..b896f5956d9e 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -1227,6 +1227,15 @@ static void wl1271_recovery_work(struct work_struct *work) | |||
1227 | wl1271_info("Hardware recovery in progress. FW ver: %s pc: 0x%x", | 1227 | wl1271_info("Hardware recovery in progress. FW ver: %s pc: 0x%x", |
1228 | wl->chip.fw_ver_str, wl1271_read32(wl, SCR_PAD4)); | 1228 | wl->chip.fw_ver_str, wl1271_read32(wl, SCR_PAD4)); |
1229 | 1229 | ||
1230 | /* | ||
1231 | * Advance security sequence number to overcome potential progress | ||
1232 | * in the firmware during recovery. This doens't hurt if the network is | ||
1233 | * not encrypted. | ||
1234 | */ | ||
1235 | if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags) || | ||
1236 | test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) | ||
1237 | wl->tx_security_seq += WL1271_TX_SQN_POST_RECOVERY_PADDING; | ||
1238 | |||
1230 | if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) | 1239 | if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) |
1231 | ieee80211_connection_loss(wl->vif); | 1240 | ieee80211_connection_loss(wl->vif); |
1232 | 1241 | ||
@@ -1980,8 +1989,6 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl, | |||
1980 | wl->tx_allocated_blocks = 0; | 1989 | wl->tx_allocated_blocks = 0; |
1981 | wl->tx_results_count = 0; | 1990 | wl->tx_results_count = 0; |
1982 | wl->tx_packets_count = 0; | 1991 | wl->tx_packets_count = 0; |
1983 | wl->tx_security_last_seq = 0; | ||
1984 | wl->tx_security_seq = 0; | ||
1985 | wl->time_offset = 0; | 1992 | wl->time_offset = 0; |
1986 | wl->session_counter = 0; | 1993 | wl->session_counter = 0; |
1987 | wl->rate_set = CONF_TX_RATE_MASK_BASIC; | 1994 | wl->rate_set = CONF_TX_RATE_MASK_BASIC; |
@@ -2154,6 +2161,10 @@ static int wl1271_unjoin(struct wl1271 *wl) | |||
2154 | clear_bit(WL1271_FLAG_JOINED, &wl->flags); | 2161 | clear_bit(WL1271_FLAG_JOINED, &wl->flags); |
2155 | memset(wl->bssid, 0, ETH_ALEN); | 2162 | memset(wl->bssid, 0, ETH_ALEN); |
2156 | 2163 | ||
2164 | /* reset TX security counters on a clean disconnect */ | ||
2165 | wl->tx_security_last_seq_lsb = 0; | ||
2166 | wl->tx_security_seq = 0; | ||
2167 | |||
2157 | /* stop filtering packets based on bssid */ | 2168 | /* stop filtering packets based on bssid */ |
2158 | wl1271_configure_filters(wl, FIF_OTHER_BSS); | 2169 | wl1271_configure_filters(wl, FIF_OTHER_BSS); |
2159 | 2170 | ||
@@ -4327,6 +4338,9 @@ struct ieee80211_hw *wl1271_alloc_hw(void) | |||
4327 | wl->quirks = 0; | 4338 | wl->quirks = 0; |
4328 | wl->platform_quirks = 0; | 4339 | wl->platform_quirks = 0; |
4329 | wl->sched_scanning = false; | 4340 | wl->sched_scanning = false; |
4341 | wl->tx_security_seq = 0; | ||
4342 | wl->tx_security_last_seq_lsb = 0; | ||
4343 | |||
4330 | setup_timer(&wl->rx_streaming_timer, wl1271_rx_streaming_timer, | 4344 | setup_timer(&wl->rx_streaming_timer, wl1271_rx_streaming_timer, |
4331 | (unsigned long) wl); | 4345 | (unsigned long) wl); |
4332 | wl->fwlog_size = 0; | 4346 | wl->fwlog_size = 0; |