fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Ioctl command numbers
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Generic rdc ioctl arguments structure.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Individual ioctl's will use 0-n of these arguments.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Each rdc ioctl is described first by the command number
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * e.g. #define RDC_CONFIG _RDCI_(0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Followed by a description of each argument (if any).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Each argument is on a single line.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * rdc_config_t *user_configuration;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * rdc_svc_args_t *daemon_configuration;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * rdc_status_t *rdc_status;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * rdc_version_t *rdc_version;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * char *rdc_host;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * char *rdc_master;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * char *rdc_group;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * struct svcpool_args *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_ASYNC6 _RDCI_(20) /* send async message by hand */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CLRKSTAT _RDCI_(21) /* clear kstat_io structure */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_STALL0 _RDCI_(22) /* stall sequence 0 on server */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_READGEN _RDCI_(23) /* cause a read on server */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Change this when the ioctl structure changes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * User level rdc set structure - must be a multiple of 64bits long.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int64_t maxqitems; /* max # of items on async q */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char group_name[NSC_MAXPATH]; /* Group the set belongs to */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char direct_file[NSC_MAXPATH]; /* Local FCAL direct io file */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char disk_queue[NSC_MAXPATH]; /* Disk Queue for set|group */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t autosync; /* Autosync on (1) or off (0) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int64_t maxqitems; /* max # of items on async q */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char group_name[NSC_MAXPATH]; /* Group the set belongs to */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char direct_file[NSC_MAXPATH]; /* Local FCAL direct io file */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char disk_queue[NSC_MAXPATH]; /* Disk Queue for set|group */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Parameter structure to pass to RDC_CONFIG
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int pad[2]; /* Do NOT remove - 32/64-bit padding */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t pad[2]; /* Do NOT remove - 32/64-bit padding */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_off_t offset; /* byte offset within bitmap mod fba */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned long addr; /* address of bitmap in userland */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * structure to initiate an asynchronous send to the secondary,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * so we can test the queuing code.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int endind; /* set when last block in multi request */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * structure to initiate a read on the secondary, so we can test the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * maxfba break up code.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void *data; /* where to place the data from the read */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr32_t data; /* where to place the data from the read */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Config ioctl commands
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_RECONFIG 7 /* Change the rdc set */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_TUNABLE 8 /* Change a tunable parameter */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_WAIT 9 /* Wait for syncs to complete */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_HEALTH 10 /* Return health state */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_RESET 12 /* reset error or failed status */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_INITQ 14 /* initialise the disk queue */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_FLUSHQ 15 /* flush queue for set */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_ADDQ 16 /* add diskq to a set/group */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_REMQ 17 /* nice remove a diskq from set/grp */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_KILLQ 18 /* forced disgard of queue */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Config ioctl options
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_SYNC 0x1 /* RDC_CMD_ENABLE, RDC_CMD_RESUME */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_ASYNC 0x2 /* RDC_CMD_ENABLE, RDC_CMD_RESUME */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_REVERSE_ROLE 0x400 /* RDC_CMD_RECONFIG */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_FORCE_QINIT 0x800 /* RDC_CMD_INITQ */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_SET_QNOBLOCK 0x1000 /* RDC_CMD_TUNABLE */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_CLR_QNOBLOCK 0x2000 /* RDC_CMD_TUNABLE */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_FORCE_DISABLE 0x4000 /* RDC_CMD_DISABLE */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Passed out by the kernel (status)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_PRIMARY 0x4 /* This node is the primary */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_SLAVE 0x8 /* This node is target of the synch */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_VOL_FAILED 0x10 /* Volume is failed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_BMP_FAILED 0x20 /* Bitmap is failed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_RSYNC_NEEDED 0x80 /* Reverse sync is needed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_FCAL_FAILED 0x400 /* Direct remote I/O failed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_ASYNC 0x800 /* Set is in async replicating mode */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_FULL 0x1000 /* Full sync, not an update */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CLR_AFTERSYNC 0x2000 /* clr bitmap on secondary after sync */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_DISKQ_FAILED 0x4000 /* Diskq I/O has failed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_QUEUING 0x8000 /* logging, but queueing to disk */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * urdc->flags vs urdc->mflags usage:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * All flags are valid in urdc->flags, in which case the condition
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * holds for the specific urdc.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The flags in RDC_MFLAGS can also be in urdc->mflags, in which case
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the condition holds for a urdc somewhere on the many/multi chains
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * connected to this urdc.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_GROUP 0x7f8 /* Volume states that affect a group */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Mask of volume flags that are valid in urdc->mflags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_SLAVE(urdc) (rdc_get_mflags(urdc) & RDC_SLAVE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Mask of volume flags that are maintained in sync_flags not flags,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and protected by rdc_many_lock rather than the group lock.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This allows code that is operating on one set to change the flags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * of another set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_SFLAGS (RDC_SYNC_NEEDED | RDC_RSYNC_NEEDED | \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Mask of volume flags that are maintained in bmap_flags not flags,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and protected by the bmapmutex rather than the group lock.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_SYNC_STATE_FLAGS (RDC_LOGGING | RDC_SYNCING | RDC_QUEUING | \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_ASYNC(urdc) (rdc_get_vflags(urdc) & RDC_ASYNC)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_PRIMARY(urdc) (rdc_get_vflags(urdc) & RDC_PRIMARY)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_STATE(urdc, state) (rdc_get_vflags(urdc) & (state))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_REPLICATING(urdc) (!(rdc_get_vflags(urdc) & RDC_LOGGING) && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _KERNEL */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t nset; /* Number of sets requested/enabled */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t maxsets; /* Max # of sets allowed today */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct netbuf addrmask; /* Address mask for host */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_IOCTL(cmd, a0, a1, a2, a3, a4, ustatus) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rdc_ioctl((long)(cmd), (long)(a0), (long)(a1), (long)(a2), \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int rdc_ioctl(long, long, long, long, long, long, spcs_s_info_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int rdc_ioctl_simple(long, void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* ! _KERNEL */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _RDC_IOCTL_H */