diff options
author | Eliad Peller <eliad@wizery.com> | 2011-10-10 04:12:58 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-10-11 08:04:23 -0400 |
commit | 48e93e402ad19f570bae323b07911bdf6562af8e (patch) | |
tree | e472d28864aede3c878886941b338bdb64947a54 /drivers/net/wireless/wl12xx/tx.c | |
parent | 4b730b6a814fe52425d90ff3db3d8deefb22fb24 (diff) |
wl12xx: move tx_security_seq into wlvif
The last security seq num has to be saved across reconfigs.
Add a new "persistent" struct into wlvif, which won't get
deleted on wl12xx_init_vif_data()
Signed-off-by: Eliad Peller <eliad@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 | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index c7be15186c4a..8c35d37ba600 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c | |||
@@ -755,6 +755,8 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, | |||
755 | struct wl1271_tx_hw_res_descr *result) | 755 | struct wl1271_tx_hw_res_descr *result) |
756 | { | 756 | { |
757 | struct ieee80211_tx_info *info; | 757 | struct ieee80211_tx_info *info; |
758 | struct ieee80211_vif *vif; | ||
759 | struct wl12xx_vif *wlvif; | ||
758 | struct sk_buff *skb; | 760 | struct sk_buff *skb; |
759 | int id = result->id; | 761 | int id = result->id; |
760 | int rate = -1; | 762 | int rate = -1; |
@@ -774,6 +776,10 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, | |||
774 | return; | 776 | return; |
775 | } | 777 | } |
776 | 778 | ||
779 | /* info->control is valid as long as we don't update info->status */ | ||
780 | vif = info->control.vif; | ||
781 | wlvif = wl12xx_vif_to_data(vif); | ||
782 | |||
777 | /* update the TX status info */ | 783 | /* update the TX status info */ |
778 | if (result->status == TX_SUCCESS) { | 784 | if (result->status == TX_SUCCESS) { |
779 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) | 785 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
@@ -801,14 +807,14 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, | |||
801 | info->control.hw_key->cipher == WLAN_CIPHER_SUITE_CCMP || | 807 | info->control.hw_key->cipher == WLAN_CIPHER_SUITE_CCMP || |
802 | info->control.hw_key->cipher == WL1271_CIPHER_SUITE_GEM)) { | 808 | info->control.hw_key->cipher == WL1271_CIPHER_SUITE_GEM)) { |
803 | u8 fw_lsb = result->tx_security_sequence_number_lsb; | 809 | u8 fw_lsb = result->tx_security_sequence_number_lsb; |
804 | u8 cur_lsb = wl->tx_security_last_seq_lsb; | 810 | u8 cur_lsb = wlvif->tx_security_last_seq_lsb; |
805 | 811 | ||
806 | /* | 812 | /* |
807 | * update security sequence number, taking care of potential | 813 | * update security sequence number, taking care of potential |
808 | * wrap-around | 814 | * wrap-around |
809 | */ | 815 | */ |
810 | wl->tx_security_seq += (fw_lsb - cur_lsb + 256) % 256; | 816 | wlvif->tx_security_seq += (fw_lsb - cur_lsb) & 0xff; |
811 | wl->tx_security_last_seq_lsb = fw_lsb; | 817 | wlvif->tx_security_last_seq_lsb = fw_lsb; |
812 | } | 818 | } |
813 | 819 | ||
814 | /* remove private header from packet */ | 820 | /* remove private header from packet */ |