xref: /netbsd-src/sys/arch/xen/include/xbdvar.h (revision 5f99165065355bf6728981dc7750b9f62cd67dc1)
1*5f991650Smlelstv /* $NetBSD: xbdvar.h,v 1.17 2015/05/02 08:00:08 mlelstv Exp $ */
29a39f88eScl 
39a39f88eScl /*
49a39f88eScl  *
59a39f88eScl  * Copyright (c) 2004 Christian Limpach.
69a39f88eScl  * All rights reserved.
79a39f88eScl  *
89a39f88eScl  * Redistribution and use in source and binary forms, with or without
99a39f88eScl  * modification, are permitted provided that the following conditions
109a39f88eScl  * are met:
119a39f88eScl  * 1. Redistributions of source code must retain the above copyright
129a39f88eScl  *    notice, this list of conditions and the following disclaimer.
139a39f88eScl  * 2. Redistributions in binary form must reproduce the above copyright
149a39f88eScl  *    notice, this list of conditions and the following disclaimer in the
159a39f88eScl  *    documentation and/or other materials provided with the distribution.
169a39f88eScl  *
179a39f88eScl  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
189a39f88eScl  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
199a39f88eScl  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
209a39f88eScl  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
219a39f88eScl  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
229a39f88eScl  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
239a39f88eScl  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
249a39f88eScl  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
259a39f88eScl  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
269a39f88eScl  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
279a39f88eScl  */
289a39f88eScl 
299a39f88eScl 
309a39f88eScl #ifndef _XEN_XBDVAR_H_
319a39f88eScl #define _XEN_XBDVAR_H_
329a39f88eScl 
3356d32429Sriastradh #include <sys/rndsource.h>
3456d32429Sriastradh 
359a39f88eScl struct xbd_softc {
36af33bdeeScegger 	device_t		sc_dev;		/* base device glue */
379a39f88eScl 	struct dk_softc		sc_dksc;	/* generic disk interface */
389a39f88eScl 	unsigned long		sc_xd_device;	/* cookie identifying device */
39d877f23fScl 	int			sc_shutdown;	/* about to be removed */
403afd44cfStls 	krndsource_t	sc_rnd_source;
419a39f88eScl };
429a39f88eScl 
439a39f88eScl struct xbd_attach_args {
44edf6d721Scl 	const char 		*xa_device;
45e9666f30Sbouyer 	vdisk_t			*xa_xd;
468d5b657eScl 	struct sysctlnode	*xa_diskcookies;
479a39f88eScl };
489a39f88eScl 
49af33bdeeScegger int xbd_scan(device_t, struct xbd_attach_args *, cfprint_t);
502aa6d508Sjld void xbd_suspend(void);
512aa6d508Sjld void xbd_resume(void);
529a39f88eScl 
539a39f88eScl #endif /* _XEN_XBDVAR_H_ */
54