From b0f62f0c1c710273bf89d984f7277fd280be8a6d Mon Sep 17 00:00:00 2001 From: "Kenneth D. Merry" Date: Tue, 29 Aug 2000 22:09:23 +0000 Subject: [PATCH] Add quirk entries from Andre Albsmeier to disable the sync cache command for the Quantum "MAVERICK 540S" and "LPS525S". Also, add common string variables, since we seem to have a few Quantum and Micropolis drives in here. Fix the 'quantum' variable usage in scsi_all.c that likely got broken when someone staticized things in cam_xpt.c. (That particular problem would cause Quantum Fireball ST drives to not get spun up if they were not already spinning.) Submitted by: Andre Albsmeier --- sys/cam/scsi/scsi_all.c | 8 -------- sys/cam/scsi/scsi_da.c | 25 +++++++++++++++++++++---- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index d964fca4764f..abe14d2063a7 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -711,15 +711,7 @@ scsi_op_desc(u_int16_t opcode, struct scsi_inquiry_data *inq_data) asc, asc, action #endif -/* - * If we're in the kernel, 'quantum' is already defined in cam_xpt.c. - * Otherwise, we need to define it. - */ -#ifdef _KERNEL -extern const char quantum[]; -#else static const char quantum[] = "QUANTUM"; -#endif /* * WARNING: You must update the num_ascs field below for this quirk table diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 760b275ea779..b1da80bcf5c0 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -134,6 +134,9 @@ struct da_quirk_entry { da_quirks quirks; }; +static const char quantum[] = "QUANTUM"; +static const char microp[] = "MICROP"; + static struct da_quirk_entry da_quirk_table[] = { { @@ -152,7 +155,7 @@ static struct da_quirk_entry da_quirk_table[] = * either. Reported by: Matthew Jacob * in NetBSD PR kern/6027, August 24, 1998. */ - {T_DIRECT, SIP_MEDIA_FIXED, "MICROP", "2217*", "*"}, + {T_DIRECT, SIP_MEDIA_FIXED, microp, "2217*", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, { @@ -161,7 +164,7 @@ static struct da_quirk_entry da_quirk_table[] = * either. Reported by: Hellmuth Michaelis (hm@kts.org) * (PR 8882). */ - {T_DIRECT, SIP_MEDIA_FIXED, "MICROP", "2112*", "*"}, + {T_DIRECT, SIP_MEDIA_FIXED, microp, "2112*", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, { @@ -172,6 +175,20 @@ static struct da_quirk_entry da_quirk_table[] = {T_DIRECT, SIP_MEDIA_FIXED, "NEC", "D3847*", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, + { + /* + * Doesn't like the synchronize cache command. + */ + {T_DIRECT, SIP_MEDIA_FIXED, quantum, "MAVERICK 540S", "*"}, + /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * Doesn't like the synchronize cache command. + */ + {T_DIRECT, SIP_MEDIA_FIXED, quantum, "LPS525S", "*"}, + /*quirks*/ DA_Q_NO_SYNC_CACHE + }, { /* * Doesn't work correctly with 6 byte reads/writes. @@ -179,14 +196,14 @@ static struct da_quirk_entry da_quirk_table[] = * 6-byte CDB. * Reported by: Adam McDougall */ - {T_DIRECT, SIP_MEDIA_FIXED, "QUANTUM", "VIKING 4*", "*"}, + {T_DIRECT, SIP_MEDIA_FIXED, quantum, "VIKING 4*", "*"}, /*quirks*/ DA_Q_NO_6_BYTE }, { /* * See above. */ - {T_DIRECT, SIP_MEDIA_FIXED, "QUANTUM", "VIKING 2*", "*"}, + {T_DIRECT, SIP_MEDIA_FIXED, quantum, "VIKING 2*", "*"}, /*quirks*/ DA_Q_NO_6_BYTE }, {