Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 17 May 2009 22:48:05 +0000 (15:48 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 17 May 2009 22:48:05 +0000 (15:48 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: padlock - Revert aes-all alias to aes
  crypto: api - Fix algorithm module auto-loading
  crypto: eseqiv - Fix IV generation for sync algorithms
  crypto: ixp4xx - check firmware for crypto support

1  2 
drivers/crypto/ixp4xx_crypto.c

@@@ -209,7 -209,7 +209,7 @@@ static struct platform_device pseudo_de
        .id   = 0,
        .num_resources = 0,
        .dev  = {
 -              .coherent_dma_mask = DMA_32BIT_MASK,
 +              .coherent_dma_mask = DMA_BIT_MASK(32),
                .release = dev_release,
        }
  };
@@@ -415,6 -415,7 +415,7 @@@ static void crypto_done_action(unsigne
  static int init_ixp_crypto(void)
  {
        int ret = -ENODEV;
+       u32 msg[2] = { 0, 0 };
  
        if (! ( ~(*IXP4XX_EXP_CFG2) & (IXP4XX_FEATURE_HASH |
                                IXP4XX_FEATURE_AES | IXP4XX_FEATURE_DES))) {
                return ret;
  
        if (!npe_running(npe_c)) {
-               npe_load_firmware(npe_c, npe_name(npe_c), dev);
+               ret = npe_load_firmware(npe_c, npe_name(npe_c), dev);
+               if (ret) {
+                       return ret;
+               }
+               if (npe_recv_message(npe_c, msg, "STATUS_MSG"))
+                       goto npe_error;
+       } else {
+               if (npe_send_message(npe_c, msg, "STATUS_MSG"))
+                       goto npe_error;
+               if (npe_recv_message(npe_c, msg, "STATUS_MSG"))
+                       goto npe_error;
        }
  
+       switch ((msg[1]>>16) & 0xff) {
+       case 3:
+               printk(KERN_WARNING "Firmware of %s lacks AES support\n",
+                               npe_name(npe_c));
+               support_aes = 0;
+               break;
+       case 4:
+       case 5:
+               support_aes = 1;
+               break;
+       default:
+               printk(KERN_ERR "Firmware of %s lacks crypto support\n",
+                       npe_name(npe_c));
+               return -ENODEV;
+       }
        /* buffer_pool will also be used to sometimes store the hmac,
         * so assure it is large enough
         */
  
        qmgr_enable_irq(RECV_QID);
        return 0;
+ npe_error:
+       printk(KERN_ERR "%s not responding\n", npe_name(npe_c));
+       ret = -EIO;
  err:
        if (ctx_pool)
                dma_pool_destroy(ctx_pool);