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 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> |
36#include <sys/sysctl.h> |
37#include <sys/sx.h> 38#include <sys/taskqueue.h> |
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 |
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 */ |
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) |
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_ */ |