/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_NSCTL_H
#define _SYS_NSCTL_H
#ifdef __cplusplus
extern "C" {
#endif
#define __NSC_GEN__
#endif
/*
* nsctl multi-terabyte volume support
*
* To build a multi-terabyte stack, '#define NSC_MULTI_TERABYTE'.
*/
#ifdef NSC_MULTI_TERABYTE
#ifdef _LP64
#else
#endif
#else /* max 1TB volume size */
typedef int nsc_off_t;
typedef int nsc_size_t;
#endif
#ifdef _KERNEL
#ifdef sun
#endif
/*
* Generic parameter definition.
*/
typedef struct nsc_def_s {
} nsc_def_t;
#endif /* _KERNEL */
/* ID and Type flags */
typedef enum nsc_power_ops_e {
/* with timeleft (rideout) minutes */
/* be shutdown, save any state */
#ifdef _KERNEL
/* Module Flags */
#ifndef _NSC_DEV_H
#endif
extern int nsc_unregister_io(nsc_io_t *, int);
extern int nsc_unregister_path(nsc_path_t *, int);
extern int nsc_cache_sizes(int *, int *);
extern int nsc_node_hints(unsigned int *);
extern int nsc_node_hints_set(unsigned int);
extern int nsc_unregister_power(blind_t);
/*
* Strategy function interface
*/
#ifndef DS_DDICT
#endif
extern void *nsc_get_devops(major_t);
#endif /* _KERNEL */
/* Block sizes */
/* bytes to fba */
/* Return values */
#define NSC_DONE (0)
/*
* External file descriptor.
*/
#ifndef _NSC_DEV_H
#endif
#endif /* _KERNEL || _KMEMUSER */
#ifdef _KERNEL
extern char *nsc_pathname(nsc_fd_t *);
extern int nsc_shared(nsc_fd_t *);
extern int nsc_setval(nsc_fd_t *, char *, int);
extern int nsc_getval(nsc_fd_t *, char *, int *);
extern int nsc_attach(nsc_fd_t *, int);
extern int nsc_reserve(nsc_fd_t *, int);
extern void nsc_reserve_lk(nsc_fd_t *);
extern void nsc_release(nsc_fd_t *);
extern int nsc_release_lk(nsc_fd_t *);
extern int nsc_detach(nsc_fd_t *, int);
extern int nsc_waiting(nsc_fd_t *);
extern int nsc_get_pinned(nsc_fd_t *);
extern int nsc_max_devices(void);
extern int nsc_control(nsc_fd_t *, int, void *, int);
#endif /* _KERNEL */
/*
* I/O device structure.
*/
#ifndef _NSC_DEV_H
#endif
#ifdef _KERNEL
#endif
/*
* Data structures used by I/O interface.
*/
} nsc_vec_t;
} nsc_buf_t;
#endif /* _KERNEL || _KMEMUSER */
/* Allocate flags */
/* Other flags */
#ifdef _KERNEL
extern int nsc_free_buf(nsc_buf_t *);
void (*)(), void (*)(), void (*)());
extern int nsc_free_handle(nsc_buf_t *);
extern int nsc_uwrite(nsc_fd_t *, void *, void *);
#endif /* _KERNEL */
/*
* Performance hints.
*/
#ifdef _KERNEL
/*
* node hint actions
*/
#define NSC_GET_NODE_HINT 0
/*
* Reflective memory spinlocks.
*/
#ifndef _NSC_RMSPIN_H
#endif
extern nsc_rmlock_t *nsc_rm_lock_alloc(char *, int, void *);
extern void nsc_rm_lock_dealloc(nsc_rmlock_t *);
extern int nsc_rm_lock(nsc_rmlock_t *);
extern void nsc_rm_unlock(nsc_rmlock_t *);
#endif /* _KERNEL */
/*
* Memory allocation routines.
*/
#ifdef _KERNEL
#ifndef _NSC_MEM_H
#endif
extern nsc_mem_t *nsc_register_mem(char *, int, int);
extern void nsc_unregister_mem(nsc_mem_t *);
extern void nsc_kmem_free(void *, size_t);
/* nvmem suppport */
extern void nsc_cm_errhdlr(void *, void *, size_t, int);
#endif /* _KERNEL */
/*
* Max pathname
* Note: Currently defined both here and in nsc_dev.h
*/
#if !defined(NSC_MAXPATH)
#endif
#ifdef _KERNEL
/*
* Inter-module function (callback) services
*/
#ifndef _NSC_GEN_H
#endif
extern int nsc_unregister_svc(nsc_svc_t *);
/*
* String manipulation functions.
*/
#ifndef sun
#endif /* sun */
extern char *nsc_strdup(char *);
extern void nsc_strfree(char *);
extern int nsc_strmatch(char *, char *);
extern void nsc_sprintf(char *, char *, ...);
extern uint64_t nsc_strhash(char *);
/*
* Macro definitions.
*/
#ifndef NULL
#define NULL 0
#endif
/*
* External definitions.
*/
extern int nsc_max_nodeid, nsc_min_nodeid;
extern int nsc_node_id(void);
extern char *nsc_node_name(void);
extern int nsc_node_up(int);
extern int nsc_delay_sig(clock_t);
extern void nsc_yield(void);
extern void nsc_membar_stld(void);
extern caddr_t nsc_caller(void);
extern caddr_t nsc_callee(void);
extern int nsc_create_process(void (*)(void *), void *, boolean_t);
extern int nsc_power_init(void);
extern void nsc_power_deinit(void);
extern int nsc_nodeid_data(void);
extern void nsc_do_sysevent(char *, char *, int, int, char *, dev_info_t *);
/*
*/
#if defined(_SYS_CONF_H)
#ifndef D_MP
#define D_MP 0
#endif
#endif
extern void *nsc_threadp(void);
#endif /* _KERNEL */
/*
* Common defines
*/
#ifndef TRUE
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NBBY
#endif
/*
* kstat definition
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_NSCTL_H */