/*
* 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 SBUSMEM_DEBUG */
#ifdef SBUSMEM_DEBUG
#include <sys/ddi_impldefs.h>
int sbusmem_debug_flag;
#endif /* SBUSMEM_DEBUG */
static void *sbusmem_state_head;
struct sbusmem_unit {
};
sbmem_open, /* open */
sbmem_close, /* close */
nodev, /* strategy */
nodev, /* print */
nodev, /* dump */
sbmem_read, /* read */
sbmem_write, /* write */
nodev, /* ioctl */
sbmem_devmap, /* devmap */
nodev, /* mmap */
ddi_devmap_segmap, /* segmap */
nochpoll, /* poll */
ddi_prop_op, /* cb_prop_op */
0, /* streamtab */
CB_REV, /* rev */
nodev, /* int (*cb_aread)() */
nodev /* int (*cb_awrite)() */
};
DEVO_REV, /* devo_rev, */
0, /* refcnt */
sbmem_info, /* get_dev_info */
nulldev, /* identify */
nulldev, /* probe */
sbmem_attach, /* attach */
sbmem_detach, /* detach */
nodev, /* reset */
&sbmem_cb_ops, /* driver operations */
(struct bus_ops *)0, /* bus operations */
nulldev, /* power */
ddi_quiesce_not_needed, /* quiesce */
};
&mod_driverops, /* Type of module. This one is a driver */
"SBus memory driver", /* Name of module. */
&sbmem_ops, /* driver ops */
};
};
#if !defined(lint)
#endif
int
_init(void)
{
int error;
sizeof (struct sbusmem_unit), 1)) != 0) {
return (error);
}
}
return (error);
}
int
_fini(void)
{
int error;
}
return (error);
}
int
{
}
static int
{
char *ident;
switch (cmd) {
case DDI_ATTACH:
#ifdef SBUSMEM_DEBUG
"sbmem_attach%d: No size property\n", instance);
#endif /* SBUSMEM_DEBUG */
break;
}
#ifdef SBUSMEM_DEBUG
{
"sbmem_attach%d: No reg property\n", instance);
} else {
"sbmem_attach%d: slot 0x%x size 0x%x\n", instance,
}
}
#endif /* SBUSMEM_DEBUG */
#ifdef SBUSMEM_DEBUG
"sbmem_attach%d: No ident property\n", instance);
#endif /* SBUSMEM_DEBUG */
break;
}
instance) != DDI_SUCCESS)
break;
break;
}
break;
}
#ifdef SBUSMEM_DEBUG
sbusmem_debug("sbmem_attach%d: dip 0x%p size 0x%x\n",
#endif /* SBUSMEM_DEBUG */
error = DDI_SUCCESS;
break;
case DDI_RESUME:
error = DDI_SUCCESS;
break;
default:
break;
}
return (error);
}
static int
{
int instance;
switch (cmd) {
case DDI_DETACH:
return (DDI_SUCCESS);
case DDI_SUSPEND:
return (DDI_SUCCESS);
}
return (DDI_FAILURE);
}
/*ARGSUSED1*/
static int
{
int instance;
return (EINVAL);
return (ENXIO);
}
return (0);
}
/*ARGSUSED*/
static int
{
return (EINVAL);
return (0);
}
static int
{
#endif /* lint || __lint */
switch (infocmd) {
case DDI_INFO_DEVT2DEVINFO:
error = DDI_SUCCESS;
#ifdef SBUSMEM_DEBUG
#endif /* SBUSMEM_DEBUG */
}
break;
case DDI_INFO_DEVT2INSTANCE:
error = DDI_SUCCESS;
break;
default:
break;
}
return (error);
}
static int
{
}
static int
{
}
static int
{
uint_t c;
#endif /* lint || __lint */
return (ENXIO);
}
uio->uio_iovcnt--;
if (uio->uio_iovcnt < 0)
continue;
}
return (EFAULT);
}
return (0); /* EOF */
}
return (EFAULT);
}
sizeof (int)) != DDI_SUCCESS)
}
return (error);
}
static int
{
#endif /* lint || __lint */
return (ENXIO);
}
return (ENXIO);
}
return (error);
}
return (0);
}