summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/include/vmbus.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/hyperv/include/vmbus.h')
-rw-r--r--sys/dev/hyperv/include/vmbus.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/sys/dev/hyperv/include/vmbus.h b/sys/dev/hyperv/include/vmbus.h
index b429021..56be416 100644
--- a/sys/dev/hyperv/include/vmbus.h
+++ b/sys/dev/hyperv/include/vmbus.h
@@ -50,6 +50,9 @@
#define VMBUS_VERSION_MAJOR(ver) (((uint32_t)(ver)) >> 16)
#define VMBUS_VERSION_MINOR(ver) (((uint32_t)(ver)) & 0xffff)
+#define VMBUS_CHAN_POLLHZ_MIN 100 /* 10ms interval */
+#define VMBUS_CHAN_POLLHZ_MAX 1000000 /* 1us interval */
+
/*
* GPA stuffs.
*/
@@ -117,6 +120,8 @@ struct vmbus_chan_br {
};
struct vmbus_channel;
+struct vmbus_xact;
+struct vmbus_xact_ctx;
struct hyperv_guid;
struct task;
struct taskqueue;
@@ -129,6 +134,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,9 +171,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);
@@ -173,6 +214,7 @@ int vmbus_chan_send_prplist(struct vmbus_channel *chan,
uint32_t vmbus_chan_id(const struct vmbus_channel *chan);
uint32_t vmbus_chan_subidx(const struct vmbus_channel *chan);
bool vmbus_chan_is_primary(const struct vmbus_channel *chan);
+bool vmbus_chan_is_revoked(const struct vmbus_channel *chan);
const struct hyperv_guid *
vmbus_chan_guid_inst(const struct vmbus_channel *chan);
int vmbus_chan_prplist_nelem(int br_size, int prpcnt_max,
@@ -182,4 +224,8 @@ bool vmbus_chan_tx_empty(const struct vmbus_channel *chan);
struct taskqueue *
vmbus_chan_mgmt_tq(const struct vmbus_channel *chan);
+void vmbus_chan_poll_enable(struct vmbus_channel *chan,
+ u_int pollhz);
+void vmbus_chan_poll_disable(struct vmbus_channel *chan);
+
#endif /* !_VMBUS_H_ */
OpenPOWER on IntegriCloud