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 _NSC_IOCTL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _NSC_IOCTL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/dkio.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/vtoc.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef DKIOCPARTITION
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/efi_partition.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Ioctl definitions for Storage Device.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _NSC_(x) (('S'<<16)|('D'<<8)|(x))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_OPEN _NSC_(1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_RESERVE _NSC_(2)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_RELEASE _NSC_(3)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_PARTSIZE _NSC_(4)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_FREEZE _NSC_(5)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_UNFREEZE _NSC_(6)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_ISFROZEN _NSC_(7)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_POWERMSG _NSC_(8) /* UPS/PCU power state */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_NSKERND _NSC_(9)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_GLOBAL_SIZES _NSC_(10) /* size of RM segs */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_GLOBAL_DATA _NSC_(11)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_NVMEM_CLEAN _NSC_(12) /* mark nvm nsc_global clean */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_NVMEM_CLEANF _NSC_(13) /* force mark clean */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSCIOC_BSIZE _NSC_(14) /* get partition size */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Structure definitions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct nscioc_open {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char path[NSC_MAXPATH]; /* Pathname */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int flag; /* Flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int mode; /* Open modes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int pad[15];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct nscioc_partsize {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t partsize;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct nskernd {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t data1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t data2;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char char1[NSC_MAXPATH];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char char2[NSC_MAXPATH];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int command;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct nscioc_bsize {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t vtoc; /* (struct vtoc *) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t dki_info; /* (struct dk_cinfo *) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t raw_fd; /* dev_t of slice/partition */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t p64; /* (struct partition64 *) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int efi; /* do we have an EFI partition table? */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _KERNEL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nskernd_command(intptr_t, int, int *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nskern_bsize(struct nscioc_bsize *, int *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _NSC_IOCTL_H */