summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/include
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2017-01-05 05:24:30 +0000
committersephe <sephe@FreeBSD.org>2017-01-05 05:24:30 +0000
commitb5728fedd8bb5efa5e68aed3a7ffd3e536bc15f6 (patch)
tree867bd350a5208c3a332418350067d4fc33fb26f1 /sys/dev/hyperv/include
parent98790e3105b6a493bf310c06e13ef6a1c756abc4 (diff)
downloadFreeBSD-src-b5728fedd8bb5efa5e68aed3a7ffd3e536bc15f6.zip
FreeBSD-src-b5728fedd8bb5efa5e68aed3a7ffd3e536bc15f6.tar.gz
MFC 309128,309129,309131-309136,309138-309140,309224,309225
309128 hyperv/vmbus: Commit the GPADL id only after the connection succeeds. Minor style change. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8563 309129 hyperv/vmbus: Minor style changes. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8564 309131 hyperv/vmbus: Fix sysctl tree leakage, if channel open fails. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8565 309132 hyperv/vmbus: Don't close unopened channels. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8566 309133 hyperv/vmbus: GPADL disconnect error on a revoked channel is benign. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8567 309134 hyperv/vmbus: No stranded bufring GPADL is allowed. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8568 309135 hyperv/vmbus: Return EISCONN if the bufring GPADL can't be disconnected. So that the callers of vmbus_chan_open_br() could handle the passed in bufring memory properly. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8569 309136 hyperv/vmbus: Don't free the bufring if its GPADL can't be disconnected. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8570 309138 hyperv/vmbus: Always try disconnect/free bufring memory upon channel close While I'm here, minor wording and style changes. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8598 309139 hyperv/vmbus: Propagate close error. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8599 309140 hyperv/vmbus: Add a simplified version of channel close. So that the caller can know the channel close error and react accordingly. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8600 309224 hyperv/vmbus: Zero out GPADL if error happens. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8601 309225 hyperv/vmbus: Add supportive transaction wait function. This function supports channel revocation properly. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8611
Diffstat (limited to 'sys/dev/hyperv/include')
-rw-r--r--sys/dev/hyperv/include/vmbus.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/dev/hyperv/include/vmbus.h b/sys/dev/hyperv/include/vmbus.h
index 7fe93ce..a6dfe5b 100644
--- a/sys/dev/hyperv/include/vmbus.h
+++ b/sys/dev/hyperv/include/vmbus.h
@@ -116,6 +116,7 @@ struct vmbus_chan_br {
};
struct vmbus_channel;
+struct vmbus_xact;
struct vmbus_xact_ctx;
struct hyperv_guid;
struct task;
@@ -129,6 +130,36 @@ vmbus_get_channel(device_t dev)
return device_get_ivars(dev);
}
+/*
+ * vmbus_chan_open_br()
+ *
+ * Return values:
+ * 0 Succeeded.
+ * EISCONN Failed, and the memory passed through 'br' is still
+ * connected. Callers must _not_ free the the memory
+ * passed through 'br', if this error happens.
+ * other values Failed. The memory passed through 'br' is no longer
+ * connected. Callers are free to do anything with the
+ * memory passed through 'br'.
+ *
+ *
+ *
+ * vmbus_chan_close_direct()
+ *
+ * NOTE:
+ * Callers of this function _must_ make sure to close all sub-channels before
+ * closing the primary channel.
+ *
+ * Return values:
+ * 0 Succeeded.
+ * EISCONN Failed, and the memory associated with the bufring
+ * is still connected. Callers must _not_ free the the
+ * memory associated with the bufring, if this error
+ * happens.
+ * other values Failed. The memory associated with the bufring is
+ * no longer connected. Callers are free to do anything
+ * with the memory associated with the bufring.
+ */
int vmbus_chan_open(struct vmbus_channel *chan,
int txbr_size, int rxbr_size, const void *udata, int udlen,
vmbus_chan_callback_t cb, void *cbarg);
@@ -136,12 +167,15 @@ int vmbus_chan_open_br(struct vmbus_channel *chan,
const struct vmbus_chan_br *cbr, const void *udata,
int udlen, vmbus_chan_callback_t cb, void *cbarg);
void vmbus_chan_close(struct vmbus_channel *chan);
+int vmbus_chan_close_direct(struct vmbus_channel *chan);
void vmbus_chan_intr_drain(struct vmbus_channel *chan);
void vmbus_chan_run_task(struct vmbus_channel *chan,
struct task *task);
void vmbus_chan_set_orphan(struct vmbus_channel *chan,
struct vmbus_xact_ctx *);
void vmbus_chan_unset_orphan(struct vmbus_channel *chan);
+const void *vmbus_chan_xact_wait(const struct vmbus_channel *chan,
+ struct vmbus_xact *xact, size_t *resp_len, bool can_sleep);
int vmbus_chan_gpadl_connect(struct vmbus_channel *chan,
bus_addr_t paddr, int size, uint32_t *gpadl);
OpenPOWER on IntegriCloud