toshiba.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <libintl.h>
#include "transport.h"
#include "toshiba.h"
#include "device.h"
#include "misc_scsi.h"
#include "util.h"
#include "main.h"
#include "msgs.h"
#include "mmc.h"
0, 0, 0, 2, 0, 0, 0 };
/*
* These are commands for using older Sun Toshiba drives. These
* commands are needed for reading CD TOC and audio extraction
* and changing speeds (used for audio extraction).
*/
int
{
scmd = get_uscsi_cmd();
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
if (ret >= 0)
break;
}
if (ret < 0)
return (0);
return (1);
}
int
{
int ret;
if (debug) {
(void) printf("toshiba_speed_ctrl: WRONG CMD %d\n",
cmd);
}
return (0);
}
if (cmd == SET_READ_SPEED) {
if (verbose)
"Cannot set speed on this device.\n"));
return (0);
}
if (speed == 32) {
if (strncmp("SUN32XCD",
return (1);
}
(speed != 12)) {
if (verbose)
"%dx speed is not supported by the device.\n"));
return (0);
}
}
ret = 0;
scmd = get_uscsi_cmd();
/* 6 byte mode sense for older drives */
goto end_speed_ctrl;
if (cmd == GET_READ_SPEED) {
goto end_speed_ctrl;
}
if (cmd == SET_READ_SPEED) {
scmd = get_uscsi_cmd();
/* 6 byte mode sense command for older drives */
goto end_speed_ctrl;
ret = 1;
}
return (ret);
}