1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25 #ifndef _SYS_SUNNDI_H
26 #define _SYS_SUNNDI_H
27
28 /*
29 * Sun Specific NDI definitions
30 */
31
32 #include <sys/esunddi.h>
33 #include <sys/sunddi.h>
34 #include <sys/obpdefs.h>
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 #ifdef _KERNEL
41
42 #define NDI_SUCCESS DDI_SUCCESS /* successful return */
308 #define NDI_MDI_FALLBACK 0x00000004 /* Leadville to fallback to phci */
309 #define NDI_CONFIG 0x00000008 /* recursively config descendants */
310 #define NDI_UNCONFIG 0x00000010 /* unconfig to uninitialized state */
311 #define NDI_DEVI_BIND 0x00000020 /* transition to DS_BOUND state */
312 #define NDI_DEVI_PERSIST 0x00000040 /* do not config offlined nodes */
313 #define NDI_PROMNAME 0x00000080 /* name comes from prom */
314 #define NDI_DEVFS_CLEAN 0x00001000 /* clean dv_nodes only, no detach */
315 #define NDI_AUTODETACH 0x00002000 /* moduninstall daemon */
316 #define NDI_NO_EVENT 0x00004000 /* don't devfs add/remove events */
317 #define NDI_DEVI_DEBUG 0x00008000 /* turn on observability */
318 #define NDI_CONFIG_REPROBE 0x00010000 /* force reprobe (deferred attach) */
319 #define NDI_DEVI_ONLINE 0x00020000 /* force offlined device to online */
320 #define NDI_DEVI_OFFLINE 0x00040000 /* set detached device to offline */
321 #define NDI_POST_EVENT 0x00080000 /* Post NDI events before remove */
322 #define NDI_BRANCH_EVENT_OP 0x01000000 /* branch op needs branch event */
323 #define NDI_NO_EVENT_STATE_CHNG 0x02000000 /* don't change the event state */
324 #define NDI_DRV_CONF_REPROBE 0x04000000 /* reprobe conf-enum'd nodes only */
325 #define NDI_DETACH_DRIVER 0x08000000 /* performing driver_detach */
326 #define NDI_MTC_OFF 0x10000000 /* disable multi-threading */
327 #define NDI_USER_REQ 0x20000000 /* user requested operation */
328
329 /* ndi interface flag values */
330 #define NDI_SLEEP 0x000000
331 #define NDI_NOSLEEP 0x100000
332 #define NDI_EVENT_NOPASS 0x200000 /* do not pass event req up the tree */
333
334 int
335 ndi_devi_offline(dev_info_t *dip, uint_t flags);
336
337 /*
338 * Find the child dev_info node of parent nexus 'p' whose name
339 * matches "cname"@"caddr". Use ndi_devi_findchild() instead.
340 */
341 dev_info_t *
342 ndi_devi_find(dev_info_t *p, char *cname, char *caddr);
343
344 /*
345 * Find the child dev_info node of parent nexus 'p' whose name
346 * matches device name "name"@"addr".
347 */
|
1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2018 Nexenta Systems, Inc.
25 */
26
27 #ifndef _SYS_SUNNDI_H
28 #define _SYS_SUNNDI_H
29
30 /*
31 * Sun Specific NDI definitions
32 */
33
34 #include <sys/esunddi.h>
35 #include <sys/sunddi.h>
36 #include <sys/obpdefs.h>
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 #ifdef _KERNEL
43
44 #define NDI_SUCCESS DDI_SUCCESS /* successful return */
310 #define NDI_MDI_FALLBACK 0x00000004 /* Leadville to fallback to phci */
311 #define NDI_CONFIG 0x00000008 /* recursively config descendants */
312 #define NDI_UNCONFIG 0x00000010 /* unconfig to uninitialized state */
313 #define NDI_DEVI_BIND 0x00000020 /* transition to DS_BOUND state */
314 #define NDI_DEVI_PERSIST 0x00000040 /* do not config offlined nodes */
315 #define NDI_PROMNAME 0x00000080 /* name comes from prom */
316 #define NDI_DEVFS_CLEAN 0x00001000 /* clean dv_nodes only, no detach */
317 #define NDI_AUTODETACH 0x00002000 /* moduninstall daemon */
318 #define NDI_NO_EVENT 0x00004000 /* don't devfs add/remove events */
319 #define NDI_DEVI_DEBUG 0x00008000 /* turn on observability */
320 #define NDI_CONFIG_REPROBE 0x00010000 /* force reprobe (deferred attach) */
321 #define NDI_DEVI_ONLINE 0x00020000 /* force offlined device to online */
322 #define NDI_DEVI_OFFLINE 0x00040000 /* set detached device to offline */
323 #define NDI_POST_EVENT 0x00080000 /* Post NDI events before remove */
324 #define NDI_BRANCH_EVENT_OP 0x01000000 /* branch op needs branch event */
325 #define NDI_NO_EVENT_STATE_CHNG 0x02000000 /* don't change the event state */
326 #define NDI_DRV_CONF_REPROBE 0x04000000 /* reprobe conf-enum'd nodes only */
327 #define NDI_DETACH_DRIVER 0x08000000 /* performing driver_detach */
328 #define NDI_MTC_OFF 0x10000000 /* disable multi-threading */
329 #define NDI_USER_REQ 0x20000000 /* user requested operation */
330 #define NDI_DEVI_GONE 0x40000000 /* device is gone */
331
332 /* ndi interface flag values */
333 #define NDI_SLEEP 0x000000
334 #define NDI_NOSLEEP 0x100000
335 #define NDI_EVENT_NOPASS 0x200000 /* do not pass event req up the tree */
336
337 int
338 ndi_devi_offline(dev_info_t *dip, uint_t flags);
339
340 /*
341 * Find the child dev_info node of parent nexus 'p' whose name
342 * matches "cname"@"caddr". Use ndi_devi_findchild() instead.
343 */
344 dev_info_t *
345 ndi_devi_find(dev_info_t *p, char *cname, char *caddr);
346
347 /*
348 * Find the child dev_info node of parent nexus 'p' whose name
349 * matches device name "name"@"addr".
350 */
|