vmbus_xact.h revision 303947
1303947Ssephe/*- 2303947Ssephe * Copyright (c) 2016 Microsoft Corp. 3303947Ssephe * All rights reserved. 4303947Ssephe * 5303947Ssephe * Redistribution and use in source and binary forms, with or without 6303947Ssephe * modification, are permitted provided that the following conditions 7303947Ssephe * are met: 8303947Ssephe * 1. Redistributions of source code must retain the above copyright 9303947Ssephe * notice unmodified, this list of conditions, and the following 10303947Ssephe * disclaimer. 11303947Ssephe * 2. Redistributions in binary form must reproduce the above copyright 12303947Ssephe * notice, this list of conditions and the following disclaimer in the 13303947Ssephe * documentation and/or other materials provided with the distribution. 14303947Ssephe * 15303947Ssephe * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16303947Ssephe * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17303947Ssephe * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18303947Ssephe * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19303947Ssephe * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20303947Ssephe * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21303947Ssephe * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22303947Ssephe * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23303947Ssephe * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24303947Ssephe * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25303947Ssephe * 26303947Ssephe * $FreeBSD: head/sys/dev/hyperv/include/vmbus_xact.h 303947 2016-08-11 05:49:49Z sephe $ 27303947Ssephe */ 28303947Ssephe 29303947Ssephe#ifndef _VMBUS_XACT_H_ 30303947Ssephe#define _VMBUS_XACT_H_ 31303947Ssephe 32303947Ssephe#include <sys/param.h> 33303947Ssephe#include <sys/bus.h> 34303947Ssephe 35303947Ssephestruct vmbus_xact; 36303947Ssephestruct vmbus_xact_ctx; 37303947Ssephe 38303947Ssephestruct vmbus_xact_ctx *vmbus_xact_ctx_create(bus_dma_tag_t dtag, 39303947Ssephe size_t req_size, size_t resp_size); 40303947Ssephevoid vmbus_xact_ctx_destroy(struct vmbus_xact_ctx *ctx); 41303947Ssephestruct vmbus_xact *vmbus_xact_get(struct vmbus_xact_ctx *ctx, 42303947Ssephe size_t req_len); 43303947Ssephevoid vmbus_xact_put(struct vmbus_xact *xact); 44303947Ssephe 45303947Ssephevoid *vmbus_xact_req_data(const struct vmbus_xact *xact); 46303947Ssephebus_addr_t vmbus_xact_req_paddr(const struct vmbus_xact *xact); 47303947Ssephevoid vmbus_xact_activate(struct vmbus_xact *xact); 48303947Ssephevoid vmbus_xact_deactivate(struct vmbus_xact *xact); 49303947Ssepheconst void *vmbus_xact_wait(struct vmbus_xact *xact, 50303947Ssephe size_t *resp_len); 51303947Ssephevoid vmbus_xact_wakeup(struct vmbus_xact *xact, 52303947Ssephe const void *data, size_t dlen); 53303947Ssephe 54303947Ssephe#endif /* !_VMBUS_XACT_H_ */ 55