diff options
author | Oz Krakowski <ozk@ti.com> | 2011-06-26 10:36:02 +0300 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-07-05 21:33:19 +0300 |
commit | b992c68228a3ccdf73ea4f57519e1663839a9cbe (patch) | |
tree | f2f208489c15e63612d5d6fe86bbdfef125523c7 /drivers/net/wireless/wl12xx/tx.c | |
parent | 95dac04f881322b510c45e5ae83f0dbee4f823a2 (diff) | |
download | talos-obmc-linux-b992c68228a3ccdf73ea4f57519e1663839a9cbe.tar.gz talos-obmc-linux-b992c68228a3ccdf73ea4f57519e1663839a9cbe.zip |
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/tx.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/tx.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index 200590c0d9e3..003f9e08691b 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c @@ -704,10 +704,24 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, wl->stats.retry_count += result->ack_failures; - /* update security sequence number */ - wl->tx_security_seq += (result->lsb_security_sequence_number - - wl->tx_security_last_seq); - wl->tx_security_last_seq = result->lsb_security_sequence_number; + /* + * update sequence number only when relevant, i.e. only in + * sessions of TKIP, AES and GEM (not in open or WEP sessions) + */ + if (info->control.hw_key && + (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP || + info->control.hw_key->cipher == WLAN_CIPHER_SUITE_CCMP || + info->control.hw_key->cipher == WL1271_CIPHER_SUITE_GEM)) { + u8 fw_lsb = result->tx_security_sequence_number_lsb; + u8 cur_lsb = wl->tx_security_last_seq_lsb; + + /* + * update security sequence number, taking care of potential + * wrap-around + */ + wl->tx_security_seq += (fw_lsb - cur_lsb + 256) % 256; + wl->tx_security_last_seq_lsb = fw_lsb; + } /* remove private header from packet */ skb_pull(skb, sizeof(struct wl1271_tx_hw_descr)); |