vmbusicvar.h revision 1.1 1 1.1 nonaka /* $NetBSD: vmbusicvar.h,v 1.1 2019/02/15 08:54:02 nonaka Exp $ */
2 1.1 nonaka /* $OpenBSD: hypervic.c,v 1.13 2017/08/10 15:25:57 mikeb Exp $ */
3 1.1 nonaka
4 1.1 nonaka /*-
5 1.1 nonaka * Copyright (c) 2009-2016 Microsoft Corp.
6 1.1 nonaka * Copyright (c) 2012 NetApp Inc.
7 1.1 nonaka * Copyright (c) 2012 Citrix Inc.
8 1.1 nonaka * Copyright (c) 2016 Mike Belopuhov <mike (at) esdenera.com>
9 1.1 nonaka * All rights reserved.
10 1.1 nonaka *
11 1.1 nonaka * Redistribution and use in source and binary forms, with or without
12 1.1 nonaka * modification, are permitted provided that the following conditions
13 1.1 nonaka * are met:
14 1.1 nonaka * 1. Redistributions of source code must retain the above copyright
15 1.1 nonaka * notice unmodified, this list of conditions, and the following
16 1.1 nonaka * disclaimer.
17 1.1 nonaka * 2. Redistributions in binary form must reproduce the above copyright
18 1.1 nonaka * notice, this list of conditions and the following disclaimer in the
19 1.1 nonaka * documentation and/or other materials provided with the distribution.
20 1.1 nonaka *
21 1.1 nonaka * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 1.1 nonaka * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 1.1 nonaka * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 1.1 nonaka * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 1.1 nonaka * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 1.1 nonaka * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 1.1 nonaka * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 1.1 nonaka * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 1.1 nonaka * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 1.1 nonaka * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 1.1 nonaka */
32 1.1 nonaka
33 1.1 nonaka /*
34 1.1 nonaka * The OpenBSD port was done under funding by Esdenera Networks GmbH.
35 1.1 nonaka */
36 1.1 nonaka
37 1.1 nonaka #ifndef _VMBUSICVAR_H_
38 1.1 nonaka #define _VMBUSICVAR_H_
39 1.1 nonaka
40 1.1 nonaka #include <sys/sysctl.h>
41 1.1 nonaka
42 1.1 nonaka #include <dev/hyperv/vmbusvar.h>
43 1.1 nonaka
44 1.1 nonaka struct vmbusic_softc {
45 1.1 nonaka device_t sc_dev;
46 1.1 nonaka
47 1.1 nonaka struct vmbus_channel *sc_chan;
48 1.1 nonaka
49 1.1 nonaka void *sc_buf;
50 1.1 nonaka size_t sc_buflen;
51 1.1 nonaka
52 1.1 nonaka uint32_t sc_fwver; /* framework version */
53 1.1 nonaka uint32_t sc_msgver; /* message version */
54 1.1 nonaka
55 1.1 nonaka struct sysctllog *sc_log;
56 1.1 nonaka };
57 1.1 nonaka
58 1.1 nonaka int vmbusic_probe(struct vmbus_attach_args *, const struct hyperv_guid *);
59 1.1 nonaka int vmbusic_attach(device_t, struct vmbus_attach_args *,
60 1.1 nonaka vmbus_channel_callback_t);
61 1.1 nonaka int vmbusic_detach(device_t, int);
62 1.1 nonaka
63 1.1 nonaka int vmbusic_negotiate(struct vmbusic_softc *, void *, uint32_t *, uint32_t,
64 1.1 nonaka uint32_t);
65 1.1 nonaka int vmbusic_sendresp(struct vmbusic_softc *, struct vmbus_channel *,
66 1.1 nonaka void *, uint32_t, uint64_t);
67 1.1 nonaka
68 1.1 nonaka #endif /* _VMBUSICVAR_H_ */
69