summaryrefslogtreecommitdiff
path: root/sys/scsi
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-05-27 16:50:32 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-05-27 16:50:32 +0000
commit20e5ac48a0c4ac10784169c11b1cf6fd1cf71280 (patch)
treea0dd223372a31df6979b2f806a9371d9cc553e63 /sys/scsi
parentc172e0a293252febf3e42cce242a4cd01db57a0e (diff)
No longer used after merge of atapi/scsi cd code.
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/atapi_cd.h46
-rw-r--r--sys/scsi/cd_atapi.c192
-rw-r--r--sys/scsi/cd_scsi.c194
-rw-r--r--sys/scsi/scsi_cd.h86
4 files changed, 0 insertions, 518 deletions
diff --git a/sys/scsi/atapi_cd.h b/sys/scsi/atapi_cd.h
deleted file mode 100644
index b7019ea6c51..00000000000
--- a/sys/scsi/atapi_cd.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* $OpenBSD: atapi_cd.h,v 1.5 2005/05/23 18:29:15 krw Exp $ */
-/* $NetBSD: atapi_cd.h,v 1.9 1998/07/13 16:50:56 thorpej Exp $ */
-
-/*
- * Copyright (c) 1996 Manuel Bouyer. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Manuel Bouyer.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#define ATAPI_LOAD_UNLOAD 0xa6
-struct atapi_load_unload {
- u_int8_t opcode;
- u_int8_t unused1[3];
- u_int8_t options;
- u_int8_t unused2[3];
- u_int8_t slot;
- u_int8_t unused3[3];
-};
-
-struct atapi_cd_mode_data {
- struct scsi_mode_header_big header;
- struct cd_audio_page audio;
-};
diff --git a/sys/scsi/cd_atapi.c b/sys/scsi/cd_atapi.c
deleted file mode 100644
index 1f80d985c2b..00000000000
--- a/sys/scsi/cd_atapi.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/* $OpenBSD: cd_atapi.c,v 1.8 2005/05/23 18:29:15 krw Exp $ */
-/* $NetBSD: cd_atapi.c,v 1.10 1998/08/31 22:28:06 cgd Exp $ */
-
-/*
- * Copyright (c) 1997 Manuel Bouyer. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Charles M. Hannum.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Originally written by Julian Elischer (julian@tfs.com)
- * for TRW Financial Systems for use under the MACH(2.5) operating system.
- *
- * TRW Financial Systems, in accordance with their agreement with Carnegie
- * Mellon University, makes this software available to CMU to distribute
- * or use in any manner that they see fit as long as this message is kept with
- * the software. For this reason TFS also grants any other persons or
- * organisations permission to use or modify this software.
- *
- * TFS supplies this software to be publicly redistributed
- * on the understanding that TFS is not responsible for the correct
- * functioning of this software in any circumstances.
- *
- * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/file.h>
-#include <sys/device.h>
-#include <sys/disk.h>
-#include <sys/buf.h>
-#include <sys/conf.h>
-#if NRND > 0
-#include <sys/rnd.h>
-#endif
-
-#include <sys/cdio.h>
-
-#include <scsi/scsi_all.h>
-#include <scsi/cd.h>
-#include <scsi/atapi_cd.h>
-#include <scsi/cdvar.h>
-#include <scsi/scsiconf.h>
-
-
-static int cd_atapibus_setchan(struct cd_softc *, int, int, int, int, int);
-static int cd_atapibus_getvol(struct cd_softc *, struct ioc_vol *, int);
-static int cd_atapibus_setvol(struct cd_softc *, const struct ioc_vol *,
- int);
-static int cd_atapibus_set_pa_immed(struct cd_softc *, int);
-static int cd_atapibus_load_unload(struct cd_softc *, int, int);
-
-const struct cd_ops cd_atapibus_ops = {
- cd_atapibus_setchan,
- cd_atapibus_getvol,
- cd_atapibus_setvol,
- cd_atapibus_set_pa_immed,
- cd_atapibus_load_unload,
-};
-
-static int
-cd_atapibus_setchan(cd, p0, p1, p2, p3, flags)
- struct cd_softc *cd;
- int p0, p1, p2, p3, flags;
-{
- struct atapi_cd_mode_data data;
- int error;
-
- error = scsi_mode_sense_big(cd->sc_link, 0, AUDIO_PAGE,
- (struct scsi_mode_header_big *)&data, sizeof(data), flags, 20000);
- if (error != 0)
- return (error);
-
- data.audio.port[LEFT_PORT].channels = p0;
- data.audio.port[RIGHT_PORT].channels = p1;
- data.audio.port[2].channels = p2;
- data.audio.port[3].channels = p3;
-
- error = scsi_mode_select_big(cd->sc_link, SMS_PF,
- (struct scsi_mode_header_big *)&data, sizeof(data), flags, 20000);
-
- return (error);
-}
-
-static int
-cd_atapibus_getvol(cd, arg, flags)
- struct cd_softc *cd;
- struct ioc_vol *arg;
- int flags;
-{
- struct atapi_cd_mode_data data;
- int error;
-
- error = scsi_mode_sense_big(cd->sc_link, 0, AUDIO_PAGE,
- (struct scsi_mode_header_big *)&data, sizeof(data), flags, 20000);
- if (error != 0)
- return (error);
-
- arg->vol[0] = data.audio.port[0].volume;
- arg->vol[1] = data.audio.port[1].volume;
- arg->vol[2] = data.audio.port[2].volume;
- arg->vol[3] = data.audio.port[3].volume;
-
- return (0);
-}
-
-static int
-cd_atapibus_setvol(cd, arg, flags)
- struct cd_softc *cd;
- const struct ioc_vol *arg;
- int flags;
-{
- struct atapi_cd_mode_data data, mask;
- int error;
-
- error = scsi_mode_sense_big(cd->sc_link, 0, AUDIO_PAGE,
- (struct scsi_mode_header_big *)&data, sizeof(data), flags, 20000);
- if (error != 0)
- return (error);
-
- error = scsi_mode_sense_big(cd->sc_link, 0,
- AUDIO_PAGE | SMS_PAGE_CTRL_CHANGEABLE,
- (struct scsi_mode_header_big *)&mask, sizeof(mask), flags, 20000);
- if (error != 0)
- return (error);
-
- data.audio.port[0].volume = arg->vol[0] &
- mask.audio.port[0].volume;
- data.audio.port[1].volume = arg->vol[1] &
- mask.audio.port[1].volume;
- data.audio.port[2].volume = arg->vol[2] &
- mask.audio.port[2].volume;
- data.audio.port[3].volume = arg->vol[3] &
- mask.audio.port[3].volume;
-
- error = scsi_mode_select_big(cd->sc_link, SMS_PF,
- (struct scsi_mode_header_big *)&data, sizeof(data), flags, 20000);
-
- return (error);
-}
-
-static int
-cd_atapibus_set_pa_immed(cd, flags)
- struct cd_softc *cd;
- int flags;
-{
-
- /* Noop. */
- return (0);
-}
-
-static int
-cd_atapibus_load_unload(cd, options, slot)
- struct cd_softc *cd;
- int options, slot;
-{
- struct atapi_load_unload atapi_cmd;
-
- bzero(&atapi_cmd, sizeof(atapi_cmd));
- atapi_cmd.opcode = ATAPI_LOAD_UNLOAD;
- atapi_cmd.options = options; /* ioctl uses ATAPI values */
- atapi_cmd.slot = slot;
- return (scsi_scsi_cmd(cd->sc_link,
- (struct scsi_generic *)&atapi_cmd, sizeof(atapi_cmd),
- 0, 0, CDRETRIES, 200000, NULL, 0));
-}
diff --git a/sys/scsi/cd_scsi.c b/sys/scsi/cd_scsi.c
deleted file mode 100644
index b8791d16e3e..00000000000
--- a/sys/scsi/cd_scsi.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/* $OpenBSD: cd_scsi.c,v 1.8 2005/05/23 07:06:16 krw Exp $ */
-/* $NetBSD: cd_scsi.c,v 1.14 1998/08/31 22:28:06 cgd Exp $ */
-
-/*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Charles M. Hannum.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Originally written by Julian Elischer (julian@tfs.com)
- * for TRW Financial Systems for use under the MACH(2.5) operating system.
- *
- * TRW Financial Systems, in accordance with their agreement with Carnegie
- * Mellon University, makes this software available to CMU to distribute
- * or use in any manner that they see fit as long as this message is kept with
- * the software. For this reason TFS also grants any other persons or
- * organisations permission to use or modify this software.
- *
- * TFS supplies this software to be publicly redistributed
- * on the understanding that TFS is not responsible for the correct
- * functioning of this software in any circumstances.
- *
- * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/file.h>
-#include <sys/device.h>
-#include <sys/disk.h>
-#include <sys/buf.h>
-#include <sys/conf.h>
-#if NRND > 0
-#include <sys/rnd.h>
-#endif
-
-#include <sys/cdio.h>
-
-#include <scsi/scsi_all.h>
-#include <scsi/cd.h>
-#include <scsi/scsi_cd.h>
-#include <scsi/scsiconf.h>
-#include <scsi/cdvar.h>
-
-int cd_scsibus_setchan(struct cd_softc *, int, int, int, int, int);
-int cd_scsibus_getvol(struct cd_softc *, struct ioc_vol *, int);
-int cd_scsibus_setvol(struct cd_softc *, const struct ioc_vol *,
- int);
-int cd_scsibus_set_pa_immed(struct cd_softc *, int);
-int cd_scsibus_load_unload(struct cd_softc *, int, int);
-
-const struct cd_ops cd_scsibus_ops = {
- cd_scsibus_setchan,
- cd_scsibus_getvol,
- cd_scsibus_setvol,
- cd_scsibus_set_pa_immed,
- cd_scsibus_load_unload,
-};
-
-int
-cd_scsibus_set_pa_immed(cd, flags)
- struct cd_softc *cd;
- int flags;
-{
- struct scsi_cd_mode_data data;
- int error;
-
- error = scsi_mode_sense(cd->sc_link, 0, AUDIO_PAGE,
- (struct scsi_mode_header *)&data, AUDIOPAGESIZE, flags, 20000);
- if (error != 0)
- return (error);
-
- data.page.audio.flags &= ~CD_PA_SOTC;
- data.page.audio.flags |= CD_PA_IMMED;
-
- return (scsi_mode_select(cd->sc_link, SMS_PF,
- (struct scsi_mode_header *)&data, AUDIOPAGESIZE, flags, 20000));
-}
-
-int
-cd_scsibus_setchan(cd, p0, p1, p2, p3, flags)
- struct cd_softc *cd;
- int p0, p1, p2, p3;
- int flags;
-{
- struct scsi_cd_mode_data data;
- int error;
-
- error = scsi_mode_sense(cd->sc_link, 0, AUDIO_PAGE,
- (struct scsi_mode_header *)&data, AUDIOPAGESIZE, flags, 20000);
- if (error != 0)
- return (error);
-
- data.page.audio.port[LEFT_PORT].channels = p0;
- data.page.audio.port[RIGHT_PORT].channels = p1;
- data.page.audio.port[2].channels = p2;
- data.page.audio.port[3].channels = p3;
-
- return (scsi_mode_select(cd->sc_link, SMS_PF,
- (struct scsi_mode_header *)&data, AUDIOPAGESIZE, flags, 20000));
-}
-
-int
-cd_scsibus_getvol(cd, arg, flags)
- struct cd_softc *cd;
- struct ioc_vol *arg;
- int flags;
-{
-
- struct scsi_cd_mode_data data;
- int error;
-
- error = scsi_mode_sense(cd->sc_link, 0, AUDIO_PAGE,
- (struct scsi_mode_header *)&data, AUDIOPAGESIZE, flags, 20000);
- if (error != 0)
- return (error);
-
- arg->vol[LEFT_PORT] = data.page.audio.port[LEFT_PORT].volume;
- arg->vol[RIGHT_PORT] = data.page.audio.port[RIGHT_PORT].volume;
- arg->vol[2] = data.page.audio.port[2].volume;
- arg->vol[3] = data.page.audio.port[3].volume;
-
- return (0);
-}
-
-int
-cd_scsibus_setvol(cd, arg, flags)
- struct cd_softc *cd;
- const struct ioc_vol *arg;
- int flags;
-{
- struct scsi_cd_mode_data data;
- int error;
-
- error = scsi_mode_sense(cd->sc_link, 0, AUDIO_PAGE,
- (struct scsi_mode_header *)&data, AUDIOPAGESIZE, flags, 20000);
- if (error != 0)
- return (error);
-
- data.page.audio.port[LEFT_PORT].channels = CHANNEL_0;
- data.page.audio.port[LEFT_PORT].volume = arg->vol[LEFT_PORT];
- data.page.audio.port[RIGHT_PORT].channels = CHANNEL_1;
- data.page.audio.port[RIGHT_PORT].volume = arg->vol[RIGHT_PORT];
- data.page.audio.port[2].volume = arg->vol[2];
- data.page.audio.port[3].volume = arg->vol[3];
-
- return (scsi_mode_select(cd->sc_link, SMS_PF,
- (struct scsi_mode_header *)&data, AUDIOPAGESIZE, flags, 20000));
-}
-
-int
-cd_scsibus_load_unload(cd, options, slot)
- struct cd_softc *cd;
- int options, slot;
-{
- /*
- * Not supported on SCSI CDs that we know of (but we'll leave
- * the hook here Just In Case).
- */
- return (ENODEV);
-}
diff --git a/sys/scsi/scsi_cd.h b/sys/scsi/scsi_cd.h
deleted file mode 100644
index fa45c6981d1..00000000000
--- a/sys/scsi/scsi_cd.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* $OpenBSD: scsi_cd.h,v 1.6 2001/06/22 14:35:42 deraadt Exp $ */
-/* $NetBSD: scsi_cd.h,v 1.6 1996/03/19 03:06:39 mycroft Exp $ */
-
-/*
- * Written by Julian Elischer (julian@tfs.com)
- * for TRW Financial Systems.
- *
- * TRW Financial Systems, in accordance with their agreement with Carnegie
- * Mellon University, makes this software available to CMU to distribute
- * or use in any manner that they see fit as long as this message is kept with
- * the software. For this reason TFS also grants any other persons or
- * organisations permission to use or modify this software.
- *
- * TFS supplies this software to be publicly redistributed
- * on the understanding that TFS is not responsible for the correct
- * functioning of this software in any circumstances.
- *
- * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
- */
-#ifndef _SCSI_SCSI_CD_H
-#define _SCSI_SCSI_CD_H 1
-
-struct scsi_cd_write_params_page {
- u_int8_t page_code;
- u_int8_t page_len;
- u_int8_t write_type;
-#define WRITE_TYPE_DUMMY 0x10 /* do not actually write blocks */
-#define WRITE_TYPE_MASK 0x0f /* session write type */
- u_int8_t track_mode;
-#define TRACK_MODE_MULTI_SESS 0xc0 /* multisession write type */
-#define TRACK_MODE_FP 0x20 /* fixed packet (if in packet mode) */
-#define TRACK_MODE_COPY 0x10 /* 1st higher gen of copy prot track */
-#define TRACK_MODE_PREEPMPASIS 0x01 /* audio w/ preemphasis (audio) */
-#define TRACK_MODE_INCREMENTAL 0x01 /* incremental data track (data) */
-#define TRACK_MODE_ALLOW_COPY 0x02 /* digital copy is permitted */
-#define TRACK_MODE_DATA 0x04 /* this is a data track */
-#define TRACK_MODE_4CHAN 0x08 /* four channel audio */
- u_int8_t dbtype;
-#define DBTYPE_MASK 0x0f /* data block type */
- u_int8_t reserved1[2];
- u_int8_t host_appl_code;
-#define HOST_APPL_CODE_MASK 0x3f /* host application code of disk */
- u_int8_t session_format;
- u_int8_t reserved2;
- u_int8_t packet_size[4];
- u_int8_t audio_pause_len[2];
- u_int8_t media_cat_number[16];
- u_int8_t isrc[14];
- u_int8_t sub_header[4];
- u_int8_t vendir_unique[4];
-};
-
-#ifdef CDDA
-/*
- * There are 2352 bytes in a CD digital audio frame. One frame is 1/75 of a
- * second, at 44.1kHz sample rate, 16 bits/sample, 2 channels.
- *
- * The frame data have the two channels interleaved, with the left
- * channel first. Samples are little endian 16-bit signed values.
- */
-#define CD_DA_BLKSIZ 2352 /* # bytes in CD-DA frame */
-#ifndef CD_NORMAL_DENSITY_CODE
-#define CD_NORMAL_DENSITY_CODE 0x00 /* from Toshiba CD-ROM specs */
-#endif
-#ifndef CD_DA_DENSITY_CODE
-#define CD_DA_DENSITY_CODE 0x82 /* from Toshiba CD-ROM specs */
-#endif
-#endif /* CDDA */
-
-union scsi_cd_pages {
- struct scsi_cd_write_params_page write_params;
- struct cd_audio_page audio;
-};
-
-struct scsi_cd_mode_data {
- struct scsi_mode_header header;
- struct scsi_blk_desc blk_desc;
- union scsi_cd_pages page;
-};
-
-#define AUDIOPAGESIZE \
- (sizeof(struct scsi_mode_header) + sizeof(struct scsi_blk_desc) \
- + sizeof(struct cd_audio_page))
-
-#endif /*_SCSI_SCSI_CD_H*/
-