md_notify.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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_MD_NOTIFY_H
#define _SYS_MD_NOTIFY_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define MD_EVENT_ID (0xda1eab1e)
#define MD_NOTIFY_HALT_TRIES (4)
#define MD_NOTIFY_NAME_SIZE (64)
#define MD_NOTIFY_REVISION 1
/* mdn_flags bits in struct md_event_queue */
#define MD_EVENT_QUEUE_DESTROY (0x00000001)
#define MD_EVENT_QUEUE_INVALID (0x00000002)
#define MD_EVENT_QUEUE_FULL (0x00000008)
typedef enum md_event_type {
EQ_EMPTY = 0,
/* Configuration Changes */
EQ_CREATE = 1,
/* State Changes */
EQ_INIT_START = 0x00000400,
EQ_RESYNC_SUCCESS, /* resync has succeeded */
EQ_RESYNC_DONE, /* resync completed */
EQ_HOTSPARED, /* hot spare aquired for use */
EQ_HS_FREED, /* hotspare no longer in use */
EQ_HS_CHANGED, /* change of metadevice hotspare pool */
/* User defined event */
EQ_USER = 0x00100000,
/* Notify Specfic */
EQ_LAST }
typedef enum md_event_cmds {
EQ_NONE = 0x00000000,
EQ_ON = 0x00000001,
EQ_OFF = 0x00000002,
EQ_GET_NOWAIT = 0x00000010,
EQ_GET_WAIT = 0x00000040,
EQ_PUT = 0x00000020,
EQ_ALLVALID = 0x00000073
typedef enum md_tags {
} md_tags_t;
#pragma pack(4)
#endif
typedef struct md_event_ioctl {
int mdn_rev; /* revision number */
char mdn_name[MD_NOTIFY_NAME_SIZE];
/* queue name */
int mdn_flags; /* ioctl flags */
#pragma pack()
#endif
/* ioctl flags */
typedef enum notify_cmds_t
typedef struct notify {
}notify_t;
#ifdef _KERNEL
typedef struct md_event {
typedef struct md_event_queue {
char mdn_name[MD_NOTIFY_NAME_SIZE];
/* queue name */
int mdn_flags; /* queue flags */
int mdn_waiting; /* number of process waiting */
/*
* The remainder of this file defines items that are used for testing
* md_notify.
*/
/*
* Named services for testing
*/
#define MD_NOTIFY_REAP_OFF "notify turn reap off"
#define MD_NOTIFY_REAP_ON "notify turn reap on"
#define MD_NOTIFY_TEST_STATS "notify test statistics"
/*
* The MD_NOTIFY_TEST_STATS named service can be invoked to get md_notify
* to set the values of this structure. The md_tnotify module uses this
* structure.
*/
typedef struct md_notify_stats {
/* event queue. */
int mds_max_queue; /* Max. # events in notify queue. */
int mds_reap; /* events since last reap. */
int mds_reap_count; /* # events between reaps. */
int mds_reap_off; /* non-zero -> reaping is off. */
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_MD_NOTIFY_H */