mhd_local.h revision 61961e0f20c7637a3846bb39786bb9dffa91dfb9
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _MHD_LOCAL_H
#define _MHD_LOCAL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <stdarg.h>
#include <ctype.h>
#include <sys/sysmacros.h>
#include <metamhd.h>
#include <thread.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* millisecond time
*/
typedef u_longlong_t mhd_msec_t;
/*
* drive record
*/
typedef uint_t mhd_state_t;
#define DRIVE_PROBING 0x0100
#define DRIVE_STATUSING 0x0200
#define DRIVE_SERIALING 0x0400
#define DRIVE_VTOCING 0x0800
#define DRIVE_CINFOING 0x1000
typedef struct mhd_drive {
char *dr_rname; /* raw device name */
char *dr_rname0; /* slice 0 raw device name */
int dr_fd; /* open slice 0 */
int dr_errnum; /* errno for DRIVE_ERRORED */
} mhd_drive_t;
/*
* drive list
*/
typedef struct mhd_drive_list {
#define MHD_NULL_LIST { NULL, 0, 0 }
/*
* drive set
*/
typedef struct mhd_drive_set {
char *sr_name; /* set name */
int sr_ff; /* failfast device descriptor */
/*
* debug stuff
*/
#define MHD_DEBUG 0
#ifdef MHD_DEBUG
extern int mhd_debug;
#else /* ! MHD_DEBUG */
#define MHDPRINTF(n)
#define MHDPRINTF1(n)
#define MHDPRINTF2(n)
#endif /* ! MHD_DEBUG */
/*
* extern functions
*/
/* mhd_drive.c */
extern const mhd_drive_list_t mhd_null_list;
mhd_error_t *mhep);
mhd_error_t *mhep);
/* mhd_error.c */
/*PRINTFLIKE2*/
/*PRINTFLIKE1*/
extern void mhd_perror(const char *fmt, ...);
/*PRINTFLIKE1*/
extern void mhd_eprintf(const char *fmt, ...);
/* mhd_failfast.c */
/* mhd_init.c */
mhd_error_t *mhep);
/* mhd_ioctl.c */
/* mhd_mem.c */
extern char *Strdup(const char *p);
extern void Free(void *p);
/* mhd_set.c */
mhd_drive_t *dp);
mhd_error_t *mhep);
/* mhd_synch.c */
mhd_msec_t to);
/* mhd_time.c */
extern mhd_msec_t mhd_time();
#ifdef __cplusplus
}
#endif
#endif /* _MHD_LOCAL_H */