devctl.h 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DEVCTL_H
#define _SYS_DEVCTL_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Device control interfaces
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* structure used to pass IOCTL data between the libdevice interfaces
* and nexus driver devctl IOCTL interface.
*
* Applications and nexus drivers may not access the contents of this
* structure directly. Instead, drivers must use the ndi_dc_XXX(9n)
* interfaces, while applications must use the interfaces provided by
* libdevice.so.1.
*/
struct devctl_iocdata {
void *cpyout_buf; /* copyout vector */
char *c_nodename; /* child device nodename */
char *c_unitaddr; /* child device unit address */
};
#if defined(_SYSCALL32)
/*
*/
struct devctl_iocdata32 {
};
#endif
/*
* State of receptacle for an Attachment Point.
*/
typedef enum {
} ap_rstate_t;
/*
* State of occupant for an Attachment Point.
*/
typedef enum {
} ap_ostate_t;
/*
* condition of an Attachment Point.
*/
typedef enum {
/*
* structure used to return the state of Attachment Point (AP) thru
* devctl_ap_getstate() interface.
*/
typedef struct devctl_ap_state {
#if defined(_SYSCALL32)
/*
*/
typedef struct devctl_ap_state32 {
#endif
/*
* is (c) in the range of possible devctl IOCTL commands?
*/
/*
* Device and Bus State definitions
*
* Device state is returned as a set of bit-flags that indicate the current
* operational state of a device node.
*
* Device nodes for leaf devices only contain state information for the
* device itself. Nexus device nodes contain both Bus and Device state
* information.
*
* DEVICE_ONLINE - Device is available for use by the system. Mutually
* exclusive with DEVICE_OFFLINE.
*
* DEVICE_OFFLINE - Device is unavailable for use by the system.
* Mutually exclusive with DEVICE_ONLINE and DEVICE_BUSY.
*
* DEVICE_DOWN - Device has been placed in the "DOWN" state by
* its controlling driver.
*
* DEVICE_BUSY - Device has open instances or nexus has INITALIZED
* children (nexi). A device in this state is by
* definition Online.
*
* Bus state is returned as a set of bit-flags which indicates the
* operational state of a bus associated with the nexus dev_info node.
*
* BUS_ACTIVE - The bus associated with the device node is Active.
* I/O requests from child devices attached to the
* are initiated (or queued for initiation) as they
* are received.
*
* BUS_QUIESCED - The bus associated with the device node has been
* Quieced. I/O requests from child devices attached
* to the bus are held pending until the bus nexus is
* Unquiesced.
*
* BUS_SHUTDOWN - The bus associated with the device node has been
* shutdown by the nexus driver. I/O requests from
* child devices are returned with an error indicating
* the requested operation failed.
*/
#define DEVICE_ONLINE 0x1
#define DEVICE_BUSY 0x2
#define DEVICE_OFFLINE 0x4
#define DEVICE_DOWN 0x8
#define BUS_ACTIVE 0x10
#define BUS_QUIESCED 0x20
#define BUS_SHUTDOWN 0x40
#define DC_DEVI_NODENAME "ndi_dc.devi_nodename"
#define DEVCTL_CONSTRUCT 0x1
#define DEVCTL_OFFLINE 0x2
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DEVCTL_H */