/*
 * Details of the "wire" protocol between Xen Store Daemon and client
 * library or guest kernel.
 * Copyright (C) 2005 Rusty Russell IBM Corporation
 */

#ifndef _XS_WIRE_H
#define _XS_WIRE_H

enum xsd_sockmsg_type
{
    XS_DEBUG,
    XS_DIRECTORY,
    XS_READ,
    XS_GET_PERMS,
    XS_WATCH,
    XS_UNWATCH,
    XS_TRANSACTION_START,
    XS_TRANSACTION_END,
    XS_INTRODUCE,
    XS_RELEASE,
    XS_GET_DOMAIN_PATH,
    XS_WRITE,
    XS_MKDIR,
    XS_RM,
    XS_SET_PERMS,
    XS_WATCH_EVENT,
    XS_ERROR,
    XS_IS_DOMAIN_INTRODUCED,
    XS_RESUME,
    XS_SET_TARGET,
    XS_RESTRICT,
    XS_RESET_WATCHES,
};

#define XS_WRITE_NONE "NONE"
#define XS_WRITE_CREATE "CREATE"
#define XS_WRITE_CREATE_EXCL "CREATE|EXCL"

/* We hand errors as strings, for portability. */
struct xsd_errors
{
    int errnum;
    const char *errstring;
};
#define XSD_ERROR(x) { x, #x }
static struct xsd_errors xsd_errors[] __attribute__((unused)) = {
    XSD_ERROR(EINVAL),
    XSD_ERROR(EACCES),
    XSD_ERROR(EEXIST),
    XSD_ERROR(EISDIR),
    XSD_ERROR(ENOENT),
    XSD_ERROR(ENOMEM),
    XSD_ERROR(ENOSPC),
    XSD_ERROR(EIO),
    XSD_ERROR(ENOTEMPTY),
    XSD_ERROR(ENOSYS),
    XSD_ERROR(EROFS),
    XSD_ERROR(EBUSY),
    XSD_ERROR(EAGAIN),
    XSD_ERROR(EISCONN)
};

struct xsd_sockmsg
{
    uint32_t type;  /* XS_??? */
    uint32_t req_id;/* Request identifier, echoed in daemon's response.  */
    uint32_t tx_id; /* Transaction id (0 if not related to a transaction). */
    uint32_t len;   /* Length of data following this. */

    /* Generally followed by nul-terminated string(s). */
};

enum xs_watch_type
{
    XS_WATCH_PATH = 0,
    XS_WATCH_TOKEN
};

/* Inter-domain shared memory communications. */
#define XENSTORE_RING_SIZE 1024
typedef uint32_t XENSTORE_RING_IDX;
#define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
struct xenstore_domain_interface {
    char req[XENSTORE_RING_SIZE]; /* Requests to xenstore daemon. */
    char rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
    XENSTORE_RING_IDX req_cons, req_prod;
    XENSTORE_RING_IDX rsp_cons, rsp_prod;
};

/* Violating this is very bad.  See docs/misc/xenstore.txt. */
#define XENSTORE_PAYLOAD_MAX 4096

#endif /* _XS_WIRE_H */
622b29d4ecb268e30242b1e&amp;id2=09f2ba0b0b7c44ecea49cf69a708203b76ba5535'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/drivers/usb/serial/garmin_gps.c'>
<input type='hidden' name='id' value='56e3d92ddb97d9584622b29d4ecb268e30242b1e'/><input type='hidden' name='id2' value='09f2ba0b0b7c44ecea49cf69a708203b76ba5535'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/diff/?id=56e3d92ddb97d9584622b29d4ecb268e30242b1e&amp;id2=09f2ba0b0b7c44ecea49cf69a708203b76ba5535'>root</a>/<a href='/cgit.cgi/linux/net-next.git/diff/drivers?id=56e3d92ddb97d9584622b29d4ecb268e30242b1e&amp;id2=09f2ba0b0b7c44ecea49cf69a708203b76ba5535'>drivers</a>/<a href='/cgit.cgi/linux/net-next.git/diff/drivers/usb?id=56e3d92ddb97d9584622b29d4ecb268e30242b1e&amp;id2=09f2ba0b0b7c44ecea49cf69a708203b76ba5535'>usb</a>/<a href='/cgit.cgi/linux/net-next.git/diff/drivers/usb/serial?id=56e3d92ddb97d9584622b29d4ecb268e30242b1e&amp;id2=09f2ba0b0b7c44ecea49cf69a708203b76ba5535'>serial</a>/<a href='/cgit.cgi/linux/net-next.git/diff/drivers/usb/serial/garmin_gps.c?id=56e3d92ddb97d9584622b29d4ecb268e30242b1e&amp;id2=09f2ba0b0b7c44ecea49cf69a708203b76ba5535'>garmin_gps.c</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='56e3d92ddb97d9584622b29d4ecb268e30242b1e'/><input type='hidden' name='id2' value='09f2ba0b0b7c44ecea49cf69a708203b76ba5535'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?id=56e3d92ddb97d9584622b29d4ecb268e30242b1e&amp;id2=09f2ba0b0b7c44ecea49cf69a708203b76ba5535'>Diffstat</a> (limited to 'drivers/usb/serial/garmin_gps.c')</div><table summary='diffstat' class='diffstat'>