diff options
-rw-r--r-- | drivers/scsi/advansys.c | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 2f3707613285..e79f7955f6ea 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c | |||
@@ -2289,10 +2289,8 @@ typedef struct adveep_38C1600_config { | |||
2289 | #define BIOS_CTRL_AIPP_DIS 0x2000 | 2289 | #define BIOS_CTRL_AIPP_DIS 0x2000 |
2290 | 2290 | ||
2291 | #define ADV_3550_MEMSIZE 0x2000 /* 8 KB Internal Memory */ | 2291 | #define ADV_3550_MEMSIZE 0x2000 /* 8 KB Internal Memory */ |
2292 | #define ADV_3550_IOLEN 0x40 /* I/O Port Range in bytes */ | ||
2293 | 2292 | ||
2294 | #define ADV_38C0800_MEMSIZE 0x4000 /* 16 KB Internal Memory */ | 2293 | #define ADV_38C0800_MEMSIZE 0x4000 /* 16 KB Internal Memory */ |
2295 | #define ADV_38C0800_IOLEN 0x100 /* I/O Port Range in bytes */ | ||
2296 | 2294 | ||
2297 | /* | 2295 | /* |
2298 | * XXX - Since ASC38C1600 Rev.3 has a local RAM failure issue, there is | 2296 | * XXX - Since ASC38C1600 Rev.3 has a local RAM failure issue, there is |
@@ -2302,8 +2300,6 @@ typedef struct adveep_38C1600_config { | |||
2302 | * #define ADV_38C1600_MEMSIZE 0x8000L * 32 KB Internal Memory * | 2300 | * #define ADV_38C1600_MEMSIZE 0x8000L * 32 KB Internal Memory * |
2303 | */ | 2301 | */ |
2304 | #define ADV_38C1600_MEMSIZE 0x4000 /* 16 KB Internal Memory */ | 2302 | #define ADV_38C1600_MEMSIZE 0x4000 /* 16 KB Internal Memory */ |
2305 | #define ADV_38C1600_IOLEN 0x100 /* I/O Port Range 256 bytes */ | ||
2306 | #define ADV_38C1600_MEMLEN 0x1000 /* Memory Range 4KB bytes */ | ||
2307 | 2303 | ||
2308 | /* | 2304 | /* |
2309 | * Byte I/O register address from base of 'iop_base'. | 2305 | * Byte I/O register address from base of 'iop_base'. |
@@ -3952,7 +3948,6 @@ static const char *advansys_info(struct Scsi_Host *shost) | |||
3952 | ASC_DVC_VAR *asc_dvc_varp; | 3948 | ASC_DVC_VAR *asc_dvc_varp; |
3953 | ADV_DVC_VAR *adv_dvc_varp; | 3949 | ADV_DVC_VAR *adv_dvc_varp; |
3954 | char *busname; | 3950 | char *busname; |
3955 | int iolen; | ||
3956 | char *widename = NULL; | 3951 | char *widename = NULL; |
3957 | 3952 | ||
3958 | boardp = ASC_BOARDP(shost); | 3953 | boardp = ASC_BOARDP(shost); |
@@ -3966,13 +3961,12 @@ static const char *advansys_info(struct Scsi_Host *shost) | |||
3966 | } else { | 3961 | } else { |
3967 | busname = "ISA"; | 3962 | busname = "ISA"; |
3968 | } | 3963 | } |
3969 | /* Don't reference 'shost->n_io_port'; It may be truncated. */ | ||
3970 | sprintf(info, | 3964 | sprintf(info, |
3971 | "AdvanSys SCSI %s: %s: IO 0x%lX-0x%lX, IRQ 0x%X, DMA 0x%X", | 3965 | "AdvanSys SCSI %s: %s: IO 0x%lX-0x%lX, IRQ 0x%X, DMA 0x%X", |
3972 | ASC_VERSION, busname, | 3966 | ASC_VERSION, busname, |
3973 | (ulong)shost->io_port, | 3967 | (ulong)shost->io_port, |
3974 | (ulong)shost->io_port + boardp->asc_n_io_port - | 3968 | (ulong)shost->io_port + ASC_IOADR_GAP - 1, |
3975 | 1, shost->irq, shost->dma_channel); | 3969 | shost->irq, shost->dma_channel); |
3976 | } else { | 3970 | } else { |
3977 | if (asc_dvc_varp->bus_type & ASC_IS_VL) { | 3971 | if (asc_dvc_varp->bus_type & ASC_IS_VL) { |
3978 | busname = "VL"; | 3972 | busname = "VL"; |
@@ -3991,12 +3985,11 @@ static const char *advansys_info(struct Scsi_Host *shost) | |||
3991 | "bus type %d\n", boardp->id, | 3985 | "bus type %d\n", boardp->id, |
3992 | asc_dvc_varp->bus_type); | 3986 | asc_dvc_varp->bus_type); |
3993 | } | 3987 | } |
3994 | /* Don't reference 'shost->n_io_port'; It may be truncated. */ | ||
3995 | sprintf(info, | 3988 | sprintf(info, |
3996 | "AdvanSys SCSI %s: %s: IO 0x%lX-0x%lX, IRQ 0x%X", | 3989 | "AdvanSys SCSI %s: %s: IO 0x%lX-0x%lX, IRQ 0x%X", |
3997 | ASC_VERSION, busname, (ulong)shost->io_port, | 3990 | ASC_VERSION, busname, (ulong)shost->io_port, |
3998 | (ulong)shost->io_port + boardp->asc_n_io_port - | 3991 | (ulong)shost->io_port + ASC_IOADR_GAP - 1, |
3999 | 1, shost->irq); | 3992 | shost->irq); |
4000 | } | 3993 | } |
4001 | } else { | 3994 | } else { |
4002 | /* | 3995 | /* |
@@ -4008,19 +4001,16 @@ static const char *advansys_info(struct Scsi_Host *shost) | |||
4008 | */ | 4001 | */ |
4009 | adv_dvc_varp = &boardp->dvc_var.adv_dvc_var; | 4002 | adv_dvc_varp = &boardp->dvc_var.adv_dvc_var; |
4010 | if (adv_dvc_varp->chip_type == ADV_CHIP_ASC3550) { | 4003 | if (adv_dvc_varp->chip_type == ADV_CHIP_ASC3550) { |
4011 | iolen = ADV_3550_IOLEN; | ||
4012 | widename = "Ultra-Wide"; | 4004 | widename = "Ultra-Wide"; |
4013 | } else if (adv_dvc_varp->chip_type == ADV_CHIP_ASC38C0800) { | 4005 | } else if (adv_dvc_varp->chip_type == ADV_CHIP_ASC38C0800) { |
4014 | iolen = ADV_38C0800_IOLEN; | ||
4015 | widename = "Ultra2-Wide"; | 4006 | widename = "Ultra2-Wide"; |
4016 | } else { | 4007 | } else { |
4017 | iolen = ADV_38C1600_IOLEN; | ||
4018 | widename = "Ultra3-Wide"; | 4008 | widename = "Ultra3-Wide"; |
4019 | } | 4009 | } |
4020 | sprintf(info, | 4010 | sprintf(info, |
4021 | "AdvanSys SCSI %s: PCI %s: PCIMEM 0x%lX-0x%lX, IRQ 0x%X", | 4011 | "AdvanSys SCSI %s: PCI %s: PCIMEM 0x%lX-0x%lX, IRQ 0x%X", |
4022 | ASC_VERSION, widename, (ulong)adv_dvc_varp->iop_base, | 4012 | ASC_VERSION, widename, (ulong)adv_dvc_varp->iop_base, |
4023 | (ulong)adv_dvc_varp->iop_base + iolen - 1, shost->irq); | 4013 | (ulong)adv_dvc_varp->iop_base + boardp->asc_n_io_port - 1, shost->irq); |
4024 | } | 4014 | } |
4025 | ASC_ASSERT(strlen(info) < ASC_INFO_SIZE); | 4015 | ASC_ASSERT(strlen(info) < ASC_INFO_SIZE); |
4026 | ASC_DBG(1, "advansys_info: end\n"); | 4016 | ASC_DBG(1, "advansys_info: end\n"); |
@@ -6700,10 +6690,7 @@ static int asc_prt_driver_conf(struct Scsi_Host *shost, char *cp, int cplen) | |||
6700 | boardp->asc_n_io_port); | 6690 | boardp->asc_n_io_port); |
6701 | ASC_PRT_NEXT(); | 6691 | ASC_PRT_NEXT(); |
6702 | 6692 | ||
6703 | /* 'shost->n_io_port' may be truncated because it is only one byte. */ | 6693 | len = asc_prt_line(cp, leftlen, " io_port 0x%x\n", shost->io_port); |
6704 | len = asc_prt_line(cp, leftlen, | ||
6705 | " io_port 0x%x, n_io_port 0x%x\n", | ||
6706 | shost->io_port, shost->n_io_port); | ||
6707 | ASC_PRT_NEXT(); | 6694 | ASC_PRT_NEXT(); |
6708 | 6695 | ||
6709 | if (ASC_NARROW_BOARD(boardp)) { | 6696 | if (ASC_NARROW_BOARD(boardp)) { |
@@ -7595,8 +7582,8 @@ static void asc_prt_scsi_host(struct Scsi_Host *s) | |||
7595 | printk(" host_busy %u, host_no %d, last_reset %d,\n", | 7582 | printk(" host_busy %u, host_no %d, last_reset %d,\n", |
7596 | s->host_busy, s->host_no, (unsigned)s->last_reset); | 7583 | s->host_busy, s->host_no, (unsigned)s->last_reset); |
7597 | 7584 | ||
7598 | printk(" base 0x%lx, io_port 0x%lx, n_io_port %u, irq 0x%x,\n", | 7585 | printk(" base 0x%lx, io_port 0x%lx, irq 0x%x,\n", |
7599 | (ulong)s->base, (ulong)s->io_port, s->n_io_port, s->irq); | 7586 | (ulong)s->base, (ulong)s->io_port, s->irq); |
7600 | 7587 | ||
7601 | printk(" dma_channel %d, this_id %d, can_queue %d,\n", | 7588 | printk(" dma_channel %d, this_id %d, can_queue %d,\n", |
7602 | s->dma_channel, s->this_id, s->can_queue); | 7589 | s->dma_channel, s->this_id, s->can_queue); |
@@ -17537,15 +17524,6 @@ advansys_board_found(int iop, struct device *dev, int bus_type) | |||
17537 | } | 17524 | } |
17538 | 17525 | ||
17539 | /* | 17526 | /* |
17540 | * 'n_io_port' currently is one byte. | ||
17541 | * | ||
17542 | * Set a value to 'n_io_port', but never referenced it because | ||
17543 | * it may be truncated. | ||
17544 | */ | ||
17545 | shost->n_io_port = boardp->asc_n_io_port <= 255 ? | ||
17546 | boardp->asc_n_io_port : 255; | ||
17547 | |||
17548 | /* | ||
17549 | * Following v1.3.89, 'cmd_per_lun' is no longer needed | 17527 | * Following v1.3.89, 'cmd_per_lun' is no longer needed |
17550 | * and should be set to zero. | 17528 | * and should be set to zero. |
17551 | * | 17529 | * |