25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * CDDL HEADER START
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * The contents of this file are subject to the terms of the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Common Development and Distribution License (the "License").
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * You may not use this file except in compliance with the License.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * or http://www.opensolaris.org/os/licensing.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * See the License for the specific language governing permissions
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * and limitations under the License.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * When distributing Covered Code, include this CDDL HEADER in each
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * If applicable, add the following below this CDDL HEADER, with the
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * fields enclosed by brackets "[]" replaced with your own identifying
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * information: Portions Copyright [yyyy] [name of copyright owner]
25cf1a301a396c38e8adf52c15f537b80d2483f7jl *
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * CDDL HEADER END
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Use is subject to license terms.
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#ifndef _FIOMP_H
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define _FIOMP_H
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#pragma ident "%Z%%M% %I% %E% SMI"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#ifdef __cplusplus
25cf1a301a396c38e8adf52c15f537b80d2483f7jlextern "C" {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#endif
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_TRUE 1
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_FALSE 0
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_MAX_STR 1024 /* same as FILENAME_MAX */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_PATH_ALL (-1)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* ioctl base */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPC ('f' << 8)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * ioctl for the meta management node
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* create a new multi-path */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPNEW (FIOMPC|0x0)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* encapsulate using devices */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPENCAP (FIOMPC|0x1)
25cf1a301a396c38e8adf52c15f537b80d2483f7jlstruct fiompdev {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int api_level; /* API level = 0 */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int inst_no; /* instance number */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl minor_t inst_minor; /* instance management node */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl minor_t user_minor; /* user access node */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int num; /* number of devices */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char **devs; /* device names */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int mpmode; /* multi pathing */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int autopath; /* automatic path change */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int block; /* able to block physical device */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int needsync; /* need synchronize path status */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl void *ext; /* for extension = NULL */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl};
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* get an instance device's information */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPDEVINFO (FIOMPC|0x2)
25cf1a301a396c38e8adf52c15f537b80d2483f7jlstruct fiomp_devinfo {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int inst_no; /* instance number */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char real_name[FIOMP_MAX_STR]; /* instance management node */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char user_path[FIOMP_MAX_STR]; /* user access path */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int path_num; /* number of paths */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int mpmode; /* multi pathing */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int autopath; /* automatic path change */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int block; /* able to block physical device */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int needsync; /* need synchronize path status */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl void *ext; /* for extension = NULL */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl};
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* get number of all instances */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPALLINSTNUM (FIOMPC|0x3)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* get all device's informations */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPALLDEVINFO (FIOMPC|0x4)
25cf1a301a396c38e8adf52c15f537b80d2483f7jlstruct fiomp_all_devinfo {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int num; /* number of instances */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl struct fiomp_devinfo *devinfo; /* device informations */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl};
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* keep 0x5 - 0xf for reserve */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * ioctl for instance management nodes
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* get max number of paths */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPMAXPATHNUM (FIOMPC|0x10)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* set the device's property */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPSETPROP (FIOMPC|0x11)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* get the device's property */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPGETPROP (FIOMPC|0x12)
25cf1a301a396c38e8adf52c15f537b80d2483f7jlstruct fiompprop {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char *iomp_name; /* instance name */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char *iomp_real_name;
25cf1a301a396c38e8adf52c15f537b80d2483f7jl /* instance management node (/devices) */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char *iomp_user_path; /* instance management node (/dev) */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char *iomp_status; /* status of the instance */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int num; /* number of paths */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char **iomp_path; /* target device nodes (/devices) */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char **iomp_logical_path; /* target device nodes (/dev) */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char **iomp_path_status; /* status of target devices */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char **iomp_path_block; /* access block */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl};
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* destroy the instance */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPDESTROY (FIOMPC|0x13)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* stop the path */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPSTOP (FIOMPC|0x14)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* start the path */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPSTART (FIOMPC|0x15)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* list all paths */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPLIST (FIOMPC|0x16)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* get the path status */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPSTATUS (FIOMPC|0x17)
25cf1a301a396c38e8adf52c15f537b80d2483f7jlstruct fiompstatus {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int pathnum; /* path number */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int status; /* FIOMP_STAT_xxxx */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char *message; /* some messages */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int block_status; /* access block status */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl void *ext; /* reservesd (= NULL) */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl};
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* status */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_STAT_ACTIVE PATH_STAT_ACTIVE
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_STAT_STANDBY PATH_STAT_STANDBY
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_STAT_STOP PATH_STAT_STOP
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_STAT_FAIL PATH_STAT_FAIL
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_STAT_DISCON PATH_STAT_DISCON
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_STAT_ENCAP PATH_STAT_ENCAP
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_STAT_EMPTY PATH_STAT_EMPTY
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* access block status */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_BSTAT_BLOCK 1
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_BSTAT_UNBLOCK 0
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* add, delete */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPADD (FIOMPC|0x18)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPDEL (FIOMPC|0x19)
25cf1a301a396c38e8adf52c15f537b80d2483f7jlstruct fiomppath {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int num; /* number of paths */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl char **devs; /* device names */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl};
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* active, stabdby */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPACTIVE (FIOMPC|0x1a)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPSTANDBY (FIOMPC|0x1b)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* block, unblock */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPBLOCK (FIOMPC|0x1c)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPUNBLOCK (FIOMPC|0x1d)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* diagnostic mode ON,OFF */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPDIAGON (FIOMPC|0x1e)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPDIAGOFF (FIOMPC|0x1f)
25cf1a301a396c38e8adf52c15f537b80d2483f7jlstruct fiomp_diag_mode {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int pathnum; /* path for diagnostic */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int level; /* = 0 */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl};
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* get all status */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPGETALLSTAT (FIOMPC|0x20)
25cf1a301a396c38e8adf52c15f537b80d2483f7jlstruct fiomp_all_stat {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int num; /* number of paths */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl struct fiompstatus *status; /* path status */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl};
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* change the status of paths */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPCHG (FIOMPC|0x21)
25cf1a301a396c38e8adf52c15f537b80d2483f7jlstruct fiompchg {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int num; /* number of all paths */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl struct fiompstatus *set_status; /* setting values */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl struct fiompstatus *pre_status; /* previous values */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl struct fiompstatus *status; /* current values */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl};
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* recover the failed path */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPRECOVER (FIOMPC|0x22)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* disconnect/reconnect the path */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPDISCONNECT (FIOMPC|0x23)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPCONNECT (FIOMPC|0x24)
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* keep 0x25 - 0x2f for reserve */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Common ioctl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* get event */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMPGETEVENT (FIOMPC|0x30)
25cf1a301a396c38e8adf52c15f537b80d2483f7jlstruct fiompevent {
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int event; /* event type = FIOMP_EVT_xx */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl int num; /* instance number(meta management) or */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl /* number of all path(instance management) */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl struct fiompstatus *pre_status; /* previous status */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl struct fiompstatus *status; /* current status */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl};
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/* event type */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_EVT_NONE 0x0
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_EVT_NEW 0x1
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_EVT_DESTROY 0x2
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_EVT_STAT 0x101
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_EVT_PATHS 0x102
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl/*
25cf1a301a396c38e8adf52c15f537b80d2483f7jl * Device property
25cf1a301a396c38e8adf52c15f537b80d2483f7jl */
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_PROP_NAME "iomp-name"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_PROP_REAL_NAME "iomp-real-name"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_PROP_PATH_N "iomp-path-"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_PROP_USER_PATH "iomp-user-path"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_PROP_LOGIC_PATH_N "iomp-logical-path-"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_PROP_STATUS "iomp-status"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_PROP_PATH_NUM "iomp-path-num"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_PROP_STATUS_N "iomp-path-status-"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_PROP_BLOCK_N "iomp-path-block-"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#define FIOMP_PROP_BLOCK_DEFAULT "iomp-path-block-default"
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#ifdef __cplusplus
25cf1a301a396c38e8adf52c15f537b80d2483f7jl}
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#endif
25cf1a301a396c38e8adf52c15f537b80d2483f7jl
25cf1a301a396c38e8adf52c15f537b80d2483f7jl#endif /* _FIOMP_H */