Deleted Added
full compact
if_hnreg.h (307475) if_hnreg.h (307476)
1/*-
2 * Copyright (c) 2016 Microsoft Corp.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2016 Microsoft Corp.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: stable/11/sys/dev/hyperv/netvsc/if_hnreg.h 307475 2016-10-17 05:53:38Z sephe $
26 * $FreeBSD: stable/11/sys/dev/hyperv/netvsc/if_hnreg.h 307476 2016-10-17 06:09:36Z sephe $
27 */
28
29#ifndef _IF_HNREG_H_
30#define _IF_HNREG_H_
31
32#include <sys/param.h>
33#include <sys/systm.h>
34
35#define HN_NVS_RXBUF_SIG 0xcafe
36#define HN_NVS_CHIM_SIG 0xface
37
27 */
28
29#ifndef _IF_HNREG_H_
30#define _IF_HNREG_H_
31
32#include <sys/param.h>
33#include <sys/systm.h>
34
35#define HN_NVS_RXBUF_SIG 0xcafe
36#define HN_NVS_CHIM_SIG 0xface
37
38#define HN_NVS_CHIM_IDX_INVALID 0xffffffff
39
40#define HN_NVS_RNDIS_MTYPE_DATA 0
41#define HN_NVS_RNDIS_MTYPE_CTRL 1
42
43/*
44 * NVS message transacion status codes.
45 */
38#define HN_NVS_STATUS_OK 1
46#define HN_NVS_STATUS_OK 1
47#define HN_NVS_STATUS_FAILED 2
39
48
49/*
50 * NVS request/response message types.
51 */
40#define HN_NVS_TYPE_INIT 1
41#define HN_NVS_TYPE_INIT_RESP 2
42#define HN_NVS_TYPE_NDIS_INIT 100
43#define HN_NVS_TYPE_RXBUF_CONN 101
44#define HN_NVS_TYPE_RXBUF_CONNRESP 102
45#define HN_NVS_TYPE_RXBUF_DISCONN 103
46#define HN_NVS_TYPE_CHIM_CONN 104
47#define HN_NVS_TYPE_CHIM_CONNRESP 105
48#define HN_NVS_TYPE_CHIM_DISCONN 106
52#define HN_NVS_TYPE_INIT 1
53#define HN_NVS_TYPE_INIT_RESP 2
54#define HN_NVS_TYPE_NDIS_INIT 100
55#define HN_NVS_TYPE_RXBUF_CONN 101
56#define HN_NVS_TYPE_RXBUF_CONNRESP 102
57#define HN_NVS_TYPE_RXBUF_DISCONN 103
58#define HN_NVS_TYPE_CHIM_CONN 104
59#define HN_NVS_TYPE_CHIM_CONNRESP 105
60#define HN_NVS_TYPE_CHIM_DISCONN 106
61#define HN_NVS_TYPE_RNDIS 107
62#define HN_NVS_TYPE_RNDIS_ACK 108
49#define HN_NVS_TYPE_NDIS_CONF 125
63#define HN_NVS_TYPE_NDIS_CONF 125
64#define HN_NVS_TYPE_VFASSOC_NOTE 128 /* notification */
65#define HN_NVS_TYPE_SET_DATAPATH 129
50#define HN_NVS_TYPE_SUBCH_REQ 133
51#define HN_NVS_TYPE_SUBCH_RESP 133 /* same as SUBCH_REQ */
66#define HN_NVS_TYPE_SUBCH_REQ 133
67#define HN_NVS_TYPE_SUBCH_RESP 133 /* same as SUBCH_REQ */
68#define HN_NVS_TYPE_TXTBL_NOTE 134 /* notification */
52
53/*
54 * Any size less than this one will _not_ work, e.g. hn_nvs_init
55 * only has 12B valid data, however, if only 12B data were sent,
56 * Hypervisor would never reply.
57 */
58#define HN_NVS_REQSIZE_MIN 32
59
69
70/*
71 * Any size less than this one will _not_ work, e.g. hn_nvs_init
72 * only has 12B valid data, however, if only 12B data were sent,
73 * Hypervisor would never reply.
74 */
75#define HN_NVS_REQSIZE_MIN 32
76
77/* NVS message common header */
78struct hn_nvs_hdr {
79 uint32_t nvs_type;
80} __packed;
81
60struct hn_nvs_init {
61 uint32_t nvs_type; /* HN_NVS_TYPE_INIT */
62 uint32_t nvs_ver_min;
63 uint32_t nvs_ver_max;
64 uint8_t nvs_rsvd[20];
65} __packed;
66CTASSERT(sizeof(struct hn_nvs_init) >= HN_NVS_REQSIZE_MIN);
67

--- 89 unchanged lines hidden (view full) ---

157CTASSERT(sizeof(struct hn_nvs_subch_req) >= HN_NVS_REQSIZE_MIN);
158
159struct hn_nvs_subch_resp {
160 uint32_t nvs_type; /* HN_NVS_TYPE_SUBCH_RESP */
161 uint32_t nvs_status; /* HN_NVS_STATUS_ */
162 uint32_t nvs_nsubch;
163} __packed;
164
82struct hn_nvs_init {
83 uint32_t nvs_type; /* HN_NVS_TYPE_INIT */
84 uint32_t nvs_ver_min;
85 uint32_t nvs_ver_max;
86 uint8_t nvs_rsvd[20];
87} __packed;
88CTASSERT(sizeof(struct hn_nvs_init) >= HN_NVS_REQSIZE_MIN);
89

--- 89 unchanged lines hidden (view full) ---

179CTASSERT(sizeof(struct hn_nvs_subch_req) >= HN_NVS_REQSIZE_MIN);
180
181struct hn_nvs_subch_resp {
182 uint32_t nvs_type; /* HN_NVS_TYPE_SUBCH_RESP */
183 uint32_t nvs_status; /* HN_NVS_STATUS_ */
184 uint32_t nvs_nsubch;
185} __packed;
186
187struct hn_nvs_rndis {
188 uint32_t nvs_type; /* HN_NVS_TYPE_RNDIS */
189 uint32_t nvs_rndis_mtype;/* HN_NVS_RNDIS_MTYPE_ */
190 /*
191 * Chimney sending buffer index and size.
192 *
193 * NOTE:
194 * If nvs_chim_idx is set to HN_NVS_CHIM_IDX_INVALID
195 * and nvs_chim_sz is set to 0, then chimney sending
196 * buffer is _not_ used by this RNDIS message.
197 */
198 uint32_t nvs_chim_idx;
199 uint32_t nvs_chim_sz;
200 uint8_t nvs_rsvd[16];
201} __packed;
202CTASSERT(sizeof(struct hn_nvs_rndis) >= HN_NVS_REQSIZE_MIN);
203
204struct hn_nvs_rndis_ack {
205 uint32_t nvs_type; /* HN_NVS_TYPE_RNDIS_ACK */
206 uint32_t nvs_status; /* HN_NVS_STATUS_ */
207 uint8_t nvs_rsvd[24];
208} __packed;
209CTASSERT(sizeof(struct hn_nvs_rndis_ack) >= HN_NVS_REQSIZE_MIN);
210
165#endif /* !_IF_HNREG_H_ */
211#endif /* !_IF_HNREG_H_ */