tvhci.c revision a195726fa33097e56cf1c25c31feddb827e140f0
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * CDDL HEADER START
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * The contents of this file are subject to the terms of the
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * Common Development and Distribution License, Version 1.0 only
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * (the "License"). You may not use this file except in compliance
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * with the License.
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * or http://www.opensolaris.org/os/licensing.
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * See the License for the specific language governing permissions
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * and limitations under the License.
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * When distributing Covered Code, include this CDDL HEADER in each
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * If applicable, add the following below this CDDL HEADER, with the
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * fields enclosed by brackets "[]" replaced with your own identifying
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * information: Portions Copyright [yyyy] [name of copyright owner]
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * CDDL HEADER END
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * Use is subject to license terms.
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore#pragma ident "%Z%%M% %I% %E% SMI"
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore * The tvhci driver can be used to exercise the mpxio framework together
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amore/* cb_ops entry points */
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amorestatic int tvhci_open(dev_t *, int, int, cred_t *);
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amorestatic int tvhci_close(dev_t, int, int, cred_t *);
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amorestatic int tvhci_ioctl(dev_t, int, intptr_t, int, cred_t *, int *);
4297a3b0d0a35d80f86fff155e288e885a100e6dGarrett D'Amorestatic int tvhci_attach(dev_info_t *, ddi_attach_cmd_t);
dev_info_t **);
static void *tvhci_state;
struct tvhci_state {
&modldrv,
_init(void)
int rval;
return (rval);
return (rval);
_fini(void)
int rval;
return (rval);
return (rval);
return (EINVAL);
return (ENXIO);
return (EINVAL);
return (ENXIO);
char *vclass;
switch (cmd) {
case DDI_ATTACH:
case DDI_RESUME:
case DDI_PM_RESUME:
return (DDI_FAILURE);
return (DDI_FAILURE);
goto attach_fail;
goto attach_fail;
goto attach_fail;
vhci_regis++;
goto attach_fail;
return (DDI_SUCCESS);
if (vhci_regis)
return (DDI_FAILURE);
switch (cmd) {
case DDI_DETACH:
case DDI_SUSPEND:
case DDI_PM_SUSPEND:
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_SUCCESS);
switch (cmd) {
case DDI_INFO_DEVT2DEVINFO:
return (DDI_FAILURE);
case DDI_INFO_DEVT2INSTANCE:
return (DDI_FAILURE);
return (DDI_SUCCESS);
return (MDI_SUCCESS);
return (MDI_SUCCESS);
return (MDI_SUCCESS);
return (MDI_SUCCESS);
return (DDI_FAILURE);
switch (ctlop) {
case DDI_CTLOPS_REPORTDEV:
return (DDI_FAILURE);
return (DDI_SUCCESS);
case DDI_CTLOPS_INITCHILD:
case DDI_CTLOPS_UNINITCHILD:
case DDI_CTLOPS_DMAPMAPC:
case DDI_CTLOPS_REPORTINT:
case DDI_CTLOPS_REGSIZE:
case DDI_CTLOPS_NREGS:
case DDI_CTLOPS_SIDDEV:
case DDI_CTLOPS_SLAVEONLY:
case DDI_CTLOPS_AFFINITY:
case DDI_CTLOPS_POKE:
case DDI_CTLOPS_PEEK:
return (DDI_FAILURE);
case DDI_CTLOPS_ATTACH:
case DDI_CTLOPS_BTOP:
case DDI_CTLOPS_BTOPR:
case DDI_CTLOPS_DETACH:
case DDI_CTLOPS_DVMAPAGESIZE:
case DDI_CTLOPS_IOMIN:
case DDI_CTLOPS_POWER:
case DDI_CTLOPS_PTOB:
return (DDI_FAILURE);
return (DDI_SUCCESS);
return (DDI_SUCCESS);
return (pname);
return (rval);
while (ph) {
== DDI_SUCCESS) {
return (rval);
while (ph) {
return (rval);
char *devnm;
int circ;
switch (op) {
case BUS_CONFIG_ONE:
case BUS_CONFIG_ALL:
case BUS_CONFIG_DRIVER:
return (DDI_FAILURE);
switch (op) {
case BUS_UNCONFIG_ONE:
return (DDI_SUCCESS);
case BUS_UNCONFIG_ALL:
return (rval);
case BUS_UNCONFIG_DRIVER:
return (DDI_FAILURE);