fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
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 *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
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 *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _RDC_IOCTL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _RDC_IOCTL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/unistat/spcs_s.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/nsctl/nsctl.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef DS_DDICT
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <rpc/rpc.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _SunOS_5_6
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define netbuf32 netbuf
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/nsctl/model.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _rdc_ioctl_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte long arg0;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte long arg1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte long arg2;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte long arg3;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte long arg4;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte long magic;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte spcs_s_info_t ustatus;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte long pad[1];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} _rdc_ioctl_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _SYSCALL32
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _rdc_ioctl32_s {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t arg0;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t arg1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t arg2;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t arg3;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t arg4;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t magic;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte spcs_s_info32_t ustatus;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t pad[1];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} _rdc_ioctl32_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Ioctl command numbers
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _RDCI_(x) (('R'<<16)|('D'<<8)|(x))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Generic rdc ioctl arguments structure.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Individual ioctl's will use 0-n of these arguments.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Each rdc ioctl is described first by the command number
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * e.g. #define RDC_CONFIG _RDCI_(0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Followed by a description of each argument (if any).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Each argument is on a single line.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CONFIG _RDCI_(0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * rdc_config_t *user_configuration;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_ENABLE_SVR _RDCI_(1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * rdc_svc_args_t *daemon_configuration;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_STATUS _RDCI_(2)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * rdc_status_t *rdc_status;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_VERSION _RDCI_(3)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * rdc_version_t *rdc_version;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_LINK_DOWN _RDCI_(4)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * char *rdc_host;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_SYNC_EVENT _RDCI_(5)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * char *rdc_master;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * char *rdc_group;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_POOL_CREATE _RDCI_(6)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * struct svcpool_args *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_POOL_WAIT _RDCI_(7)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * int id
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_POOL_RUN _RDCI_(8)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * int id
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_BITMAPOP _RDCI_(9)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef DEBUG
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#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MAX_RDC_HOST_SIZE 64
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Change this when the ioctl structure changes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_MAGIC 0xf00d0001
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct rdc_addr {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct netbuf addr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char intf[MAX_RDC_HOST_SIZE];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char file[NSC_MAXPATH];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char bitmap[NSC_MAXPATH];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} rdc_addr_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _SYSCALL32
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct rdc_addr32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct netbuf32 addr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char intf[MAX_RDC_HOST_SIZE];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char file[NSC_MAXPATH];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char bitmap[NSC_MAXPATH];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * User level rdc set structure - must be a multiple of 64bits long.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct rdc_set {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rdc_addr_t primary;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rdc_addr_t secondary;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct knetconfig *netconfig;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte long align1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte double alignfix;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int flags; /* See RDC flags below */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int sync_flags; /* See RDC flags below */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int bmap_flags; /* See RDC flags below */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int mflags; /* RDC 1-to-many flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int index; /* 0 .. rdc_max_sets - 1 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int bits_set; /* Bits set in bitmap */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int autosync; /* Autosync on (1) or off (0) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int syshostid; /* for cluster integration */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int asyncthr; /* # of async threads */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int setid; /* unique set id for this set */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t sync_pos; /* Progress through sync */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t volume_size; /* Size of volume */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int64_t maxqfbas; /* max # of fbas on async q */
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} rdc_set_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _SYSCALL32
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct rdc_set32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct rdc_addr32 primary;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct rdc_addr32 secondary;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr32_t netconfig;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t align1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte double alignfix;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t flags; /* See RDC flags below */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t sync_flags; /* See RDC flags below */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t bmap_flags; /* See RDC flags below */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t mflags; /* RDC 1-to-many flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t index; /* 0 .. rdc_max_sets - 1 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t bits_set; /* Bits set in bitmap */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t autosync; /* Autosync on (1) or off (0) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t syshostid; /* for cluster integration */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t asyncthr; /* # of async threads */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t setid; /* unique set id for this set */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t sync_pos; /* Progress through sync */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t volume_size; /* Size of volume */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int64_t maxqfbas; /* max # of fbas on async q */
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};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Parameter structure to pass to RDC_CONFIG
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct rdc_config {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int command; /* RDC_CMD_XXX */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int options; /* RDC_OPT_XXX */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int pad[2]; /* Do NOT remove - 32/64-bit padding */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rdc_set_t rdc_set[1]; /* The rdc sets */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} rdc_config_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _SYSCALL32
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct rdc_config32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t command; /* RDC_CMD_XXX */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t options; /* RDC_OPT_XXX */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t pad[2]; /* Do NOT remove - 32/64-bit padding */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct rdc_set32 rdc_set[1]; /* The rdc sets */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_BITMAPSET 0x01
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_BITMAPOR 0x02
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct rdc_bitmap_op {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_off_t offset; /* byte offset within bitmap mod fba */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t op; /* or/set operation */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char sechost[MAX_RDC_HOST_SIZE];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char secfile[NSC_MAXPATH];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t len; /* length of bitmap in bytes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned long addr; /* address of bitmap in userland */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} rdc_bitmap_op_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _SYSCALL32
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct rdc_bitmap_op32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_off_t offset;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t op;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char sechost[MAX_RDC_HOST_SIZE];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char secfile[NSC_MAXPATH];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t addr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} rdc_bitmap_op32_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef DEBUG
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * structure to initiate an asynchronous send to the secondary,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * so we can test the queuing code.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct rdc_async6 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char sechost[MAX_RDC_HOST_SIZE];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char secfile[NSC_MAXPATH];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int pos; /* Position in file */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int seq;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int pat; /* fill data with this */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int idx; /* server returned index */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int spos; /* sub task start block */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int slen; /* sub task length */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int endind; /* set when last block in multi request */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} rdc_async6_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * structure to initiate a read on the secondary, so we can test the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * maxfba break up code.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct rdc_readgen {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char sechost[MAX_RDC_HOST_SIZE];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char secfile[NSC_MAXPATH];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int pos;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int idx;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int flag;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int rpcversion;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void *data; /* where to place the data from the read */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} rdc_readgen_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _SYSCALL32
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct rdc_readgen32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char sechost[MAX_RDC_HOST_SIZE];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char secfile[NSC_MAXPATH];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int pos;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int idx;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int flag;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int rpcversion;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr32_t data; /* where to place the data from the read */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} rdc_readgen32_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Config ioctl commands
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_ENABLE 1 /* New enable */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_DISABLE 2 /* Complete disable */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_RESUME 3 /* Local re-enable */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_SUSPEND 4 /* Local clear */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_LOG 5 /* Start logging mode */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_CMD_COPY 6 /* Start synching */
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_STATUS 11 /* Single set status */
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#define RDC_CMD_REPQ 19 /* replace queue */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Config ioctl options
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
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_PRIMARY 0x4 /* All */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_SECONDARY 0x8 /* All */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_FORWARD 0x10 /* RDC_CMD_COPY */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_REVERSE 0x20 /* RDC_CMD_COPY */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_FULL 0x40 /* RDC_CMD_COPY */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_UPDATE 0x80 /* RDC_CMD_COPY */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_SETBMP 0x100 /* RDC_CMD_ENABLE */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_OPT_CLRBMP 0x200 /* RDC_CMD_ENABLE */
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
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * RDC flags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Passed out by the kernel (status)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_ENABLED 0x2 /* RDC enabled */
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_SYNC_NEEDED 0x40 /* Sync is needed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_RSYNC_NEEDED 0x80 /* Reverse sync is needed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_SYNCING 0x100 /* Synch in progress */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_LOGGING 0x200 /* Logging */
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#ifndef RDC_QNOBLOCK
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_QNOBLOCK 0x10000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_SYNC_START 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_SYNC_DONE 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_RSYNC_START 2
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _KERNEL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * urdc->flags vs urdc->mflags usage:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * All flags are valid in urdc->flags, in which case the condition
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * holds for the specific urdc.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
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 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_GROUP 0x7f8 /* Volume states that affect a group */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Mask of volume flags that are valid in urdc->mflags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_MFLAGS (RDC_SLAVE | RDC_RSYNC_NEEDED)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_SLAVE(urdc) (rdc_get_mflags(urdc) & RDC_SLAVE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
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 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_SFLAGS (RDC_SYNC_NEEDED | RDC_RSYNC_NEEDED | \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte RDC_VOL_FAILED | RDC_CLR_AFTERSYNC)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
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 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_BFLAGS RDC_BMP_FAILED
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_VFLAGS (~(RDC_SFLAGS | RDC_BFLAGS))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RDC_SYNC_STATE_FLAGS (RDC_LOGGING | RDC_SYNCING | RDC_QUEUING | \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte RDC_ASYNC)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
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_SECONDARY(urdc) (!IS_PRIMARY(urdc))
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 !(rdc_get_vflags(urdc) & RDC_SYNCING))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _KERNEL */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct rdc_status {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int nset; /* Number of sets requested/enabled */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int maxsets; /* Max # of sets allowed today */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rdc_set_t rdc_set[1];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} rdc_status_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _SYSCALL32
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct rdc_status32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t nset; /* Number of sets requested/enabled */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t maxsets; /* Max # of sets allowed today */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct rdc_set32 rdc_set[1];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct rdc_svc_args {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int fd; /* Connection endpoint */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int nthr; /* Number of server threads */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char netid[128]; /* Identify transport */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct netbuf addrmask; /* Address mask for host */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} rdc_svc_args_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _SYSCALL32
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct rdc_svc_args32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t fd;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t nthr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char netid[128];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct netbuf32 addrmask;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct rdc_version {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int major; /* Major release number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int minor; /* Minor release number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int micro; /* Micro release number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int baseline; /* Baseline revison number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} rdc_version_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _SYSCALL32
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct rdc_version32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t major; /* Major release number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t minor; /* Minor release number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t micro; /* Micro release number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int32_t baseline; /* Baseline revison number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} rdc_version32_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if !defined(_KERNEL)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
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 Forte (long)(a3), (long)(a4), (ustatus))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
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
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* ! _KERNEL */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _RDC_IOCTL_H */