Commit f455d910 authored by James Bottomley's avatar James Bottomley Committed by Christoph Hellwig

Convert tmcscsim to new probing interfaces

From: 	Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Update the driver to use the new pci, scsi and
module interfaces.

Modified with feedback from hch
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 5776e385
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
# define USE_NEW_EH # define USE_NEW_EH
#endif #endif
static int DC390_detect(Scsi_Host_Template *psht);
static int DC390_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)); static int DC390_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *));
static int DC390_abort(Scsi_Cmnd *cmd); static int DC390_abort(Scsi_Cmnd *cmd);
static int DC390_reset(Scsi_Cmnd *cmd); static int DC390_reset(Scsi_Cmnd *cmd);
......
...@@ -789,7 +789,7 @@ dc390_MsgIn_complete (UCHAR *msgbuf, UINT len) ...@@ -789,7 +789,7 @@ dc390_MsgIn_complete (UCHAR *msgbuf, UINT len)
/* read and eval received messages */ /* read and eval received messages */
void static void
dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus) dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
{ {
PDCB pDCB = pACB->pActiveDCB; PDCB pDCB = pACB->pActiveDCB;
...@@ -948,7 +948,7 @@ dc390_DataInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus) ...@@ -948,7 +948,7 @@ dc390_DataInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
dc390_DataIO_Comm (pACB, pSRB, READ_DIRECTION); dc390_DataIO_Comm (pACB, pSRB, READ_DIRECTION);
} }
void static void
dc390_CommandPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus) dc390_CommandPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
{ {
PDCB pDCB; PDCB pDCB;
...@@ -989,7 +989,7 @@ dc390_StatusPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus) ...@@ -989,7 +989,7 @@ dc390_StatusPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
//DC390_write8 (DMA_Cmd, DMA_IDLE_CMD); //DC390_write8 (DMA_Cmd, DMA_IDLE_CMD);
} }
void static void
dc390_MsgOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus) dc390_MsgOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
{ {
UCHAR bval, i, cnt; UCHAR bval, i, cnt;
...@@ -1097,7 +1097,7 @@ dc390_SetXferRate( PACB pACB, PDCB pDCB ) ...@@ -1097,7 +1097,7 @@ dc390_SetXferRate( PACB pACB, PDCB pDCB )
} }
void static void
dc390_Disconnect( PACB pACB ) dc390_Disconnect( PACB pACB )
{ {
PDCB pDCB; PDCB pDCB;
...@@ -1179,7 +1179,7 @@ dc390_Disconnect( PACB pACB ) ...@@ -1179,7 +1179,7 @@ dc390_Disconnect( PACB pACB )
} }
void static void
dc390_Reselect( PACB pACB ) dc390_Reselect( PACB pACB )
{ {
PDCB pDCB; PDCB pDCB;
...@@ -1349,10 +1349,10 @@ dc390_add_dev (PACB pACB, PDCB pDCB, PSCSI_INQDATA ptr) ...@@ -1349,10 +1349,10 @@ dc390_add_dev (PACB pACB, PDCB pDCB, PSCSI_INQDATA ptr)
}; };
void static void
dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB ) dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
{ {
UCHAR bval, status, i, DCB_removed; UCHAR bval, status, i;
PSCSICMD pcmd; PSCSICMD pcmd;
PSCSI_INQDATA ptr; PSCSI_INQDATA ptr;
PSGL ptr2; PSGL ptr2;
...@@ -1362,7 +1362,6 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB ) ...@@ -1362,7 +1362,6 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
/* KG: Moved pci_unmap here */ /* KG: Moved pci_unmap here */
dc390_pci_unmap(pSRB); dc390_pci_unmap(pSRB);
DCB_removed = 0;
status = pSRB->TargetStatus; status = pSRB->TargetStatus;
ptr = (PSCSI_INQDATA) (pcmd->request_buffer); ptr = (PSCSI_INQDATA) (pcmd->request_buffer);
if( pcmd->use_sg ) if( pcmd->use_sg )
...@@ -1569,8 +1568,6 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB ) ...@@ -1569,8 +1568,6 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
(pcmd->sense_buffer[2] & 0xf) == ILLEGAL_REQUEST) || host_byte(pcmd->result) & DID_ERROR ) (pcmd->sense_buffer[2] & 0xf) == ILLEGAL_REQUEST) || host_byte(pcmd->result) & DID_ERROR )
{ {
/* device not present: remove */ /* device not present: remove */
//dc390_Going_remove (pDCB, pSRB);
dc390_remove_dev (pACB, pDCB); DCB_removed = 1;
if( (pcmd->device->id == pACB->pScsiHost->max_id - 1) && if( (pcmd->device->id == pACB->pScsiHost->max_id - 1) &&
((pcmd->device->lun == 0) || (pcmd->device->lun == pACB->pScsiHost->max_lun - 1)) ) ((pcmd->device->lun == 0) || (pcmd->device->lun == pACB->pScsiHost->max_lun - 1)) )
...@@ -1582,24 +1579,14 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB ) ...@@ -1582,24 +1579,14 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
if( (pcmd->device->id == pACB->pScsiHost->max_id - 1) && if( (pcmd->device->id == pACB->pScsiHost->max_id - 1) &&
(pcmd->device->lun == pACB->pScsiHost->max_lun - 1) ) (pcmd->device->lun == pACB->pScsiHost->max_lun - 1) )
pACB->scan_devices = END_SCAN ; pACB->scan_devices = END_SCAN ;
/* pACB->DeviceCnt++; */ /* Dev is added on INQUIRY */
} }
} }
} }
//if( pSRB->pcmd->cmnd[0] == INQUIRY &&
// (host_byte(pcmd->result) == DID_OK || status_byte(pcmd->result) & CHECK_CONDITION) )
if( pcmd->cmnd[0] == INQUIRY && if( pcmd->cmnd[0] == INQUIRY &&
(pcmd->result == (DID_OK << 16) || status_byte(pcmd->result) & CHECK_CONDITION) ) (pcmd->result == (DID_OK << 16) || status_byte(pcmd->result) & CHECK_CONDITION) )
{ {
if ((ptr->DevType & SCSI_DEVTYPE) == TYPE_NODEV && !DCB_removed) if ((ptr->DevType & SCSI_DEVTYPE) != TYPE_NODEV)
{
//printk ("DC390: Type = nodev! (%02i-%i)\n", pcmd->target, pcmd->lun);
/* device not present: remove */
//dc390_Going_remove (pDCB, pSRB);
dc390_remove_dev (pACB, pDCB); DCB_removed = 1;
}
else
{ {
/* device found: add */ /* device found: add */
dc390_add_dev (pACB, pDCB, ptr); dc390_add_dev (pACB, pDCB, ptr);
...@@ -1608,11 +1595,11 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB ) ...@@ -1608,11 +1595,11 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
if( (pcmd->device->id == pACB->pScsiHost->max_id - 1) && if( (pcmd->device->id == pACB->pScsiHost->max_id - 1) &&
(pcmd->device->lun == pACB->pScsiHost->max_lun - 1) ) (pcmd->device->lun == pACB->pScsiHost->max_lun - 1) )
pACB->scan_devices = 0; pACB->scan_devices = 0;
}; }
pcmd->resid = pcmd->request_bufflen - pSRB->TotalXferredLen; pcmd->resid = pcmd->request_bufflen - pSRB->TotalXferredLen;
if (!DCB_removed) dc390_Going_remove (pDCB, pSRB); dc390_Going_remove (pDCB, pSRB);
/* Add to free list */ /* Add to free list */
dc390_Free_insert (pACB, pSRB); dc390_Free_insert (pACB, pSRB);
...@@ -1625,7 +1612,7 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB ) ...@@ -1625,7 +1612,7 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
/* Remove all SRBs from Going list and inform midlevel */ /* Remove all SRBs from Going list and inform midlevel */
void static void
dc390_DoingSRB_Done( PACB pACB, PSCSICMD cmd ) dc390_DoingSRB_Done( PACB pACB, PSCSICMD cmd )
{ {
PDCB pDCB, pdcb; PDCB pDCB, pdcb;
...@@ -1760,4 +1747,3 @@ dc390_InvalidCmd( PACB pACB ) ...@@ -1760,4 +1747,3 @@ dc390_InvalidCmd( PACB pACB )
if( pACB->pActiveDCB->pActiveSRB->SRBState & (SRB_START_+SRB_MSGOUT) ) if( pACB->pActiveDCB->pActiveSRB->SRBState & (SRB_START_+SRB_MSGOUT) )
DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD); DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD);
} }
This diff is collapsed.
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