/*-1* Copyright (c) 2010-2012 Hans Petter Selasky. All rights reserved.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions5* are met:6* 1. Redistributions of source code must retain the above copyright7* notice, this list of conditions and the following disclaimer.8* 2. Redistributions in binary form must reproduce the above copyright9* notice, this list of conditions and the following disclaimer in the10* documentation and/or other materials provided with the distribution.11*12* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND13* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE14* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE15* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE16* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL17* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS18* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)19* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT20* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY21* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF22* SUCH DAMAGE.23*/2425#ifndef _CUSE_DEFS_H_26#define _CUSE_DEFS_H_2728#define CUSE_VERSION 0x0001252930#define CUSE_ERR_NONE 031#define CUSE_ERR_BUSY -132#define CUSE_ERR_WOULDBLOCK -233#define CUSE_ERR_INVALID -334#define CUSE_ERR_NO_MEMORY -435#define CUSE_ERR_FAULT -536#define CUSE_ERR_SIGNAL -637#define CUSE_ERR_OTHER -738#define CUSE_ERR_NOT_LOADED -839#define CUSE_ERR_NO_DEVICE -94041#define CUSE_POLL_NONE 042#define CUSE_POLL_READ 143#define CUSE_POLL_WRITE 244#define CUSE_POLL_ERROR 44546#define CUSE_FFLAG_NONE 047#define CUSE_FFLAG_READ 148#define CUSE_FFLAG_WRITE 249#define CUSE_FFLAG_NONBLOCK 450#define CUSE_FFLAG_COMPAT32 8 /* peer is running in 32-bit compat mode */5152#define CUSE_DBG_NONE 053#define CUSE_DBG_FULL 15455/* maximum data transfer length */56#define CUSE_LENGTH_MAX 0x7FFFFFFFU5758enum {59CUSE_CMD_NONE,60CUSE_CMD_OPEN,61CUSE_CMD_CLOSE,62CUSE_CMD_READ,63CUSE_CMD_WRITE,64CUSE_CMD_IOCTL,65CUSE_CMD_POLL,66CUSE_CMD_SIGNAL,67CUSE_CMD_SYNC,68CUSE_CMD_MAX,69};7071#define CUSE_MAKE_ID(a,b,c,u) ((((a) & 0x7F) << 24)| \72(((b) & 0xFF) << 16)|(((c) & 0xFF) << 8)|((u) & 0xFF))7374#define CUSE_ID_MASK 0x7FFFFF00U7576/*77* The following ID's are defined:78* ===============================79*/80#define CUSE_ID_DEFAULT(what) CUSE_MAKE_ID(0,0,what,0)81#define CUSE_ID_WEBCAMD(what) CUSE_MAKE_ID('W','C',what,0) /* Used by Webcamd. */82#define CUSE_ID_SUNDTEK(what) CUSE_MAKE_ID('S','K',what,0) /* Used by Sundtek. */83#define CUSE_ID_CX88(what) CUSE_MAKE_ID('C','X',what,0) /* Used by cx88 driver. */84#define CUSE_ID_UHIDD(what) CUSE_MAKE_ID('U','D',what,0) /* Used by uhidd. */8586#endif /* _CUSE_DEFS_H_ */878889