Use a medium_type field of 0 (Default), instead of the value that was

obtained by the MOSE SENSE command.  SONY drives are too stupid to eat
their own food.

Submitted by:	stu@solaris.com (Stu Phillips)

While i was at it, i've removed two bogus channel numbers in the``set
mono'' command, that kept my Toshiba drive complaining.

Also remove Julian's misspelling of `stereo'.
This commit is contained in:
Joerg Wunsch 1995-12-30 13:56:28 +00:00
parent 1c0c773193
commit 32871264d8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13119

View File

@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
* $Id: cd.c,v 1.53 1995/12/14 09:54:18 phk Exp $
* $Id: cd.c,v 1.54 1995/12/20 12:02:43 dufault Exp $
*/
#define SPLCD splbio
@ -830,7 +830,7 @@ cd_ioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p,
error = cd_get_mode(unit, &data, AUDIO_PAGE);
if (error)
break;
data.page.audio.port[LEFT_PORT].channels = LEFT_CHANNEL | RIGHT_CHANNEL | 4 | 8;
data.page.audio.port[LEFT_PORT].channels = LEFT_CHANNEL | RIGHT_CHANNEL;
data.page.audio.port[RIGHT_PORT].channels = LEFT_CHANNEL | RIGHT_CHANNEL;
data.page.audio.port[2].channels = 0;
data.page.audio.port[3].channels = 0;
@ -839,7 +839,7 @@ cd_ioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p,
break;
}
break;
case CDIOCSETSTERIO:
case CDIOCSETSTEREO:
{
struct cd_mode_data data;
error = cd_get_mode(unit, &data, AUDIO_PAGE);
@ -1093,6 +1093,12 @@ cd_set_mode(unit, data)
scsi_cmd.byte2 |= SMS_PF;
scsi_cmd.length = sizeof(*data) & 0xff;
data->header.data_length = 0;
/*
* SONY drives do not allow a mode select with a medium_type
* value that has just been returned by a mode sense; use a
* medium_type of 0 (Default) instead.
*/
data->header.medium_type = 0;
return (scsi_scsi_cmd(SCSI_LINK(&cd_switch, unit),
(struct scsi_generic *) &scsi_cmd,
sizeof(scsi_cmd),