[generic] ppp: Fix high softirq utilization with pppoa
[openwrt.git] / package / madwifi / patches / 123-ccmp_checks.patch
index f549cd4..6178a3f 100644 (file)
@@ -1,7 +1,65 @@
-diff -ur madwifi.old/net80211/ieee80211_crypto_ccmp.c madwifi.dev/net80211/ieee80211_crypto_ccmp.c
---- madwifi.old/net80211/ieee80211_crypto_ccmp.c       2007-06-02 04:37:47.425966000 +0200
-+++ madwifi.dev/net80211/ieee80211_crypto_ccmp.c       2007-06-02 18:38:27.675882768 +0200
-@@ -465,6 +465,9 @@
+--- a/net80211/ieee80211_crypto_ccmp.c
++++ b/net80211/ieee80211_crypto_ccmp.c
+@@ -115,6 +115,7 @@ ccmp_attach(struct ieee80211vap *vap, st
+ /* This function (crypto_alloc_foo might sleep. Therefore:
+  * Context: process
+  */
++#ifdef CONFIG_CRYPTO
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+       ctx->cc_tfm = crypto_alloc_tfm("aes", 0);
+ #else
+@@ -123,7 +124,8 @@ ccmp_attach(struct ieee80211vap *vap, st
+       if (IS_ERR(ctx->cc_tfm))
+               ctx->cc_tfm = NULL;
+ #endif
+-      
++#endif
++
+       if (ctx->cc_tfm == NULL) {
+               IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
+                               "%s: unable to load kernel AES crypto support\n",
+@@ -138,12 +140,14 @@ ccmp_detach(struct ieee80211_key *k)
+ {
+       struct ccmp_ctx *ctx = k->wk_private;
++#ifdef CONFIG_CRYPTO
+       if (ctx->cc_tfm != NULL)
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+               crypto_free_tfm(ctx->cc_tfm);
+ #else
+               crypto_free_cipher(ctx->cc_tfm);
+ #endif
++#endif
+       FREE(ctx, M_DEVBUF);
+       _MOD_DEC_USE(THIS_MODULE);
+@@ -169,7 +173,9 @@ ccmp_setkey(struct ieee80211_key *k)
+                       return 0;
+               }
++#ifdef CONFIG_CRYPTO
+               crypto_cipher_setkey(ctx->cc_tfm, k->wk_key, k->wk_keylen);
++#endif
+       }
+       return 1;
+@@ -324,6 +330,7 @@ xor_block(u8 *b, const u8 *a, size_t len
+ static void
+ rijndael_encrypt(struct crypto_cipher *tfm, const void *src, void *dst)
+ {
++#ifdef CONFIG_CRYPTO
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
+       crypto_cipher_encrypt_one(tfm, dst, src);
+ #else
+@@ -339,6 +346,7 @@ rijndael_encrypt(struct crypto_cipher *t
+       sg_dst.length = AES_BLOCK_LEN;
+       crypto_cipher_encrypt(tfm, &sg_dst, &sg_src, AES_BLOCK_LEN);
+ #endif
++#endif
+ }
+ /*
+@@ -475,6 +483,9 @@ ccmp_encrypt(struct ieee80211_key *key,
        uint8_t *mic, *pos;
        u_int space;
  
@@ -11,7 +69,7 @@ diff -ur madwifi.old/net80211/ieee80211_crypto_ccmp.c madwifi.dev/net80211/ieee8
        ctx->cc_vap->iv_stats.is_crypto_ccmp++;
  
        skb = skb0;
-@@ -579,6 +582,9 @@
+@@ -589,6 +600,9 @@ ccmp_decrypt(struct ieee80211_key *key,
        uint8_t *pos, *mic;
        u_int space;
  
@@ -21,19 +79,17 @@ diff -ur madwifi.old/net80211/ieee80211_crypto_ccmp.c madwifi.dev/net80211/ieee8
        ctx->cc_vap->iv_stats.is_crypto_ccmp++;
  
        skb = skb0;
-diff -ur madwifi.old/net80211/ieee80211_crypto_ccmp.c madwifi.dev/net80211/ieee80211_crypto_ccmp.c
---- madwifi.old/net80211/ieee80211_crypto_ccmp.c       2007-06-02 19:40:56.291006648 +0200
-+++ madwifi.dev/net80211/ieee80211_crypto_ccmp.c       2007-06-03 04:19:47.561334192 +0200
-@@ -118,6 +118,12 @@
-       ctx->cc_ic = vap->iv_ic;
-       ctx->cc_tfm = crypto_alloc_cipher("aes", 0,
-                                       CRYPTO_ALG_ASYNC);
-+      
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
-+      if (IS_ERR(ctx->cc_tfm))
-+              ctx->cc_tfm = NULL;
-+#endif
-+
-       if (ctx->cc_tfm == NULL) {
-               IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
-                               "%s: unable to load kernel AES crypto support\n",
+--- a/Makefile
++++ b/Makefile
+@@ -192,11 +192,4 @@ endif
+           exit 1; \
+       fi
+       
+-      @# check crypto support is enabled
+-      @if [ -z "$(CONFIG_CRYPTO)" ]; then \
+-          echo "FAILED"; \
+-          echo "Please enable crypto API."; \
+-          exit 1; \
+-      fi
+-      
+       @echo "ok."
This page took 0.031466 seconds and 4 git commands to generate.