Perform the exorcism on scsipi_mode_select() too.

This commit is contained in:
mycroft 2003-09-08 03:33:31 +00:00
parent 4588667f28
commit 637a6554cf
2 changed files with 10 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: scsipi_all.h,v 1.23 2003/09/08 03:24:12 mycroft Exp $ */ /* $NetBSD: scsipi_all.h,v 1.24 2003/09/08 03:33:31 mycroft Exp $ */
/* /*
* SCSI and SCSI-like general interface description * SCSI and SCSI-like general interface description
@ -104,16 +104,8 @@ struct scsipi_mode_select {
u_int8_t byte2; u_int8_t byte2;
#define SMS_SP 0x01 /* save page */ #define SMS_SP 0x01 /* save page */
#define SMS_PF 0x10 /* page format (0 = SCSI-1, 1 = SCSI-2) */ #define SMS_PF 0x10 /* page format (0 = SCSI-1, 1 = SCSI-2) */
u_int8_t unused; u_int8_t unused[2];
union { u_int8_t length;
struct {
u_int8_t unused;
u_int8_t length;
} scsi __attribute__((packed));
struct {
u_int8_t length[2];
} atapi __attribute__((packed));
} u_len;
u_int8_t control; u_int8_t control;
} __attribute__((packed)); } __attribute__((packed));

View File

@ -1,4 +1,4 @@
/* $NetBSD: scsipi_base.c,v 1.89 2003/09/08 03:24:12 mycroft Exp $ */ /* $NetBSD: scsipi_base.c,v 1.90 2003/09/08 03:33:32 mycroft Exp $ */
/*- /*-
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc. * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.89 2003/09/08 03:24:12 mycroft Exp $"); __KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.90 2003/09/08 03:33:32 mycroft Exp $");
#include "opt_scsi.h" #include "opt_scsi.h"
@ -1248,13 +1248,14 @@ scsipi_mode_select(periph, byte2, data, len, flags, retries, timeout)
struct scsipi_mode_select scsipi_cmd; struct scsipi_mode_select scsipi_cmd;
int error; int error;
#if 1
if (scsipi_periph_bustype(periph) == SCSIPI_BUSTYPE_ATAPI)
panic("scsipi_mode_select: what the Hell am I doing here?");
#endif
memset(&scsipi_cmd, 0, sizeof(scsipi_cmd)); memset(&scsipi_cmd, 0, sizeof(scsipi_cmd));
scsipi_cmd.opcode = MODE_SELECT; scsipi_cmd.opcode = MODE_SELECT;
scsipi_cmd.byte2 = byte2; scsipi_cmd.byte2 = byte2;
if (scsipi_periph_bustype(periph) == SCSIPI_BUSTYPE_ATAPI) scsipi_cmd.length = len & 0xff;
_lto2b(len, scsipi_cmd.u_len.atapi.length);
else
scsipi_cmd.u_len.scsi.length = len & 0xff;
error = scsipi_command(periph, (struct scsipi_generic *)&scsipi_cmd, error = scsipi_command(periph, (struct scsipi_generic *)&scsipi_cmd,
sizeof(scsipi_cmd), (void *)data, len, retries, timeout, NULL, sizeof(scsipi_cmd), (void *)data, len, retries, timeout, NULL,
flags | XS_CTL_DATA_OUT); flags | XS_CTL_DATA_OUT);