// IOCTLS.H -- IOCTL code definitions for AIOWDM driver

#ifndef IOCTLS_H
#define IOCTLS_H

#ifndef CTL_CODE
	#pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h")
#endif

#define FILE_DEVICE_KRNLDRVR 0x80ff

#define IOCTL_QUERY_INFO	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x800, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_QUERY_BAR_BASE	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x801, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_QUERY_BAR_RANGE	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x802, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_IRQ_WAIT_BEGIN	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x810, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_IRQ_WAIT_ABORT	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x812, METHOD_BUFFERED, FILE_ANY_ACCESS )
#define IOCTL_IRQ_POLL	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x814, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_SET_COS_SCHEME	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x816, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_FORGET_IRP	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x880, METHOD_BUFFERED, FILE_WRITE_ACCESS)

#define IOCTL_PORT_IN	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x820, METHOD_BUFFERED, FILE_READ_ACCESS )
#define IOCTL_PORT_INSTR	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x821, METHOD_BUFFERED, FILE_READ_ACCESS )
#define IOCTL_PIO_INSTR	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x821, METHOD_OUT_DIRECT, FILE_READ_ACCESS )
#define IOCTL_PORT_OUT	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x822, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_PORT_OUTSTR	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x823, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_PIO_OUTSTR	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x823, METHOD_IN_DIRECT,  FILE_WRITE_ACCESS)
//#define IOCTL_MEM_IN	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x824, METHOD_BUFFERED, FILE_READ_ACCESS )
//#define IOCTL_MEM_OUT	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x826, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_PORTMB_OUT	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x82A, METHOD_BUFFERED, FILE_WRITE_ACCESS)

#define IOCTL_InBAR CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x850, METHOD_BUFFERED, FILE_READ_ACCESS )
#define IOCTL_OutBAR CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x851, METHOD_BUFFERED, FILE_WRITE_ACCESS)

#define IOCTL_GET_BENCH	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x830, METHOD_BUFFERED, FILE_READ_ACCESS )

/*
#define IOCTL_DMA_RAW_START	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x840, METHOD_BUFFERED,   FILE_ANY_ACCESS  )
#define IOCTL_DMA_RAW_STOP	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x841, METHOD_BUFFERED,   FILE_ANY_ACCESS  )

#define IOCTL_DMA_RAW_READ	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x820, METHOD_OUT_DIRECT, FILE_READ_ACCESS )
#define IOCTL_DMA_RAW_WRITE	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x820, METHOD_IN_DIRECT,  FILE_WRITE_ACCESS)
*/

#define IOCTL_DMA_PIONG_CONTROL	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x840, METHOD_BUFFERED,   FILE_WRITE_ACCESS)
#define IOCTL_DMA_PIONG_READ	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x840, METHOD_OUT_DIRECT, FILE_READ_ACCESS )
//#define IOCTL_DMA_PIONG_WRITE	CTL_CODE(FILE_DEVICE_KRNLDRVR, 0x840, METHOD_IN_DIRECT,  FILE_WRITE_ACCESS)

#endif
