summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-05-23 06:46:39 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-05-23 06:46:39 +0000
commit5b44b31e793184e824651a218ffc9c819d9d8f56 (patch)
treeb88f174410dc835b495852f56cda7b3b6ee1f904
parent8459723298b06d5eacc8fef95784036326fd4614 (diff)
Remove more superfluous structures, etc. No functional change.
-rw-r--r--sys/scsi/atapi_cd.h77
-rw-r--r--sys/scsi/cd_atapi.c52
2 files changed, 28 insertions, 101 deletions
diff --git a/sys/scsi/atapi_cd.h b/sys/scsi/atapi_cd.h
index bedaa1cf5c6..be03edd0901 100644
--- a/sys/scsi/atapi_cd.h
+++ b/sys/scsi/atapi_cd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapi_cd.h,v 1.3 2005/05/22 21:11:31 krw Exp $ */
+/* $OpenBSD: atapi_cd.h,v 1.4 2005/05/23 06:46:38 krw Exp $ */
/* $NetBSD: atapi_cd.h,v 1.9 1998/07/13 16:50:56 thorpej Exp $ */
/*
@@ -40,82 +40,9 @@ struct atapi_load_unload {
u_int8_t unused3[3];
};
-struct atapi_cdrom_page {
- u_int8_t page;
- u_int8_t length;
- u_int8_t reserved;
- u_int8_t inact_mult;
- u_int8_t spm[2];
- u_int8_t fps[2];
-};
-
-struct atapi_cap_page {
- /* Capabilities page */
- u_int8_t page_code;
- u_int8_t param_len;
- u_int8_t reserved1[2];
-
- u_int8_t cap1;
-#define AUDIO_PLAY 0x01 /* audio play supported */
-#define AV_COMPOSITE /* composite audio/video supported */
-#define DA_PORT1 /* digital audio on port 1 */
-#define DA_PORT2 /* digital audio on port 2 */
-#define M2F1 /* mode 2 form 1 (XA) read */
-#define M2F2 /* mode 2 form 2 format */
-#define CD_MULTISESSION /* multi-session photo-CD */
- u_int8_t cap2;
-#define CD_DA 0x01 /* audio-CD read supported */
-#define CD_DA_STREAM 0x02 /* CD-DA streaming */
-#define RW_SUB 0x04 /* combined R-W subchannels */
-#define RW_SUB_CORR 0x08 /* R-W subchannel data corrected */
-#define C2_ERRP 0x10 /* C2 error pointers supported */
-#define ISRC 0x20 /* can return the ISRC */
-#define UPC 0x40 /* can return the catalog number UPC */
- u_int8_t m_status;
-#define CANLOCK 0x01 /* could be locked */
-#define LOCK_STATE 0x02 /* current lock state */
-#define PREVENT_JUMP 0x04 /* prevent jumper installed */
-#define CANEJECT 0x08 /* can eject */
-#define MECH_MASK 0xe0 /* loading mechanism type */
-#define MECH_CADDY 0x00
-#define MECH_TRAY 0x20
-#define MECH_POPUP 0x40
-#define MECH_CHANGER_INDIV 0x80
-#define MECH_CHANGER_CARTRIDGE 0xa0
- u_int8_t cap3;
-#define SEPARATE_VOL 0x01 /* independent volume of channels */
-#define SEPARATE_MUTE 0x02 /* independent mute of channels */
-#define SUPP_DISK_PRESENT 0x04 /* changer can report contents of slots */
-#define SSS 0x08 /* software slot selection */
- u_int8_t max_speed[2]; /* max raw data rate in bytes/1000 */
- u_int8_t max_vol_levels[2]; /* number of discrete volume levels */
- u_int8_t buf_size[2]; /* internal buffer size in bytes/1024 */
- u_int8_t cur_speed[2]; /* current data rate in bytes/1000 */
- /* Digital drive output format description (optional?) */
- u_int8_t reserved2;
- u_int8_t dig_output; /* Digital drive output format description */
- u_int8_t reserved3[2];
-};
-
-#define ATAPI_CDROM_PAGE 0x0d
-#define ATAPI_AUDIO_PAGE 0x0e
#define ATAPI_AUDIO_PAGE_MASK 0x4e
-#define ATAPI_CAP_PAGE 0x2a
-
-union atapi_cd_pages {
- struct atapi_cdrom_page cdrom;
- struct atapi_cap_page cap;
- struct cd_audio_page audio;
-};
struct atapi_cd_mode_data {
struct scsi_mode_header_big header;
- union atapi_cd_pages pages;
+ struct cd_audio_page audio;
};
-
-#define AUDIOPAGESIZE \
- (sizeof(struct scsi_mode_header_big) + sizeof(struct cd_audio_page))
-#define CDROMPAGESIZE \
- (sizeof(struct scsi_mode_header_big) + sizeof(struct atapi_cdrom_page))
-#define CAPPAGESIZE \
- (sizeof(struct scsi_mode_header_big) + sizeof(struct atapi_cap_page))
diff --git a/sys/scsi/cd_atapi.c b/sys/scsi/cd_atapi.c
index 2954c5a7de9..38247b0c689 100644
--- a/sys/scsi/cd_atapi.c
+++ b/sys/scsi/cd_atapi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd_atapi.c,v 1.5 2005/05/14 00:20:43 krw Exp $ */
+/* $OpenBSD: cd_atapi.c,v 1.6 2005/05/23 06:46:38 krw Exp $ */
/* $NetBSD: cd_atapi.c,v 1.10 1998/08/31 22:28:06 cgd Exp $ */
/*
@@ -93,18 +93,18 @@ cd_atapibus_setchan(cd, p0, p1, p2, p3, flags)
int error;
bzero(&data, sizeof(data));
- error = scsi_mode_sense_big(cd->sc_link, 0, ATAPI_AUDIO_PAGE,
- (struct scsi_mode_header_big *)&data, AUDIOPAGESIZE, flags, 20000);
+ 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.pages.audio.port[LEFT_PORT].channels = p0;
- data.pages.audio.port[RIGHT_PORT].channels = p1;
- data.pages.audio.port[2].channels = p2;
- data.pages.audio.port[3].channels = p3;
+ 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, AUDIOPAGESIZE, flags, 20000);
+ (struct scsi_mode_header_big *)&data, sizeof(data), flags, 20000);
return (error);
}
@@ -119,15 +119,15 @@ cd_atapibus_getvol(cd, arg, flags)
int error;
bzero(&data, sizeof(data));
- error = scsi_mode_sense_big(cd->sc_link, 0, ATAPI_AUDIO_PAGE,
- (struct scsi_mode_header_big *)&data, AUDIOPAGESIZE, flags, 20000);
+ 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.pages.audio.port[0].volume;
- arg->vol[1] = data.pages.audio.port[1].volume;
- arg->vol[2] = data.pages.audio.port[2].volume;
- arg->vol[3] = data.pages.audio.port[3].volume;
+ 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);
}
@@ -142,28 +142,28 @@ cd_atapibus_setvol(cd, arg, flags)
int error;
bzero(&data, sizeof(data));
- error = scsi_mode_sense_big(cd->sc_link, 0, ATAPI_AUDIO_PAGE,
- (struct scsi_mode_header_big *)&data, AUDIOPAGESIZE, flags, 20000);
+ 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);
bzero(&mask, sizeof(mask));
error = scsi_mode_sense_big(cd->sc_link, 0, ATAPI_AUDIO_PAGE_MASK,
- (struct scsi_mode_header_big *)&mask, AUDIOPAGESIZE, flags, 20000);
+ (struct scsi_mode_header_big *)&mask, sizeof(mask), flags, 20000);
if (error != 0)
return (error);
- data.pages.audio.port[0].volume = arg->vol[0] &
- mask.pages.audio.port[0].volume;
- data.pages.audio.port[1].volume = arg->vol[1] &
- mask.pages.audio.port[1].volume;
- data.pages.audio.port[2].volume = arg->vol[2] &
- mask.pages.audio.port[2].volume;
- data.pages.audio.port[3].volume = arg->vol[3] &
- mask.pages.audio.port[3].volume;
+ 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, AUDIOPAGESIZE, flags, 20000);
+ (struct scsi_mode_header_big *)&data, sizeof(data), flags, 20000);
return (error);
}