xref: /openbsd/sys/sys/hotplug.h (revision a1df61ee)
1*a1df61eeSmk /*	$OpenBSD: hotplug.h,v 1.5 2006/05/28 16:52:34 mk Exp $	*/
2cfd0487fSgrange /*
3cfd0487fSgrange  * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
4cfd0487fSgrange  *
5cfd0487fSgrange  * Permission to use, copy, modify, and distribute this software for any
6cfd0487fSgrange  * purpose with or without fee is hereby granted, provided that the above
7cfd0487fSgrange  * copyright notice and this permission notice appear in all copies.
8cfd0487fSgrange  *
9cfd0487fSgrange  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10cfd0487fSgrange  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11cfd0487fSgrange  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12cfd0487fSgrange  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13cfd0487fSgrange  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14cfd0487fSgrange  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15cfd0487fSgrange  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16cfd0487fSgrange  */
17cfd0487fSgrange 
18cfd0487fSgrange #ifndef _SYS_HOTPLUG_H_
19cfd0487fSgrange #define _SYS_HOTPLUG_H_
20cfd0487fSgrange 
21cfd0487fSgrange /*
22cfd0487fSgrange  * Public interface for enqueuing and dequeueing device
23cfd0487fSgrange  * attachment and detachment notifications.
24cfd0487fSgrange  */
25cfd0487fSgrange 
26cfd0487fSgrange #define HOTPLUG_DEVAT		0x01	/* device attached	*/
27cfd0487fSgrange #define HOTPLUG_DEVDT		0x02	/* device detached	*/
28cfd0487fSgrange 
29cfd0487fSgrange struct hotplug_event {
30cfd0487fSgrange 	int		he_type;	/* event type		*/
31cfd0487fSgrange 	enum devclass	he_devclass;	/* device class		*/
32cfd0487fSgrange 	char		he_devname[16];	/* device name		*/
33cfd0487fSgrange };
34cfd0487fSgrange 
35cfd0487fSgrange #ifdef _KERNEL
36f8ec9918Shenning void	hotplug_device_attach(enum devclass, char *);
37f8ec9918Shenning void	hotplug_device_detach(enum devclass, char *);
38cfd0487fSgrange #endif
39cfd0487fSgrange 
40cfd0487fSgrange #endif	/* _SYS_HOTPLUG_H_ */
41