Deleted Added
full compact
vmbus_chanvar.h (307599) vmbus_chanvar.h (311359)
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/vmbus/vmbus_chanvar.h 307599 2016-10-19 02:24:17Z sephe $
26 * $FreeBSD: stable/11/sys/dev/hyperv/vmbus/vmbus_chanvar.h 311359 2017-01-05 04:22:03Z sephe $
27 */
28
29#ifndef _VMBUS_CHANVAR_H_
30#define _VMBUS_CHANVAR_H_
31
32#include <sys/param.h>
33#include <sys/lock.h>
34#include <sys/mutex.h>
35#include <sys/queue.h>
27 */
28
29#ifndef _VMBUS_CHANVAR_H_
30#define _VMBUS_CHANVAR_H_
31
32#include <sys/param.h>
33#include <sys/lock.h>
34#include <sys/mutex.h>
35#include <sys/queue.h>
36#include <sys/taskqueue.h>
37#include <sys/sysctl.h>
36#include <sys/sysctl.h>
37#include <sys/sx.h>
38#include <sys/taskqueue.h>
38
39#include <dev/hyperv/include/hyperv.h>
40#include <dev/hyperv/include/hyperv_busdma.h>
41#include <dev/hyperv/include/vmbus.h>
42#include <dev/hyperv/vmbus/vmbus_brvar.h>
43
44struct vmbus_channel {
45 /*

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

133
134 TAILQ_ENTRY(vmbus_channel) ch_link; /* channel link */
135 uint32_t ch_subidx; /* subchan index */
136 volatile uint32_t ch_stflags; /* atomic-op */
137 /* VMBUS_CHAN_ST_ */
138 struct hyperv_guid ch_guid_type;
139 struct hyperv_guid ch_guid_inst;
140
39
40#include <dev/hyperv/include/hyperv.h>
41#include <dev/hyperv/include/hyperv_busdma.h>
42#include <dev/hyperv/include/vmbus.h>
43#include <dev/hyperv/vmbus/vmbus_brvar.h>
44
45struct vmbus_channel {
46 /*

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

134
135 TAILQ_ENTRY(vmbus_channel) ch_link; /* channel link */
136 uint32_t ch_subidx; /* subchan index */
137 volatile uint32_t ch_stflags; /* atomic-op */
138 /* VMBUS_CHAN_ST_ */
139 struct hyperv_guid ch_guid_type;
140 struct hyperv_guid ch_guid_inst;
141
142 struct sx ch_orphan_lock;
143 struct vmbus_xact_ctx *ch_orphan_xact;
144
145 int ch_refs;
146
141 struct sysctl_ctx_list ch_sysctl_ctx;
142} __aligned(CACHE_LINE_SIZE);
143
144#define VMBUS_CHAN_ISPRIMARY(chan) ((chan)->ch_subidx == 0)
145
146/*
147 * If this flag is set, this channel's interrupt will be masked in ISR,
148 * and the RX bufring will be drained before this channel's interrupt is

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

154#define VMBUS_CHAN_FLAG_BATCHREAD 0x0002
155
156#define VMBUS_CHAN_TXF_HASMNF 0x0001
157
158#define VMBUS_CHAN_ST_OPENED_SHIFT 0
159#define VMBUS_CHAN_ST_ONPRIL_SHIFT 1
160#define VMBUS_CHAN_ST_ONSUBL_SHIFT 2
161#define VMBUS_CHAN_ST_ONLIST_SHIFT 3
147 struct sysctl_ctx_list ch_sysctl_ctx;
148} __aligned(CACHE_LINE_SIZE);
149
150#define VMBUS_CHAN_ISPRIMARY(chan) ((chan)->ch_subidx == 0)
151
152/*
153 * If this flag is set, this channel's interrupt will be masked in ISR,
154 * and the RX bufring will be drained before this channel's interrupt is

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

160#define VMBUS_CHAN_FLAG_BATCHREAD 0x0002
161
162#define VMBUS_CHAN_TXF_HASMNF 0x0001
163
164#define VMBUS_CHAN_ST_OPENED_SHIFT 0
165#define VMBUS_CHAN_ST_ONPRIL_SHIFT 1
166#define VMBUS_CHAN_ST_ONSUBL_SHIFT 2
167#define VMBUS_CHAN_ST_ONLIST_SHIFT 3
168#define VMBUS_CHAN_ST_REVOKED_SHIFT 4 /* sticky */
162#define VMBUS_CHAN_ST_OPENED (1 << VMBUS_CHAN_ST_OPENED_SHIFT)
163#define VMBUS_CHAN_ST_ONPRIL (1 << VMBUS_CHAN_ST_ONPRIL_SHIFT)
164#define VMBUS_CHAN_ST_ONSUBL (1 << VMBUS_CHAN_ST_ONSUBL_SHIFT)
165#define VMBUS_CHAN_ST_ONLIST (1 << VMBUS_CHAN_ST_ONLIST_SHIFT)
169#define VMBUS_CHAN_ST_OPENED (1 << VMBUS_CHAN_ST_OPENED_SHIFT)
170#define VMBUS_CHAN_ST_ONPRIL (1 << VMBUS_CHAN_ST_ONPRIL_SHIFT)
171#define VMBUS_CHAN_ST_ONSUBL (1 << VMBUS_CHAN_ST_ONSUBL_SHIFT)
172#define VMBUS_CHAN_ST_ONLIST (1 << VMBUS_CHAN_ST_ONLIST_SHIFT)
173#define VMBUS_CHAN_ST_REVOKED (1 << VMBUS_CHAN_ST_REVOKED_SHIFT)
166
167struct vmbus_softc;
168struct vmbus_message;
169
170void vmbus_event_proc(struct vmbus_softc *, int);
171void vmbus_event_proc_compat(struct vmbus_softc *, int);
172void vmbus_chan_msgproc(struct vmbus_softc *,
173 const struct vmbus_message *);
174void vmbus_chan_destroy_all(struct vmbus_softc *);
175
176#endif /* !_VMBUS_CHANVAR_H_ */
174
175struct vmbus_softc;
176struct vmbus_message;
177
178void vmbus_event_proc(struct vmbus_softc *, int);
179void vmbus_event_proc_compat(struct vmbus_softc *, int);
180void vmbus_chan_msgproc(struct vmbus_softc *,
181 const struct vmbus_message *);
182void vmbus_chan_destroy_all(struct vmbus_softc *);
183
184#endif /* !_VMBUS_CHANVAR_H_ */