hci1394_misc.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 (c) 1999-2000 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Misc. HBA functions. These include getinfo, open, close, shutdown, and
* overall driver state control functions.
*/
/* ARGSUSED */
int
{
int status;
switch (cmd) {
case DDI_INFO_DEVT2DEVINFO:
if (soft_state == NULL) {
"ddi_get_soft_state() failed");
HCI1394_TNF_HAL_STACK, "");
return (DDI_FAILURE);
}
break;
case DDI_INFO_DEVT2INSTANCE:
break;
default:
}
return (status);
}
/* ARGSUSED */
int
{
if (soft_state == NULL) {
return (ENXIO);
}
return (0);
}
/* ARGSUSED */
int
{
return (0);
}
/*
* hci1394_shutdown()
* Shutdown the HW. Something bad that we cannot recover from happened.
*/
void
{
/*
* In the debug version of the driver, we want to do an assert here so
* that we don't reset the hardware and can look and see what happened
* to cause the shutdown.
*/
#ifndef TEST_SHUTDOWN
ASSERT(0);
#endif
if (soft_state == NULL) {
HCI1394_TNF_HAL_STACK, "");
return;
}
/*
* Don't allow the HW to generate any more interrupts. Make sure we
* disable interrupts before setting the driver state to shutdown.
*/
/* don't accept anymore commands from services layer */
/* Reset the OHCI HW */
/* Flush out async DMA Q's (cancels pendingQ timeouts too) */
}
/*
* hci1394_state()
* returns the current state of the driver
*/
{
return (hal_state);
}
/*
* hci1394_state_set()
* Set the current state of the driver. This routine will return failure
* if the driver state is currently set to HCI1394_SHUTDOWN. We do not
* allow a transition out of shutdown.
*/
int
{
/* Do not allow a transition out of shutdown */
"");
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}