/*
* 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.
*/
/*
* Media independent RPC-like comms
*/
#ifdef DS_DDICT
#endif
#include "ncall.h"
#include "ncall_module.h"
/*
* cb_ops functions.
*/
static int ncallprint(dev_t, char *);
nulldev, /* open */
nulldev, /* close */
nulldev, /* strategy */
nodev, /* dump */
nodev, /* read */
nodev, /* write */
nodev, /* devmap */
nodev, /* mmap */
nodev, /* segmap */
nochpoll, /* poll */
NULL, /* NOT a stream */
nodev, /* aread */
nodev, /* awrite */
};
/*
* dev_ops functions.
*/
0,
nulldev, /* identify */
nulldev, /* probe */
nodev, /* reset */
(struct bus_ops *)0,
NULL /* power */
};
/*
* Module linkage.
*/
extern struct mod_ops mod_driverops;
"nws:Kernel Call:" ISS_VERSION_STR,
};
&modldrv,
0
};
typedef struct ncall_modinfo_s {
static int ncall_active;
static int ncallgetnodes(intptr_t, int, int *);
extern void ncall_init_stub(void);
int
_init(void)
{
int error;
return (error);
}
return (0);
}
int
_fini(void)
{
int error;
return (error);
return (error);
}
int
{
}
static int
{
switch (cmd) {
case DDI_ATTACH:
0, DDI_PSEUDO, 0) != DDI_SUCCESS)
goto failed;
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
static int
{
switch (cmd) {
case DDI_DETACH:
/*
* If still active, then refuse to detach.
*/
return (DDI_FAILURE);
/*
* Remove all minor nodes.
*/
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
}
/* ARGSUSED */
static int
{
switch (infocmd) {
case DDI_INFO_DEVT2DEVINFO:
rc = DDI_SUCCESS;
break;
case DDI_INFO_DEVT2INSTANCE:
/*
* We only have a single instance.
*/
*result = 0;
rc = DDI_SUCCESS;
break;
default:
break;
}
return (rc);
}
/* ARGSUSED */
static int
{
return (0);
}
int
{
int rc = 0;
return (EINVAL);
ncall_modules = new;
} else {
}
return (rc);
}
int
{
rc = 0;
break;
}
}
return (rc);
}
static int
ncall_stop(void)
{
int rc = 0;
}
return (rc);
}
/* ARGSUSED */
{
int mirror;
int rc = 0;
*rvalp = 0;
return (rc);
switch (cmd) {
case NC_IOC_START:
if (ncall_active) {
break;
}
return (EFAULT);
ncall_active = 1;
break;
case NC_IOC_STOP:
ncall_active = 0;
rc = ncall_stop();
break;
case NC_IOC_GETNODE:
if (!ncall_active) {
break;
}
sizeof (ncall_nodeinfo), mode) < 0) {
break;
}
/*
* can't return -1, as this will mask the ioctl
* failure, so return 0.
*/
if (mirror == -1)
mirror = 0;
break;
case NC_IOC_GETNETNODES:
break;
case NC_IOC_PING:
if (!ncall_active) {
break;
}
break;
}
break;
default:
break;
}
return (rc);
}
void
{
if (ncall_modules)
}
void
{
if (ncall_modules)
}
int
{
if (ncall_modules)
else
return (0);
}
char *
{
if (ncall_modules)
else
return ("unknown");
}
int
{
if (ncall_modules)
else
return (-1);
}
int
ncall_self(void)
{
if (ncall_modules)
else
return (-1);
}
int
{
if (ncall_modules)
return (rc);
}
int
struct timeval *t, ...)
{
if (ncall_modules)
return (rc);
}
int
void *vptr, ...)
{
if (ncall_modules)
return (rc);
}
int
struct timeval *t, ...)
{
if (ncall_modules)
return (rc);
}
int
{
if (ncall_modules)
return (rc);
}
int
{
if (ncall_modules)
return (rc);
}
void
{
if (ncall_modules)
}
void
{
if (ncall_modules)
}
int
{
if (ncall_modules)
return (rc);
}
int
{
if (ncall_modules)
return (rc);
}
int
{
if (ncall_modules)
return (rc);
}
void
{
if (ncall_modules) {
}
}
void
{
if (ncall_modules)
}
void
{
if (ncall_modules)
}
int
{
if (ncall_modules)
return (rc);
}
int
{
int rc = 0;
if (ncall_modules)
return (rc);
}
int
{
int rc = 0;
if (ncall_modules)
return (rc);
}
int
{
if (ncall_modules)
return (rc);
}
static int
{
int slot;
int rc;
int nodecnt;
int nodeid;
void *sequence;
char *nodename;
rc = 0;
nodecnt = ncall_maxnodes();
if (nodecnt <= 0) {
return (ENONET);
}
/*
* If the user passes up a null address argument, then
* maximum, so space can be correctly allocated.
*/
return (0);
}
slot = 0;
/*
* There is a small window where nextnode can
* return a valid nodeid, and it being disabled
* which will get nodename to return "".
* Discard the nodeid if this happens.
*/
/*
* make sure its null terminated when it
* gets to userland.
*/
size);
slot++;
}
}
mode) < 0) {
} else {
/*
* tell them how many have come back.
*/
}
return (rc);
}