};
-UCHAR
+static UCHAR
dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB )
{
UCHAR cmd; UCHAR disc_allowed, try_sync_nego;
#if DMA_INT
UCHAR dstatus;
#endif
- DC390_AFLAGS DC390_IFLAGS; //DC390_DFLAGS
+ DC390_IFLAGS;
pACB = (PACB)dev_id;
for (pACB2 = dc390_pACB_start; (pACB2 && pACB2 != pACB); pACB2 = pACB2->pNextACB);
return IRQ_NONE;
}
- //DC390_LOCK_DRV;
-
sstatus = DC390_read8 (Scsi_Status);
if( !(sstatus & INTERRUPT) )
- { /*DC390_UNLOCK_DRV;*/ return IRQ_NONE; };
+ return IRQ_NONE;
DEBUG1(printk (KERN_DEBUG "sstatus=%02x,", sstatus));
#if DMA_INT
DC390_LOCK_IO(pACB->pScsiHost);
- DC390_LOCK_ACB;
dstatus = dc390_dma_intr (pACB);
- DC390_UNLOCK_ACB;
DC390_UNLOCK_IO(pACB->pScsiHost);
DEBUG1(printk (KERN_DEBUG "dstatus=%02x,", dstatus));
if (! (dstatus & SCSI_INTERRUPT))
{
DEBUG0(printk (KERN_WARNING "DC390 Int w/o SCSI actions (only DMA?)\n"));
- //DC390_UNLOCK_DRV;
return IRQ_NONE;
};
#else
#endif
DC390_LOCK_IO(pACB->pScsiHost);
- DC390_LOCK_ACB;
- //DC390_UNLOCK_DRV_NI; /* Allow _other_ CPUs to process IRQ (useful for shared IRQs) */
istate = DC390_read8 (Intern_State);
istatus = DC390_read8 (INT_Status); /* This clears Scsi_Status, Intern_State and INT_Status ! */
}
unlock:
- //DC390_LOCK_DRV_NI;
- DC390_UNLOCK_ACB;
DC390_UNLOCK_IO(pACB->pScsiHost);
- //DC390_UNLOCK_DRV; /* Restore initial flags */
return IRQ_HANDLED;
}
-irqreturn_t do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
{
irqreturn_t ret;
DEBUG1(printk (KERN_INFO "DC390: Irq (%i) caught: ", irq));
return ret;
}
-void
+static void
dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
{
UCHAR sstatus;
}
}
-void
+static void
dc390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
{
UCHAR sstatus, residual, bval;
{
DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD);
DC390_write8 (DMA_Cmd, READ_DIRECTION+DMA_IDLE_CMD); /* | DMA_INT */
- }
+ }
}
static void
psgl = pSRB->pSegmentList;
//dc390_pci_sync(pSRB);
- while (pSRB->TotalXferredLen + (ULONG) psgl->length < pSRB->Saved_Ptr)
+ while (pSRB->TotalXferredLen + (ULONG) sg_dma_len(psgl) < pSRB->Saved_Ptr)
{
- pSRB->TotalXferredLen += (ULONG) psgl->length;
+ pSRB->TotalXferredLen += (ULONG) sg_dma_len(psgl);
pSRB->SGIndex++;
if( pSRB->SGIndex < pSRB->SGcount )
{
} else if(pcmd->request_buffer) {
//dc390_pci_sync(pSRB);
- pSRB->Segmentx.length = pcmd->request_bufflen - pSRB->Saved_Ptr;
+ sg_dma_len(&pSRB->Segmentx) = pcmd->request_bufflen - pSRB->Saved_Ptr;
pSRB->SGcount = 1;
pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
} else {
}
-void
+static void
dc390_DataIO_Comm( PACB pACB, PSRB pSRB, UCHAR ioDir)
{
PSGL psgl;
if (pDCB) printk (KERN_ERR "DC390: pSRB == pTmpSRB! (TagQ Error?) (%02i-%i)\n",
pDCB->TargetID, pDCB->TargetLUN);
else printk (KERN_ERR "DC390: pSRB == pTmpSRB! (TagQ Error?) (DCB 0!)\n");
+
+ pSRB->pSRBDCB = pDCB;
dc390_EnableMsgOut_Abort (pACB, pSRB);
if (pDCB) pDCB->DCBFlag |= ABORT_DEV;
return;
pSRB = psrb;
}
pDCB->pGoingSRB = 0;
- dc390_Query_to_Waiting (pACB);
dc390_Waiting_process (pACB);
}
else
ptr2 = pSRB->pSegmentList;
for( i=pSRB->SGIndex; i < bval; i++)
{
- swlval += ptr2->length;
+ swlval += sg_dma_len(ptr2);
ptr2++;
}
REMOVABLEDEBUG(printk(KERN_INFO "XferredLen=%08x,NotXferLen=%08x\n",\
pACB->scan_devices = 0;
};
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,3,30)
pcmd->resid = pcmd->request_bufflen - pSRB->TotalXferredLen;
-#endif
if (!DCB_removed) dc390_Going_remove (pDCB, pSRB);
/* Add to free list */
dc390_Free_insert (pACB, pSRB);
DEBUG0(printk (KERN_DEBUG "DC390: SRBdone: done pid %li\n", pcmd->pid));
- DC390_UNLOCK_ACB_NI;
pcmd->scsi_done (pcmd);
- DC390_LOCK_ACB_NI;
- dc390_Query_to_Waiting (pACB);
dc390_Waiting_process (pACB);
return;
}
/* ReleaseSRB( pDCB, pSRB ); */
DEBUG0(printk (KERN_DEBUG "DC390: DoingSRB_Done: done pid %li\n", pcmd->pid));
- DC390_UNLOCK_ACB_NI;
pcmd->scsi_done( pcmd );
- DC390_LOCK_ACB_NI;
#endif
psrb = psrb2;
}
pdcb->TagMask = 0;
pdcb = pdcb->pNextDCB;
} while( pdcb != pDCB );
- dc390_Query_to_Waiting (pACB);
}