aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hptiop.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/hptiop.h')
-rw-r--r--drivers/scsi/hptiop.h229
1 files changed, 10 insertions, 219 deletions
diff --git a/drivers/scsi/hptiop.h b/drivers/scsi/hptiop.h
index f04f7e81d1ae..2a5e46e001cb 100644
--- a/drivers/scsi/hptiop.h
+++ b/drivers/scsi/hptiop.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * HighPoint RR3xxx controller driver for Linux 2 * HighPoint RR3xxx controller driver for Linux
3 * Copyright (C) 2006 HighPoint Technologies, Inc. All Rights Reserved. 3 * Copyright (C) 2006-2007 HighPoint Technologies, Inc. All Rights Reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -18,219 +18,6 @@
18#ifndef _HPTIOP_H_ 18#ifndef _HPTIOP_H_
19#define _HPTIOP_H_ 19#define _HPTIOP_H_
20 20
21/*
22 * logical device type.
23 * Identify array (logical device) and physical device.
24 */
25#define LDT_ARRAY 1
26#define LDT_DEVICE 2
27
28/*
29 * Array types
30 */
31#define AT_UNKNOWN 0
32#define AT_RAID0 1
33#define AT_RAID1 2
34#define AT_RAID5 3
35#define AT_RAID6 4
36#define AT_JBOD 7
37
38#define MAX_NAME_LENGTH 36
39#define MAX_ARRAYNAME_LEN 16
40
41#define MAX_ARRAY_MEMBERS_V1 8
42#define MAX_ARRAY_MEMBERS_V2 16
43
44/* keep definition for source code compatiblity */
45#define MAX_ARRAY_MEMBERS MAX_ARRAY_MEMBERS_V1
46
47/*
48 * array flags
49 */
50#define ARRAY_FLAG_DISABLED 0x00000001 /* The array is disabled */
51#define ARRAY_FLAG_NEEDBUILDING 0x00000002 /* need to be rebuilt */
52#define ARRAY_FLAG_REBUILDING 0x00000004 /* in rebuilding process */
53#define ARRAY_FLAG_BROKEN 0x00000008 /* broken but still working */
54#define ARRAY_FLAG_BOOTDISK 0x00000010 /* has a active partition */
55#define ARRAY_FLAG_BOOTMARK 0x00000040 /* array has boot mark set */
56#define ARRAY_FLAG_NEED_AUTOREBUILD 0x00000080 /* auto-rebuild should start */
57#define ARRAY_FLAG_VERIFYING 0x00000100 /* is being verified */
58#define ARRAY_FLAG_INITIALIZING 0x00000200 /* is being initialized */
59#define ARRAY_FLAG_TRANSFORMING 0x00000400 /* tranform in progress */
60#define ARRAY_FLAG_NEEDTRANSFORM 0x00000800 /* array need tranform */
61#define ARRAY_FLAG_NEEDINITIALIZING 0x00001000 /* initialization not done */
62#define ARRAY_FLAG_BROKEN_REDUNDANT 0x00002000 /* broken but redundant */
63
64/*
65 * device flags
66 */
67#define DEVICE_FLAG_DISABLED 0x00000001 /* device is disabled */
68#define DEVICE_FLAG_UNINITIALIZED 0x00010000 /* device is not initialized */
69#define DEVICE_FLAG_LEGACY 0x00020000 /* lagacy drive */
70#define DEVICE_FLAG_IS_SPARE 0x80000000 /* is a spare disk */
71
72/*
73 * ioctl codes
74 */
75#define HPT_CTL_CODE(x) (x+0xFF00)
76#define HPT_CTL_CODE_LINUX_TO_IOP(x) ((x)-0xff00)
77
78#define HPT_IOCTL_GET_CONTROLLER_INFO HPT_CTL_CODE(2)
79#define HPT_IOCTL_GET_CHANNEL_INFO HPT_CTL_CODE(3)
80#define HPT_IOCTL_GET_LOGICAL_DEVICES HPT_CTL_CODE(4)
81#define HPT_IOCTL_GET_DRIVER_CAPABILITIES HPT_CTL_CODE(19)
82#define HPT_IOCTL_GET_DEVICE_INFO_V3 HPT_CTL_CODE(46)
83#define HPT_IOCTL_GET_CONTROLLER_INFO_V2 HPT_CTL_CODE(47)
84
85/*
86 * Controller information.
87 */
88struct hpt_controller_info {
89 u8 chip_type; /* chip type */
90 u8 interrupt_level; /* IRQ level */
91 u8 num_buses; /* bus count */
92 u8 chip_flags;
93
94 u8 product_id[MAX_NAME_LENGTH];/* product name */
95 u8 vendor_id[MAX_NAME_LENGTH]; /* vendor name */
96}
97__attribute__((packed));
98
99/*
100 * Channel information.
101 */
102struct hpt_channel_info {
103 __le32 io_port; /* IDE Base Port Address */
104 __le32 control_port; /* IDE Control Port Address */
105 __le32 devices[2]; /* device connected to this channel */
106}
107__attribute__((packed));
108
109/*
110 * Array information.
111 */
112struct hpt_array_info_v3 {
113 u8 name[MAX_ARRAYNAME_LEN]; /* array name */
114 u8 description[64]; /* array description */
115 u8 create_manager[16]; /* who created it */
116 __le32 create_time; /* when created it */
117
118 u8 array_type; /* array type */
119 u8 block_size_shift; /* stripe size */
120 u8 ndisk; /* Number of ID in Members[] */
121 u8 reserved;
122
123 __le32 flags; /* working flags, see ARRAY_FLAG_XXX */
124 __le32 members[MAX_ARRAY_MEMBERS_V2]; /* member array/disks */
125
126 __le32 rebuilding_progress;
127 __le64 rebuilt_sectors; /* rebuilding point (LBA) for single member */
128
129 __le32 transform_source;
130 __le32 transform_target; /* destination device ID */
131 __le32 transforming_progress;
132 __le32 signature; /* persistent identification*/
133 __le16 critical_members; /* bit mask of critical members */
134 __le16 reserve2;
135 __le32 reserve;
136}
137__attribute__((packed));
138
139/*
140 * physical device information.
141 */
142#define MAX_PARENTS_PER_DISK 8
143
144struct hpt_device_info_v2 {
145 u8 ctlr_id; /* controller id */
146 u8 path_id; /* bus */
147 u8 target_id; /* id */
148 u8 device_mode_setting; /* Current Data Transfer mode: 0-4 PIO0-4 */
149 /* 5-7 MW DMA0-2, 8-13 UDMA0-5 */
150 u8 device_type; /* device type */
151 u8 usable_mode; /* highest usable mode */
152
153#ifdef __BIG_ENDIAN_BITFIELD
154 u8 NCQ_enabled: 1;
155 u8 NCQ_supported: 1;
156 u8 TCQ_enabled: 1;
157 u8 TCQ_supported: 1;
158 u8 write_cache_enabled: 1;
159 u8 write_cache_supported: 1;
160 u8 read_ahead_enabled: 1;
161 u8 read_ahead_supported: 1;
162 u8 reserved6: 6;
163 u8 spin_up_mode: 2;
164#else
165 u8 read_ahead_supported: 1;
166 u8 read_ahead_enabled: 1;
167 u8 write_cache_supported: 1;
168 u8 write_cache_enabled: 1;
169 u8 TCQ_supported: 1;
170 u8 TCQ_enabled: 1;
171 u8 NCQ_supported: 1;
172 u8 NCQ_enabled: 1;
173 u8 spin_up_mode: 2;
174 u8 reserved6: 6;
175#endif
176
177 __le32 flags; /* working flags, see DEVICE_FLAG_XXX */
178 u8 ident[150]; /* (partitial) Identify Data of this device */
179
180 __le64 total_free;
181 __le64 max_free;
182 __le64 bad_sectors;
183 __le32 parent_arrays[MAX_PARENTS_PER_DISK];
184}
185__attribute__((packed));
186
187/*
188 * Logical device information.
189 */
190#define INVALID_TARGET_ID 0xFF
191#define INVALID_BUS_ID 0xFF
192
193struct hpt_logical_device_info_v3 {
194 u8 type; /* LDT_ARRAY or LDT_DEVICE */
195 u8 cache_policy; /* refer to CACHE_POLICY_xxx */
196 u8 vbus_id; /* vbus sequence in vbus_list */
197 u8 target_id; /* OS target id. 0xFF is invalid */
198 /* OS name: DISK $VBusId_$TargetId */
199 __le64 capacity; /* array capacity */
200 __le32 parent_array; /* don't use this field for physical
201 device. use ParentArrays field in
202 hpt_device_info_v2 */
203 /* reserved statistic fields */
204 __le32 stat1;
205 __le32 stat2;
206 __le32 stat3;
207 __le32 stat4;
208
209 union {
210 struct hpt_array_info_v3 array;
211 struct hpt_device_info_v2 device;
212 } __attribute__((packed)) u;
213
214}
215__attribute__((packed));
216
217/*
218 * ioctl structure
219 */
220#define HPT_IOCTL_MAGIC 0xA1B2C3D4
221
222struct hpt_ioctl_u {
223 u32 magic; /* used to check if it's a valid ioctl packet */
224 u32 ioctl_code; /* operation control code */
225 void __user *inbuf; /* input data buffer */
226 u32 inbuf_size; /* size of input data buffer */
227 void __user *outbuf; /* output data buffer */
228 u32 outbuf_size; /* size of output data buffer */
229 void __user *bytes_returned; /* count of bytes returned */
230}
231__attribute__((packed));
232
233
234struct hpt_iopmu 21struct hpt_iopmu
235{ 22{
236 __le32 resrved0[4]; 23 __le32 resrved0[4];
@@ -252,6 +39,8 @@ struct hpt_iopmu
252#define IOPMU_QUEUE_EMPTY 0xffffffff 39#define IOPMU_QUEUE_EMPTY 0xffffffff
253#define IOPMU_QUEUE_MASK_HOST_BITS 0xf0000000 40#define IOPMU_QUEUE_MASK_HOST_BITS 0xf0000000
254#define IOPMU_QUEUE_ADDR_HOST_BIT 0x80000000 41#define IOPMU_QUEUE_ADDR_HOST_BIT 0x80000000
42#define IOPMU_QUEUE_REQUEST_SIZE_BIT 0x40000000
43#define IOPMU_QUEUE_REQUEST_RESULT_BIT 0x40000000
255 44
256#define IOPMU_OUTBOUND_INT_MSG0 1 45#define IOPMU_OUTBOUND_INT_MSG0 1
257#define IOPMU_OUTBOUND_INT_MSG1 2 46#define IOPMU_OUTBOUND_INT_MSG1 2
@@ -336,7 +125,8 @@ struct hpt_iop_request_set_config
336{ 125{
337 struct hpt_iop_request_header header; 126 struct hpt_iop_request_header header;
338 __le32 iop_id; 127 __le32 iop_id;
339 __le32 vbus_id; 128 __le16 vbus_id;
129 __le16 max_host_request_size;
340 __le32 reserve[6]; 130 __le32 reserve[6];
341}; 131};
342 132
@@ -412,9 +202,8 @@ struct hptiop_hba {
412 struct Scsi_Host * host; 202 struct Scsi_Host * host;
413 struct pci_dev * pcidev; 203 struct pci_dev * pcidev;
414 204
415 struct list_head link;
416
417 /* IOP config info */ 205 /* IOP config info */
206 u32 interface_version;
418 u32 firmware_version; 207 u32 firmware_version;
419 u32 sdram_size; 208 u32 sdram_size;
420 u32 max_devices; 209 u32 max_devices;
@@ -423,8 +212,10 @@ struct hptiop_hba {
423 u32 max_sg_descriptors; 212 u32 max_sg_descriptors;
424 213
425 u32 req_size; /* host-allocated request buffer size */ 214 u32 req_size; /* host-allocated request buffer size */
426 int initialized; 215
427 int msg_done; 216 int iopintf_v2: 1;
217 int initialized: 1;
218 int msg_done: 1;
428 219
429 struct hptiop_request * req_list; 220 struct hptiop_request * req_list;
430 struct hptiop_request reqs[HPTIOP_MAX_REQUESTS]; 221 struct hptiop_request reqs[HPTIOP_MAX_REQUESTS];