aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-08-28 17:01:54 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:48:51 -0400
commit8f20fc24986a083228823d9b68adca20714b254e (patch)
treeb5d7638b913649c7a181d6703ccd72e35ca06de9 /net/mac80211/tx.c
parent13262ffd4902805acad2618c12b41fcaa6c50791 (diff)
[MAC80211]: embed key conf in key, fix driver interface
This patch embeds the struct ieee80211_key_conf into struct ieee80211_key and thus avoids allocations and having data present twice. This required some more changes: 1) The removal of the IEEE80211_KEY_DEFAULT_TX_KEY key flag. This flag isn't used by drivers nor should it be since we have a set_key_idx() callback. Maybe that callback needs to be extended to include the key conf, but only a driver that requires it will tell. 2) The removal of the IEEE80211_KEY_DEFAULT_WEP_ONLY key flag. This flag is global, so it shouldn't be passed in the key conf structure. Pass it to the function instead. Also, this patch removes the AID parameter to the set_key() callback because it is currently unused and the hardware currently cannot know about the AID anyway. I suspect this was used with some hardware that actually selected the AID itself, but that functionality was removed. Additionally, I've removed the ALG_NULL key algorithm since we have ALG_NONE. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index ddb104a70161..684f928def93 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -539,11 +539,11 @@ ieee80211_tx_h_fragment(struct ieee80211_txrx_data *tx)
539 539
540static int wep_encrypt_skb(struct ieee80211_txrx_data *tx, struct sk_buff *skb) 540static int wep_encrypt_skb(struct ieee80211_txrx_data *tx, struct sk_buff *skb)
541{ 541{
542 if (tx->key->force_sw_encrypt) { 542 if (tx->key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT) {
543 if (ieee80211_wep_encrypt(tx->local, skb, tx->key)) 543 if (ieee80211_wep_encrypt(tx->local, skb, tx->key))
544 return -1; 544 return -1;
545 } else { 545 } else {
546 tx->u.tx.control->key_idx = tx->key->hw_key_idx; 546 tx->u.tx.control->key_idx = tx->key->conf.hw_key_idx;
547 if (tx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV) { 547 if (tx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV) {
548 if (ieee80211_wep_add_iv(tx->local, skb, tx->key) == 548 if (ieee80211_wep_add_iv(tx->local, skb, tx->key) ==
549 NULL) 549 NULL)
@@ -561,7 +561,7 @@ ieee80211_tx_h_wep_encrypt(struct ieee80211_txrx_data *tx)
561 561
562 fc = le16_to_cpu(hdr->frame_control); 562 fc = le16_to_cpu(hdr->frame_control);
563 563
564 if (!tx->key || tx->key->alg != ALG_WEP || 564 if (!tx->key || tx->key->conf.alg != ALG_WEP ||
565 ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA && 565 ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA &&
566 ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT || 566 ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT ||
567 (fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_AUTH))) 567 (fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_AUTH)))