Implement ST_Q_UNIMODAL quirk, which indicates that a drive will reject

all attempts to mode select, even if the attempted mode is supported.
Add the ST_Q_UNIMODAL quirk for the HP Colorado T4000s which exhibits
this behavior.  (Someone please lob a tactical nuke in that direction.)

From David Rosenthal <dshr@vitria.com> on netbsd-bugs.
This commit is contained in:
thorpej 1996-05-24 02:04:29 +00:00
parent 4e8477f520
commit a0be48ca23
4 changed files with 58 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: scsi_tape.h,v 1.8 1996/03/19 03:05:15 mycroft Exp $ */
/* $NetBSD: scsi_tape.h,v 1.9 1996/05/24 02:04:47 thorpej Exp $ */
/*
* Copyright (c) 1994 Charles Hannum. All rights reserved.
@ -209,6 +209,7 @@ struct block_desc_cipher {
0x15 1 45434 RLL CS ECMA TC17 4
0x16 48 10000 MFM C X3.193-1990 1
0x17 48 42500 MFM C X3B5/91-174 1
0x45 73 67733 RLL C QIC3095
where Code means:
NRZI Non Return to Zero, change on ones
@ -244,5 +245,6 @@ struct block_desc_cipher {
#define QIC_1320 0x12
#define DDS 0x13
#define DAT_1 0x13
#define QIC_3095 0x45
#endif /* _SCSI_TAPE_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: st.c,v 1.66 1996/05/05 19:53:01 christos Exp $ */
/* $NetBSD: st.c,v 1.67 1996/05/24 02:04:29 thorpej Exp $ */
/*
* Copyright (c) 1994 Charles Hannum. All rights reserved.
@ -80,8 +80,11 @@
#define STUNIT(z) ((minor(z) >> 4) )
#define CTLMODE 3
#define SCSI_2_MAX_DENSITY_CODE 0x17 /* maximum density code specified
* in SCSI II spec. */
/*
* Maximum density code known.
*/
#define SCSI_2_MAX_DENSITY_CODE 0x45
/*
* Define various devices that we know mis-behave in some way,
* and note how they are bad, so we can correct for them
@ -98,6 +101,7 @@ struct quirkdata {
#define ST_Q_SENSE_HELP 0x0002 /* must do READ for good MODE SENSE */
#define ST_Q_IGNORE_LOADS 0x0004
#define ST_Q_BLKSIZE 0x0008 /* variable-block media_blksize > 0 */
#define ST_Q_UNIMODAL 0x0010 /* unimode drive rejects mode select */
u_int page_0_size;
#define MAX_PAGE_0_SIZE 64
struct modes modes[4];
@ -201,6 +205,13 @@ struct st_quirk_inquiry_pattern st_quirk_patterns[] = {
{0, 0, 0}, /* minor 8-11 */
{0, 0, 0} /* minor 12-15 */
}}},
{{T_SEQUENTIAL, T_REMOV,
"HP ", "T4000s ", ""}, {ST_Q_UNIMODAL, 0, {
{0, 0, QIC_3095}, /* minor 0-3 */
{0, 0, QIC_3095}, /* minor 4-7 */
{0, 0, QIC_3095}, /* minor 8-11 */
{0, 0, QIC_3095}, /* minor 12-15 */
}}},
#if 0
{{T_SEQUENTIAL, T_REMOV,
"EXABYTE ", "EXB-8200 ", ""}, {0, 12, {
@ -1391,6 +1402,18 @@ st_mode_select(st, flags)
scsi_select_len = 12 + st->page_0_size;
/*
* This quirk deals with drives that have only one valid mode
* and think this gives them license to reject all mode selects,
* even if the selected mode is the one that is supported.
*/
if (st->quirks & ST_Q_UNIMODAL) {
SC_DEBUG(sc_link, SDEV_DB3,
("not setting density 0x%x blksize 0x%x\n",
st->density, st->blksize));
return 0;
}
/*
* Set up for a mode select
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: scsi_tape.h,v 1.8 1996/03/19 03:05:15 mycroft Exp $ */
/* $NetBSD: scsi_tape.h,v 1.9 1996/05/24 02:04:47 thorpej Exp $ */
/*
* Copyright (c) 1994 Charles Hannum. All rights reserved.
@ -209,6 +209,7 @@ struct block_desc_cipher {
0x15 1 45434 RLL CS ECMA TC17 4
0x16 48 10000 MFM C X3.193-1990 1
0x17 48 42500 MFM C X3B5/91-174 1
0x45 73 67733 RLL C QIC3095
where Code means:
NRZI Non Return to Zero, change on ones
@ -244,5 +245,6 @@ struct block_desc_cipher {
#define QIC_1320 0x12
#define DDS 0x13
#define DAT_1 0x13
#define QIC_3095 0x45
#endif /* _SCSI_TAPE_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: st.c,v 1.66 1996/05/05 19:53:01 christos Exp $ */
/* $NetBSD: st.c,v 1.67 1996/05/24 02:04:29 thorpej Exp $ */
/*
* Copyright (c) 1994 Charles Hannum. All rights reserved.
@ -80,8 +80,11 @@
#define STUNIT(z) ((minor(z) >> 4) )
#define CTLMODE 3
#define SCSI_2_MAX_DENSITY_CODE 0x17 /* maximum density code specified
* in SCSI II spec. */
/*
* Maximum density code known.
*/
#define SCSI_2_MAX_DENSITY_CODE 0x45
/*
* Define various devices that we know mis-behave in some way,
* and note how they are bad, so we can correct for them
@ -98,6 +101,7 @@ struct quirkdata {
#define ST_Q_SENSE_HELP 0x0002 /* must do READ for good MODE SENSE */
#define ST_Q_IGNORE_LOADS 0x0004
#define ST_Q_BLKSIZE 0x0008 /* variable-block media_blksize > 0 */
#define ST_Q_UNIMODAL 0x0010 /* unimode drive rejects mode select */
u_int page_0_size;
#define MAX_PAGE_0_SIZE 64
struct modes modes[4];
@ -201,6 +205,13 @@ struct st_quirk_inquiry_pattern st_quirk_patterns[] = {
{0, 0, 0}, /* minor 8-11 */
{0, 0, 0} /* minor 12-15 */
}}},
{{T_SEQUENTIAL, T_REMOV,
"HP ", "T4000s ", ""}, {ST_Q_UNIMODAL, 0, {
{0, 0, QIC_3095}, /* minor 0-3 */
{0, 0, QIC_3095}, /* minor 4-7 */
{0, 0, QIC_3095}, /* minor 8-11 */
{0, 0, QIC_3095}, /* minor 12-15 */
}}},
#if 0
{{T_SEQUENTIAL, T_REMOV,
"EXABYTE ", "EXB-8200 ", ""}, {0, 12, {
@ -1391,6 +1402,18 @@ st_mode_select(st, flags)
scsi_select_len = 12 + st->page_0_size;
/*
* This quirk deals with drives that have only one valid mode
* and think this gives them license to reject all mode selects,
* even if the selected mode is the one that is supported.
*/
if (st->quirks & ST_Q_UNIMODAL) {
SC_DEBUG(sc_link, SDEV_DB3,
("not setting density 0x%x blksize 0x%x\n",
st->density, st->blksize));
return 0;
}
/*
* Set up for a mode select
*/