From 7c478bd95313f5f23a4c958a745db2134aa03244 Mon Sep 17 00:00:00 2001 From: "stevel@tonic-gate" Date: Tue, 14 Jun 2005 00:00:00 -0700 Subject: OpenSolaris Launch --- usr/src/cmd/cdrw/trackio.h | 86 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 usr/src/cmd/cdrw/trackio.h (limited to 'usr/src/cmd/cdrw/trackio.h') diff --git a/usr/src/cmd/cdrw/trackio.h b/usr/src/cmd/cdrw/trackio.h new file mode 100644 index 0000000000..611d2f8d17 --- /dev/null +++ b/usr/src/cmd/cdrw/trackio.h @@ -0,0 +1,86 @@ +/* + * 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 + * or http://www.opensolaris.org/os/licensing. + * 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. + */ + +#ifndef _TRACKIO_H +#define _TRACKIO_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include "bstream.h" +#include "misc_scsi.h" + +struct trackio_error { + int err_type; +/* File I/O errors */ + int te_errno; +/* Transport Errors */ + uchar_t status, key, asc, ascq; +}; + +/* + * trackio error types + */ +#define TRACKIO_ERR_SYSTEM 1 +#define TRACKIO_ERR_TRANSPORT 2 +#define TRACKIO_ERR_USER_ABORT 3 + +/* + * iob state + */ +#define IOBS_UNDER_FILE_IO 1 +#define IOBS_UNDER_DEVICE_IO 2 +#define IOBS_READY 3 +#define IOBS_EMPTY 4 + +struct iobuf { + uchar_t *iob_buf; + uint32_t iob_total_size; /* total size of the buf */ + uint32_t iob_data_size; /* size of the data in buf */ + uint32_t iob_start_blk; /* starting block address on the device */ + uint16_t iob_nblks; /* number of data blocks in this buf */ + int iob_state; /* state of buf */ +}; + +/* Use small buffers. Some drives do not behave well with large buffers */ +#define NIOBS 8 +#define NBLKS_PER_BUF 24 /* < 64K in all cases */ +#define DATA_TRACK_BLKSIZE 2048 +#define AUDIO_TRACK_BLKSIZE 2352 + +int write_track(cd_device *dev, struct track_info *ti, bstreamhandle h, + int (*cb)(void *, int64_t), void *arg, struct + trackio_error *te); + +#ifdef __cplusplus +} +#endif + +#endif /* _TRACKIO_H */ -- cgit v1.2.3