1185605Skmacy#-
2185605Skmacy# Copyright (c) 2008 Doug Rabson
3185605Skmacy# All rights reserved.
4185605Skmacy#
5185605Skmacy# Redistribution and use in source and binary forms, with or without
6185605Skmacy# modification, are permitted provided that the following conditions
7185605Skmacy# are met:
8185605Skmacy# 1. Redistributions of source code must retain the above copyright
9185605Skmacy#    notice, this list of conditions and the following disclaimer.
10185605Skmacy# 2. Redistributions in binary form must reproduce the above copyright
11185605Skmacy#    notice, this list of conditions and the following disclaimer in the
12185605Skmacy#    documentation and/or other materials provided with the distribution.
13185605Skmacy#
14185605Skmacy# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15185605Skmacy# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16185605Skmacy# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17185605Skmacy# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18185605Skmacy# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19185605Skmacy# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20185605Skmacy# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21185605Skmacy# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22185605Skmacy# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23185605Skmacy# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24185605Skmacy# SUCH DAMAGE.
25185605Skmacy#
26185605Skmacy# $FreeBSD$
27185605Skmacy#
28185605Skmacy
29185605Skmacy#include <sys/bus.h>
30185605Skmacy
31222975Sgibbs#include <machine/atomic.h>
32255040Sgibbs
33255040Sgibbs#include <xen/xen-os.h>
34222975Sgibbs#include <xen/evtchn.h>
35222975Sgibbs#include <xen/xenbus/xenbusvar.h>
36222975Sgibbs
37185605SkmacyINTERFACE xenbus;
38185605Skmacy
39214077Sgibbs/**
40214077Sgibbs * \brief Callback triggered when the state of the otherend
41214077Sgibbs *        of a split device changes.
42214077Sgibbs *
43214077Sgibbs * \param _dev       NewBus device_t for this XenBus device whose otherend's
44214077Sgibbs *                   state has changed..
45214077Sgibbs * \param _newstate  The new state of the otherend device.
46214077Sgibbs */
47222975SgibbsMETHOD void otherend_changed {
48214077Sgibbs	device_t _dev;
49214077Sgibbs	enum xenbus_state _newstate;
50185605Skmacy};
51222975Sgibbs
52222975Sgibbs/**
53222975Sgibbs * \brief Callback triggered when the XenStore tree of the local end
54222975Sgibbs *        of a split device changes.
55222975Sgibbs *
56222975Sgibbs * \param _dev   NewBus device_t for this XenBus device whose otherend's
57222975Sgibbs *               state has changed..
58222975Sgibbs * \param _path  The tree relative sub-path to the modified node.  The empty
59222975Sgibbs *               string indicates the root of the tree was destroyed.
60222975Sgibbs */
61222975SgibbsMETHOD void localend_changed {
62222975Sgibbs	device_t _dev;
63222975Sgibbs	const char * _path;
64222975Sgibbs} DEFAULT xenbus_localend_changed;
65