Commit 6ca38fb5 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Christoph Hellwig

[PATCH] SCSI tmscsim.c: fix inline compile errors

Original Patch From: Adrian Bunk <bunk@fs.tum.de>

I looked at those 3 functions. dc390_EnableMsgOut_Abort is called 5 times
in the code and is 0x30 bytes long (as compiled with 3.3.2), so,
uninlining it, probably, makes most sense. The other 2 functions are
called only ones each and from the interrupt, so, I applied the
"alternative approach" to them - moved above the calling functions.
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 9ca51573
......@@ -213,8 +213,17 @@ dc390_dma_intr (struct dc390_acb* pACB)
}
#endif
static void __inline__
dc390_InvalidCmd(struct dc390_acb* pACB)
{
if (pACB->pActiveDCB->pActiveSRB->SRBState & (SRB_START_ | SRB_MSGOUT))
DC390_write8(ScsiCmd, CLEAR_FIFO_CMD);
}
static irqreturn_t __inline__
DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
DC390_Interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
struct dc390_acb *pACB, *pACB2;
struct dc390_dcb *pDCB;
......@@ -594,7 +603,7 @@ dc390_MsgIn_reject (struct dc390_acb* pACB, struct dc390_srb* pSRB)
}
/* abort command */
static void __inline__
static void
dc390_EnableMsgOut_Abort ( struct dc390_acb* pACB, struct dc390_srb* pSRB )
{
pSRB->MsgOutBuf[0] = ABORT;
......@@ -1333,6 +1342,35 @@ dc390_add_dev (struct dc390_acb* pACB, struct dc390_dcb* pDCB, PSCSI_INQDATA ptr
}
static void __inline__
dc390_RequestSense(struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB)
{
struct scsi_cmnd *pcmd;
pcmd = pSRB->pcmd;
REMOVABLEDEBUG(printk(KERN_INFO "DC390: RequestSense(Cmd %02x, Id %02x, LUN %02x)\n",\
pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN));
pSRB->SRBFlag |= AUTO_REQSENSE;
pSRB->SavedSGCount = pcmd->use_sg;
pSRB->SavedTotXLen = pSRB->TotalXferredLen;
pSRB->AdaptStatus = 0;
pSRB->TargetStatus = 0; /* CHECK_CONDITION<<1; */
/* We are called from SRBdone, original PCI mapping has been removed
* already, new one is set up from StartSCSI */
pSRB->SGIndex = 0;
pSRB->TotalXferredLen = 0;
pSRB->SGToBeXferLen = 0;
if (dc390_StartSCSI(pACB, pDCB, pSRB)) {
dc390_Going_to_Waiting(pDCB, pSRB);
dc390_waiting_timer(pACB, HZ/5);
}
}
static void
dc390_SRBdone( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB )
{
......@@ -1662,51 +1700,3 @@ dc390_ScsiRstDetect( struct dc390_acb* pACB )
}
return;
}
static void __inline__
dc390_RequestSense( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB )
{
struct scsi_cmnd *pcmd;
pcmd = pSRB->pcmd;
REMOVABLEDEBUG(printk (KERN_INFO "DC390: RequestSense (Cmd %02x, Id %02x, LUN %02x)\n",\
pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN));
pSRB->SRBFlag |= AUTO_REQSENSE;
//pSRB->Segment0[0] = (u32) pSRB->CmdBlock[0];
//pSRB->Segment0[1] = (u32) pSRB->CmdBlock[4];
//pSRB->Segment1[0] = ((u32)(pcmd->cmd_len) << 8) + pSRB->SGcount;
//pSRB->Segment1[1] = pSRB->TotalXferredLen;
pSRB->SavedSGCount = pcmd->use_sg;
pSRB->SavedTotXLen = pSRB->TotalXferredLen;
pSRB->AdaptStatus = 0;
pSRB->TargetStatus = 0; /* CHECK_CONDITION<<1; */
/* We are called from SRBdone, original PCI mapping has been removed
* already, new one is set up from StartSCSI */
pSRB->SGIndex = 0;
//pSRB->CmdBlock[0] = REQUEST_SENSE;
//pSRB->CmdBlock[1] = pDCB->TargetLUN << 5;
//(u16) pSRB->CmdBlock[2] = 0;
//(u16) pSRB->CmdBlock[4] = sizeof(pcmd->sense_buffer);
//pSRB->ScsiCmdLen = 6;
pSRB->TotalXferredLen = 0;
pSRB->SGToBeXferLen = 0;
if( dc390_StartSCSI( pACB, pDCB, pSRB ) ) {
dc390_Going_to_Waiting ( pDCB, pSRB );
dc390_waiting_timer (pACB, HZ/5);
}
}
static void __inline__
dc390_InvalidCmd( struct dc390_acb* pACB )
{
if( pACB->pActiveDCB->pActiveSRB->SRBState & (SRB_START_+SRB_MSGOUT) )
DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD);
}
......@@ -291,9 +291,7 @@ static void dc390_SRBdone( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struc
static void dc390_DoingSRB_Done( struct dc390_acb* pACB, struct scsi_cmnd * cmd);
static void dc390_ScsiRstDetect( struct dc390_acb* pACB );
static void dc390_ResetSCSIBus( struct dc390_acb* pACB );
static void __inline__ dc390_RequestSense( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB );
static void __inline__ dc390_InvalidCmd( struct dc390_acb* pACB );
static void __inline__ dc390_EnableMsgOut_Abort (struct dc390_acb*, struct dc390_srb*);
static void dc390_EnableMsgOut_Abort(struct dc390_acb*, struct dc390_srb*);
static irqreturn_t do_DC390_Interrupt( int, void *, struct pt_regs *);
static int dc390_initAdapter(struct Scsi_Host *psh, unsigned long io_port, u8 Irq, u8 index );
......@@ -942,8 +940,6 @@ static void dc390_BuildSRB (struct scsi_cmnd *pcmd, struct dc390_dcb* pDCB, stru
{
pSRB->pSRBDCB = pDCB;
pSRB->pcmd = pcmd;
//pSRB->ScsiCmdLen = pcmd->cmd_len;
//memcpy (pSRB->CmdBlock, pcmd->cmnd, pcmd->cmd_len);
pSRB->SGIndex = 0;
pSRB->AdaptStatus = 0;
......
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