aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorYogesh Ashok Powar <yogeshp@marvell.com>2011-05-05 07:00:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-05 14:59:24 -0400
commite4eefec73ea0a740bfe8736e3ac30dfe92fe392b (patch)
treecd1881b5d190745a7fcf80c12ffee394922af0af /drivers/net
parenteee40820e95e6dbd7b0709e7b8cca453004ae7b1 (diff)
mwl8k: Do not ask mac80211 to generate IV for crypto keys
Since firmware is capable of generating IV's for all crypto suits (TKIP, CCMP and WEP), do not ask mac80211 to generate IV when HW crypto is being used. Instead only reserve appropriate space in tx skb's in the driver, so that the firmware can write IV's values. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/mwl8k.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index d06591a7e566..32261189bcef 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -784,7 +784,8 @@ static inline void mwl8k_remove_dma_header(struct sk_buff *skb, __le16 qos)
784#define REDUCED_TX_HEADROOM 8 784#define REDUCED_TX_HEADROOM 8
785 785
786static void 786static void
787mwl8k_add_dma_header(struct mwl8k_priv *priv, struct sk_buff *skb, int tail_pad) 787mwl8k_add_dma_header(struct mwl8k_priv *priv, struct sk_buff *skb,
788 int head_pad, int tail_pad)
788{ 789{
789 struct ieee80211_hdr *wh; 790 struct ieee80211_hdr *wh;
790 int hdrlen; 791 int hdrlen;
@@ -816,7 +817,7 @@ mwl8k_add_dma_header(struct mwl8k_priv *priv, struct sk_buff *skb, int tail_pad)
816 skb->truesize += REDUCED_TX_HEADROOM; 817 skb->truesize += REDUCED_TX_HEADROOM;
817 } 818 }
818 819
819 reqd_hdrlen = sizeof(*tr); 820 reqd_hdrlen = sizeof(*tr) + head_pad;
820 821
821 if (hdrlen != reqd_hdrlen) 822 if (hdrlen != reqd_hdrlen)
822 skb_push(skb, reqd_hdrlen - hdrlen); 823 skb_push(skb, reqd_hdrlen - hdrlen);
@@ -845,6 +846,7 @@ static void mwl8k_encapsulate_tx_frame(struct mwl8k_priv *priv,
845 struct ieee80211_tx_info *tx_info; 846 struct ieee80211_tx_info *tx_info;
846 struct ieee80211_key_conf *key_conf; 847 struct ieee80211_key_conf *key_conf;
847 int data_pad; 848 int data_pad;
849 int head_pad = 0;
848 850
849 wh = (struct ieee80211_hdr *)skb->data; 851 wh = (struct ieee80211_hdr *)skb->data;
850 852
@@ -856,9 +858,7 @@ static void mwl8k_encapsulate_tx_frame(struct mwl8k_priv *priv,
856 858
857 /* 859 /*
858 * Make sure the packet header is in the DMA header format (4-address 860 * Make sure the packet header is in the DMA header format (4-address
859 * without QoS), the necessary crypto padding between the header and the 861 * without QoS), and add head & tail padding when HW crypto is enabled.
860 * payload has already been provided by mac80211, but it doesn't add
861 * tail padding when HW crypto is enabled.
862 * 862 *
863 * We have the following trailer padding requirements: 863 * We have the following trailer padding requirements:
864 * - WEP: 4 trailer bytes (ICV) 864 * - WEP: 4 trailer bytes (ICV)
@@ -867,6 +867,7 @@ static void mwl8k_encapsulate_tx_frame(struct mwl8k_priv *priv,
867 */ 867 */
868 data_pad = 0; 868 data_pad = 0;
869 if (key_conf != NULL) { 869 if (key_conf != NULL) {
870 head_pad = key_conf->iv_len;
870 switch (key_conf->cipher) { 871 switch (key_conf->cipher) {
871 case WLAN_CIPHER_SUITE_WEP40: 872 case WLAN_CIPHER_SUITE_WEP40:
872 case WLAN_CIPHER_SUITE_WEP104: 873 case WLAN_CIPHER_SUITE_WEP104:
@@ -880,7 +881,7 @@ static void mwl8k_encapsulate_tx_frame(struct mwl8k_priv *priv,
880 break; 881 break;
881 } 882 }
882 } 883 }
883 mwl8k_add_dma_header(priv, skb, data_pad); 884 mwl8k_add_dma_header(priv, skb, head_pad, data_pad);
884} 885}
885 886
886/* 887/*
@@ -1837,7 +1838,7 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
1837 if (priv->ap_fw) 1838 if (priv->ap_fw)
1838 mwl8k_encapsulate_tx_frame(priv, skb); 1839 mwl8k_encapsulate_tx_frame(priv, skb);
1839 else 1840 else
1840 mwl8k_add_dma_header(priv, skb, 0); 1841 mwl8k_add_dma_header(priv, skb, 0, 0);
1841 1842
1842 wh = &((struct mwl8k_dma_data *)skb->data)->wh; 1843 wh = &((struct mwl8k_dma_data *)skb->data)->wh;
1843 1844
@@ -4071,7 +4072,6 @@ static int mwl8k_set_key(struct ieee80211_hw *hw,
4071 addr = sta->addr; 4072 addr = sta->addr;
4072 4073
4073 if (cmd_param == SET_KEY) { 4074 if (cmd_param == SET_KEY) {
4074 key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
4075 rc = mwl8k_cmd_encryption_set_key(hw, vif, addr, key); 4075 rc = mwl8k_cmd_encryption_set_key(hw, vif, addr, key);
4076 if (rc) 4076 if (rc)
4077 goto out; 4077 goto out;