From 637a6554cf91fa4db0e4a00cf190c860e567ceb5 Mon Sep 17 00:00:00 2001 From: mycroft Date: Mon, 8 Sep 2003 03:33:31 +0000 Subject: [PATCH] Perform the exorcism on scsipi_mode_select() too. --- sys/dev/scsipi/scsipi_all.h | 14 +++----------- sys/dev/scsipi/scsipi_base.c | 13 +++++++------ 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/sys/dev/scsipi/scsipi_all.h b/sys/dev/scsipi/scsipi_all.h index 2f79f9484cac..7e9a7016696e 100644 --- a/sys/dev/scsipi/scsipi_all.h +++ b/sys/dev/scsipi/scsipi_all.h @@ -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 @@ -104,16 +104,8 @@ struct scsipi_mode_select { u_int8_t byte2; #define SMS_SP 0x01 /* save page */ #define SMS_PF 0x10 /* page format (0 = SCSI-1, 1 = SCSI-2) */ - u_int8_t unused; - union { - 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 unused[2]; + u_int8_t length; u_int8_t control; } __attribute__((packed)); diff --git a/sys/dev/scsipi/scsipi_base.c b/sys/dev/scsipi/scsipi_base.c index 46c4fd822231..9dfa6a7acfd1 100644 --- a/sys/dev/scsipi/scsipi_base.c +++ b/sys/dev/scsipi/scsipi_base.c @@ -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. @@ -38,7 +38,7 @@ */ #include -__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" @@ -1248,13 +1248,14 @@ scsipi_mode_select(periph, byte2, data, len, flags, retries, timeout) struct scsipi_mode_select scsipi_cmd; 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)); scsipi_cmd.opcode = MODE_SELECT; scsipi_cmd.byte2 = byte2; - if (scsipi_periph_bustype(periph) == SCSIPI_BUSTYPE_ATAPI) - _lto2b(len, scsipi_cmd.u_len.atapi.length); - else - scsipi_cmd.u_len.scsi.length = len & 0xff; + scsipi_cmd.length = len & 0xff; error = scsipi_command(periph, (struct scsipi_generic *)&scsipi_cmd, sizeof(scsipi_cmd), (void *)data, len, retries, timeout, NULL, flags | XS_CTL_DATA_OUT);