Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
drivers
scsi
megaraid
megaraid_ioctl.h
Go to the documentation of this file.
1
/*
2
*
3
* Linux MegaRAID device driver
4
*
5
* Copyright (c) 2003-2004 LSI Logic Corporation.
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version
10
* 2 of the License, or (at your option) any later version.
11
*
12
* FILE : megaraid_ioctl.h
13
*
14
* Definitions to interface with user level applications
15
*/
16
17
#ifndef _MEGARAID_IOCTL_H_
18
#define _MEGARAID_IOCTL_H_
19
20
#include <linux/types.h>
21
#include <
linux/semaphore.h
>
22
23
#include "
mbox_defs.h
"
24
25
/*
26
* console messages debug levels
27
*/
28
#define CL_ANN 0
/* print unconditionally, announcements */
29
#define CL_DLEVEL1 1
/* debug level 1, informative */
30
#define CL_DLEVEL2 2
/* debug level 2, verbose */
31
#define CL_DLEVEL3 3
/* debug level 3, very verbose */
32
42
#define con_log(level, fmt) if (LSI_DBGLVL >= level) printk fmt;
43
44
/*
45
* Definitions & Declarations needed to use common management module
46
*/
47
48
#define MEGAIOC_MAGIC 'm'
49
#define MEGAIOCCMD _IOWR(MEGAIOC_MAGIC, 0, mimd_t)
50
51
#define MEGAIOC_QNADAP 'm'
/* Query # of adapters */
52
#define MEGAIOC_QDRVRVER 'e'
/* Query driver version */
53
#define MEGAIOC_QADAPINFO 'g'
/* Query adapter information */
54
55
#define USCSICMD 0x80
56
#define UIOC_RD 0x00001
57
#define UIOC_WR 0x00002
58
59
#define MBOX_CMD 0x00000
60
#define GET_DRIVER_VER 0x10000
61
#define GET_N_ADAP 0x20000
62
#define GET_ADAP_INFO 0x30000
63
#define GET_CAP 0x40000
64
#define GET_STATS 0x50000
65
#define GET_IOCTL_VERSION 0x01
66
67
#define EXT_IOCTL_SIGN_SZ 16
68
#define EXT_IOCTL_SIGN "$$_EXTD_IOCTL_$$"
69
70
#define MBOX_LEGACY 0x00
/* ioctl has legacy mbox*/
71
#define MBOX_HPE 0x01
/* ioctl has hpe mbox */
72
73
#define APPTYPE_MIMD 0x00
/* old existing apps */
74
#define APPTYPE_UIOC 0x01
/* new apps using uioc */
75
76
#define IOCTL_ISSUE 0x00000001
/* Issue ioctl */
77
#define IOCTL_ABORT 0x00000002
/* Abort previous ioctl */
78
79
#define DRVRTYPE_MBOX 0x00000001
/* regular mbox driver */
80
#define DRVRTYPE_HPE 0x00000002
/* new hpe driver */
81
82
#define MKADAP(adapno) (MEGAIOC_MAGIC << 8 | (adapno) )
83
#define GETADAP(mkadap) ((mkadap) ^ MEGAIOC_MAGIC << 8)
84
85
#define MAX_DMA_POOLS 5
/* 4k, 8k, 16k, 32k, 64k*/
86
87
117
typedef
struct
uioc
{
118
119
/* User Apps: */
120
121
uint8_t
signature
[
EXT_IOCTL_SIGN_SZ
];
122
uint16_t
mb_type
;
123
uint16_t
app_type
;
124
uint32_t
opcode
;
125
uint32_t
adapno
;
126
uint64_t
cmdbuf
;
127
uint32_t
xferlen
;
128
uint32_t
data_dir
;
129
int32_t
status
;
130
uint8_t
reserved
[128];
131
132
/* Driver Data: */
133
void
__user
*
user_data
;
134
uint32_t
user_data_len
;
135
136
/* 64bit alignment */
137
uint32_t
pad_for_64bit_align
;
138
139
mraid_passthru_t
__user
*
user_pthru
;
140
141
mraid_passthru_t *
pthru32
;
142
dma_addr_t
pthru32_h
;
143
144
struct
list_head
list
;
145
void
(*
done
)(
struct
uioc
*);
146
147
caddr_t
buf_vaddr
;
148
dma_addr_t
buf_paddr
;
149
int8_t
pool_index
;
150
uint8_t
free_buf
;
151
152
uint8_t
timedout
;
153
154
}
__attribute__
((
aligned
(1024),packed)) uioc_t;
155
156
175
typedef
struct
mraid_hba_info
{
176
177
uint16_t
pci_vendor_id
;
178
uint16_t
pci_device_id
;
179
uint16_t
subsys_vendor_id
;
180
uint16_t
subsys_device_id
;
181
182
uint64_t
baseport
;
183
uint8_t
pci_bus
;
184
uint8_t
pci_dev_fn
;
185
uint8_t
pci_slot
;
186
uint8_t
irq
;
187
188
uint32_t
unique_id
;
189
uint32_t
host_no
;
190
191
uint8_t
num_ldrv
;
192
}
__attribute__
((
aligned
(256), packed)) mraid_hba_info_t;
193
194
209
typedef
struct
mcontroller
{
210
211
uint64_t
base
;
212
uint8_t
irq
;
213
uint8_t
numldrv
;
214
uint8_t
pcibus
;
215
uint16_t
pcidev
;
216
uint8_t
pcifun
;
217
uint16_t
pciid
;
218
uint16_t
pcivendor
;
219
uint8_t
pcislot
;
220
uint32_t
uid
;
221
222
}
__attribute__
((packed)) mcontroller_t;
223
224
235
typedef
struct
mm_dmapool
{
236
caddr_t
vaddr
;
237
dma_addr_t
paddr
;
238
uint32_t
buf_size
;
239
struct
dma_pool
*
handle
;
240
spinlock_t
lock
;
241
uint8_t
in_use
;
242
}
mm_dmapool_t
;
243
244
267
typedef
struct
mraid_mmadp
{
268
269
/* Filled by driver */
270
271
uint32_t
unique_id
;
272
uint32_t
drvr_type
;
273
unsigned
long
drvr_data
;
274
uint16_t
timeout
;
275
uint8_t
max_kioc
;
276
277
struct
pci_dev
*
pdev
;
278
279
int
(*
issue_uioc
)(
unsigned
long
, uioc_t *,
uint32_t
);
280
281
/* Maintained by common module */
282
uint32_t
quiescent
;
283
284
struct
list_head
list
;
285
uioc_t *
kioc_list
;
286
struct
list_head
kioc_pool
;
287
spinlock_t
kioc_pool_lock
;
288
struct
semaphore
kioc_semaphore
;
289
290
mbox64_t *
mbox_list
;
291
struct
dma_pool
*
pthru_dma_pool
;
292
mm_dmapool_t
dma_pool_list
[
MAX_DMA_POOLS
];
293
294
}
mraid_mmadp_t
;
295
296
int
mraid_mm_register_adp
(
mraid_mmadp_t
*);
297
int
mraid_mm_unregister_adp
(
uint32_t
);
298
uint32_t
mraid_mm_adapter_app_handle
(
uint32_t
);
299
300
#endif
/* _MEGARAID_IOCTL_H_ */
Generated on Thu Jan 10 2013 14:22:18 for Linux Kernel by
1.8.2