Commit e80f061d authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Christoph Hellwig

[PATCH] tmscsim: remove DeviceCnt

On Wed, 26 May 2004, Christoph Hellwig wrote:
> On Sun, May 23, 2004 at 11:19:58PM +0200, Guennadi Liakhovetski wrote:
> >
> > Whereas, DCBCnt is incremented on slave_alloc, decremented on
> > slave_destroy and used in a couple more places. So, is it safe to assume
> > that DeviceCnt is redundant and remove it in a next patch?... Then it
> > might be already safe to move scan_devices as you suggest?
>
> Looks like a way to go.  I'm not sure what scan_device is supposed to
> do as I already wrote, but from looking at when it's set/cleared I'm
> pretty sure it tries to indicate whethere we're currently scanning for
> devices.  And useing slave_alloc/slave_configure is a much safer way to
> find that out then guessing from the commands sent.

So, here's the first one - remove DeviceCnt.
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 6e1c1603
......@@ -1302,7 +1302,6 @@ dc390_remove_dev (PACB pACB, PDCB pDCB)
if (pDCB == pACB->pDCBRunRobin) pACB->pDCBRunRobin = pDCB->pNextDCB;
kfree (pDCB);
pACB->DCBCnt--;
/* pACB->DeviceCnt--; */
};
......@@ -1590,7 +1589,6 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
{
/* device found: add */
dc390_add_dev (pACB, pDCB, ptr);
if (pACB->scan_devices) pACB->DeviceCnt++;
}
if( (pcmd->device->id == pACB->pScsiHost->max_id - 1) &&
(pcmd->device->lun == pACB->pScsiHost->max_lun - 1) )
......
......@@ -1734,7 +1734,6 @@ static void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index
pACB->AdapterIndex = index;
pACB->status = 0;
psh->this_id = dc390_eepromBuf[index][EE_ADAPT_SCSI_ID];
pACB->DeviceCnt = 0;
pACB->DCBCnt = 0;
pACB->TagMaxNum = 2 << dc390_eepromBuf[index][EE_TAG_CMD_NUM];
pACB->ACBFlag = 0;
......@@ -2089,7 +2088,7 @@ static int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start,
SPRINTF(" Lost arbitrations %i, Sel. connected %i, Connected: %s\n",
pACB->SelLost, pACB->SelConn, pACB->Connected? "Yes": "No");
SPRINTF("Nr of attached devices: %i, Nr of DCBs: %i\n", pACB->DeviceCnt, pACB->DCBCnt);
SPRINTF("Nr of DCBs: %i\n", pACB->DCBCnt);
SPRINTF("Map of attached LUNs: %02x %02x %02x %02x %02x %02x %02x %02x\n",
pACB->DCBmap[0], pACB->DCBmap[1], pACB->DCBmap[2], pACB->DCBmap[3],
pACB->DCBmap[4], pACB->DCBmap[5], pACB->DCBmap[6], pACB->DCBmap[7]);
......
......@@ -196,10 +196,8 @@ UCHAR status;
UCHAR SRBCount;
UCHAR AdapterIndex; /*; nth Adapter this driver */
UCHAR DeviceCnt;
UCHAR DCBCnt;
/* 0x10: */
UCHAR TagMaxNum;
UCHAR ACBFlag;
UCHAR Gmode2;
......@@ -213,13 +211,11 @@ PDCB pActiveDCB;
PSRB pFreeSRB;
PSRB pTmpSRB;
/* 0x2c: */
UCHAR msgin123[4];
UCHAR DCBmap[MAX_SCSI_ID];
UCHAR Connected;
UCHAR pad;
/* 0x30: */
#if defined(USE_SPINLOCKS) && USE_SPINLOCKS > 1 && (defined(CONFIG_SMP) || DEBUG_SPINLOCKS > 0)
spinlock_t lock;
#endif
......@@ -230,20 +226,17 @@ UCHAR MsgLen;
UCHAR Ignore_IRQ; /* Not used */
PDEVDECL1; /* Pointer to PCI cfg. space */
/* 0x40/0x3c: */
ULONG Cmds;
UINT SelLost;
UINT SelConn;
UINT CmdInQ;
UINT CmdOutOfSRB;
/* 0x54/0x50: */
struct timer_list Waiting_Timer;
/* 0x68/0x64: */
DC390_SRB TmpSRB;
/* 0xcc/0xc8: */
DC390_SRB SRB_array[MAX_SRB_CNT]; /* 50 SRBs */
/* 0xfa4/0xfa0: */
};
typedef struct _ACB DC390_ACB, *PACB;
......
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