diff options
author | Matthew Wilcox <matthew@wil.cx> | 2005-11-29 23:08:46 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-12-13 20:11:47 -0500 |
commit | 66e8d1cc64e95be78e6138cc88635f7e3108ef58 (patch) | |
tree | a95be81fadaa90f90a7425f3f83ca7588598290a /drivers/scsi/sym53c8xx_2 | |
parent | b37df48923b76155de2a728e1155ed263dba5f53 (diff) |
[SCSI] sym2: Report disabled devices and LUNs more attractively
Rather than print a list of targets at driver init time, print each
disabled target as we attempt to scan it.
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/sym53c8xx_2')
-rw-r--r-- | drivers/scsi/sym53c8xx_2/sym_glue.c | 14 | ||||
-rw-r--r-- | drivers/scsi/sym53c8xx_2/sym_hipd.c | 30 |
2 files changed, 11 insertions, 33 deletions
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c index cb3d195bdb94..1fffd2b3c654 100644 --- a/drivers/scsi/sym53c8xx_2/sym_glue.c +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c | |||
@@ -1018,6 +1018,7 @@ static int sym53c8xx_slave_alloc(struct scsi_device *sdev) | |||
1018 | if (sdev->id >= SYM_CONF_MAX_TARGET || sdev->lun >= SYM_CONF_MAX_LUN) | 1018 | if (sdev->id >= SYM_CONF_MAX_TARGET || sdev->lun >= SYM_CONF_MAX_LUN) |
1019 | return -ENXIO; | 1019 | return -ENXIO; |
1020 | 1020 | ||
1021 | tp->starget = sdev->sdev_target; | ||
1021 | /* | 1022 | /* |
1022 | * Fail the device init if the device is flagged NOSCAN at BOOT in | 1023 | * Fail the device init if the device is flagged NOSCAN at BOOT in |
1023 | * the NVRAM. This may speed up boot and maintain coherency with | 1024 | * the NVRAM. This may speed up boot and maintain coherency with |
@@ -1027,17 +1028,24 @@ static int sym53c8xx_slave_alloc(struct scsi_device *sdev) | |||
1027 | * lun devices behave badly when asked for a non zero LUN. | 1028 | * lun devices behave badly when asked for a non zero LUN. |
1028 | */ | 1029 | */ |
1029 | 1030 | ||
1030 | if ((tp->usrflags & SYM_SCAN_BOOT_DISABLED) || | 1031 | if (tp->usrflags & SYM_SCAN_BOOT_DISABLED) { |
1031 | ((tp->usrflags & SYM_SCAN_LUNS_DISABLED) && sdev->lun != 0)) { | ||
1032 | tp->usrflags &= ~SYM_SCAN_BOOT_DISABLED; | 1032 | tp->usrflags &= ~SYM_SCAN_BOOT_DISABLED; |
1033 | starget_printk(KERN_INFO, tp->starget, | ||
1034 | "Scan at boot disabled in NVRAM\n"); | ||
1033 | return -ENXIO; | 1035 | return -ENXIO; |
1034 | } | 1036 | } |
1035 | 1037 | ||
1038 | if (tp->usrflags & SYM_SCAN_LUNS_DISABLED) { | ||
1039 | if (sdev->lun != 0) | ||
1040 | return -ENXIO; | ||
1041 | starget_printk(KERN_INFO, tp->starget, | ||
1042 | "Multiple LUNs disabled in NVRAM\n"); | ||
1043 | } | ||
1044 | |||
1036 | lp = sym_alloc_lcb(np, sdev->id, sdev->lun); | 1045 | lp = sym_alloc_lcb(np, sdev->id, sdev->lun); |
1037 | if (!lp) | 1046 | if (!lp) |
1038 | return -ENOMEM; | 1047 | return -ENOMEM; |
1039 | 1048 | ||
1040 | tp->starget = sdev->sdev_target; | ||
1041 | spi_min_period(tp->starget) = tp->usr_period; | 1049 | spi_min_period(tp->starget) = tp->usr_period; |
1042 | spi_max_width(tp->starget) = tp->usr_width; | 1050 | spi_max_width(tp->starget) = tp->usr_width; |
1043 | 1051 | ||
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c index 0b0cba0d0bbe..7a3c807dcfca 100644 --- a/drivers/scsi/sym53c8xx_2/sym_hipd.c +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c | |||
@@ -616,29 +616,6 @@ static __inline void sym_init_burst(struct sym_hcb *np, u_char bc) | |||
616 | } | 616 | } |
617 | } | 617 | } |
618 | 618 | ||
619 | |||
620 | /* | ||
621 | * Print out the list of targets that have some flag disabled by user. | ||
622 | */ | ||
623 | static void sym_print_targets_flag(struct sym_hcb *np, int mask, char *msg) | ||
624 | { | ||
625 | int cnt; | ||
626 | int i; | ||
627 | |||
628 | for (cnt = 0, i = 0 ; i < SYM_CONF_MAX_TARGET ; i++) { | ||
629 | if (i == np->myaddr) | ||
630 | continue; | ||
631 | if (np->target[i].usrflags & mask) { | ||
632 | if (!cnt++) | ||
633 | printf("%s: %s disabled for targets", | ||
634 | sym_name(np), msg); | ||
635 | printf(" %d", i); | ||
636 | } | ||
637 | } | ||
638 | if (cnt) | ||
639 | printf(".\n"); | ||
640 | } | ||
641 | |||
642 | /* | 619 | /* |
643 | * Save initial settings of some IO registers. | 620 | * Save initial settings of some IO registers. |
644 | * Assumed to have been set by BIOS. | 621 | * Assumed to have been set by BIOS. |
@@ -986,13 +963,6 @@ static int sym_prepare_setting(struct Scsi_Host *shost, struct sym_hcb *np, stru | |||
986 | sym_name(np), np->rv_scntl3, np->rv_dmode, np->rv_dcntl, | 963 | sym_name(np), np->rv_scntl3, np->rv_dmode, np->rv_dcntl, |
987 | np->rv_ctest3, np->rv_ctest4, np->rv_ctest5); | 964 | np->rv_ctest3, np->rv_ctest4, np->rv_ctest5); |
988 | } | 965 | } |
989 | /* | ||
990 | * Let user be aware of targets that have some disable flags set. | ||
991 | */ | ||
992 | sym_print_targets_flag(np, SYM_SCAN_BOOT_DISABLED, "SCAN AT BOOT"); | ||
993 | if (sym_verbose) | ||
994 | sym_print_targets_flag(np, SYM_SCAN_LUNS_DISABLED, | ||
995 | "SCAN FOR LUNS"); | ||
996 | 966 | ||
997 | return 0; | 967 | return 0; |
998 | } | 968 | } |