Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196717
b: refs/heads/master
c: 9970071
h: refs/heads/master
i:
  196715: aff29da
v: v3
  • Loading branch information
Chihau Chau authored and Herbert Xu committed Apr 19, 2010
1 parent 764d632 commit 7cb6e84
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 750052dd2400cd09e0864d75b63c2c0bf605056f
refs/heads/master: 99700716a9b2e117fd50c6d3f1fd5edeef6dc6d2
36 changes: 20 additions & 16 deletions trunk/drivers/crypto/geode-aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
#include <crypto/algapi.h>
#include <crypto/aes.h>

#include <asm/io.h>
#include <asm/delay.h>
#include <linux/io.h>
#include <linux/delay.h>

#include "geode-aes.h"

/* Static structures */

static void __iomem * _iobase;
static void __iomem *_iobase;
static spinlock_t lock;

/* Write a 128 bit field (either a writable key or IV) */
static inline void
_writefield(u32 offset, void *value)
{
int i;
for(i = 0; i < 4; i++)
for (i = 0; i < 4; i++)
iowrite32(((u32 *) value)[i], _iobase + offset + (i * 4));
}

Expand All @@ -39,7 +39,7 @@ static inline void
_readfield(u32 offset, void *value)
{
int i;
for(i = 0; i < 4; i++)
for (i = 0; i < 4; i++)
((u32 *) value)[i] = ioread32(_iobase + offset + (i * 4));
}

Expand All @@ -59,7 +59,7 @@ do_crypt(void *src, void *dst, int len, u32 flags)
do {
status = ioread32(_iobase + AES_INTR_REG);
cpu_relax();
} while(!(status & AES_INTRA_PENDING) && --counter);
} while (!(status & AES_INTRA_PENDING) && --counter);

/* Clear the event */
iowrite32((status & 0xFF) | AES_INTRA_PENDING, _iobase + AES_INTR_REG);
Expand Down Expand Up @@ -317,7 +317,7 @@ geode_cbc_decrypt(struct blkcipher_desc *desc,
err = blkcipher_walk_virt(desc, &walk);
op->iv = walk.iv;

while((nbytes = walk.nbytes)) {
while ((nbytes = walk.nbytes)) {
op->src = walk.src.virt.addr,
op->dst = walk.dst.virt.addr;
op->mode = AES_MODE_CBC;
Expand Down Expand Up @@ -349,7 +349,7 @@ geode_cbc_encrypt(struct blkcipher_desc *desc,
err = blkcipher_walk_virt(desc, &walk);
op->iv = walk.iv;

while((nbytes = walk.nbytes)) {
while ((nbytes = walk.nbytes)) {
op->src = walk.src.virt.addr,
op->dst = walk.dst.virt.addr;
op->mode = AES_MODE_CBC;
Expand Down Expand Up @@ -429,7 +429,7 @@ geode_ecb_decrypt(struct blkcipher_desc *desc,
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);

while((nbytes = walk.nbytes)) {
while ((nbytes = walk.nbytes)) {
op->src = walk.src.virt.addr,
op->dst = walk.dst.virt.addr;
op->mode = AES_MODE_ECB;
Expand Down Expand Up @@ -459,7 +459,7 @@ geode_ecb_encrypt(struct blkcipher_desc *desc,
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);

while((nbytes = walk.nbytes)) {
while ((nbytes = walk.nbytes)) {
op->src = walk.src.virt.addr,
op->dst = walk.dst.virt.addr;
op->mode = AES_MODE_ECB;
Expand Down Expand Up @@ -518,11 +518,12 @@ static int __devinit
geode_aes_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
int ret;

if ((ret = pci_enable_device(dev)))
ret = pci_enable_device(dev);
if (ret)
return ret;

if ((ret = pci_request_regions(dev, "geode-aes")))
ret = pci_request_regions(dev, "geode-aes");
if (ret)
goto eenable;

_iobase = pci_iomap(dev, 0, 0);
Expand All @@ -537,13 +538,16 @@ geode_aes_probe(struct pci_dev *dev, const struct pci_device_id *id)
/* Clear any pending activity */
iowrite32(AES_INTR_PENDING | AES_INTR_MASK, _iobase + AES_INTR_REG);

if ((ret = crypto_register_alg(&geode_alg)))
ret = crypto_register_alg(&geode_alg);
if (ret)
goto eiomap;

if ((ret = crypto_register_alg(&geode_ecb_alg)))
ret = crypto_register_alg(&geode_ecb_alg);
if (ret)
goto ealg;

if ((ret = crypto_register_alg(&geode_cbc_alg)))
ret = crypto_register_alg(&geode_cbc_alg);
if (ret)
goto eecb;

printk(KERN_NOTICE "geode-aes: GEODE AES engine enabled.\n");
Expand Down

0 comments on commit 7cb6e84

Please sign in to comment.