Commit e4587f45 authored by Ching Huang's avatar Ching Huang Committed by Martin K. Petersen

scsi: arcmsr: Replace constant ARCMSR_MAX_OUTSTANDING_CMD

Replace constant ARCMSR_MAX_OUTSTANDING_CMD by variable
acb->maxOutstanding that was determined by user.
Signed-off-by: default avatarChing Huang <ching2048@areca.com.tw>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent dd6206e1
...@@ -1315,7 +1315,7 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) ...@@ -1315,7 +1315,7 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb)
/*clear and abort all outbound posted Q*/ /*clear and abort all outbound posted Q*/
writel(outbound_intstatus, &reg->outbound_intstatus);/*clear interrupt*/ writel(outbound_intstatus, &reg->outbound_intstatus);/*clear interrupt*/
while(((flag_ccb = readl(&reg->outbound_queueport)) != 0xFFFFFFFF) while(((flag_ccb = readl(&reg->outbound_queueport)) != 0xFFFFFFFF)
&& (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { && (i++ < acb->maxOutstanding)) {
pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5));/*frame must be 32 bytes aligned*/ pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5));/*frame must be 32 bytes aligned*/
pCCB = container_of(pARCMSR_CDB, struct CommandControlBlock, arcmsr_cdb); pCCB = container_of(pARCMSR_CDB, struct CommandControlBlock, arcmsr_cdb);
error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE0) ? true : false; error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE0) ? true : false;
...@@ -1345,7 +1345,7 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) ...@@ -1345,7 +1345,7 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb)
break; break;
case ACB_ADAPTER_TYPE_C: { case ACB_ADAPTER_TYPE_C: {
struct MessageUnit_C __iomem *reg = acb->pmuC; struct MessageUnit_C __iomem *reg = acb->pmuC;
while ((readl(&reg->host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { while ((readl(&reg->host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) && (i++ < acb->maxOutstanding)) {
/*need to do*/ /*need to do*/
flag_ccb = readl(&reg->outbound_queueport_low); flag_ccb = readl(&reg->outbound_queueport_low);
ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0); ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0);
...@@ -1421,7 +1421,7 @@ static void arcmsr_remove(struct pci_dev *pdev) ...@@ -1421,7 +1421,7 @@ static void arcmsr_remove(struct pci_dev *pdev)
acb->acb_flags |= ACB_F_SCSISTOPADAPTER; acb->acb_flags |= ACB_F_SCSISTOPADAPTER;
acb->acb_flags &= ~ACB_F_IOP_INITED; acb->acb_flags &= ~ACB_F_IOP_INITED;
for (poll_count = 0; poll_count < ARCMSR_MAX_OUTSTANDING_CMD; poll_count++){ for (poll_count = 0; poll_count < acb->maxOutstanding; poll_count++){
if (!atomic_read(&acb->ccboutstandingcount)) if (!atomic_read(&acb->ccboutstandingcount))
break; break;
arcmsr_interrupt(acb);/* FIXME: need spinlock */ arcmsr_interrupt(acb);/* FIXME: need spinlock */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment