vdsk_common.h revision 0a55fbb79ee31ed09f84a9ae28e9747bc23f4a08
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _VDSK_COMMON_H
#define _VDSK_COMMON_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* This header file contains the private LDoms Virtual Disk (vDisk) definitions
* common to both the server (vds) and the client (vdc)
*/
#include <sys/machparam.h>
#include <sys/vio_common.h>
#include <sys/vio_mailbox.h>
/*
* vDisk definitions
*/
/*
* The number of Descriptor Ring entries
*
* Constraints:
* - overall DRing size must be greater than 8K (MMU_PAGESIZE)
* - overall DRing size should be 8K aligned (desirable but not enforced)
* - DRing entry must be 8 byte aligned
*/
#define VD_DRING_LEN 512
/*
*
*/
#define VD_DRING_ENTRY_SZ (sizeof (vd_dring_entry_t) + \
/*
* The maximum block size we can transmit using one Descriptor Ring entry
*
* Currently no FS uses more than 128K and it doesn't look like they
* will either as there is no perf gain to be had by larger values.
* ( see ZFS comment at definition of SPA_MAXBLOCKSIZE ).
*
* We choose 256K to give us some headroom.
*/
#define VD_USEC_TIMEOUT 20000
#define VD_LDC_IDS_PROP "ldc-ids"
#define VD_LDC_QLEN 32
/*
*/
#define VD_COPYOUT 0x1
#define VD_COPYIN 0x2
/*
* vDisk operations on physical devices
*/
/*
* Definitions of the various ways vds can export disk support to vdc.
*/
typedef enum vd_disk_type {
VD_DISK_TYPE_UNK = 0, /* Unknown device type */
VD_DISK_TYPE_SLICE, /* slice in block device */
VD_DISK_TYPE_DISK /* entire disk (slice 2) */
/*
* vDisk Descriptor payload
*/
typedef struct vd_dring_payload {
/*
* vDisk Descriptor entry
*/
typedef struct vd_dring_entry {
/*
* vDisk control operation structures
*
* XXX FIXME - future support - add structures for VD_OP_XXXX
*/
/*
* vDisk geometry definition (VD_OP_GET_DISKGEOM and VD_OP_SET_DISKGEOM)
*/
typedef struct vd_geom {
} vd_geom_t;
/*
* vDisk partition definition
*/
typedef struct vd_partition {
/*
* vDisk VTOC definition (VD_OP_GET_VTOC and VD_OP_SET_VTOC)
*/
typedef struct vd_vtoc {
} vd_vtoc_t;
/*
* Copy the contents of a vd_geom_t to the contents of a dk_geom struct
*/
{ \
}
/*
* Copy the contents of a vd_vtoc_t to the contents of a vtoc struct
*/
{ \
sizeof ((vtoc)->v_asciilabel))); \
for (int i = 0; i < (vd_vtoc)->num_partitions; i++) { \
} \
}
/*
* Copy the contents of a dk_geom struct to the contents of a vd_geom_t
*/
{ \
}
/*
* Copy the contents of a vtoc struct to the contents of a vd_vtoc_t
*/
{ \
sizeof ((vd_vtoc)->volume_name))); \
sizeof ((vd_vtoc)->ascii_label))); \
} \
}
#ifdef __cplusplus
}
#endif
#endif /* _VDSK_COMMON_H */