diff options
author | Matthew Wilcox <matthew@wil.cx> | 2007-07-30 10:08:22 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-10-12 14:39:26 -0400 |
commit | ecec1947479e52eeb4378cc5706d6d46b0cf5172 (patch) | |
tree | fd7de03d71eb944175ed31d8df7472431b21f934 /drivers/scsi | |
parent | 47d853ccbe7fc6b79aeddd97cf6f5b08bf81d58b (diff) |
[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: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/advansys.c | 260 |
1 files changed, 110 insertions, 150 deletions
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 5885ce4aad9a..dc9dca37c258 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c | |||
@@ -1815,9 +1815,6 @@ static void AscEnableInterrupt(PortAddr); | |||
1815 | static void AscSetBank(PortAddr, uchar); | 1815 | static void AscSetBank(PortAddr, uchar); |
1816 | static int AscResetChipAndScsiBus(ASC_DVC_VAR *); | 1816 | static int AscResetChipAndScsiBus(ASC_DVC_VAR *); |
1817 | #ifdef CONFIG_ISA | 1817 | #ifdef CONFIG_ISA |
1818 | static ushort AscGetIsaDmaChannel(PortAddr); | ||
1819 | static ushort AscSetIsaDmaChannel(PortAddr, ushort); | ||
1820 | static uchar AscSetIsaDmaSpeed(PortAddr, uchar); | ||
1821 | static uchar AscGetIsaDmaSpeed(PortAddr); | 1818 | static uchar AscGetIsaDmaSpeed(PortAddr); |
1822 | #endif /* CONFIG_ISA */ | 1819 | #endif /* CONFIG_ISA */ |
1823 | static uchar AscReadLramByte(PortAddr, ushort); | 1820 | static uchar AscReadLramByte(PortAddr, ushort); |
@@ -1862,18 +1859,11 @@ static int AscIsrQDone(ASC_DVC_VAR *); | |||
1862 | static ushort AscGetEisaChipCfg(PortAddr); | 1859 | static ushort AscGetEisaChipCfg(PortAddr); |
1863 | #endif /* CONFIG_ISA */ | 1860 | #endif /* CONFIG_ISA */ |
1864 | static uchar AscGetChipScsiCtrl(PortAddr); | 1861 | static uchar AscGetChipScsiCtrl(PortAddr); |
1865 | static uchar AscSetChipScsiID(PortAddr, uchar); | ||
1866 | static uchar AscGetChipVersion(PortAddr, ushort); | 1862 | static uchar AscGetChipVersion(PortAddr, ushort); |
1867 | static ushort AscGetChipBusType(PortAddr); | ||
1868 | static ASC_DCNT AscLoadMicroCode(PortAddr, ushort, uchar *, ushort); | 1863 | static ASC_DCNT AscLoadMicroCode(PortAddr, ushort, uchar *, ushort); |
1869 | static int AscFindSignature(PortAddr); | ||
1870 | static void AscToggleIRQAct(PortAddr); | 1864 | static void AscToggleIRQAct(PortAddr); |
1871 | static uchar AscGetChipIRQ(PortAddr, ushort); | ||
1872 | static uchar AscSetChipIRQ(PortAddr, uchar, ushort); | ||
1873 | static ushort AscGetChipBiosAddress(PortAddr, ushort); | ||
1874 | static inline ulong DvcEnterCritical(void); | 1865 | static inline ulong DvcEnterCritical(void); |
1875 | static inline void DvcLeaveCritical(ulong); | 1866 | static inline void DvcLeaveCritical(ulong); |
1876 | static ushort AscGetChipBiosAddress(PortAddr, ushort); | ||
1877 | static void DvcSleepMilliSecond(ASC_DCNT); | 1867 | static void DvcSleepMilliSecond(ASC_DCNT); |
1878 | static void DvcDelayNanoSecond(ASC_DVC_VAR *, ASC_DCNT); | 1868 | static void DvcDelayNanoSecond(ASC_DVC_VAR *, ASC_DCNT); |
1879 | static void DvcPutScsiQ(PortAddr, ushort, uchar *, int); | 1869 | static void DvcPutScsiQ(PortAddr, ushort, uchar *, int); |
@@ -1887,7 +1877,6 @@ static int AscSgListToQueue(int); | |||
1887 | #ifdef CONFIG_ISA | 1877 | #ifdef CONFIG_ISA |
1888 | static void AscEnableIsaDma(uchar); | 1878 | static void AscEnableIsaDma(uchar); |
1889 | #endif /* CONFIG_ISA */ | 1879 | #endif /* CONFIG_ISA */ |
1890 | static ASC_DCNT AscGetMaxDmaCount(ushort); | ||
1891 | static const char *advansys_info(struct Scsi_Host *shost); | 1880 | static const char *advansys_info(struct Scsi_Host *shost); |
1892 | 1881 | ||
1893 | /* | 1882 | /* |
@@ -3710,10 +3699,6 @@ static int asc_prt_adv_board_info(struct Scsi_Host *, char *, int); | |||
3710 | static int asc_prt_line(char *, int, char *fmt, ...); | 3699 | static int asc_prt_line(char *, int, char *fmt, ...); |
3711 | #endif /* CONFIG_PROC_FS */ | 3700 | #endif /* CONFIG_PROC_FS */ |
3712 | 3701 | ||
3713 | /* Declaration for Asc Library internal functions referenced by driver. */ | ||
3714 | static int AscFindSignature(PortAddr); | ||
3715 | static ushort AscGetEEPConfig(PortAddr, ASCEEP_CONFIG *, ushort); | ||
3716 | |||
3717 | /* Statistics function prototypes. */ | 3702 | /* Statistics function prototypes. */ |
3718 | #ifdef ADVANSYS_STATS | 3703 | #ifdef ADVANSYS_STATS |
3719 | #ifdef CONFIG_PROC_FS | 3704 | #ifdef CONFIG_PROC_FS |
@@ -3822,8 +3807,7 @@ advansys_proc_info(struct Scsi_Host *shost, char *buffer, char **start, | |||
3822 | cp = boardp->prtbuf; | 3807 | cp = boardp->prtbuf; |
3823 | cplen = asc_prt_adv_bios(shost, cp, ASC_PRTBUF_SIZE); | 3808 | cplen = asc_prt_adv_bios(shost, cp, ASC_PRTBUF_SIZE); |
3824 | ASC_ASSERT(cplen < ASC_PRTBUF_SIZE); | 3809 | ASC_ASSERT(cplen < ASC_PRTBUF_SIZE); |
3825 | cnt = | 3810 | cnt = asc_proc_copy(advoffset, offset, curbuf, leftlen, cp, |
3826 | asc_proc_copy(advoffset, offset, curbuf, leftlen, cp, | ||
3827 | cplen); | 3811 | cplen); |
3828 | totcnt += cnt; | 3812 | totcnt += cnt; |
3829 | leftlen -= cnt; | 3813 | leftlen -= cnt; |
@@ -3910,11 +3894,10 @@ advansys_proc_info(struct Scsi_Host *shost, char *buffer, char **start, | |||
3910 | for (tgt_id = 0; tgt_id <= ADV_MAX_TID; tgt_id++) { | 3894 | for (tgt_id = 0; tgt_id <= ADV_MAX_TID; tgt_id++) { |
3911 | cp = boardp->prtbuf; | 3895 | cp = boardp->prtbuf; |
3912 | cplen = asc_prt_target_stats(shost, tgt_id, cp, | 3896 | cplen = asc_prt_target_stats(shost, tgt_id, cp, |
3913 | ASC_PRTBUF_SIZE); | 3897 | ASC_PRTBUF_SIZE); |
3914 | ASC_ASSERT(cplen <= ASC_PRTBUF_SIZE); | 3898 | ASC_ASSERT(cplen <= ASC_PRTBUF_SIZE); |
3915 | cnt = | 3899 | cnt = asc_proc_copy(advoffset, offset, curbuf, leftlen, cp, |
3916 | asc_proc_copy(advoffset, offset, curbuf, leftlen, cp, | 3900 | cplen); |
3917 | cplen); | ||
3918 | totcnt += cnt; | 3901 | totcnt += cnt; |
3919 | leftlen -= cnt; | 3902 | leftlen -= cnt; |
3920 | if (leftlen == 0) { | 3903 | if (leftlen == 0) { |
@@ -4004,15 +3987,14 @@ static const char *advansys_info(struct Scsi_Host *shost) | |||
4004 | } | 3987 | } |
4005 | } else { | 3988 | } else { |
4006 | busname = "?"; | 3989 | busname = "?"; |
4007 | ASC_PRINT2 | 3990 | ASC_PRINT2("advansys_info: board %d: unknown " |
4008 | ("advansys_info: board %d: unknown bus type %d\n", | 3991 | "bus type %d\n", boardp->id, |
4009 | boardp->id, asc_dvc_varp->bus_type); | 3992 | asc_dvc_varp->bus_type); |
4010 | } | 3993 | } |
4011 | /* Don't reference 'shost->n_io_port'; It may be truncated. */ | 3994 | /* Don't reference 'shost->n_io_port'; It may be truncated. */ |
4012 | sprintf(info, | 3995 | sprintf(info, |
4013 | "AdvanSys SCSI %s: %s: IO 0x%lX-0x%lX, IRQ 0x%X", | 3996 | "AdvanSys SCSI %s: %s: IO 0x%lX-0x%lX, IRQ 0x%X", |
4014 | ASC_VERSION, busname, | 3997 | ASC_VERSION, busname, (ulong)shost->io_port, |
4015 | (ulong)shost->io_port, | ||
4016 | (ulong)shost->io_port + boardp->asc_n_io_port - | 3998 | (ulong)shost->io_port + boardp->asc_n_io_port - |
4017 | 1, shost->irq); | 3999 | 1, shost->irq); |
4018 | } | 4000 | } |
@@ -4193,18 +4175,16 @@ static int advansys_reset(struct scsi_cmnd *scp) | |||
4193 | 4175 | ||
4194 | /* Refer to ASC_IERR_* defintions for meaning of 'err_code'. */ | 4176 | /* Refer to ASC_IERR_* defintions for meaning of 'err_code'. */ |
4195 | if (asc_dvc_varp->err_code) { | 4177 | if (asc_dvc_varp->err_code) { |
4196 | ASC_PRINT2 | 4178 | ASC_PRINT2("advansys_reset: board %d: SCSI bus reset " |
4197 | ("advansys_reset: board %d: SCSI bus reset error: 0x%x\n", | 4179 | "error: 0x%x\n", boardp->id, |
4198 | boardp->id, asc_dvc_varp->err_code); | 4180 | asc_dvc_varp->err_code); |
4199 | ret = FAILED; | 4181 | ret = FAILED; |
4200 | } else if (status) { | 4182 | } else if (status) { |
4201 | ASC_PRINT2 | 4183 | ASC_PRINT2("advansys_reset: board %d: SCSI bus reset " |
4202 | ("advansys_reset: board %d: SCSI bus reset warning: 0x%x\n", | 4184 | "warning: 0x%x\n", boardp->id, status); |
4203 | boardp->id, status); | ||
4204 | } else { | 4185 | } else { |
4205 | ASC_PRINT1 | 4186 | ASC_PRINT1("advansys_reset: board %d: SCSI bus reset " |
4206 | ("advansys_reset: board %d: SCSI bus reset successful.\n", | 4187 | "successful.\n", boardp->id); |
4207 | boardp->id); | ||
4208 | } | 4188 | } |
4209 | 4189 | ||
4210 | ASC_DBG(1, "advansys_reset: after AscInitAsc1000Driver()\n"); | 4190 | ASC_DBG(1, "advansys_reset: after AscInitAsc1000Driver()\n"); |
@@ -4225,15 +4205,13 @@ static int advansys_reset(struct scsi_cmnd *scp) | |||
4225 | ASC_DBG(1, "advansys_reset: before AdvResetChipAndSB()\n"); | 4205 | ASC_DBG(1, "advansys_reset: before AdvResetChipAndSB()\n"); |
4226 | switch (AdvResetChipAndSB(adv_dvc_varp)) { | 4206 | switch (AdvResetChipAndSB(adv_dvc_varp)) { |
4227 | case ASC_TRUE: | 4207 | case ASC_TRUE: |
4228 | ASC_PRINT1 | 4208 | ASC_PRINT1("advansys_reset: board %d: SCSI bus reset " |
4229 | ("advansys_reset: board %d: SCSI bus reset successful.\n", | 4209 | "successful.\n", boardp->id); |
4230 | boardp->id); | ||
4231 | break; | 4210 | break; |
4232 | case ASC_FALSE: | 4211 | case ASC_FALSE: |
4233 | default: | 4212 | default: |
4234 | ASC_PRINT1 | 4213 | ASC_PRINT1("advansys_reset: board %d: SCSI bus reset " |
4235 | ("advansys_reset: board %d: SCSI bus reset error.\n", | 4214 | "error.\n", boardp->id); |
4236 | boardp->id); | ||
4237 | ret = FAILED; | 4215 | ret = FAILED; |
4238 | break; | 4216 | break; |
4239 | } | 4217 | } |
@@ -4254,8 +4232,8 @@ static int advansys_reset(struct scsi_cmnd *scp) | |||
4254 | * is returned in 'last_scp'. | 4232 | * is returned in 'last_scp'. |
4255 | */ | 4233 | */ |
4256 | if (done_scp == NULL) { | 4234 | if (done_scp == NULL) { |
4257 | done_scp = | 4235 | done_scp = asc_dequeue_list(&boardp->active, &last_scp, |
4258 | asc_dequeue_list(&boardp->active, &last_scp, ASC_TID_ALL); | 4236 | ASC_TID_ALL); |
4259 | for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) { | 4237 | for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) { |
4260 | tscp->result = HOST_BYTE(DID_RESET); | 4238 | tscp->result = HOST_BYTE(DID_RESET); |
4261 | } | 4239 | } |
@@ -4281,8 +4259,8 @@ static int advansys_reset(struct scsi_cmnd *scp) | |||
4281 | * to DID_RESET. | 4259 | * to DID_RESET. |
4282 | */ | 4260 | */ |
4283 | if (done_scp == NULL) { | 4261 | if (done_scp == NULL) { |
4284 | done_scp = | 4262 | done_scp = asc_dequeue_list(&boardp->waiting, &last_scp, |
4285 | asc_dequeue_list(&boardp->waiting, &last_scp, ASC_TID_ALL); | 4263 | ASC_TID_ALL); |
4286 | for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) { | 4264 | for (tscp = done_scp; tscp; tscp = REQPNEXT(tscp)) { |
4287 | tscp->result = HOST_BYTE(DID_RESET); | 4265 | tscp->result = HOST_BYTE(DID_RESET); |
4288 | } | 4266 | } |
@@ -4313,9 +4291,8 @@ static int advansys_reset(struct scsi_cmnd *scp) | |||
4313 | /* | 4291 | /* |
4314 | * Complete all the 'done_scp' requests. | 4292 | * Complete all the 'done_scp' requests. |
4315 | */ | 4293 | */ |
4316 | if (done_scp != NULL) { | 4294 | if (done_scp) |
4317 | asc_scsi_done_list(done_scp); | 4295 | asc_scsi_done_list(done_scp); |
4318 | } | ||
4319 | 4296 | ||
4320 | ASC_DBG1(1, "advansys_reset: ret %d\n", ret); | 4297 | ASC_DBG1(1, "advansys_reset: ret %d\n", ret); |
4321 | 4298 | ||
@@ -4829,33 +4806,33 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp) | |||
4829 | case ASC_NOERROR: | 4806 | case ASC_NOERROR: |
4830 | ASC_STATS(scp->device->host, exe_noerror); | 4807 | ASC_STATS(scp->device->host, exe_noerror); |
4831 | /* | 4808 | /* |
4832 | * Increment monotonically increasing per device successful | 4809 | * Increment monotonically increasing per device |
4833 | * request counter. Wrapping doesn't matter. | 4810 | * successful request counter. Wrapping doesn't matter. |
4834 | */ | 4811 | */ |
4835 | boardp->reqcnt[scp->device->id]++; | 4812 | boardp->reqcnt[scp->device->id]++; |
4836 | asc_enqueue(&boardp->active, scp, ASC_BACK); | 4813 | asc_enqueue(&boardp->active, scp, ASC_BACK); |
4837 | ASC_DBG(1, | 4814 | ASC_DBG(1, "asc_execute_scsi_cmnd: AscExeScsiQueue(), " |
4838 | "asc_execute_scsi_cmnd: AscExeScsiQueue(), ASC_NOERROR\n"); | 4815 | "ASC_NOERROR\n"); |
4839 | break; | 4816 | break; |
4840 | case ASC_BUSY: | 4817 | case ASC_BUSY: |
4841 | /* | 4818 | /* |
4842 | * Caller will enqueue request on the target's waiting queue | 4819 | * Caller will enqueue request on the target's waiting |
4843 | * and retry later. | 4820 | * queue and retry later. |
4844 | */ | 4821 | */ |
4845 | ASC_STATS(scp->device->host, exe_busy); | 4822 | ASC_STATS(scp->device->host, exe_busy); |
4846 | break; | 4823 | break; |
4847 | case ASC_ERROR: | 4824 | case ASC_ERROR: |
4848 | ASC_PRINT2 | 4825 | ASC_PRINT2("asc_execute_scsi_cmnd: board %d: " |
4849 | ("asc_execute_scsi_cmnd: board %d: AscExeScsiQueue() ASC_ERROR, err_code 0x%x\n", | 4826 | "AscExeScsiQueue() ASC_ERROR, err_code 0x%x\n", |
4850 | boardp->id, asc_dvc_varp->err_code); | 4827 | boardp->id, asc_dvc_varp->err_code); |
4851 | ASC_STATS(scp->device->host, exe_error); | 4828 | ASC_STATS(scp->device->host, exe_error); |
4852 | scp->result = HOST_BYTE(DID_ERROR); | 4829 | scp->result = HOST_BYTE(DID_ERROR); |
4853 | asc_enqueue(&boardp->done, scp, ASC_BACK); | 4830 | asc_enqueue(&boardp->done, scp, ASC_BACK); |
4854 | break; | 4831 | break; |
4855 | default: | 4832 | default: |
4856 | ASC_PRINT2 | 4833 | ASC_PRINT2("asc_execute_scsi_cmnd: board %d: " |
4857 | ("asc_execute_scsi_cmnd: board %d: AscExeScsiQueue() unknown, err_code 0x%x\n", | 4834 | "AscExeScsiQueue() unknown, err_code 0x%x\n", |
4858 | boardp->id, asc_dvc_varp->err_code); | 4835 | boardp->id, asc_dvc_varp->err_code); |
4859 | ASC_STATS(scp->device->host, exe_unknown); | 4836 | ASC_STATS(scp->device->host, exe_unknown); |
4860 | scp->result = HOST_BYTE(DID_ERROR); | 4837 | scp->result = HOST_BYTE(DID_ERROR); |
4861 | asc_enqueue(&boardp->done, scp, ASC_BACK); | 4838 | asc_enqueue(&boardp->done, scp, ASC_BACK); |
@@ -4875,20 +4852,21 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp) | |||
4875 | */ | 4852 | */ |
4876 | switch (adv_build_req(boardp, scp, &adv_scsiqp)) { | 4853 | switch (adv_build_req(boardp, scp, &adv_scsiqp)) { |
4877 | case ASC_NOERROR: | 4854 | case ASC_NOERROR: |
4878 | ASC_DBG(3, | 4855 | ASC_DBG(3, "asc_execute_scsi_cmnd: adv_build_req " |
4879 | "asc_execute_scsi_cmnd: adv_build_req ASC_NOERROR\n"); | 4856 | "ASC_NOERROR\n"); |
4880 | break; | 4857 | break; |
4881 | case ASC_BUSY: | 4858 | case ASC_BUSY: |
4882 | ASC_DBG(1, | 4859 | ASC_DBG(1, "asc_execute_scsi_cmnd: adv_build_req " |
4883 | "asc_execute_scsi_cmnd: adv_build_req ASC_BUSY\n"); | 4860 | "ASC_BUSY\n"); |
4884 | /* | 4861 | /* |
4885 | * If busy is returned the request has not been enqueued. | 4862 | * If busy is returned the request has not been |
4886 | * It will be enqueued by the caller on the target's waiting | 4863 | * enqueued. It will be enqueued by the caller on the |
4887 | * queue and retried later. | 4864 | * target's waiting queue and retried later. |
4888 | * | 4865 | * |
4889 | * The asc_stats fields 'adv_build_noreq' and 'adv_build_nosg' | 4866 | * The asc_stats fields 'adv_build_noreq' and |
4890 | * count wide board busy conditions. They are updated in | 4867 | * 'adv_build_nosg' count wide board busy conditions. |
4891 | * adv_build_req and adv_get_sglist, respectively. | 4868 | * They are updated in adv_build_req and |
4869 | * adv_get_sglist, respectively. | ||
4892 | */ | 4870 | */ |
4893 | return ASC_BUSY; | 4871 | return ASC_BUSY; |
4894 | case ASC_ERROR: | 4872 | case ASC_ERROR: |
@@ -4898,8 +4876,8 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp) | |||
4898 | * by the caller. | 4876 | * by the caller. |
4899 | */ | 4877 | */ |
4900 | default: | 4878 | default: |
4901 | ASC_DBG(1, | 4879 | ASC_DBG(1, "asc_execute_scsi_cmnd: adv_build_req " |
4902 | "asc_execute_scsi_cmnd: adv_build_req ASC_ERROR\n"); | 4880 | "ASC_ERROR\n"); |
4903 | ASC_STATS(scp->device->host, build_error); | 4881 | ASC_STATS(scp->device->host, build_error); |
4904 | return ASC_ERROR; | 4882 | return ASC_ERROR; |
4905 | } | 4883 | } |
@@ -4912,33 +4890,33 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp) | |||
4912 | case ASC_NOERROR: | 4890 | case ASC_NOERROR: |
4913 | ASC_STATS(scp->device->host, exe_noerror); | 4891 | ASC_STATS(scp->device->host, exe_noerror); |
4914 | /* | 4892 | /* |
4915 | * Increment monotonically increasing per device successful | 4893 | * Increment monotonically increasing per device |
4916 | * request counter. Wrapping doesn't matter. | 4894 | * successful request counter. Wrapping doesn't matter. |
4917 | */ | 4895 | */ |
4918 | boardp->reqcnt[scp->device->id]++; | 4896 | boardp->reqcnt[scp->device->id]++; |
4919 | asc_enqueue(&boardp->active, scp, ASC_BACK); | 4897 | asc_enqueue(&boardp->active, scp, ASC_BACK); |
4920 | ASC_DBG(1, | 4898 | ASC_DBG(1, "asc_execute_scsi_cmnd: AdvExeScsiQueue(), " |
4921 | "asc_execute_scsi_cmnd: AdvExeScsiQueue(), ASC_NOERROR\n"); | 4899 | "ASC_NOERROR\n"); |
4922 | break; | 4900 | break; |
4923 | case ASC_BUSY: | 4901 | case ASC_BUSY: |
4924 | /* | 4902 | /* |
4925 | * Caller will enqueue request on the target's waiting queue | 4903 | * Caller will enqueue request on the target's waiting |
4926 | * and retry later. | 4904 | * queue and retry later. |
4927 | */ | 4905 | */ |
4928 | ASC_STATS(scp->device->host, exe_busy); | 4906 | ASC_STATS(scp->device->host, exe_busy); |
4929 | break; | 4907 | break; |
4930 | case ASC_ERROR: | 4908 | case ASC_ERROR: |
4931 | ASC_PRINT2 | 4909 | ASC_PRINT2("asc_execute_scsi_cmnd: board %d: " |
4932 | ("asc_execute_scsi_cmnd: board %d: AdvExeScsiQueue() ASC_ERROR, err_code 0x%x\n", | 4910 | "AdvExeScsiQueue() ASC_ERROR, err_code 0x%x\n", |
4933 | boardp->id, adv_dvc_varp->err_code); | 4911 | boardp->id, adv_dvc_varp->err_code); |
4934 | ASC_STATS(scp->device->host, exe_error); | 4912 | ASC_STATS(scp->device->host, exe_error); |
4935 | scp->result = HOST_BYTE(DID_ERROR); | 4913 | scp->result = HOST_BYTE(DID_ERROR); |
4936 | asc_enqueue(&boardp->done, scp, ASC_BACK); | 4914 | asc_enqueue(&boardp->done, scp, ASC_BACK); |
4937 | break; | 4915 | break; |
4938 | default: | 4916 | default: |
4939 | ASC_PRINT2 | 4917 | ASC_PRINT2("asc_execute_scsi_cmnd: board %d: " |
4940 | ("asc_execute_scsi_cmnd: board %d: AdvExeScsiQueue() unknown, err_code 0x%x\n", | 4918 | "AdvExeScsiQueue() unknown, err_code 0x%x\n", |
4941 | boardp->id, adv_dvc_varp->err_code); | 4919 | boardp->id, adv_dvc_varp->err_code); |
4942 | ASC_STATS(scp->device->host, exe_unknown); | 4920 | ASC_STATS(scp->device->host, exe_unknown); |
4943 | scp->result = HOST_BYTE(DID_ERROR); | 4921 | scp->result = HOST_BYTE(DID_ERROR); |
4944 | asc_enqueue(&boardp->done, scp, ASC_BACK); | 4922 | asc_enqueue(&boardp->done, scp, ASC_BACK); |
@@ -4981,9 +4959,9 @@ static int asc_build_req(asc_board_t *boardp, struct scsi_cmnd *scp) | |||
4981 | * is supported. | 4959 | * is supported. |
4982 | */ | 4960 | */ |
4983 | if (scp->cmd_len > ASC_MAX_CDB_LEN) { | 4961 | if (scp->cmd_len > ASC_MAX_CDB_LEN) { |
4984 | ASC_PRINT3 | 4962 | ASC_PRINT3("asc_build_req: board %d: cmd_len %d > " |
4985 | ("asc_build_req: board %d: cmd_len %d > ASC_MAX_CDB_LEN %d\n", | 4963 | "ASC_MAX_CDB_LEN %d\n", boardp->id, scp->cmd_len, |
4986 | boardp->id, scp->cmd_len, ASC_MAX_CDB_LEN); | 4964 | ASC_MAX_CDB_LEN); |
4987 | scp->result = HOST_BYTE(DID_ERROR); | 4965 | scp->result = HOST_BYTE(DID_ERROR); |
4988 | asc_enqueue(&boardp->done, scp, ASC_BACK); | 4966 | asc_enqueue(&boardp->done, scp, ASC_BACK); |
4989 | return ASC_ERROR; | 4967 | return ASC_ERROR; |
@@ -7330,27 +7308,27 @@ DvcGetQinfo(PortAddr iop_base, ushort s_addr, uchar *inbuf, int words) | |||
7330 | * Return the BIOS address of the adapter at the specified | 7308 | * Return the BIOS address of the adapter at the specified |
7331 | * I/O port and with the specified bus type. | 7309 | * I/O port and with the specified bus type. |
7332 | */ | 7310 | */ |
7333 | static ushort __devinit AscGetChipBiosAddress(PortAddr iop_base, ushort bus_type) | 7311 | static unsigned short __devinit |
7312 | AscGetChipBiosAddress(PortAddr iop_base, unsigned short bus_type) | ||
7334 | { | 7313 | { |
7335 | ushort cfg_lsw; | 7314 | unsigned short cfg_lsw; |
7336 | ushort bios_addr; | 7315 | unsigned short bios_addr; |
7337 | 7316 | ||
7338 | /* | 7317 | /* |
7339 | * The PCI BIOS is re-located by the motherboard BIOS. Because | 7318 | * The PCI BIOS is re-located by the motherboard BIOS. Because |
7340 | * of this the driver can not determine where a PCI BIOS is | 7319 | * of this the driver can not determine where a PCI BIOS is |
7341 | * loaded and executes. | 7320 | * loaded and executes. |
7342 | */ | 7321 | */ |
7343 | if (bus_type & ASC_IS_PCI) { | 7322 | if (bus_type & ASC_IS_PCI) |
7344 | return (0); | 7323 | return 0; |
7345 | } | 7324 | |
7346 | #ifdef CONFIG_ISA | 7325 | #ifdef CONFIG_ISA |
7347 | if ((bus_type & ASC_IS_EISA) != 0) { | 7326 | if ((bus_type & ASC_IS_EISA) != 0) { |
7348 | cfg_lsw = AscGetEisaChipCfg(iop_base); | 7327 | cfg_lsw = AscGetEisaChipCfg(iop_base); |
7349 | cfg_lsw &= 0x000F; | 7328 | cfg_lsw &= 0x000F; |
7350 | bios_addr = (ushort)(ASC_BIOS_MIN_ADDR + | 7329 | bios_addr = ASC_BIOS_MIN_ADDR + cfg_lsw * ASC_BIOS_BANK_SIZE; |
7351 | (cfg_lsw * ASC_BIOS_BANK_SIZE)); | 7330 | return bios_addr; |
7352 | return (bios_addr); | 7331 | } |
7353 | } /* if */ | ||
7354 | #endif /* CONFIG_ISA */ | 7332 | #endif /* CONFIG_ISA */ |
7355 | 7333 | ||
7356 | cfg_lsw = AscGetChipCfgLsw(iop_base); | 7334 | cfg_lsw = AscGetChipCfgLsw(iop_base); |
@@ -7358,13 +7336,10 @@ static ushort __devinit AscGetChipBiosAddress(PortAddr iop_base, ushort bus_type | |||
7358 | /* | 7336 | /* |
7359 | * ISA PnP uses the top bit as the 32K BIOS flag | 7337 | * ISA PnP uses the top bit as the 32K BIOS flag |
7360 | */ | 7338 | */ |
7361 | if (bus_type == ASC_IS_ISAPNP) { | 7339 | if (bus_type == ASC_IS_ISAPNP) |
7362 | cfg_lsw &= 0x7FFF; | 7340 | cfg_lsw &= 0x7FFF; |
7363 | } | 7341 | bios_addr = ASC_BIOS_MIN_ADDR + (cfg_lsw >> 12) * ASC_BIOS_BANK_SIZE; |
7364 | /* if */ | 7342 | return bios_addr; |
7365 | bios_addr = (ushort)(((cfg_lsw >> 12) * ASC_BIOS_BANK_SIZE) + | ||
7366 | ASC_BIOS_MIN_ADDR); | ||
7367 | return (bios_addr); | ||
7368 | } | 7343 | } |
7369 | 7344 | ||
7370 | /* | 7345 | /* |
@@ -7661,10 +7636,8 @@ static void asc_prt_scsi_cmnd(struct scsi_cmnd *s) | |||
7661 | 7636 | ||
7662 | printk(" timeout_per_command %d\n", s->timeout_per_command); | 7637 | printk(" timeout_per_command %d\n", s->timeout_per_command); |
7663 | 7638 | ||
7664 | printk | 7639 | printk(" scsi_done 0x%p, done 0x%p, host_scribble 0x%p, result 0x%x\n", |
7665 | (" scsi_done 0x%lx, done 0x%lx, host_scribble 0x%lx, result 0x%x\n", | 7640 | s->scsi_done, s->done, s->host_scribble, s->result); |
7666 | (ulong)s->scsi_done, (ulong)s->done, (ulong)s->host_scribble, | ||
7667 | s->result); | ||
7668 | 7641 | ||
7669 | printk(" tag %u, pid %u\n", (unsigned)s->tag, (unsigned)s->pid); | 7642 | printk(" tag %u, pid %u\n", (unsigned)s->tag, (unsigned)s->pid); |
7670 | } | 7643 | } |
@@ -7676,34 +7649,31 @@ static void asc_prt_asc_dvc_var(ASC_DVC_VAR *h) | |||
7676 | { | 7649 | { |
7677 | printk("ASC_DVC_VAR at addr 0x%lx\n", (ulong)h); | 7650 | printk("ASC_DVC_VAR at addr 0x%lx\n", (ulong)h); |
7678 | 7651 | ||
7679 | printk | 7652 | printk(" iop_base 0x%x, err_code 0x%x, dvc_cntl 0x%x, bug_fix_cntl " |
7680 | (" iop_base 0x%x, err_code 0x%x, dvc_cntl 0x%x, bug_fix_cntl %d,\n", | 7653 | "%d,\n", h->iop_base, h->err_code, h->dvc_cntl, h->bug_fix_cntl); |
7681 | h->iop_base, h->err_code, h->dvc_cntl, h->bug_fix_cntl); | ||
7682 | 7654 | ||
7683 | printk | 7655 | printk(" bus_type %d, isr_callback 0x%p, exe_callback 0x%p, " |
7684 | (" bus_type %d, isr_callback 0x%lx, exe_callback 0x%lx, init_sdtr 0x%x,\n", | 7656 | "init_sdtr 0x%x,\n", h->bus_type, h->isr_callback, |
7685 | h->bus_type, (ulong)h->isr_callback, (ulong)h->exe_callback, | 7657 | h->exe_callback, (unsigned)h->init_sdtr); |
7686 | (unsigned)h->init_sdtr); | ||
7687 | 7658 | ||
7688 | printk | 7659 | printk(" sdtr_done 0x%x, use_tagged_qng 0x%x, unit_not_ready 0x%x, " |
7689 | (" sdtr_done 0x%x, use_tagged_qng 0x%x, unit_not_ready 0x%x, chip_no 0x%x,\n", | 7660 | "chip_no 0x%x,\n", (unsigned)h->sdtr_done, |
7690 | (unsigned)h->sdtr_done, (unsigned)h->use_tagged_qng, | 7661 | (unsigned)h->use_tagged_qng, (unsigned)h->unit_not_ready, |
7691 | (unsigned)h->unit_not_ready, (unsigned)h->chip_no); | 7662 | (unsigned)h->chip_no); |
7692 | 7663 | ||
7693 | printk | 7664 | printk(" queue_full_or_busy 0x%x, start_motor 0x%x, scsi_reset_wait " |
7694 | (" queue_full_or_busy 0x%x, start_motor 0x%x, scsi_reset_wait %u,\n", | 7665 | "%u,\n", (unsigned)h->queue_full_or_busy, |
7695 | (unsigned)h->queue_full_or_busy, (unsigned)h->start_motor, | 7666 | (unsigned)h->start_motor, (unsigned)h->scsi_reset_wait); |
7696 | (unsigned)h->scsi_reset_wait); | ||
7697 | 7667 | ||
7698 | printk | 7668 | printk(" is_in_int %u, max_total_qng %u, cur_total_qng %u, " |
7699 | (" is_in_int %u, max_total_qng %u, cur_total_qng %u, in_critical_cnt %u,\n", | 7669 | "in_critical_cnt %u,\n", (unsigned)h->is_in_int, |
7700 | (unsigned)h->is_in_int, (unsigned)h->max_total_qng, | 7670 | (unsigned)h->max_total_qng, (unsigned)h->cur_total_qng, |
7701 | (unsigned)h->cur_total_qng, (unsigned)h->in_critical_cnt); | 7671 | (unsigned)h->in_critical_cnt); |
7702 | 7672 | ||
7703 | printk | 7673 | printk(" last_q_shortage %u, init_state 0x%x, no_scam 0x%x, " |
7704 | (" last_q_shortage %u, init_state 0x%x, no_scam 0x%x, pci_fix_asyn_xfer 0x%x,\n", | 7674 | "pci_fix_asyn_xfer 0x%x,\n", (unsigned)h->last_q_shortage, |
7705 | (unsigned)h->last_q_shortage, (unsigned)h->init_state, | 7675 | (unsigned)h->init_state, (unsigned)h->no_scam, |
7706 | (unsigned)h->no_scam, (unsigned)h->pci_fix_asyn_xfer); | 7676 | (unsigned)h->pci_fix_asyn_xfer); |
7707 | 7677 | ||
7708 | printk(" cfg 0x%lx, irq_no 0x%x\n", (ulong)h->cfg, (unsigned)h->irq_no); | 7678 | printk(" cfg 0x%lx, irq_no 0x%x\n", (ulong)h->cfg, (unsigned)h->irq_no); |
7709 | } | 7679 | } |
@@ -8007,27 +7977,28 @@ static uchar __devinit AscSetChipScsiID(PortAddr iop_base, uchar new_host_id) | |||
8007 | return (AscGetChipScsiID(iop_base)); | 7977 | return (AscGetChipScsiID(iop_base)); |
8008 | } | 7978 | } |
8009 | 7979 | ||
8010 | static uchar __devinit AscGetChipScsiCtrl(PortAddr iop_base) | 7980 | static unsigned char __devinit AscGetChipScsiCtrl(PortAddr iop_base) |
8011 | { | 7981 | { |
8012 | uchar sc; | 7982 | unsigned char sc; |
8013 | 7983 | ||
8014 | AscSetBank(iop_base, 1); | 7984 | AscSetBank(iop_base, 1); |
8015 | sc = inp(iop_base + IOP_REG_SC); | 7985 | sc = inp(iop_base + IOP_REG_SC); |
8016 | AscSetBank(iop_base, 0); | 7986 | AscSetBank(iop_base, 0); |
8017 | return (sc); | 7987 | return sc; |
8018 | } | 7988 | } |
8019 | 7989 | ||
8020 | static uchar __devinit AscGetChipVersion(PortAddr iop_base, ushort bus_type) | 7990 | static unsigned char __devinit |
7991 | AscGetChipVersion(PortAddr iop_base, unsigned short bus_type) | ||
8021 | { | 7992 | { |
8022 | if ((bus_type & ASC_IS_EISA) != 0) { | 7993 | if (bus_type & ASC_IS_EISA) { |
8023 | PortAddr eisa_iop; | 7994 | PortAddr eisa_iop; |
8024 | uchar revision; | 7995 | unsigned char revision; |
8025 | eisa_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | | 7996 | eisa_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | |
8026 | (PortAddr) ASC_EISA_REV_IOP_MASK; | 7997 | (PortAddr) ASC_EISA_REV_IOP_MASK; |
8027 | revision = inp(eisa_iop); | 7998 | revision = inp(eisa_iop); |
8028 | return ((uchar)((ASC_CHIP_MIN_VER_EISA - 1) + revision)); | 7999 | return ASC_CHIP_MIN_VER_EISA - 1 + revision; |
8029 | } | 8000 | } |
8030 | return (AscGetChipVerNo(iop_base)); | 8001 | return AscGetChipVerNo(iop_base); |
8031 | } | 8002 | } |
8032 | 8003 | ||
8033 | static ushort __devinit AscGetChipBusType(PortAddr iop_base) | 8004 | static ushort __devinit AscGetChipBusType(PortAddr iop_base) |
@@ -10281,13 +10252,12 @@ static ushort __devinit AscInitGetConfig(ASC_DVC_VAR *asc_dvc) | |||
10281 | warn_code |= AscInitAscDvcVar(asc_dvc); | 10252 | warn_code |= AscInitAscDvcVar(asc_dvc); |
10282 | warn_code |= AscInitFromEEP(asc_dvc); | 10253 | warn_code |= AscInitFromEEP(asc_dvc); |
10283 | asc_dvc->init_state |= ASC_INIT_STATE_END_GET_CFG; | 10254 | asc_dvc->init_state |= ASC_INIT_STATE_END_GET_CFG; |
10284 | if (asc_dvc->scsi_reset_wait > ASC_MAX_SCSI_RESET_WAIT) { | 10255 | if (asc_dvc->scsi_reset_wait > ASC_MAX_SCSI_RESET_WAIT) |
10285 | asc_dvc->scsi_reset_wait = ASC_MAX_SCSI_RESET_WAIT; | 10256 | asc_dvc->scsi_reset_wait = ASC_MAX_SCSI_RESET_WAIT; |
10286 | } | ||
10287 | } else { | 10257 | } else { |
10288 | asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE; | 10258 | asc_dvc->err_code = ASC_IERR_BAD_SIGNATURE; |
10289 | } | 10259 | } |
10290 | return (warn_code); | 10260 | return warn_code; |
10291 | } | 10261 | } |
10292 | 10262 | ||
10293 | static ushort __devinit AscInitSetConfig(ASC_DVC_VAR *asc_dvc) | 10263 | 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 | int ret; | 17124 | int ret; |
17155 | 17125 | ||
17156 | /* | 17126 | /* |
17157 | * Adapter found. | ||
17158 | * | ||
17159 | * Register the adapter, get its configuration, and | 17127 | * Register the adapter, get its configuration, and |
17160 | * initialize it. | 17128 | * initialize it. |
17161 | */ | 17129 | */ |
17162 | ASC_DBG(2, "advansys_board_found: scsi_host_alloc()\n"); | 17130 | ASC_DBG(2, "advansys_board_found: scsi_host_alloc()\n"); |
17163 | shost = scsi_host_alloc(&advansys_template, sizeof(asc_board_t)); | 17131 | shost = scsi_host_alloc(&advansys_template, sizeof(asc_board_t)); |
17164 | |||
17165 | if (!shost) | 17132 | if (!shost) |
17166 | return NULL; | 17133 | return NULL; |
17167 | 17134 | ||
@@ -17169,8 +17136,6 @@ advansys_board_found(int iop, struct device *dev, int bus_type) | |||
17169 | boardp = ASC_BOARDP(shost); | 17136 | boardp = ASC_BOARDP(shost); |
17170 | memset(boardp, 0, sizeof(asc_board_t)); | 17137 | memset(boardp, 0, sizeof(asc_board_t)); |
17171 | boardp->id = asc_board_count++; | 17138 | boardp->id = asc_board_count++; |
17172 | |||
17173 | /* Initialize spinlock. */ | ||
17174 | spin_lock_init(&boardp->lock); | 17139 | spin_lock_init(&boardp->lock); |
17175 | 17140 | ||
17176 | /* | 17141 | /* |
@@ -17590,11 +17555,6 @@ advansys_board_found(int iop, struct device *dev, int bus_type) | |||
17590 | */ | 17555 | */ |
17591 | boardp->init_tidmask |= | 17556 | boardp->init_tidmask |= |
17592 | ADV_TID_TO_TIDMASK(adv_dvc_varp->chip_scsi_id); | 17557 | ADV_TID_TO_TIDMASK(adv_dvc_varp->chip_scsi_id); |
17593 | |||
17594 | /* | ||
17595 | * Finish initializing the 'Scsi_Host' structure. | ||
17596 | */ | ||
17597 | shost->irq = adv_dvc_varp->irq_no; | ||
17598 | } | 17558 | } |
17599 | 17559 | ||
17600 | /* | 17560 | /* |