sbd_io.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/dditypes.h>
#include <sys/ddi_impldefs.h>
#include <sys/ndi_impldefs.h>
#include <sys/machsystm.h>
/*
* Given a dev_info_t of a branch root, walk down the
* branch to attach drivers
*/
/*ARGSUSED*/
void
{
}
/*
* remove device nodes for the branch indicated by dip
* Hold the status lock so that status can safely do ddi_pathname().
*/
/*ARGSUSED*/
void
{
int rv;
if (rv) {
/*
* If non-NULL, fdip is returned held and must be released.
*/
} else {
}
}
}
/*ARGSUSED*/
void
{
} else {
}
/*
* Any changes to this io component should be performed above
* this call to ensure the component is fully initialized
* before transitioning to the new state.
*/
}
/*ARGSUSED*/
int
{
return (0);
}
int
{
return (0);
}
/*ARGSUSED*/
int
{
fn_t f = "sbd_pre_detach_io";
PR_IO("%s...\n", f);
if (devnum <= 0)
return (-1);
/* fail if any I/O devices are referenced */
PR_IO("%s: failed - I/O devices ref'd\n", f);
return (-1);
}
return (0);
}
/*ARGSUSED*/
int
{
return (0);
}
/*ARGSUSED*/
int
{
return (0);
}
/*ARGSUSED*/
int
{
int i, ix;
sbderror_t *ep;
/*
* Only look for requested devices that are actually present.
*/
/*
* Concurrent status and unconfigure, disconnect are allowed.
* To prevent DR code from accessing stale dips, check the
* present devset and access the dips with status lock held.
* Disconnect and unconfigure code change dip state with
* status lock (sb_slock) held.
*/
for (i = ix = 0; i < MAX_IO_UNITS_PER_BOARD; i++) {
int unit;
int namelen;
int refcount = 0;
continue;
/*
* Check to make sure the io component is in a state
* where its fully initialized.
*/
continue;
continue;
continue;
else {
break;
}
}
/*
* This is safe to do as unconfigure and disconnect
* hold the status lock while changing dip state.
*/
/*
* We use a dummy handle in which to collect
* the major numbers of unsafe devices.
*/
isp->is_unsafe_count = 0;
/*
* Reset error field since we don't care about
* errors at this level. The unsafe devices
* will be reported in the structure.
*/
ix++;
dsp++;
}
return (ix);
}
/*ARGSUSED*/
int
{
int i, ix;
/*
* Only look for requested devices that are actually present.
*/
for (i = ix = 0; i < MAX_IO_UNITS_PER_BOARD; i++) {
continue;
continue;
ix++;
}
return (ix);
}
int
{
register int i, reftotal = 0;
fn_t f = "sbd_check_io_refs";
sbderror_t *ep;
for (i = 0; i < devnum; i++) {
int ref;
ref = 0;
if (ref) {
if (SBD_GET_ERR(ep) == 0) {
}
}
PR_IO("%s: dip(%s) ref = %d\n",
}
return (reftotal);
}
int
{
dev_info_t **tdip;
int state;
(state == DDI_DEVSTATE_UP)) {
return (DDI_WALK_TERMINATE);
}
}
return (DDI_WALK_CONTINUE);
}
int
{
fn_t f = "sbd_pre_release_io";
int rv = 0;
int i;
/* fail if any I/O devices are referenced */
/*
* One of the devices may have failed check to see which
* and set in the main handle
*/
for (i = 0; i < devnum; i++) {
(void) sbd_set_err_in_hdl(hp,
break;
}
}
PR_IO("%s: failed - I/O devices ref'd\n", f);
}
return (rv);
}