summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-14 05:51:39 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-14 05:51:39 +0000
commit0a7903fd60da65431b55ca7a8ea85701797e3730 (patch)
tree77c8abea34c0b4617a525c22ad2021962cf4946a
parentf75a9bdc0e593d179a97f67eae64405c698156f7 (diff)
from netbsd:
add a bunch of rogues Trim NULs, in addition to spaces, in scsi_strvis().
-rw-r--r--sys/scsi/scsiconf.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index 39e5fc060a0..81f4623694c 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: scsiconf.c,v 1.43 1995/10/13 20:01:03 gwr Exp $ */
+/* $NetBSD: scsiconf.c,v 1.45 1995/12/11 04:43:01 mycroft Exp $ */
/*
* Copyright (c) 1994 Charles Hannum. All rights reserved.
@@ -224,10 +224,10 @@ scsi_strvis(dst, src, len)
int len;
{
- /* Trim leading and trailing blanks. */
- while (len > 0 && src[0] == ' ')
+ /* Trim leading and trailing blanks and NULs. */
+ while (len > 0 && (src[0] == ' ' || src[0] == '\0'))
++src, --len;
- while (len > 0 && src[len-1] == ' ')
+ while (len > 0 && (src[len-1] == ' ' || src[len-1] == '\0'))
--len;
while (len > 0) {
@@ -315,6 +315,8 @@ struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = {
{T_DIRECT, T_FIXED,
"QUANTUM ", "PD1225S ", "", SDEV_NOLUNS},
{T_DIRECT, T_FIXED,
+ "QUANTUM ", "PD210S SUN0207", "", SDEV_NOLUNS},
+ {T_DIRECT, T_FIXED,
"RODIME ", "RO3000S ", "", SDEV_NOLUNS},
{T_DIRECT, T_FIXED,
"SEAGATE ", "ST157N ", "", SDEV_NOLUNS},
@@ -329,11 +331,15 @@ struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = {
{T_SEQUENTIAL, T_REMOV,
" ", " ", " ", SDEV_NOLUNS},
{T_SEQUENTIAL, T_REMOV,
+ "CALIPER ", "CP150 ", "", SDEV_NOLUNS},
+ {T_SEQUENTIAL, T_REMOV,
"EXABYTE ", "EXB-8200 ", "", SDEV_NOLUNS},
{T_SEQUENTIAL, T_REMOV,
"SONY ", "SDT-2000 ", "2.09", SDEV_NOLUNS},
{T_SEQUENTIAL, T_REMOV,
- "SONY ", "SDT-5000 ", "3.17", SDEV_NOSYNCWIDE},
+ "SONY ", "SDT-5000 ", "3.", SDEV_NOSYNCWIDE},
+ {T_SEQUENTIAL, T_REMOV,
+ "SONY ", "SDT-5200 ", "3.", SDEV_NOLUNS},
{T_SEQUENTIAL, T_REMOV,
"TANDBERG", " TDC 3600 ", "", SDEV_NOLUNS},
{T_SEQUENTIAL, T_REMOV,
@@ -561,7 +567,7 @@ scsi_inqmatch(inqbuf, base, nmatches, matchsize, bestpriority)
continue;
priority += len;
-#if 0
+#if SCSIDEBUG
printf("scsi_inqmatch: %d/%d/%d <%s, %s, %s>\n",
priority, match->type, match->removable,
match->vendor, match->product, match->revision);