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