xref: /dflybsd-src/contrib/lvm2/dist/libdm/ioctl/libdm-netbsd.h (revision bf0d92b7fe9456dcf7fead1088076021bf662363)
14bc64275SAlex Hornung /*        $NetBSD: libdm-netbsd.h,v 1.1 2009/12/05 11:38:40 haad Exp $
24bc64275SAlex Hornung 
34bc64275SAlex Hornung /*
44bc64275SAlex Hornung  * Copyright (c) 2008 The NetBSD Foundation, Inc.
54bc64275SAlex Hornung  * All rights reserved.
64bc64275SAlex Hornung  *
74bc64275SAlex Hornung  * This code is derived from software contributed to The NetBSD Foundation
84bc64275SAlex Hornung  * by Adam Hamsik.
94bc64275SAlex Hornung  *
104bc64275SAlex Hornung  * Redistribution and use in source and binary forms, with or without
114bc64275SAlex Hornung  * modification, are permitted provided that the following conditions
124bc64275SAlex Hornung  * are met:
134bc64275SAlex Hornung  * 1. Redistributions of source code must retain the above copyright
144bc64275SAlex Hornung  *    notice, this list of conditions and the following disclaimer.
154bc64275SAlex Hornung  * 2. Redistributions in binary form must reproduce the above copyright
164bc64275SAlex Hornung  *    notice, this list of conditions and the following disclaimer in the
174bc64275SAlex Hornung  *    documentation and/or other materials provided with the distribution.
184bc64275SAlex Hornung  *
194bc64275SAlex Hornung  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
204bc64275SAlex Hornung  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
214bc64275SAlex Hornung  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
224bc64275SAlex Hornung  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
234bc64275SAlex Hornung  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
244bc64275SAlex Hornung  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
254bc64275SAlex Hornung  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
264bc64275SAlex Hornung  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
274bc64275SAlex Hornung  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
284bc64275SAlex Hornung  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
294bc64275SAlex Hornung  * POSSIBILITY OF SUCH DAMAGE.
304bc64275SAlex Hornung  */
314bc64275SAlex Hornung 
324bc64275SAlex Hornung #ifndef __LIB_DM_H__
334bc64275SAlex Hornung #define __LIB_DM_H__
344bc64275SAlex Hornung 
354bc64275SAlex Hornung #include <libprop/proplib.h>
36*bf0d92b7SSascha Wildner #include <unistd.h>
374bc64275SAlex Hornung 
384bc64275SAlex Hornung #  define MAJOR(x) major((x))
394bc64275SAlex Hornung #  define MINOR(x) minor((x))
404bc64275SAlex Hornung #  define MKDEV(x,y) makedev((x),(y))
414bc64275SAlex Hornung 
424bc64275SAlex Hornung /* Name of device-mapper driver in kernel */
434bc64275SAlex Hornung #define DM_NAME "dm"
444bc64275SAlex Hornung 
454bc64275SAlex Hornung /* Types for nbsd_get_dm_major */
464bc64275SAlex Hornung #define DM_CHAR_MAJOR 1
474bc64275SAlex Hornung #define DM_BLOCK_MAJOR 2
484bc64275SAlex Hornung 
494bc64275SAlex Hornung /* libdm_netbsd.c */
504bc64275SAlex Hornung int nbsd_get_dm_major(uint32_t *, int); /* Get dm device major numbers */
514bc64275SAlex Hornung 
524bc64275SAlex Hornung int nbsd_dmi_add_cmd(const char *, prop_dictionary_t);
534bc64275SAlex Hornung int nbsd_dmi_add_version(const int [3], prop_dictionary_t);
544bc64275SAlex Hornung int nbsd_dm_add_uint(const char *, uint64_t, prop_dictionary_t);
554bc64275SAlex Hornung int nbsd_dm_add_str(const char *, char *, prop_dictionary_t );
564bc64275SAlex Hornung 
574bc64275SAlex Hornung struct dm_ioctl* nbsd_dm_dict_to_dmi(prop_dictionary_t, const int);
584bc64275SAlex Hornung 
594bc64275SAlex Hornung #endif /* __NETBSD_DM_H__ */
60