1607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#ifndef _UAPICCISS_IOCTLH
2607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define _UAPICCISS_IOCTLH
3607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
4607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#include <linux/types.h>
5607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#include <linux/ioctl.h>
6607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#include <linux/cciss_defs.h>
7607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
8607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_IOC_MAGIC 'B'
9607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
10607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
11607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howellstypedef struct _cciss_pci_info_struct
12607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells{
13607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells	unsigned char 	bus;
14607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells	unsigned char 	dev_fn;
15607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells	unsigned short	domain;
16607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells	__u32 		board_id;
17607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells} cciss_pci_info_struct;
18607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
19607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howellstypedef struct _cciss_coalint_struct
20607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells{
21607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells	__u32  delay;
22607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells	__u32  count;
23607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells} cciss_coalint_struct;
24607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
25607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howellstypedef char NodeName_type[16];
26607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
27607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howellstypedef __u32 Heartbeat_type;
28607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
29607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CISS_PARSCSIU2 	0x0001
30607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CISS_PARCSCIU3 	0x0002
31607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CISS_FIBRE1G	0x0100
32607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CISS_FIBRE2G	0x0200
33607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howellstypedef __u32 BusTypes_type;
34607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
35607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howellstypedef char FirmwareVer_type[4];
36607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howellstypedef __u32 DriverVer_type;
37607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
38607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define MAX_KMALLOC_SIZE 128000
39607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
40607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howellstypedef struct _IOCTL_Command_struct {
41607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells  LUNAddr_struct	   LUN_info;
42607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells  RequestBlock_struct      Request;
43607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells  ErrorInfo_struct  	   error_info;
44607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells  WORD			   buf_size;  /* size in bytes of the buf */
45607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells  BYTE			   __user *buf;
46607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells} IOCTL_Command_struct;
47607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
48607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howellstypedef struct _BIG_IOCTL_Command_struct {
49607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells  LUNAddr_struct	   LUN_info;
50607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells  RequestBlock_struct      Request;
51607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells  ErrorInfo_struct  	   error_info;
52607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells  DWORD			   malloc_size; /* < MAX_KMALLOC_SIZE in cciss.c */
53607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells  DWORD			   buf_size;    /* size in bytes of the buf */
54607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells  				        /* < malloc_size * MAXSGENTRIES */
55607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells  BYTE			   __user *buf;
56607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells} BIG_IOCTL_Command_struct;
57607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
58607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howellstypedef struct _LogvolInfo_struct{
59607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells	__u32	LunID;
60607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells	int	num_opens;  /* number of opens on the logical volume */
61607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells	int	num_parts;  /* number of partitions configured on logvol */
62607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells} LogvolInfo_struct;
63607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
64607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_GETPCIINFO _IOR(CCISS_IOC_MAGIC, 1, cciss_pci_info_struct)
65607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
66607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_GETINTINFO _IOR(CCISS_IOC_MAGIC, 2, cciss_coalint_struct)
67607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_SETINTINFO _IOW(CCISS_IOC_MAGIC, 3, cciss_coalint_struct)
68607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
69607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_GETNODENAME _IOR(CCISS_IOC_MAGIC, 4, NodeName_type)
70607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_SETNODENAME _IOW(CCISS_IOC_MAGIC, 5, NodeName_type)
71607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
72607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_GETHEARTBEAT _IOR(CCISS_IOC_MAGIC, 6, Heartbeat_type)
73607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_GETBUSTYPES  _IOR(CCISS_IOC_MAGIC, 7, BusTypes_type)
74607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_GETFIRMVER   _IOR(CCISS_IOC_MAGIC, 8, FirmwareVer_type)
75607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_GETDRIVVER   _IOR(CCISS_IOC_MAGIC, 9, DriverVer_type)
76607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_REVALIDVOLS  _IO(CCISS_IOC_MAGIC, 10)
77607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_PASSTHRU	   _IOWR(CCISS_IOC_MAGIC, 11, IOCTL_Command_struct)
78607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_DEREGDISK	   _IO(CCISS_IOC_MAGIC, 12)
79607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
80607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells/* no longer used... use REGNEWD instead */
81607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_REGNEWDISK  _IOW(CCISS_IOC_MAGIC, 13, int)
82607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
83607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_REGNEWD	   _IO(CCISS_IOC_MAGIC, 14)
84607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_RESCANDISK   _IO(CCISS_IOC_MAGIC, 16)
85607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_GETLUNINFO   _IOR(CCISS_IOC_MAGIC, 17, LogvolInfo_struct)
86607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#define CCISS_BIG_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL_Command_struct)
87607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells
88607ca46e97a1b6594b29647d98a32d545c24bdffDavid Howells#endif /* _UAPICCISS_IOCTLH */
89