diff options
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/key.c | 4 | ||||
-rw-r--r-- | net/mac80211/tx.c | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index b10e33deb63e..dd6fc4aa3ff5 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -73,8 +73,6 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key) | |||
73 | key->sdata->dev->dev_addr, addr, | 73 | key->sdata->dev->dev_addr, addr, |
74 | &key->conf); | 74 | &key->conf); |
75 | 75 | ||
76 | WARN_ON(!ret && (key->conf.hw_key_idx == HW_KEY_IDX_INVALID)); | ||
77 | |||
78 | if (!ret) | 76 | if (!ret) |
79 | key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; | 77 | key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; |
80 | 78 | ||
@@ -109,7 +107,6 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) | |||
109 | key->conf.keyidx, MAC_ARG(addr), ret); | 107 | key->conf.keyidx, MAC_ARG(addr), ret); |
110 | 108 | ||
111 | key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; | 109 | key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; |
112 | key->conf.hw_key_idx = HW_KEY_IDX_INVALID; | ||
113 | } | 110 | } |
114 | 111 | ||
115 | struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata, | 112 | struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata, |
@@ -132,7 +129,6 @@ struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata, | |||
132 | * Default to software encryption; we'll later upload the | 129 | * Default to software encryption; we'll later upload the |
133 | * key to the hardware if possible. | 130 | * key to the hardware if possible. |
134 | */ | 131 | */ |
135 | key->conf.hw_key_idx = HW_KEY_IDX_INVALID; | ||
136 | key->conf.flags = 0; | 132 | key->conf.flags = 0; |
137 | key->flags = 0; | 133 | key->flags = 0; |
138 | 134 | ||
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index e2ae1e1fcc7b..3d57e6d80f6d 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -430,8 +430,6 @@ ieee80211_tx_h_select_key(struct ieee80211_txrx_data *tx) | |||
430 | { | 430 | { |
431 | struct ieee80211_key *key; | 431 | struct ieee80211_key *key; |
432 | 432 | ||
433 | tx->u.tx.control->key_idx = HW_KEY_IDX_INVALID; | ||
434 | |||
435 | if (unlikely(tx->u.tx.control->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)) | 433 | if (unlikely(tx->u.tx.control->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)) |
436 | tx->key = NULL; | 434 | tx->key = NULL; |
437 | else if (tx->sta && (key = rcu_dereference(tx->sta->key))) | 435 | else if (tx->sta && (key = rcu_dereference(tx->sta->key))) |
@@ -442,8 +440,10 @@ ieee80211_tx_h_select_key(struct ieee80211_txrx_data *tx) | |||
442 | !(tx->sdata->eapol && ieee80211_is_eapol(tx->skb))) { | 440 | !(tx->sdata->eapol && ieee80211_is_eapol(tx->skb))) { |
443 | I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted); | 441 | I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted); |
444 | return TXRX_DROP; | 442 | return TXRX_DROP; |
445 | } else | 443 | } else { |
446 | tx->key = NULL; | 444 | tx->key = NULL; |
445 | tx->u.tx.control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT; | ||
446 | } | ||
447 | 447 | ||
448 | if (tx->key) { | 448 | if (tx->key) { |
449 | tx->key->tx_rx_count++; | 449 | tx->key->tx_rx_count++; |
@@ -724,6 +724,15 @@ ieee80211_tx_h_misc(struct ieee80211_txrx_data *tx) | |||
724 | } | 724 | } |
725 | } | 725 | } |
726 | 726 | ||
727 | /* | ||
728 | * Tell hardware to not encrypt when we had sw crypto. | ||
729 | * Because we use the same flag to internally indicate that | ||
730 | * no (software) encryption should be done, we have to set it | ||
731 | * after all crypto handlers. | ||
732 | */ | ||
733 | if (tx->key && !(tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) | ||
734 | tx->u.tx.control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT; | ||
735 | |||
727 | return TXRX_CONTINUE; | 736 | return TXRX_CONTINUE; |
728 | } | 737 | } |
729 | 738 | ||
@@ -833,7 +842,6 @@ __ieee80211_parse_tx_radiotap( | |||
833 | */ | 842 | */ |
834 | 843 | ||
835 | control->retry_limit = 1; /* no retry */ | 844 | control->retry_limit = 1; /* no retry */ |
836 | control->key_idx = HW_KEY_IDX_INVALID; | ||
837 | control->flags &= ~(IEEE80211_TXCTL_USE_RTS_CTS | | 845 | control->flags &= ~(IEEE80211_TXCTL_USE_RTS_CTS | |
838 | IEEE80211_TXCTL_USE_CTS_PROTECT); | 846 | IEEE80211_TXCTL_USE_CTS_PROTECT); |
839 | control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT | | 847 | control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT | |