/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SMSERVER_H_
#define _SMSERVER_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <door.h>
#include <thread.h>
#include <synch.h>
#define INIT_NOT_DONE 0
/* SCSI FORMAT UNIT cdb[1] #defines */
/* Defect list header data[1] #defines */
/* #defines for protect medode field */
/* #defines for CARTRIDGE STATUS PAGE */
/* error reporting mechanism */
void fatal(const char *, ...);
void info(const char *, ...);
void warning(const char *, ...);
void setlog(const char *);
void flushlog();
void quit(const char *, ...);
void noise(const char *, ...);
typedef struct server_data {
char sd_init_state;
int sd_door;
int sd_fd;
typedef enum {
typedef struct door_data {
/* [1] : Death Door decriptor */
} door_data_t;
/* Symbols to simplify access of door_data_t */
typedef enum {
typedef struct {
} smedia_req_t;
typedef struct {
} smedia_ret_t;
typedef struct smedia_reqping {
typedef struct smedia_retping {
/*
* SMEDIA open device
*/
typedef struct smedia_reqopen {
int oflag;
int omode;
typedef struct smedia_retopen {
typedef struct smedia_requscsi_cmd {
short uscsi_timeout;
typedef struct smedia_retuscsi_cmd {
short uscsi_status;
typedef struct smedia_reqget_device_info {
typedef struct smedia_reqset_shfd {
typedef struct smedia_retget_device_info {
typedef struct smedia_reqget_medium_property {
typedef struct smedia_retget_medium_property {
typedef struct smedia_reqget_protection_status {
typedef struct smedia_retget_protection_status {
typedef struct smedia_reqset_protection_status {
typedef struct smedia_retset_protection_status {
typedef struct smedia_reqraw_read {
typedef struct smedia_retraw_read {
typedef struct smedia_reqraw_write {
typedef struct smedia_retraw_write {
typedef struct smedia_reqformat {
typedef struct smedia_retformat {
typedef struct smedia_reqcheck_format_status {
typedef struct smedia_retcheck_format_status {
int percent_complete;
typedef struct smedia_reqreassign_block {
typedef struct smedia_retreassign_block {
typedef struct {
typedef union {
/*
* Crude algorithm for calculating format timeout.
* 30min + 5min/100MB =>
* 35min for 100MB ZIP
* 42.5 min for 250MB ZIP
* 127 min for 2GB Jaz
* It is OK for now as this is just an upper limit by which the
* format should complete.
*/
/*
* Non sense data length for catridge status page.
* Should be 63, but IDE driver panics with a non-aligned
* data transfer.
*/
/*
* Vendor specific commands from Iomega
*/
#ifdef __cplusplus
}
#endif
#endif /* _SMSERVER_H_ */