/*
* 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.
*/
/*
* SDBC user level ioctl interface
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <strings.h>
static int __sdbc_fd;
static int
__sdbc_open(void)
{
int fd;
if (fd >= 0)
if (fd < 0)
return (-1);
}
static void
sv_list()
{
if (fd < 0)
if (fd < 0)
return;
return;
if (svn_system == NULL)
return;
/* Grab the system list from the driver */
}
int
{
int rc;
if (!__sdbc_fd && __sdbc_open() < 0)
return (-1);
switch (cmd) {
/*
* These ioctls work on open cache descriptors. The sv_list() function
* has the side-effect of re-opening all configured descriptors.
* Without this call, devices seem to "disappear" from the system when
* certain reconfiguration operations, for example II or SNDR disable,
* are done.
* It does rely on SV being configured, so in an STE-only environment
* the disappearing will still seem to happen.
*/
case SDBC_SET_CD_HINT:
case SDBC_GET_CD_HINT:
case SDBC_STATS:
case SDBC_GET_CD_BLK:
case SDBC_INJ_IOERR:
case SDBC_CLR_IOERR:
sv_list();
break;
default:
break;
}
} else {
}
return (rc);
}