diff options
Diffstat (limited to 'drivers/scsi/aacraid')
-rw-r--r-- | drivers/scsi/aacraid/aachba.c | 23 | ||||
-rw-r--r-- | drivers/scsi/aacraid/commsup.c | 4 |
2 files changed, 15 insertions, 12 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 2a128a156aa..7139659dd95 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1579,18 +1579,10 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) break; { u64 capacity; - char cp[12]; - unsigned int offset = 0; + char cp[13]; dprintk((KERN_DEBUG "READ CAPACITY_16 command.\n")); capacity = fsa_dev_ptr[cid].size - 1; - if (scsicmd->cmnd[13] > 12) { - offset = scsicmd->cmnd[13] - 12; - if (offset > sizeof(cp)) - break; - memset(cp, 0, offset); - aac_internal_transfer(scsicmd, cp, 0, offset); - } cp[0] = (capacity >> 56) & 0xff; cp[1] = (capacity >> 48) & 0xff; cp[2] = (capacity >> 40) & 0xff; @@ -1603,7 +1595,18 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) cp[9] = 0; cp[10] = 2; cp[11] = 0; - aac_internal_transfer(scsicmd, cp, offset, sizeof(cp)); + cp[12] = 0; + aac_internal_transfer(scsicmd, cp, 0, + min((unsigned int)scsicmd->cmnd[13], sizeof(cp))); + if (sizeof(cp) < scsicmd->cmnd[13]) { + unsigned int len, offset = sizeof(cp); + + memset(cp, 0, offset); + do { + len = min(scsicmd->cmnd[13]-offset, sizeof(cp)); + aac_internal_transfer(scsicmd, cp, offset, len); + } while ((offset += len) < scsicmd->cmnd[13]); + } /* Do not cache partition table for arrays */ scsicmd->device->removable = 1; diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 723c0cea7c0..38d6d00fb0f 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -820,7 +820,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) break; /* - * Find the Scsi_Device associated with the SCSI + * Find the scsi_device associated with the SCSI * address. Make sure we have the right array, and if * so set the flag to initiate a new re-config once we * see an AifEnConfigChange AIF come through. @@ -987,7 +987,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) /* - * Find the Scsi_Device associated with the SCSI address, + * Find the scsi_device associated with the SCSI address, * and mark it as changed, invalidating the cache. This deals * with changes to existing device IDs. */ |