mmc.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 <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "transport.h"
#include "mmc.h"
#include "util.h"
#include "main.h"
int
test_unit_ready(int fd)
{
scmd = get_uscsi_cmd();
/* give length of cdb structure */
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
if (dbd) {
/* don't return any block descriptors */
}
/* the page code we want */
/* allocation length */
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
/* mode select (10) command */
/* parameter list length */
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
/* tell device we are giving it a track number */
/* track number to read */
if (trackno == -1)
if (device_type == CD_RW) {
} else {
/* only 1 track is allowed on DVD media */
}
else
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
return (0);
/* Fix for old SONY drives */
}
return (1);
}
int
{
scmd = get_uscsi_cmd();
/* Logical block address */
/* allocation length */
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
if (feature == 0)
else
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
/*
* Some DVD drives take longer to write than
* the standard time, since they tend to generate
* the media TOC on the fly when the cache is full
*/
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
if (immediate) {
} else {
}
(device_type == DVD_PLUS_W)) {
/* close the session */
} else {
/* Close the track but leave session open */
}
/*
* DVD+R media are already formatted, we are using
* a special case to notify that drive to close
*/
if (device_type == DVD_PLUS) {
if (close_session) {
} else {
}
}
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
if (immediate) {
} else {
}
/* tell it to blank the last session or all of the disk */
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
if (load == 0) {
/* unload medium */
} else {
/* load medium */
}
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
if (!op) { /* prevent */
}
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
return (0);
return (1);
}
int
rezero_unit(int fd)
{
scmd = get_uscsi_cmd();
return (0);
return (1);
}
int
{
scmd = get_uscsi_cmd();
if (start) {
}
return (0);
return (1);
}
int
flush_cache(int fd)
{
scmd = get_uscsi_cmd();
if (device_type != CD_RW) {
}
return (0);
return (1);
}
/*
* used for DVD- to reserve the size we want to write.
* This is used by the drive to generate a TOC.
*/
int
{
scmd = get_uscsi_cmd();
return (0);
return (1);
}
/*
* Used for DVD+RW media to prepare the disk to write.
* It will also be used for packet mode writing when
* it becomes supported.
*/
int
format_media(int fd)
{
scmd = get_uscsi_cmd();
return (0);
/* RE-use cap structure */
/* full format */
buf[10] = 0;
return (0);
return (1);
}
/*
* Prefered method of reading the media size. This is
* the only supported method on several newer drives.
*/
{
char buf[20];
scmd = get_uscsi_cmd();
return (0);
return (filesize);
}