xref: /illumos-gate/usr/src/cmd/hal/hald/solaris/hotplug.h (revision 92f38132)
118c2aff7Sartem /***************************************************************************
218c2aff7Sartem  *
318c2aff7Sartem  * hotplug.h : definitions for HAL-internal hotplug events
418c2aff7Sartem  *
518c2aff7Sartem  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
618c2aff7Sartem  * Use is subject to license terms.
718c2aff7Sartem  *
818c2aff7Sartem  * Licensed under the Academic Free License version 2.1
918c2aff7Sartem  *
1018c2aff7Sartem  **************************************************************************/
1118c2aff7Sartem 
12*92f38132Sartem #pragma ident	"%Z%%M%	%I%	%E% SMI"
1318c2aff7Sartem 
1418c2aff7Sartem #ifndef HOTPLUG_H
1518c2aff7Sartem #define HOTPLUG_H
1618c2aff7Sartem 
1718c2aff7Sartem #include <glib.h>
1818c2aff7Sartem 
1918c2aff7Sartem #include "../device.h"
2018c2aff7Sartem #include "../util.h"
2118c2aff7Sartem 
2218c2aff7Sartem #include "devinfo.h"
2318c2aff7Sartem 
2418c2aff7Sartem typedef enum {
2518c2aff7Sartem 	HOTPLUG_ACTION_ADD,
2618c2aff7Sartem 	HOTPLUG_ACTION_REMOVE,
2718c2aff7Sartem } HotplugActionType;
2818c2aff7Sartem 
2918c2aff7Sartem typedef enum {
3018c2aff7Sartem 	HOTPLUG_EVENT_DEVFS       = 0,
3118c2aff7Sartem } HotplugEventType;
3218c2aff7Sartem 
3318c2aff7Sartem /** Data structure representing a hotplug event; also used for
3418c2aff7Sartem  *  coldplugging.
3518c2aff7Sartem  */
3618c2aff7Sartem typedef struct
3718c2aff7Sartem {
3818c2aff7Sartem 	HotplugActionType action;               /**< Whether the event is add or remove */
3918c2aff7Sartem 	HotplugEventType type;                  /**< Type of hotplug event */
4018c2aff7Sartem 
4118c2aff7Sartem 	HalDevice *d;
4218c2aff7Sartem 
4318c2aff7Sartem 	union {
4418c2aff7Sartem 		struct {
4518c2aff7Sartem 			char devfs_path[HAL_PATH_MAX];
4618c2aff7Sartem 			DevinfoDevHandler *handler;
4718c2aff7Sartem 		} devfs;
48