dsw.h revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _DSW_H
#define _DSW_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Miscellaneous defines
*/
/*
* Ioctl definitions
*/
/*
* Config and status flags
*/
/*
* used for SNMP trap only.
* These flags help distinguish between enable and resume,
* suspend and disable.
* Note that DSW_HANGING is set for both suspend and disable
*/
#define DSW_SNMP_CLR 0 /* no flag is set */
/* Overflow volume flags */
/* amending header version number */
#define II_IMPORTED_SHADOW "<imported_shadow>"
/*
* Configuration parameter defines
* ii_bitmap, ii_throttle_unit, ii_throttle_delay
*/
/*
* DSW user config structure
*/
typedef struct dsw_config_s {
char master_vol[DSW_NAMELEN];
char shadow_vol[DSW_NAMELEN];
char bitmap_vol[DSW_NAMELEN];
char cluster_tag[DSW_NAMELEN];
char group_name[DSW_NAMELEN];
int flag;
} dsw_config_t;
/*
* DSW segmented bitmap I/O structure
*/
typedef struct dsw_segment_s {
char shadow_vol[DSW_NAMELEN];
unsigned seg_number; /* 32KB Segment number to start at */
unsigned char *shd_bitmap; /* pointer to shadow bitmap */
int shd_size; /* size of shadow bitmap */
unsigned char *cpy_bitmap; /* pointer to copy bitmap */
int cpy_size; /* size of copy bitmap */
unsigned char *idx_bitmap; /* pointer to index table */
int idx_size; /* size of index table */
/*
* DSW user bitmap structure
*/
typedef struct dsw_bitmap_s {
char shadow_vol[DSW_NAMELEN];
unsigned char *shd_bitmap; /* pointer to shadow bitmap */
unsigned char *copy_bitmap; /* pointer to copy bitmap */
} dsw_bitmap_t;
/*
* DSW general ioctl structure
*/
typedef struct dsw_ioctl_s {
char shadow_vol[DSW_NAMELEN];
int flags;
} dsw_ioctl_t;
/*
* DSW general atomic ioctl structure operating on several Image sets
*/
typedef struct dsw_aioctl_s {
int flags;
int count;
} dsw_aioctl_t;
/*
* DSW stat ioctl structure
*/
typedef struct dsw_stat_s {
char shadow_vol[DSW_NAMELEN];
int stat;
char overflow_vol[DSW_NAMELEN];
char group_name[DSW_NAMELEN];
char cluster_tag[DSW_NAMELEN];
} dsw_stat_t;
/*
* DSW version ioctl structure
*/
typedef struct dsw_version_s {
int major; /* Major release number */
int minor; /* Minor release number */
int micro; /* Micro release number */
int baseline; /* Baseline revision number */
/*
* DSW get bits set in bitmap structure
*/
typedef struct dsw_bitsset_s {
char shadow_vol[DSW_NAMELEN];
/*
* DSW list ioctl structure
*/
typedef struct dsw_list_s {
int list_size; /* number of elements in list */
int list_used; /* number of elements returned */
} dsw_list_t;
/*
* DSW copy parameter structure
*/
typedef struct dsw_copyp_s {
char shadow_vol[DSW_NAMELEN];
int copy_unit;
int copy_delay;
} dsw_copyp_t;
/*
* DSW ostat ioctl structure
*/
typedef struct dsw_ostat_s {
char overflow_vol[DSW_NAMELEN];
int drefcnt;
int crefcnt;
int flags;
int hversion;
int hmagic;
} dsw_ostat_t;
/*
* DSW move group structure
*/
typedef struct dsw_movegrp_s {
char shadow_vol[DSW_NAMELEN];
char new_group[DSW_NAMELEN];
/*
* II_PIT_PROPS structure
*/
typedef struct pit_props_s {
int iirc;
int mstid;
int shdid;
int bmpid;
int ovrid;
char group[DSW_NAMELEN];
char cluster[DSW_NAMELEN];
int has_overflow;
int flags;
} pit_props_t;
/*
* II_PIT_UPDATE structure
*/
typedef struct pit_update_s {
int iirc;
char direction;
} pit_update_t;
#ifdef _KERNEL
/*
* 32 bit versions of ioctl structures
*/
typedef struct dsw_config32_s {
char master_vol[DSW_NAMELEN];
char shadow_vol[DSW_NAMELEN];
char bitmap_vol[DSW_NAMELEN];
char cluster_tag[DSW_NAMELEN];
char group_name[DSW_NAMELEN];
int flag;
/*
* DSW segmented bitmap I/O structure
*/
typedef struct dsw_segment32_s {
char shadow_vol[DSW_NAMELEN];
int shd_size;
int cpy_size;
int idx_size;
/*
* DSW user bitmap structure
*/
typedef struct dsw_bitmap32_s {
char shadow_vol[DSW_NAMELEN];
typedef struct dsw_ioctl32_s {
char shadow_vol[DSW_NAMELEN];
int flags;
typedef struct dsw_stat32_s {
char shadow_vol[DSW_NAMELEN];
int stat;
char overflow_vol[DSW_NAMELEN];
char group_name[DSW_NAMELEN];
char cluster_tag[DSW_NAMELEN];
} dsw_stat32_t;
typedef struct dsw_version32_s {
int major; /* Major release number */
int minor; /* Minor release number */
int micro; /* Micro release number */
int baseline; /* Baseline revision number */
typedef struct dsw_bitsset32_s {
char shadow_vol[DSW_NAMELEN];
typedef struct dsw_list32_s {
int list_size;
int list_used;
} dsw_list32_t;
typedef struct dsw_aioctl32_s {
int flags;
int count;
typedef struct dsw_copyp32_s {
char shadow_vol[DSW_NAMELEN];
int copy_unit;
int copy_delay;
typedef struct dsw_ostat32_s {
char overflow_vol[DSW_NAMELEN];
int drefcnt;
int crefcnt;
int flags;
int hversion;
int hmagic;
/*
* DSW move group structure
*/
typedef struct dsw_movegrp32_s {
char shadow_vol[DSW_NAMELEN];
char new_group[DSW_NAMELEN];
#endif /* _KERNEL */
/* dsw_copy dsw_ioctl_t flag bits */
/* nsc_control commands */
#ifdef __cplusplus
}
#endif
#endif /* _DSW_H */