/*
* 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.
*/
#define __NSC_GEN__
#include "nsc_dev.h"
#include "nsc_ncallio.h"
#include "../nsctl.h"
extern nsc_mem_t *_nsc_local_mem;
extern void _nsc_init_ncio(void);
extern void _nsc_deinit_ncio(void);
/*
* ncall-io io provider - client side.
*/
static int
{
char *cp;
int i, snode;
snode = 0;
i = *cp - '0';
if (i < 0 || i > 9)
break;
}
if (*cp != ':') {
"ncio: failed to convert %s to node and path",
return (-1);
}
return (snode);
}
/*
* nsc_ncio_open()
*
* The pathname that is used with the NSC_NCALL io provider should be
* of the form "<node>:<pathname>", where <node> is the decimal ncall
* nodeid of the server machine and <pathname> is the pathname of the
* device on the server node.
*/
/* ARGSUSED */
static int
{
int snode;
if (snode < 0)
return (EINVAL);
if (new) {
}
break;
nsc_ncio_top = ncp;
}
if (new)
if (!ncp)
return (ENOMEM);
return (0);
}
static int
{
return (EINVAL);
found = 0;
free = 0;
found = 1;
break;
}
}
if (!found) {
return (ENODEV);
}
free = 1;
}
if (free)
return (0);
}
/* ARGSUSED1 */
static nsc_buf_t *
{
nsc_ncio_buf_t *h;
if ((h = nsc_kmem_zalloc(sizeof (*h), KM_SLEEP,
_nsc_local_mem)) == NULL)
return (NULL);
return (&h->bufh);
}
static int
{
nsc_kmem_free(h, sizeof (*h));
return (0);
}
static int
{
int ncall_flag;
int ncall_proc;
int ncall_len;
return (EIO);
return (EINVAL);
}
if (!len)
return (0);
return (0);
/* CONSTCOND */
if (sizeof (*rw) > NCALL_DATA_SZ) {
/* CONSTCOND */
return (ENXIO);
}
} else {
ncall_flag = 0;
}
if (rwflag == 0) {
/* zero */
}
if (h->disc)
(*h->disc)(h);
if (rc != 0) {
return (rc);
}
if (rc != 0) {
return (rc);
}
if (rc != 0) {
return (rc);
}
}
if (rc != 0) {
return (rc);
}
}
return (0);
}
static int
{
}
static int
{
}
static int
{
}
static void
{
/* CONSTCOND */
while (1) {
/* found overlapping io in progress */
break;
}
}
if (!hp)
break;
if (fn) {
(*fn)(h);
}
}
}
static int
{
int wake = 0;
break;
}
wake = 1;
}
}
if (wake)
}
/* clear flags, preserve NSC_HALLOCATED */
(void) nsc_ncio_freeh(h);
return (0);
}
static int
{
nsc_ncio_buf_t *h = *hp;
int rc;
if (h == NULL) {
return (EIO);
}
/* too large */
return (ENXIO);
}
}
if (h->disc)
(*h->disc)(h);
}
return (NSC_DONE);
nsc_wait_ncio(h);
(void) nsc_ncio_freeb(h);
return (rc);
}
}
return (NSC_DONE);
}
static int
{
return (0);
}
/* ARGSUSED */
static int
{
if (flag == NSC_CACHEBLK)
*ptr = 1;
else
return (0);
}
static int
{
/* CONSTCOND */
if (sizeof (*size) > NCALL_DATA_SZ) {
/* CONSTCOND */
return (ENXIO);
}
if (rc != 0) {
return (rc);
}
if (rc != 0)
return (rc);
if (rc != 0)
return (0);
return (0);
}
{ "Provide", NSC_NCALL, 0 },
{ 0, 0, 0 }
};
/*
* ncall-io io provider - server side.
*/
/* ARGSUSED1 */
static void
{
int rc;
if (rc != 0) {
return;
}
return;
}
if (rc != 0) {
return;
}
/* CONSTCOND */
if (sizeof (nsc_size_t) > sizeof (int)) {
}
}
static int
{
char *datap;
int rc;
rc = 0;
while (tocopy > 0) {
break;
}
if (read) {
} else {
}
vec++;
}
return (rc);
}
/* ARGSUSED */
static void
{
int ioflag;
int rc;
if (rc != 0) {
return;
}
return;
}
if (rc != 0) {
return;
}
if (rc > 0) {
(void) nsc_free_buf(bufp);
}
return;
}
if (rc == 0) {
if (read) {
/* store reply data */
} else {
/* write new data */
}
}
(void) nsc_free_buf(bufp);
}
static void
{
}
static void
{
}
/*
* ncall-io io provider - setup.
*/
void
_nsc_init_ncio(void)
{
if (!nsc_ncio_io)
}
void
_nsc_deinit_ncio(void)
{
if (nsc_ncio_io)
(void) nsc_unregister_io(nsc_ncio_io, 0);
nsc_ncio_io = NULL;
}