Commit ecec1947 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by James Bottomley

[SCSI] advansys: misc reformatting

Remove some useless forward declarations
Reformat some comments, debug messages, and the occasional piece of real code
Removal of unnecessary braces
Remove duplicate setting of shost->irq
Signed-off-by: default avatarMatthew Wilcox <matthew@wil.cx>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 47d853cc
...@@ -1815,9 +1815,6 @@ static void AscEnableInterrupt(PortAddr); ...@@ -1815,9 +1815,6 @@ static void AscEnableInterrupt(PortAddr);
static void AscSetBank(PortAddr, uchar); static void AscSetBank(PortAddr, uchar);
static int AscResetChipAndScsiBus(ASC_DVC_VAR *); static int AscResetChipAndScsiBus(ASC_DVC_VAR *);
#ifdef CONFIG_ISA #ifdef CONFIG_ISA
static ushort AscGetIsaDmaChannel(PortAddr);
static ushort AscSetIsaDmaChannel(PortAddr, ushort);
static uchar AscSetIsaDmaSpeed(PortAddr, uchar);
static uchar AscGetIsaDmaSpeed(PortAddr); static uchar AscGetIsaDmaSpeed(PortAddr);
#endif /* CONFIG_ISA */ #endif /* CONFIG_ISA */
static uchar AscReadLramByte(PortAddr, ushort); static uchar AscReadLramByte(PortAddr, ushort);
...@@ -1862,18 +1859,11 @@ static int AscIsrQDone(ASC_DVC_VAR *); ...@@ -1862,18 +1859,11 @@ static int AscIsrQDone(ASC_DVC_VAR *);
static ushort AscGetEisaChipCfg(PortAddr); static ushort AscGetEisaChipCfg(PortAddr);
#endif /* CONFIG_ISA */ #endif /* CONFIG_ISA */
static uchar AscGetChipScsiCtrl(PortAddr); static uchar AscGetChipScsiCtrl(PortAddr);
static uchar AscSetChipScsiID(PortAddr, uchar);
static uchar AscGetChipVersion(PortAddr, ushort); static uchar AscGetChipVersion(PortAddr, ushort);
static ushort AscGetChipBusType(PortAddr);
static ASC_DCNT AscLoadMicroCode(PortAddr, ushort, uchar *, ushort); static ASC_DCNT AscLoadMicroCode(PortAddr, ushort, uchar *, ushort);
static int AscFindSignature(PortAddr);
static void AscToggleIRQAct(PortAddr); static void AscToggleIRQAct(PortAddr);
static uchar AscGetChipIRQ(PortAddr, ushort);
static uchar AscSetChipIRQ(PortAddr, uchar, ushort);
static ushort AscGetChipBiosAddress(PortAddr, ushort);
static inline ulong DvcEnterCritical(void); static inline ulong DvcEnterCritical(void);
static inline void DvcLeaveCritical(ulong); static inline void DvcLeaveCritical(ulong);
static ushort AscGetChipBiosAddress(PortAddr, ushort);
static void DvcSleepMilliSecond(ASC_DCNT); static void DvcSleepMilliSecond(ASC_DCNT);
static void DvcDelayNanoSecond(ASC_DVC_VAR *, ASC_DCNT); static void DvcDelayNanoSecond(ASC_DVC_VAR *, ASC_DCNT);
static void DvcPutScsiQ(PortAddr, ushort, uchar *, int); static void DvcPutScsiQ(PortAddr, ushort, uchar *, int);
...@@ -1887,7 +1877,6 @@ static int AscSgListToQueue(int); ...@@ -1887,7 +1877,6 @@ static int AscSgListToQueue(int);
#ifdef CONFIG_ISA #ifdef CONFIG_ISA
static void AscEnableIsaDma(uchar); static void AscEnableIsaDma(uchar);
#endif /* CONFIG_ISA */ #endif /* CONFIG_ISA */
static ASC_DCNT AscGetMaxDmaCount(ushort);
static const char *advansys_info(struct Scsi_Host *shost); static const char *advansys_info(struct Scsi_Host *shost);
/* /*
...@@ -3710,10 +3699,6 @@ static int asc_prt_adv_board_info(struct Scsi_Host *, char *, int); ...@@ -3710,10 +3699,6 @@ static int asc_prt_adv_board_info(struct Scsi_Host *, char *, int);
static int asc_prt_line(char *, int, char *fmt, ...); static int asc_prt_line(char *, int, char *fmt, ...);
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
/* Declaration for Asc Library internal functions referenced by driver. */
static int AscFindSignature(PortAddr);
static ushort AscGetEEPConfig(PortAddr, ASCEEP_CONFIG *, ushort);
/* Statistics function prototypes. */ /* Statistics function prototypes. */
#ifdef ADVANSYS_STATS #ifdef ADVANSYS_STATS
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
...@@ -3822,8 +3807,7 @@ advansys_proc_info(struct Scsi_Host *shost, char *buffer, char **start, ...@@ -3822,8 +3807,7 @@ advansys_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
cp = boardp->prtbuf; cp = boardp->prtbuf;
cplen = asc_prt_adv_bios(shost, cp, ASC_PRTBUF_SIZE); cplen = asc_prt_adv_bios(shost, cp, ASC_PRTBUF_SIZE);
ASC_ASSERT(cplen < ASC_PRTBUF_SIZE); ASC_ASSERT(cplen < ASC_PRTBUF_SIZE);
cnt = cnt = asc_proc_copy(advoffset, offset, curbuf, leftlen, cp,
asc_proc_copy(advoffset, offset, curbuf, leftlen, cp,
cplen); cplen);
totcnt += cnt; totcnt += cnt;
leftlen -= cnt; leftlen -= cnt;
...@@ -3912,8 +3896,7 @@ advansys_proc_info(struct Scsi_Host *shost, char *buffer, char **start, ...@@ -3912,8 +3896,7 @@ advansys_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
cplen = asc_prt_target_stats(shost, tgt_id, cp, cplen = asc_prt_target_stats(shost, tgt_id, cp,
ASC_PRTBUF_SIZE); ASC_PRTBUF_SIZE);
ASC_ASSERT(cplen <= ASC_PRTBUF_SIZE); ASC_ASSERT(cplen <= ASC_PRTBUF_SIZE);
cnt = cnt = asc_proc_copy(advoffset, offset, curbuf, leftlen, cp,
asc_proc_copy(advoffset, offset, curbuf, leftlen, cp,
cplen); cplen);
totcnt += cnt; totcnt += cnt;
leftlen -= cnt; leftlen -= cnt;
...@@ -4004,15 +3987,14 @@ static const char *advansys_info(struct Scsi_Host *shost) ...@@ -4004,15 +3987,14 @@ static const char *advansys_info(struct Scsi_Host *shost)
} }
} else { } else {
busname = "?"; busname = "?";
ASC_PRINT2 ASC_PRINT2("advansys_info: board %d: unknown "
("advansys_info: board %d: unknown bus type %d\n", "bus type %d\n", boardp->id,
boardp->id, asc_dvc_varp->bus_type); asc_dvc_varp->bus_type);
} }
/* Don't reference 'shost->n_io_port'; It may be truncated. */ /* Don't reference 'shost->n_io_port'; It may be truncated. */
sprintf(info, sprintf(info,
"AdvanSys SCSI %s: %s: IO 0x%lX-0x%lX, IRQ 0x%X", "AdvanSys SCSI %s: %s: IO 0x%lX-0x%lX, IRQ 0x%X",
ASC_VERSION, busname, ASC_VERSION, busname, (ulong)shost->io_port,
(ulong)shost->io_port,
(ulong)shost->io_port + boardp->asc_n_io_port - (ulong)shost->io_port + boardp->asc_n_io_port -
1, shost->irq); 1, shost->irq);
} }
...@@ -4193,18 +4175,16 @@ static int advansys_reset(struct scsi_cmnd *scp) ...@@ -4193,18 +4175,16 @@ static int advansys_reset(struct scsi_cmnd *scp)
/* Refer to ASC_IERR_* defintions for meaning of 'err_code'. */ /* Refer to ASC_IERR_* defintions for meaning of 'err_code'. */
if (asc_dvc_varp->err_code) { if (asc_dvc_varp->err_code) {
ASC_PRINT2 ASC_PRINT2("advansys_reset: board %d: SCSI bus reset "
("advansys_reset: board %d: SCSI bus reset error: 0x%x\n", "error: 0x%x\n", boardp->id,
boardp->id, asc_dvc_varp->err_code); asc_dvc_varp->err_code);
ret = FAILED; ret = FAILED;
} else if (status) { } else if (status) {
ASC_PRINT2 ASC_PRINT2("advansys_reset: board %d: SCSI bus reset "
("advansys_reset: board %d: SCSI bus reset warning: 0x%x\n", "warning: 0x%x\n", boardp->id, status);
boardp->id, status);
} else { } else {
ASC_PRINT1 ASC_PRINT1("advansys_reset: board %d: SCSI bus reset "
("advansys_reset: board %d: SCSI bus reset successful.\n", "successful.\n", boardp->id);
boardp->id);
} }
ASC_DBG(1, "advansys_reset: after AscInitAsc1000Driver()\n"); ASC_DBG(1, "advansys_reset: after AscInitAsc1000Driver()\n");
...@@ -4225,15 +4205,13 @@ static int advansys_reset(struct scsi_cmnd *scp) ...@@ -4225,15 +4205,13 @@ static int advansys_reset(struct scsi_cmnd *scp)
ASC_DBG(1, "advansys_reset: before AdvResetChipAndSB()\n"); ASC_DBG(1, "advansys_reset: before AdvResetChipAndSB()\n");
switch (AdvResetChipAndSB(adv_dvc_varp)) { switch (AdvResetChipAndSB(adv_dvc_varp)) {
case ASC_TRUE: case ASC_TRUE:
ASC_PRINT1 ASC_PRINT1("advansys_reset: board %d: SCSI bus reset "
("advansys_reset: board %d: SCSI bus reset successful.\n", "successful.\n", boardp->id);
boardp->id);
break; break;
case ASC_FALSE: case ASC_FALSE:
default: default:
ASC_PRINT1 ASC_PRINT1("advansys_reset: board %d: SCSI bus reset "
("advansys_reset: board %d: SCSI bus reset error.\n", "error.\n", boardp->id);
boardp->id);
ret = FAILED; ret = FAILED;
break; break;
} }
...@@ -4254,8 +4232,8 @@ static int advansys_reset(struct scsi_cmnd *scp) ...@@ -4254,8 +4232,8 @@ static int advansys_reset(struct scsi_cmnd *scp)
* is returned in 'last_scp'. * is returned in 'last_scp'.
*/ */
if (done_scp == NULL) { if (done_scp == NULL) {
done_scp = done_scp = asc_dequeue_list(&boardp->active, &last_scp,
asc_dequeue_list(&boardp->active, &last_scp, ASC_TID_ALL); ASC_TID_ALL);
for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) { for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) {
tscp->result = HOST_BYTE(DID_RESET); tscp->result = HOST_BYTE(DID_RESET);
} }
...@@ -4281,8 +4259,8 @@ static int advansys_reset(struct scsi_cmnd *scp) ...@@ -4281,8 +4259,8 @@ static int advansys_reset(struct scsi_cmnd *scp)
* to DID_RESET. * to DID_RESET.
*/ */
if (done_scp == NULL) { if (done_scp == NULL) {
done_scp = done_scp = asc_dequeue_list(&boardp->waiting, &last_scp,
asc_dequeue_list(&boardp->waiting, &last_scp, ASC_TID_ALL); ASC_TID_ALL);
for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) { for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) {
tscp->result = HOST_BYTE(DID_RESET); tscp->result = HOST_BYTE(DID_RESET);
} }
...@@ -4313,9 +4291,8 @@ static int advansys_reset(struct scsi_cmnd *scp) ...@@ -4313,9 +4291,8 @@ static int advansys_reset(struct scsi_cmnd *scp)
/* /*
* Complete all the 'done_scp' requests. * Complete all the 'done_scp' requests.
*/ */
if (done_scp != NULL) { if (done_scp)
asc_scsi_done_list(done_scp); asc_scsi_done_list(done_scp);
}
ASC_DBG1(1, "advansys_reset: ret %d\n", ret); ASC_DBG1(1, "advansys_reset: ret %d\n", ret);
...@@ -4829,32 +4806,32 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp) ...@@ -4829,32 +4806,32 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
case ASC_NOERROR: case ASC_NOERROR:
ASC_STATS(scp->device->host, exe_noerror); ASC_STATS(scp->device->host, exe_noerror);
/* /*
* Increment monotonically increasing per device successful * Increment monotonically increasing per device
* request counter. Wrapping doesn't matter. * successful request counter. Wrapping doesn't matter.
*/ */
boardp->reqcnt[scp->device->id]++; boardp->reqcnt[scp->device->id]++;
asc_enqueue(&boardp->active, scp, ASC_BACK); asc_enqueue(&boardp->active, scp, ASC_BACK);
ASC_DBG(1, ASC_DBG(1, "asc_execute_scsi_cmnd: AscExeScsiQueue(), "
"asc_execute_scsi_cmnd: AscExeScsiQueue(), ASC_NOERROR\n"); "ASC_NOERROR\n");
break; break;
case ASC_BUSY: case ASC_BUSY:
/* /*
* Caller will enqueue request on the target's waiting queue * Caller will enqueue request on the target's waiting
* and retry later. * queue and retry later.
*/ */
ASC_STATS(scp->device->host, exe_busy); ASC_STATS(scp->device->host, exe_busy);
break; break;
case ASC_ERROR: case ASC_ERROR:
ASC_PRINT2 ASC_PRINT2("asc_execute_scsi_cmnd: board %d: "
("asc_execute_scsi_cmnd: board %d: AscExeScsiQueue() ASC_ERROR, err_code 0x%x\n", "AscExeScsiQueue() ASC_ERROR, err_code 0x%x\n",
boardp->id, asc_dvc_varp->err_code); boardp->id, asc_dvc_varp->err_code);
ASC_STATS(scp->device->host, exe_error); ASC_STATS(scp->device->host, exe_error);
scp->result = HOST_BYTE(DID_ERROR); scp->result = HOST_BYTE(DID_ERROR);
asc_enqueue(&boardp->done, scp, ASC_BACK); asc_enqueue(&boardp->done, scp, ASC_BACK);
break; break;
default: default:
ASC_PRINT2 ASC_PRINT2("asc_execute_scsi_cmnd: board %d: "
("asc_execute_scsi_cmnd: board %d: AscExeScsiQueue() unknown, err_code 0x%x\n", "AscExeScsiQueue() unknown, err_code 0x%x\n",
boardp->id, asc_dvc_varp->err_code); boardp->id, asc_dvc_varp->err_code);
ASC_STATS(scp->device->host, exe_unknown); ASC_STATS(scp->device->host, exe_unknown);
scp->result = HOST_BYTE(DID_ERROR); scp->result = HOST_BYTE(DID_ERROR);
...@@ -4875,20 +4852,21 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp) ...@@ -4875,20 +4852,21 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
*/ */
switch (adv_build_req(boardp, scp, &adv_scsiqp)) { switch (adv_build_req(boardp, scp, &adv_scsiqp)) {
case ASC_NOERROR: case ASC_NOERROR:
ASC_DBG(3, ASC_DBG(3, "asc_execute_scsi_cmnd: adv_build_req "
"asc_execute_scsi_cmnd: adv_build_req ASC_NOERROR\n"); "ASC_NOERROR\n");
break; break;
case ASC_BUSY: case ASC_BUSY:
ASC_DBG(1, ASC_DBG(1, "asc_execute_scsi_cmnd: adv_build_req "
"asc_execute_scsi_cmnd: adv_build_req ASC_BUSY\n"); "ASC_BUSY\n");
/* /*
* If busy is returned the request has not been enqueued. * If busy is returned the request has not been
* It will be enqueued by the caller on the target's waiting * enqueued. It will be enqueued by the caller on the
* queue and retried later. * target's waiting queue and retried later.
* *
* The asc_stats fields 'adv_build_noreq' and 'adv_build_nosg' * The asc_stats fields 'adv_build_noreq' and
* count wide board busy conditions. They are updated in * 'adv_build_nosg' count wide board busy conditions.
* adv_build_req and adv_get_sglist, respectively. * They are updated in adv_build_req and
* adv_get_sglist, respectively.
*/ */
return ASC_BUSY; return ASC_BUSY;
case ASC_ERROR: case ASC_ERROR:
...@@ -4898,8 +4876,8 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp) ...@@ -4898,8 +4876,8 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
* by the caller. * by the caller.
*/ */
default: default:
ASC_DBG(1, ASC_DBG(1, "asc_execute_scsi_cmnd: adv_build_req "
"asc_execute_scsi_cmnd: adv_build_req ASC_ERROR\n"); "ASC_ERROR\n");
ASC_STATS(scp->device->host, build_error); ASC_STATS(scp->device->host, build_error);
return ASC_ERROR; return ASC_ERROR;
} }
...@@ -4912,32 +4890,32 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp) ...@@ -4912,32 +4890,32 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
case ASC_NOERROR: case ASC_NOERROR:
ASC_STATS(scp->device->host, exe_noerror); ASC_STATS(scp->device->host, exe_noerror);
/* /*
* Increment monotonically increasing per device successful * Increment monotonically increasing per device
* request counter. Wrapping doesn't matter. * successful request counter. Wrapping doesn't matter.
*/ */
boardp->reqcnt[scp->device->id]++; boardp->reqcnt[scp->device->id]++;
asc_enqueue(&boardp->active, scp, ASC_BACK); asc_enqueue(&boardp->active, scp, ASC_BACK);
ASC_DBG(1, ASC_DBG(1, "asc_execute_scsi_cmnd: AdvExeScsiQueue(), "
"asc_execute_scsi_cmnd: AdvExeScsiQueue(), ASC_NOERROR\n"); "ASC_NOERROR\n");
break; break;
case ASC_BUSY: case ASC_BUSY:
/* /*
* Caller will enqueue request on the target's waiting queue * Caller will enqueue request on the target's waiting
* and retry later. * queue and retry later.
*/ */
ASC_STATS(scp->device->host, exe_busy); ASC_STATS(scp->device->host, exe_busy);
break; break;
case ASC_ERROR: case ASC_ERROR:
ASC_PRINT2 ASC_PRINT2("asc_execute_scsi_cmnd: board %d: "
("asc_execute_scsi_cmnd: board %d: AdvExeScsiQueue() ASC_ERROR, err_code 0x%x\n", "AdvExeScsiQueue() ASC_ERROR, err_code 0x%x\n",
boardp->id, adv_dvc_varp->err_code); boardp->id, adv_dvc_varp->err_code);
ASC_STATS(scp->device->host, exe_error); ASC_STATS(scp->device->host, exe_error);
scp->result = HOST_BYTE(DID_ERROR); scp->result = HOST_BYTE(DID_ERROR);
asc_enqueue(&boardp->done, scp, ASC_BACK); asc_enqueue(&boardp->done, scp, ASC_BACK);
break; break;
default: default:
ASC_PRINT2 ASC_PRINT2("asc_execute_scsi_cmnd: board %d: "
("asc_execute_scsi_cmnd: board %d: AdvExeScsiQueue() unknown, err_code 0x%x\n", "AdvExeScsiQueue() unknown, err_code 0x%x\n",
boardp->id, adv_dvc_varp->err_code); boardp->id, adv_dvc_varp->err_code);
ASC_STATS(scp->device->host, exe_unknown); ASC_STATS(scp->device->host, exe_unknown);
scp->result = HOST_BYTE(DID_ERROR); scp->result = HOST_BYTE(DID_ERROR);
...@@ -4981,9 +4959,9 @@ static int asc_build_req(asc_board_t *boardp, struct scsi_cmnd *scp) ...@@ -4981,9 +4959,9 @@ static int asc_build_req(asc_board_t *boardp, struct scsi_cmnd *scp)
* is supported. * is supported.
*/ */
if (scp->cmd_len > ASC_MAX_CDB_LEN) { if (scp->cmd_len > ASC_MAX_CDB_LEN) {
ASC_PRINT3 ASC_PRINT3("asc_build_req: board %d: cmd_len %d > "
("asc_build_req: board %d: cmd_len %d > ASC_MAX_CDB_LEN %d\n", "ASC_MAX_CDB_LEN %d\n", boardp->id, scp->cmd_len,
boardp->id, scp->cmd_len, ASC_MAX_CDB_LEN); ASC_MAX_CDB_LEN);
scp->result = HOST_BYTE(DID_ERROR); scp->result = HOST_BYTE(DID_ERROR);
asc_enqueue(&boardp->done, scp, ASC_BACK); asc_enqueue(&boardp->done, scp, ASC_BACK);
return ASC_ERROR; return ASC_ERROR;
...@@ -7330,27 +7308,27 @@ DvcGetQinfo(PortAddr iop_base, ushort s_addr, uchar *inbuf, int words) ...@@ -7330,27 +7308,27 @@ DvcGetQinfo(PortAddr iop_base, ushort s_addr, uchar *inbuf, int words)
* Return the BIOS address of the adapter at the specified * Return the BIOS address of the adapter at the specified
* I/O port and with the specified bus type. * I/O port and with the specified bus type.
*/ */
static ushort __devinit AscGetChipBiosAddress(PortAddr iop_base, ushort bus_type) static unsigned short __devinit
AscGetChipBiosAddress(PortAddr iop_base, unsigned short bus_type)
{ {
ushort cfg_lsw; unsigned short cfg_lsw;
ushort bios_addr; unsigned short bios_addr;
/* /*
* The PCI BIOS is re-located by the motherboard BIOS. Because * The PCI BIOS is re-located by the motherboard BIOS. Because
* of this the driver can not determine where a PCI BIOS is * of this the driver can not determine where a PCI BIOS is
* loaded and executes. * loaded and executes.
*/ */
if (bus_type & ASC_IS_PCI) { if (bus_type & ASC_IS_PCI)
return (0); return 0;
}
#ifdef CONFIG_ISA #ifdef CONFIG_ISA
if ((bus_type & ASC_IS_EISA) != 0) { if ((bus_type & ASC_IS_EISA) != 0) {
cfg_lsw = AscGetEisaChipCfg(iop_base); cfg_lsw = AscGetEisaChipCfg(iop_base);
cfg_lsw &= 0x000F; cfg_lsw &= 0x000F;
bios_addr = (ushort)(ASC_BIOS_MIN_ADDR + bios_addr = ASC_BIOS_MIN_ADDR + cfg_lsw * ASC_BIOS_BANK_SIZE;
(cfg_lsw * ASC_BIOS_BANK_SIZE)); return bios_addr;
return (bios_addr); }
} /* if */
#endif /* CONFIG_ISA */ #endif /* CONFIG_ISA */
cfg_lsw = AscGetChipCfgLsw(iop_base); cfg_lsw = AscGetChipCfgLsw(iop_base);
...@@ -7358,13 +7336,10 @@ static ushort __devinit AscGetChipBiosAddress(PortAddr iop_base, ushort bus_type ...@@ -7358,13 +7336,10 @@ static ushort __devinit AscGetChipBiosAddress(PortAddr iop_base, ushort bus_type
/* /*
* ISA PnP uses the top bit as the 32K BIOS flag * ISA PnP uses the top bit as the 32K BIOS flag
*/ */
if (bus_type == ASC_IS_ISAPNP) { if (bus_type == ASC_IS_ISAPNP)
cfg_lsw &= 0x7FFF; cfg_lsw &= 0x7FFF;
} bios_addr = ASC_BIOS_MIN_ADDR + (cfg_lsw >> 12) * ASC_BIOS_BANK_SIZE;
/* if */ return bios_addr;
bios_addr = (ushort)(((cfg_lsw >> 12) * ASC_BIOS_BANK_SIZE) +
ASC_BIOS_MIN_ADDR);
return (bios_addr);
} }
/* /*
...@@ -7661,10 +7636,8 @@ static void asc_prt_scsi_cmnd(struct scsi_cmnd *s) ...@@ -7661,10 +7636,8 @@ static void asc_prt_scsi_cmnd(struct scsi_cmnd *s)
printk(" timeout_per_command %d\n", s->timeout_per_command); printk(" timeout_per_command %d\n", s->timeout_per_command);
printk printk(" scsi_done 0x%p, done 0x%p, host_scribble 0x%p, result 0x%x\n",
(" scsi_done 0x%lx, done 0x%lx, host_scribble 0x%lx, result 0x%x\n", s->scsi_done, s->done, s->host_scribble, s->result);
(ulong)s->scsi_done, (ulong)s->done, (ulong)s->host_scribble,
s->result);
printk(" tag %u, pid %u\n", (unsigned)s->tag, (unsigned)s->pid); printk(" tag %u, pid %u\n", (unsigned)s->tag, (unsigned)s->pid);
} }
...@@ -7676,34 +7649,31 @@ static void asc_prt_asc_dvc_var(ASC_DVC_VAR *h) ...@@ -7676,34 +7649,31 @@ static void asc_prt_asc_dvc_var(ASC_DVC_VAR *h)
{ {
printk("ASC_DVC_VAR at addr 0x%lx\n", (ulong)h); printk("ASC_DVC_VAR at addr 0x%lx\n", (ulong)h);
printk printk(" iop_base 0x%x, err_code 0x%x, dvc_cntl 0x%x, bug_fix_cntl "
(" iop_base 0x%x, err_code 0x%x, dvc_cntl 0x%x, bug_fix_cntl %d,\n", "%d,\n", h->iop_base, h->err_code, h->dvc_cntl, h->bug_fix_cntl);
h->iop_base, h->err_code, h->dvc_cntl, h->bug_fix_cntl);
printk printk(" bus_type %d, isr_callback 0x%p, exe_callback 0x%p, "
(" bus_type %d, isr_callback 0x%lx, exe_callback 0x%lx, init_sdtr 0x%x,\n", "init_sdtr 0x%x,\n", h->bus_type, h->isr_callback,
h->bus_type, (ulong)h->isr_callback, (ulong)h->exe_callback, h->exe_callback, (unsigned)h->init_sdtr);
(unsigned)h->init_sdtr);
printk printk(" sdtr_done 0x%x, use_tagged_qng 0x%x, unit_not_ready 0x%x, "
(" sdtr_done 0x%x, use_tagged_qng 0x%x, unit_not_ready 0x%x, chip_no 0x%x,\n", "chip_no 0x%x,\n", (unsigned)h->sdtr_done,
(unsigned)h->sdtr_done, (unsigned)h->use_tagged_qng, (unsigned)h->use_tagged_qng, (unsigned)h->unit_not_ready,
(unsigned)h->unit_not_ready, (unsigned)h->chip_no); (unsigned)h->chip_no);
printk printk(" queue_full_or_busy 0x%x, start_motor 0x%x, scsi_reset_wait "
(" queue_full_or_busy 0x%x, start_motor 0x%x, scsi_reset_wait %u,\n", "%u,\n", (unsigned)h->queue_full_or_busy,
(unsigned)h->queue_full_or_busy, (unsigned)h->start_motor, (unsigned)h->start_motor, (unsigned)h->scsi_reset_wait);
(unsigned)h->scsi_reset_wait);
printk printk(" is_in_int %u, max_total_qng %u, cur_total_qng %u, "
(" is_in_int %u, max_total_qng %u, cur_total_qng %u, in_critical_cnt %u,\n", "in_critical_cnt %u,\n", (unsigned)h->is_in_int,
(unsigned)h->is_in_int, (unsigned)h->max_total_qng, (unsigned)h->max_total_qng, (unsigned)h->cur_total_qng,
(unsigned)h->cur_total_qng, (unsigned)h->in_critical_cnt); (unsigned)h->in_critical_cnt);
printk printk(" last_q_shortage %u, init_state 0x%x, no_scam 0x%x, "
(" last_q_shortage %u, init_state 0x%x, no_scam 0x%x, pci_fix_asyn_xfer 0x%x,\n", "pci_fix_asyn_xfer 0x%x,\n", (unsigned)h->last_q_shortage,
(unsigned)h->last_q_shortage, (unsigned)h->init_state, (unsigned)h->init_state, (unsigned)h->no_scam,
(unsigned)h->no_scam, (unsigned)h->pci_fix_asyn_xfer); (unsigned)h->pci_fix_asyn_xfer);
printk(" cfg 0x%lx, irq_no 0x%x\n", (ulong)h->cfg, (unsigned)h->irq_no); printk(" cfg 0x%lx, irq_no 0x%x\n", (ulong)h->cfg, (unsigned)h->irq_no);
} }
...@@ -8007,27 +7977,28 @@ static uchar __devinit AscSetChipScsiID(PortAddr iop_base, uchar new_host_id) ...@@ -8007,27 +7977,28 @@ static uchar __devinit AscSetChipScsiID(PortAddr iop_base, uchar new_host_id)
return (AscGetChipScsiID(iop_base)); return (AscGetChipScsiID(iop_base));
} }
static uchar __devinit AscGetChipScsiCtrl(PortAddr iop_base) static unsigned char __devinit AscGetChipScsiCtrl(PortAddr iop_base)
{ {
uchar sc; unsigned char sc;
AscSetBank(iop_base, 1); AscSetBank(iop_base, 1);
sc = inp(iop_base + IOP_REG_SC); sc = inp(iop_base + IOP_REG_SC);
AscSetBank(iop_base, 0); AscSetBank(iop_base, 0);
return (sc); return sc;
} }
static uchar __devinit AscGetChipVersion(PortAddr iop_base, ushort bus_type) static unsigned char __devinit
AscGetChipVersion(PortAddr iop_base, unsigned short bus_type)
{ {
if ((bus_type & ASC_IS_EISA) != 0) { if (bus_type & ASC_IS_EISA) {
PortAddr eisa_iop; PortAddr eisa_iop;
uchar revision; unsigned char revision;
eisa_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | eisa_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) |
(PortAddr) ASC_EISA_REV_IOP_MASK; (PortAddr) ASC_EISA_REV_IOP_MASK;
revision = inp(eisa_iop); revision = inp(eisa_iop);
return ((uchar)((ASC_CHIP_MIN_VER_EISA - 1) + revision)); return ASC_CHIP_MIN_VER_EISA - 1 + revision;
} }
return (AscGetChipVerNo(iop_base)); return AscGetChipVerNo(iop_base);
} }
static ushort __devinit AscGetChipBusType(PortAddr iop_base) static ushort __devinit AscGetChipBusType(PortAddr iop_base)
...@@ -10281,13 +10252,12 @@ static ushort __devinit AscInitGetConfig(ASC_DVC_VAR *asc_dvc) ...@@ -10281,13 +10252,12 @@ static ushort __devinit AscInitGetConfig(ASC_DVC_VAR *asc_dvc)
warn_code |= AscInitAscDvcVar(asc_dvc); warn_code |= AscInitAscDvcVar(asc_dvc);
warn_code |= AscInitFromEEP(asc_dvc); warn_code |= AscInitFromEEP(asc_dvc);
asc_dvc->init_state |= ASC_INIT_STATE_END_GET_CFG; asc_dvc->init_state |= ASC_INIT_STATE_END_GET_CFG;
if (asc_dvc->scsi_reset_wait > ASC_MAX_SCSI_RESET_WAIT) { if (asc_dvc->scsi_reset_wait > ASC_MAX_SCSI_RESET_WAIT)
asc_dvc->scsi_reset_wait = ASC_MAX_SCSI_RESET_WAIT; asc_dvc->scsi_reset_wait = ASC_MAX_SCSI_RESET_WAIT;
}
} else { } else {
asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE; asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE;
} }
return (warn_code); return warn_code;
} }
static ushort __devinit AscInitSetConfig(ASC_DVC_VAR *asc_dvc) static ushort __devinit AscInitSetConfig(ASC_DVC_VAR *asc_dvc)
...@@ -17154,14 +17124,11 @@ advansys_board_found(int iop, struct device *dev, int bus_type) ...@@ -17154,14 +17124,11 @@ advansys_board_found(int iop, struct device *dev, int bus_type)
int ret; int ret;
/* /*
* Adapter found.
*
* Register the adapter, get its configuration, and * Register the adapter, get its configuration, and
* initialize it. * initialize it.
*/ */
ASC_DBG(2, "advansys_board_found: scsi_host_alloc()\n"); ASC_DBG(2, "advansys_board_found: scsi_host_alloc()\n");
shost = scsi_host_alloc(&advansys_template, sizeof(asc_board_t)); shost = scsi_host_alloc(&advansys_template, sizeof(asc_board_t));
if (!shost) if (!shost)
return NULL; return NULL;
...@@ -17169,8 +17136,6 @@ advansys_board_found(int iop, struct device *dev, int bus_type) ...@@ -17169,8 +17136,6 @@ advansys_board_found(int iop, struct device *dev, int bus_type)
boardp = ASC_BOARDP(shost); boardp = ASC_BOARDP(shost);
memset(boardp, 0, sizeof(asc_board_t)); memset(boardp, 0, sizeof(asc_board_t));
boardp->id = asc_board_count++; boardp->id = asc_board_count++;
/* Initialize spinlock. */
spin_lock_init(&boardp->lock); spin_lock_init(&boardp->lock);
/* /*
...@@ -17590,11 +17555,6 @@ advansys_board_found(int iop, struct device *dev, int bus_type) ...@@ -17590,11 +17555,6 @@ advansys_board_found(int iop, struct device *dev, int bus_type)
*/ */
boardp->init_tidmask |= boardp->init_tidmask |=
ADV_TID_TO_TIDMASK(adv_dvc_varp->chip_scsi_id); ADV_TID_TO_TIDMASK(adv_dvc_varp->chip_scsi_id);
/*
* Finish initializing the 'Scsi_Host' structure.
*/
shost->irq = adv_dvc_varp->irq_no;
} }
/* /*
......
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