/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
 */

#include <asm/ioctl.h>

typedef struct{
	char devname[16]; /* in */
	unsigned short pid; /* in */
	unsigned int slot; /* out */
	unsigned int error; /* out */
} pidquery_t;

#define IOCTL_PIDQUERY _IOWR(13, 79, pidquery_t*)

typedef struct {
	int handle;
	int size1;
	int size2;
	void *buffer;
	int errorcode;
} allocbuf_t;

#define IOCTL_ALLOCBUF _IOWR( '\r', 12, allocbuf_t *)

typedef struct {
	void *buffer;
	int errorcode;
} freebuf_t;

#define IOCTL_FREEBUF _IOWR( '\r', 13, freebuf_t *)

typedef struct {
	void *buffer;
	unsigned int bytesready;
	int errorcode;
} bytesready_t;

#define IOCTL_BYTESREADY _IOWR( '\r', 41, bytesready_t *)

typedef struct {
	int handle;
	void *buffer;
	int magic;
	int errorcode;
} setbuffer_t;

#define IOCTL_SETBUFFER _IOWR( '\r', 95, setbuffer_t *)

typedef struct {
	int handle;
	int errorcode;
} unsetbuffer_t;

#define IOCTL_UNSETBUFFER _IOWR( '\r', 96, unsetbuffer_t *)

typedef struct{
	void *buffer;
	void *dst;
	unsigned int dst_size;
	int magic[2];
	int bytes2read;
	int unknown;
	int errorcode;
} bufferread_t;

#define IOCTL_BUFFERREAD _IOWR( '\r', 67, bufferread_t *)

