vol.h 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.
*/
/*
* Volume Management Mux Driver Interface
*/
#ifndef _SYS_VOL_H
#define _SYS_VOL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* The labelent structures tell the driver where labels might be found,
* so the driver can watch this range of addresses and tell us
* (via the VIE_NEWLABEL event) when someone writes to one. It
* also allows the driver to "blot out" the label from reads and
* writes, if desired.
*/
struct vio_labelent {
};
#ifdef _SYSCALL32
struct vio_labelent32 {
};
#endif /* _SYSCALL32 */
/*
* Map our unit number (vim_unit) to a dev_t representing a
* real driver (vim_dev).
*/
struct vioc_map {
};
#ifdef _SYSCALL32
#pragma pack(4)
#endif
struct vioc_map32 {
};
#pragma pack()
#endif
#endif /* _SYSCALL32 */
struct vioc_dattr {
int vda_errno; /* error */
};
#ifdef _SYSCALL32
struct vioc_dattr32 {
};
#endif /* _SYSCALL32 */
/*
* Passed from daemon to driver to specify what action should happen on
* eject. This is in response to a VIE_EJECT event.
*/
enum eject_state {
VEJ_YES, /* eject is okay, send eject */
VEJ_NO, /* eject is denied, don't send eject */
VEJ_YESSTOP, /* eject is okay, don't send eject */
VEJ_NONE /* no state */
};
struct vioc_eject {
enum eject_state viej_state;
};
#ifdef _SYSCALL32
struct vioc_eject32 {
};
#endif /* _SYSCALL32 */
struct vioc_flags {
};
#ifdef _SYSCALL32
struct vioc_flags32 {
};
#endif /* _SYSCALL32 */
/*
* structure to provide buffer size of a passed in
* string so kernel can use ddi
*/
struct vol_str {
};
#ifdef _SYSCALL32
struct vol_str32 {
};
#endif /* _SYSCALL32 */
/*
* returned in response to VOLIOCINFO
*/
struct vioc_info {
};
#ifdef _SYSCALL32
#pragma pack(4)
#endif
struct vioc_info32 {
};
#pragma pack()
#endif
#endif /* _SYSCALL32 */
struct vioc_sattr {
};
#ifdef _SYSCALL32
struct vioc_sattr32 {
};
#endif /* _SYSCALL32 */
struct vioc_gattr {
};
#ifdef _SYSCALL32
struct vioc_gattr32 {
};
#endif /* _SYSCALL32 */
/* for the VOLIOCSYMNAME ioctl */
struct vioc_symname {
};
#ifdef _SYSCALL32
struct vioc_symname32 {
};
#endif /* _SYSCALL32 */
/* for the VOLIOCSYMDEV ioctl */
struct vioc_symdev {
};
#ifdef _SYSCALL32
struct vioc_symdev32 {
};
#endif /* _SYSCALL32 */
#if defined(_LONGLONG_TYPE)
#define VOLID_TMP 0xff00000000000000ull
#else
#define VOLID_TMP 0xff000000
#endif
/*
*/
#define VOL_SYMDEV_LEN (MAXPATHLEN)
/*
* max size of aliases pathname in /vol (e.g. "floppy0")
*/
#define VOL_SYMNAME_LEN (MAXNAMELEN)
/*
* Possible events that the drive can generate for the daemon.
*/
enum vie_event {
VIE_MISSING, /* driver has no mapping */
VIE_EJECT, /* eject has been requested */
VIE_DEVERR, /* error seen from device */
VIE_CLOSE, /* last close on device from userland */
VIE_CANCEL, /* user has cancelled pending i/o */
VIE_NEWLABEL, /* a new label has been written to device */
VIE_INSERT, /* new media has arrived */
VIE_GETATTR, /* get an attribute */
VIE_SETATTR, /* set an attribute */
VIE_INUSE, /* check to see if a device is in use */
VIE_CHECK, /* check a device to see if media is there */
VIE_REMOVED, /* media was removed from device */
VIE_SYMNAME, /* for volmgt_symname() */
VIE_SYMDEV, /* for volmgt_symdev() */
VIE_REMOUNT /* the medium's file system structure has changed */
};
/*
* This structure is used for communication between the daemon and
* the driver.
*/
struct vioc_event {
union {
/*
* A unit has been opened for which we don't
* have a mapping.
*/
struct ve_missing {
/*
* A request has been made to eject a unit.
*/
struct ve_eject {
int viej_force; /* DEPRECIATED */
} vie_u_eject;
/*
* New media has arrived.
*/
struct ve_insert {
} vie_u_insert;
/*
* User wants us to see if a device is in use.
*/
struct ve_inuse {
} vie_u_inuse;
/*
* User wants us to see if media has arrived in a device.
*/
struct ve_check {
} vie_u_check;
/*
* An error has been returned from a device
*/
struct ve_error {
} vie_u_error;
/*
* "last" close on a unit.
*/
struct ve_close {
} vie_u_close;
/*
* user has "interrupted" (^C) a pending operation.
*/
struct ve_cancel {
} vie_u_cancel;
/*
* New label has been written.
*/
struct ve_newlabel {
/*
* Set or get an attribute
*/
struct ve_attr {
} vie_u_attr;
struct ve_rm {
} vie_u_rm;
/*
* user wants to find the symname for a dev path
*/
struct ve_symname {
/*
* user wants to find the dev path for a symname
*/
struct ve_symdev {
} vie_u_symdev;
/*
* Medium's partition structure has changed
*/
struct ve_remount {
} vie_un;
};
#ifdef _SYSCALL32
struct vioc_event32 {
union {
/*
* A unit has been opened for which we don't
* have a mapping.
*/
struct ve_missing32 {
/*
* A request has been made to eject a unit.
*/
struct ve_eject32 {
} vie_u_eject;
/*
* New media has arrived.
*/
struct ve_insert32 {
} vie_u_insert;
/*
* User wants us to see if a device is in use.
*/
struct ve_inuse32 {
} vie_u_inuse;
/*
* User wants us to see if media has arrived in a device.
*/
struct ve_check32 {
} vie_u_check;
/*
* An error has been returned from a device
*/
struct ve_error32 {
} vie_u_error;
/*
* "last" close on a unit.
*/
struct ve_close32 {
} vie_u_close;
/*
* user has "interrupted" (^C) a pending operation.
*/
struct ve_cancel32 {
} vie_u_cancel;
/*
* New label has been written.
*/
struct ve_newlabel32 {
/*
* Set or get an attribute
*/
struct ve_attr32 {
} vie_u_attr;
struct ve_rm32 {
} vie_u_rm;
/*
* user wants to find the symname for a dev path
*/
struct ve_symname32 {
/*
* user wants to find the dev path for a symname
*/
struct ve_symdev32 {
} vie_u_symdev;
/*
* Medium has new partition structure
*/
struct ve_remount32 {
} vie_un;
};
#endif /* _SYSCALL32 */
/*
* These ioctl numbers have been allocated and approved by USL.
*/
/* "control" ioctls (i.e. only valid on unit 0) */
/* "user" ioctls */
/* Name of control port (unit 0), i.e. /dev/%s */
#define VOLCTLNAME "volctl"
#define VOLUNITNAME_BLK "u%d"
#define VOLUNITNAME_CHR "u%d,raw"
#ifdef __cplusplus
}
#endif
#endif /* _SYS_VOL_H */