diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 2888778040e4..99badf1404c3 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -206,7 +206,8 @@ static int ath_key_config(struct ath_softc *sc, | |||
206 | if (!ret) | 206 | if (!ret) |
207 | return -EIO; | 207 | return -EIO; |
208 | 208 | ||
209 | sc->sc_keytype = hk.kv_type; | 209 | if (mac) |
210 | sc->sc_keytype = hk.kv_type; | ||
210 | return 0; | 211 | return 0; |
211 | } | 212 | } |
212 | 213 | ||
@@ -368,6 +369,20 @@ static int ath9k_tx(struct ieee80211_hw *hw, | |||
368 | { | 369 | { |
369 | struct ath_softc *sc = hw->priv; | 370 | struct ath_softc *sc = hw->priv; |
370 | int hdrlen, padsize; | 371 | int hdrlen, padsize; |
372 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
373 | |||
374 | /* | ||
375 | * As a temporary workaround, assign seq# here; this will likely need | ||
376 | * to be cleaned up to work better with Beacon transmission and virtual | ||
377 | * BSSes. | ||
378 | */ | ||
379 | if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { | ||
380 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | ||
381 | if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) | ||
382 | sc->seq_no += 0x10; | ||
383 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
384 | hdr->seq_ctrl |= cpu_to_le16(sc->seq_no); | ||
385 | } | ||
371 | 386 | ||
372 | /* Add the padding after the header if this is not already done */ | 387 | /* Add the padding after the header if this is not already done */ |
373 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 388 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
@@ -756,7 +771,8 @@ static int ath9k_set_key(struct ieee80211_hw *hw, | |||
756 | key->hw_key_idx = key->keyidx; | 771 | key->hw_key_idx = key->keyidx; |
757 | /* push IV and Michael MIC generation to stack */ | 772 | /* push IV and Michael MIC generation to stack */ |
758 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; | 773 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; |
759 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; | 774 | if (key->alg == ALG_TKIP) |
775 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; | ||
760 | } | 776 | } |
761 | break; | 777 | break; |
762 | case DISABLE_KEY: | 778 | case DISABLE_KEY: |
@@ -1065,8 +1081,16 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
1065 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; | 1081 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; |
1066 | tx_status->flags &= ~ATH_TX_BAR; | 1082 | tx_status->flags &= ~ATH_TX_BAR; |
1067 | } | 1083 | } |
1068 | if (tx_status->flags) | 1084 | |
1069 | tx_info->status.excessive_retries = 1; | 1085 | if (tx_status->flags & (ATH_TX_ERROR | ATH_TX_XRETRY)) { |
1086 | if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) { | ||
1087 | /* Frame was not ACKed, but an ACK was expected */ | ||
1088 | tx_info->status.excessive_retries = 1; | ||
1089 | } | ||
1090 | } else { | ||
1091 | /* Frame was ACKed */ | ||
1092 | tx_info->flags |= IEEE80211_TX_STAT_ACK; | ||
1093 | } | ||
1070 | 1094 | ||
1071 | tx_info->status.retry_count = tx_status->retries; | 1095 | tx_info->status.retry_count = tx_status->retries; |
1072 | 1096 | ||