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.
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.
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]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _HOTPLUGD_IMPL_H
28 #define _HOTPLUGD_IMPL_H
35 * Define macros to test connection states.
37 #define HP_IS_ENABLED(s) (s == DDI_HP_CN_STATE_ENABLED)
39 #define HP_IS_ONLINE(s) ((s == DDI_HP_CN_STATE_ONLINE) || \
40 (s == DDI_HP_CN_STATE_MAINTENANCE))
42 #define HP_IS_OFFLINE(s) ((s == DDI_HP_CN_STATE_PORT_EMPTY) || \
43 (s == DDI_HP_CN_STATE_PORT_PRESENT) || \
44 (s == DDI_HP_CN_STATE_OFFLINE))
47 * Define size of nvlist buffer for set/get commands.
49 #define HP_PRIVATE_BUF_SZ 4096
52 * Define a string for parsing /devices paths.
54 #define S_DEVICES "/devices"
59 void log_err(char *fmt
, ...);
60 void log_info(char *fmt
, ...);
61 void dprintf(char *fmt
, ...);
62 boolean_t
door_server_init(void);
63 void door_server_fini(void);
64 int getinfo(const char *path
, const char *connection
, uint_t flags
,
66 int changestate(const char *path
, const char *connection
, int state
,
67 uint_t flags
, int *old_statep
, hp_node_t
*resultsp
);
68 int private_options(const char *path
, const char *connection
,
69 hp_cmd_t cmd
, const char *options
, char **resultsp
);
70 int copy_usage(hp_node_t root
);
71 int rcm_resources(hp_node_t root
, char ***rsrcsp
);
72 void free_rcm_resources(char **rsrcs
);
73 int rcm_offline(char **rsrcs
, uint_t flags
, hp_node_t root
);
74 void rcm_online(char **rsrcs
);
75 void rcm_remove(char **rsrcs
);
81 #endif /* _HOTPLUGD_IMPL_H */