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_NCALLIO_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _NSC_NCALLIO_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef __NSC_GEN__
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteError: Illegal #include - private file.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/types.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/nsctl/nsc_dev.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/nsctl/nsctl.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ncall-io structures
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * local per-device info structure
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct nsc_ncio_dev {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct nsc_ncio_dev *next; /* linkage */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char path[NSC_MAXPATH]; /* pathname */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t phash; /* path hash */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t partsize; /* size (FBAs) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int snode; /* server node */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int ref; /* ref count */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} nsc_ncio_dev_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * on the wire partsize request structure (reply is inline).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct nsc_ncio_size {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char path[NSC_MAXPATH];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} nsc_ncio_size_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * buffer handle and one the wire representation.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NSC_NCIO_MAXDATA (NCALL_DATA_SZ - FBA_SIZE(1))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct nsc_ncio_rw {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int snode; /* server node */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t pos; /* offset of i/o */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t len; /* length of i/o */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char path[NSC_MAXPATH]; /* path of device */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } rw;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char pad[FBA_SIZE(1)]; /* pad to FBA */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } rw_u;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char rw_data[NSC_NCIO_MAXDATA]; /* data */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} nsc_ncio_rw_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define rw_snode rw_u.rw.snode
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define rw_path rw_u.rw.path
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define rw_pos rw_u.rw.pos
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define rw_len rw_u.rw.len
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct nsc_ncio_bufh {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_buf_t bufh;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_vec_t vec[2];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void (*disc)();
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct nsc_ncio_bufh *next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct nsc_ncio_rw rw;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} nsc_ncio_buf_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _NSC_NCALLIO_H */