xref: /freebsd/lib/libdevctl/devctl.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
164de8019SJohn Baldwin /*-
264de8019SJohn Baldwin  * Copyright (c) 2014 John Baldwin <jhb@FreeBSD.org>
364de8019SJohn Baldwin  *
464de8019SJohn Baldwin  * Redistribution and use in source and binary forms, with or without
564de8019SJohn Baldwin  * modification, are permitted provided that the following conditions
664de8019SJohn Baldwin  * are met:
764de8019SJohn Baldwin  * 1. Redistributions of source code must retain the above copyright
864de8019SJohn Baldwin  *    notice, this list of conditions and the following disclaimer.
964de8019SJohn Baldwin  * 2. Redistributions in binary form must reproduce the above copyright
1064de8019SJohn Baldwin  *    notice, this list of conditions and the following disclaimer in the
1164de8019SJohn Baldwin  *    documentation and/or other materials provided with the distribution.
1264de8019SJohn Baldwin  *
1364de8019SJohn Baldwin  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1464de8019SJohn Baldwin  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1564de8019SJohn Baldwin  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1664de8019SJohn Baldwin  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1764de8019SJohn Baldwin  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1864de8019SJohn Baldwin  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1964de8019SJohn Baldwin  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2064de8019SJohn Baldwin  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2164de8019SJohn Baldwin  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2264de8019SJohn Baldwin  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2364de8019SJohn Baldwin  * SUCH DAMAGE.
2464de8019SJohn Baldwin  */
2564de8019SJohn Baldwin 
2664de8019SJohn Baldwin #ifndef __DEVCTL_H__
2764de8019SJohn Baldwin #define	__DEVCTL_H__
2864de8019SJohn Baldwin 
2964de8019SJohn Baldwin #include <stdbool.h>
3064de8019SJohn Baldwin 
319cdd5c07SKonstantin Belousov __BEGIN_DECLS
3264de8019SJohn Baldwin int	devctl_attach(const char *device);
3364de8019SJohn Baldwin int	devctl_detach(const char *device, bool force);
3464de8019SJohn Baldwin int	devctl_enable(const char *device);
3564de8019SJohn Baldwin int	devctl_disable(const char *device, bool force_detach);
3664de8019SJohn Baldwin int	devctl_suspend(const char *device);
3764de8019SJohn Baldwin int	devctl_resume(const char *device);
3864de8019SJohn Baldwin int	devctl_set_driver(const char *device, const char *driver, bool force);
39e05ec081SJohn Baldwin int	devctl_clear_driver(const char *device, bool force);
40a907c691SJohn Baldwin int	devctl_rescan(const char *device);
4188eb5c50SJohn Baldwin int	devctl_delete(const char *device, bool force);
425fa29797SWarner Losh int	devctl_freeze(void);
435fa29797SWarner Losh int	devctl_thaw(void);
444fbf8e1cSKonstantin Belousov int	devctl_reset(const char *device, bool detach);
45*b01f409fSWarner Losh int	devctl_getpath(const char *device, const char *locator, char **buffer);
469cdd5c07SKonstantin Belousov __END_DECLS
4764de8019SJohn Baldwin 
4864de8019SJohn Baldwin #endif /* !__DEVCTL_H__ */
49