X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Faacraid%2Fdpcsup.c;h=933f208eedbadd92dde03f2be68c1be4e62fba33;hb=62429f434091586d54b37b8dd46076e7c08b27b9;hp=42c7dcda6d9bd1c9679cddcc8dd01bb0be00ae4c;hpb=805f53f085346b6765eda02820721a14ce0d644f;p=linux-2.6 diff --git a/drivers/scsi/aacraid/dpcsup.c b/drivers/scsi/aacraid/dpcsup.c index 42c7dcda6d..933f208eed 100644 --- a/drivers/scsi/aacraid/dpcsup.c +++ b/drivers/scsi/aacraid/dpcsup.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include "aacraid.h" @@ -120,6 +120,7 @@ unsigned int aac_response_normal(struct aac_queue * q) * NOTE: we cannot touch the fib after this * call, because it may have been deallocated. */ + fib->flags = 0; fib->callback(fib->callback_data, fib); } else { unsigned long flagv; @@ -229,11 +230,9 @@ unsigned int aac_command_normal(struct aac_queue *q) * all QE there are and wake up all the waiters before exiting. */ -unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index) +unsigned int aac_intr_normal(struct aac_dev * dev, u32 index) { - u32 index = le32_to_cpu(Index); - - dprintk((KERN_INFO "aac_intr_normal(%p,%x)\n", dev, Index)); + dprintk((KERN_INFO "aac_intr_normal(%p,%x)\n", dev, index)); if ((index & 0x00000002L)) { struct hw_fib * hw_fib; struct fib * fib; @@ -248,16 +247,14 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index) * manage the linked lists. */ if ((!dev->aif_thread) - || (!(fib = kmalloc(sizeof(struct fib),GFP_ATOMIC)))) + || (!(fib = kzalloc(sizeof(struct fib),GFP_ATOMIC)))) return 1; - if (!(hw_fib = kmalloc(sizeof(struct hw_fib),GFP_ATOMIC))) { + if (!(hw_fib = kzalloc(sizeof(struct hw_fib),GFP_ATOMIC))) { kfree (fib); return 1; } - memset(hw_fib, 0, sizeof(struct hw_fib)); - memcpy(hw_fib, (struct hw_fib *)(((ptrdiff_t)(dev->regs.sa)) + + memcpy(hw_fib, (struct hw_fib *)(((uintptr_t)(dev->regs.sa)) + (index & ~0x00000002L)), sizeof(struct hw_fib)); - memset(fib, 0, sizeof(struct fib)); INIT_LIST_HEAD(&fib->fiblink); fib->type = FSAFS_NTC_FIB_CONTEXT; fib->size = sizeof(struct fib); @@ -303,7 +300,7 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index) if (hwfib->header.Command == cpu_to_le16(NuFileSystem)) { - u32 *pstatus = (u32 *)hwfib->data; + __le32 *pstatus = (__le32 *)hwfib->data; if (*pstatus & cpu_to_le32(0xffff0000)) *pstatus = cpu_to_le32(ST_OK); } @@ -317,6 +314,7 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index) * NOTE: we cannot touch the fib after this * call, because it may have been deallocated. */ + fib->flags = 0; fib->callback(fib->callback_data, fib); } else { unsigned long flagv;