1718cf2ccSPedro F. Giffuni /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 3718cf2ccSPedro F. Giffuni * 4b063a422SScott Long * Copyright (c) HighPoint Technologies, Inc. 5b063a422SScott Long * All rights reserved. 6b063a422SScott Long * 7b063a422SScott Long * Redistribution and use in source and binary forms, with or without 8b063a422SScott Long * modification, are permitted provided that the following conditions 9b063a422SScott Long * are met: 10b063a422SScott Long * 1. Redistributions of source code must retain the above copyright 11b063a422SScott Long * notice, this list of conditions and the following disclaimer. 12b063a422SScott Long * 2. Redistributions in binary form must reproduce the above copyright 13b063a422SScott Long * notice, this list of conditions and the following disclaimer in the 14b063a422SScott Long * documentation and/or other materials provided with the distribution. 15b063a422SScott Long * 16b063a422SScott Long * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17b063a422SScott Long * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18b063a422SScott Long * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19b063a422SScott Long * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20b063a422SScott Long * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21b063a422SScott Long * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22b063a422SScott Long * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23b063a422SScott Long * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24b063a422SScott Long * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25b063a422SScott Long * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26b063a422SScott Long * SUCH DAMAGE. 27b063a422SScott Long * 28b063a422SScott Long * $FreeBSD$ 29b063a422SScott Long */ 30b063a422SScott Long #include <dev/hptrr/hptrr_config.h> 31b063a422SScott Long 32b063a422SScott Long 33b063a422SScott Long #ifndef HPT_INTF_H 34b063a422SScott Long #define HPT_INTF_H 35b063a422SScott Long 36b063a422SScott Long #if defined(__BIG_ENDIAN__)&&!defined(__BIG_ENDIAN_BITFIELD) 37b063a422SScott Long #define __BIG_ENDIAN_BITFIELD 38b063a422SScott Long #endif 39b063a422SScott Long 40b063a422SScott Long #ifdef __cplusplus 41b063a422SScott Long extern "C" { 42b063a422SScott Long #endif 43b063a422SScott Long 44b063a422SScott Long #ifndef __GNUC__ 45b063a422SScott Long #define __attribute__(x) 46b063a422SScott Long #endif 47b063a422SScott Long 48b063a422SScott Long #pragma pack(1) 49b063a422SScott Long 50b063a422SScott Long /* 51b063a422SScott Long * Version of this interface. 52b063a422SScott Long * The user mode application must first issue a hpt_get_version() call to 53b063a422SScott Long * check HPT_INTERFACE_VERSION. When an utility using newer version interface 54b063a422SScott Long * is used with old version drivers, it must call only the functions that 55b063a422SScott Long * driver supported. 56b063a422SScott Long * A new version interface should only add ioctl functions; it should implement 57b063a422SScott Long * all old version functions without change their definition. 58b063a422SScott Long */ 59b063a422SScott Long #define __this_HPT_INTERFACE_VERSION 0x02000001 60b063a422SScott Long 61b063a422SScott Long #ifndef HPT_INTERFACE_VERSION 62b063a422SScott Long #error "You must define HPT_INTERFACE_VERSION you implemented" 63b063a422SScott Long #endif 64b063a422SScott Long 65b063a422SScott Long #if HPT_INTERFACE_VERSION > __this_HPT_INTERFACE_VERSION 66b063a422SScott Long #error "HPT_INTERFACE_VERSION is invalid" 67b063a422SScott Long #endif 68b063a422SScott Long 69b063a422SScott Long /* 70b063a422SScott Long * DEFINITION 71b063a422SScott Long * Logical device --- a device that can be accessed by OS. 72b063a422SScott Long * Physical device --- device attached to the controller. 73b063a422SScott Long * A logical device can be simply a physical device. 74b063a422SScott Long * 75b063a422SScott Long * Each logical and physical device has a 32bit ID. GUI will use this ID 76b063a422SScott Long * to identify devices. 77b063a422SScott Long * 1. The ID must be unique. 78b063a422SScott Long * 2. The ID must be immutable. Once an ID is assigned to a device, it 79b063a422SScott Long * must not change when system is running and the device exists. 80b063a422SScott Long * 3. The ID of logical device must be NOT reusable. If a device is 81b063a422SScott Long * removed, other newly created logical device must not use the same ID. 82b063a422SScott Long * 4. The ID must not be zero or 0xFFFFFFFF. 83b063a422SScott Long */ 84b063a422SScott Long typedef HPT_U32 DEVICEID; 85b063a422SScott Long 86b063a422SScott Long /* 87b063a422SScott Long * logical device type. 88b063a422SScott Long * Identify array (logical device) and physical device. 89b063a422SScott Long */ 90b063a422SScott Long #define LDT_ARRAY 1 91b063a422SScott Long #define LDT_DEVICE 2 92b063a422SScott Long 93b063a422SScott Long /* 94b063a422SScott Long * Array types 95b063a422SScott Long * GUI will treat all array as 1-level RAID. No RAID0/1 or RAID1/0. 96b063a422SScott Long * A RAID0/1 device is type AT_RAID1. A RAID1/0 device is type AT_RAID0. 97b063a422SScott Long * Their members may be another array of type RAID0 or RAID1. 98b063a422SScott Long */ 99b063a422SScott Long #define AT_UNKNOWN 0 100b063a422SScott Long #define AT_RAID0 1 101b063a422SScott Long #define AT_RAID1 2 102b063a422SScott Long #define AT_RAID5 3 103b063a422SScott Long #define AT_RAID6 4 1044fdb276aSScott Long #define AT_RAID3 5 1054fdb276aSScott Long #define AT_RAID4 6 106b063a422SScott Long #define AT_JBOD 7 1074fdb276aSScott Long #define AT_RAID1E 8 108b063a422SScott Long 109b063a422SScott Long /* 110b063a422SScott Long * physical device type 111b063a422SScott Long */ 112b063a422SScott Long #define PDT_UNKNOWN 0 113b063a422SScott Long #define PDT_HARDDISK 1 114b063a422SScott Long #define PDT_CDROM 2 115b063a422SScott Long #define PDT_TAPE 3 116b063a422SScott Long 117b063a422SScott Long /* 118b063a422SScott Long * Some constants. 119b063a422SScott Long */ 120b063a422SScott Long #define MAX_NAME_LENGTH 36 121b063a422SScott Long #define MAX_ARRAYNAME_LEN 16 122b063a422SScott Long 123b063a422SScott Long #define MAX_ARRAY_MEMBERS_V1 8 124b063a422SScott Long 125b063a422SScott Long #ifndef MAX_ARRAY_MEMBERS_V2 126b063a422SScott Long #define MAX_ARRAY_MEMBERS_V2 16 127b063a422SScott Long #endif 128b063a422SScott Long 129b063a422SScott Long #ifndef MAX_ARRAY_MEMBERS_V3 130b063a422SScott Long #define MAX_ARRAY_MEMBERS_V3 64 131b063a422SScott Long #endif 132b063a422SScott Long 133453130d9SPedro F. Giffuni /* keep definition for source code compatibility */ 134b063a422SScott Long #define MAX_ARRAY_MEMBERS MAX_ARRAY_MEMBERS_V1 135b063a422SScott Long 136b063a422SScott Long /* 137b063a422SScott Long * io commands 138b063a422SScott Long * GUI use these commands to do IO on logical/physical devices. 139b063a422SScott Long */ 140b063a422SScott Long #define IO_COMMAND_READ 1 141b063a422SScott Long #define IO_COMMAND_WRITE 2 142b063a422SScott Long 143b063a422SScott Long 144b063a422SScott Long 145b063a422SScott Long /* 146b063a422SScott Long * array flags 147b063a422SScott Long */ 148b063a422SScott Long #define ARRAY_FLAG_DISABLED 0x00000001 /* The array is disabled */ 149b063a422SScott Long #define ARRAY_FLAG_NEEDBUILDING 0x00000002 /* array data need to be rebuilt */ 150b063a422SScott Long #define ARRAY_FLAG_REBUILDING 0x00000004 /* array is in rebuilding process */ 151b063a422SScott Long #define ARRAY_FLAG_BROKEN 0x00000008 /* broken but may still working */ 152b063a422SScott Long #define ARRAY_FLAG_BOOTDISK 0x00000010 /* array has a active partition */ 153b063a422SScott Long 154b063a422SScott Long #define ARRAY_FLAG_BOOTMARK 0x00000040 /* array has boot mark set */ 155b063a422SScott Long #define ARRAY_FLAG_NEED_AUTOREBUILD 0x00000080 /* auto-rebuild should start */ 156b063a422SScott Long #define ARRAY_FLAG_VERIFYING 0x00000100 /* is being verified */ 157b063a422SScott Long #define ARRAY_FLAG_INITIALIZING 0x00000200 /* is being initialized */ 158453130d9SPedro F. Giffuni #define ARRAY_FLAG_TRANSFORMING 0x00000400 /* transform in progress */ 159453130d9SPedro F. Giffuni #define ARRAY_FLAG_NEEDTRANSFORM 0x00000800 /* array need transform */ 160b063a422SScott Long #define ARRAY_FLAG_NEEDINITIALIZING 0x00001000 /* the array's initialization hasn't finished*/ 161b063a422SScott Long #define ARRAY_FLAG_BROKEN_REDUNDANT 0x00002000 /* broken but redundant (raid6) */ 162b063a422SScott Long #define ARRAY_FLAG_RAID15PLUS 0x80000000 /* display this RAID 1 as RAID 1.5 */ 163b063a422SScott Long /* 164b063a422SScott Long * device flags 165b063a422SScott Long */ 166b063a422SScott Long #define DEVICE_FLAG_DISABLED 0x00000001 /* device is disabled */ 167b063a422SScott Long #define DEVICE_FLAG_BOOTDISK 0x00000002 /* disk has a active partition */ 168b063a422SScott Long #define DEVICE_FLAG_BOOTMARK 0x00000004 /* disk has boot mark set */ 169b063a422SScott Long #define DEVICE_FLAG_WITH_601 0x00000008 /* has HPT601 connected */ 1704fdb276aSScott Long #define DEVICE_FLAG_SATA 0x00000010 /* SATA or SAS device */ 171b063a422SScott Long #define DEVICE_FLAG_ON_PM_PORT 0x00000020 /* PM port */ 1724fdb276aSScott Long #define DEVICE_FLAG_SAS 0x00000040 /* SAS device */ 173b063a422SScott Long 174b063a422SScott Long #define DEVICE_FLAG_UNINITIALIZED 0x00010000 /* device is not initialized, can't be used to create array */ 175b063a422SScott Long #define DEVICE_FLAG_LEGACY 0x00020000 /* single disk & mbr contains at least one partition */ 176b063a422SScott Long 177b063a422SScott Long #define DEVICE_FLAG_IS_SPARE 0x80000000 /* is a spare disk */ 178b063a422SScott Long 179b063a422SScott Long /* 180b063a422SScott Long * array states used by hpt_set_array_state() 181b063a422SScott Long */ 182b063a422SScott Long /* old defines */ 183b063a422SScott Long #define MIRROR_REBUILD_START 1 184b063a422SScott Long #define MIRROR_REBUILD_ABORT 2 185b063a422SScott Long #define MIRROR_REBUILD_COMPLETE 3 186b063a422SScott Long /* new defines */ 187b063a422SScott Long #define AS_REBUILD_START 1 188b063a422SScott Long #define AS_REBUILD_ABORT 2 189b063a422SScott Long #define AS_REBUILD_PAUSE AS_REBUILD_ABORT 190b063a422SScott Long #define AS_REBUILD_COMPLETE 3 191b063a422SScott Long #define AS_VERIFY_START 4 192b063a422SScott Long #define AS_VERIFY_ABORT 5 193b063a422SScott Long #define AS_VERIFY_COMPLETE 6 194b063a422SScott Long #define AS_INITIALIZE_START 7 195b063a422SScott Long #define AS_INITIALIZE_ABORT 8 196b063a422SScott Long #define AS_INITIALIZE_COMPLETE 9 197b063a422SScott Long #define AS_VERIFY_FAILED 10 198b063a422SScott Long #define AS_REBUILD_STOP 11 199b063a422SScott Long #define AS_SAVE_STATE 12 200b063a422SScott Long #define AS_TRANSFORM_START 13 201b063a422SScott Long #define AS_TRANSFORM_ABORT 14 202b063a422SScott Long 203b063a422SScott Long /************************************************************************ 204b063a422SScott Long * ioctl code 205b063a422SScott Long * It would be better if ioctl code are the same on different platforms, 206b063a422SScott Long * but we must not conflict with system defined ioctl code. 207b063a422SScott Long ************************************************************************/ 208b063a422SScott Long #if defined(LINUX) || defined(__FreeBSD_version) || defined(linux) 209b063a422SScott Long #define HPT_CTL_CODE(x) (x+0xFF00) 210b063a422SScott Long #define HPT_CTL_CODE_LINUX_TO_IOP(x) ((x)-0xff00) 211b063a422SScott Long #elif defined(_MS_WIN32_) || defined(WIN32) 212b063a422SScott Long 213b063a422SScott Long #ifndef CTL_CODE 214b063a422SScott Long #define CTL_CODE( DeviceType, Function, Method, Access ) \ 215b063a422SScott Long (((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method)) 216b063a422SScott Long #endif 217b063a422SScott Long #define HPT_CTL_CODE(x) CTL_CODE(0x370, 0x900+(x), 0, 0) 218b063a422SScott Long #define HPT_CTL_CODE_WIN32_TO_IOP(x) ((((x) & 0xffff)>>2)-0x900) 219b063a422SScott Long 220b063a422SScott Long #else 221b063a422SScott Long #define HPT_CTL_CODE(x) (x) 222b063a422SScott Long #endif 223b063a422SScott Long 224b063a422SScott Long #define HPT_IOCTL_GET_VERSION HPT_CTL_CODE(0) 225b063a422SScott Long #define HPT_IOCTL_GET_CONTROLLER_COUNT HPT_CTL_CODE(1) 226b063a422SScott Long #define HPT_IOCTL_GET_CONTROLLER_INFO HPT_CTL_CODE(2) 227b063a422SScott Long #define HPT_IOCTL_GET_CHANNEL_INFO HPT_CTL_CODE(3) 228b063a422SScott Long #define HPT_IOCTL_GET_LOGICAL_DEVICES HPT_CTL_CODE(4) 229b063a422SScott Long #define HPT_IOCTL_GET_DEVICE_INFO HPT_CTL_CODE(5) 230b063a422SScott Long #define HPT_IOCTL_CREATE_ARRAY HPT_CTL_CODE(6) 231b063a422SScott Long #define HPT_IOCTL_DELETE_ARRAY HPT_CTL_CODE(7) 232b063a422SScott Long #define HPT_IOCTL_ARRAY_IO HPT_CTL_CODE(8) 233b063a422SScott Long #define HPT_IOCTL_DEVICE_IO HPT_CTL_CODE(9) 234b063a422SScott Long #define HPT_IOCTL_GET_EVENT HPT_CTL_CODE(10) 235b063a422SScott Long #define HPT_IOCTL_REBUILD_MIRROR HPT_CTL_CODE(11) 236b063a422SScott Long /* use HPT_IOCTL_REBUILD_DATA_BLOCK from now on */ 237b063a422SScott Long #define HPT_IOCTL_REBUILD_DATA_BLOCK HPT_IOCTL_REBUILD_MIRROR 238b063a422SScott Long #define HPT_IOCTL_ADD_SPARE_DISK HPT_CTL_CODE(12) 239b063a422SScott Long #define HPT_IOCTL_REMOVE_SPARE_DISK HPT_CTL_CODE(13) 240b063a422SScott Long #define HPT_IOCTL_ADD_DISK_TO_ARRAY HPT_CTL_CODE(14) 241b063a422SScott Long #define HPT_IOCTL_SET_ARRAY_STATE HPT_CTL_CODE(15) 242b063a422SScott Long #define HPT_IOCTL_SET_ARRAY_INFO HPT_CTL_CODE(16) 243b063a422SScott Long #define HPT_IOCTL_SET_DEVICE_INFO HPT_CTL_CODE(17) 244b063a422SScott Long #define HPT_IOCTL_RESCAN_DEVICES HPT_CTL_CODE(18) 245b063a422SScott Long #define HPT_IOCTL_GET_DRIVER_CAPABILITIES HPT_CTL_CODE(19) 246b063a422SScott Long #define HPT_IOCTL_GET_601_INFO HPT_CTL_CODE(20) 247b063a422SScott Long #define HPT_IOCTL_SET_601_INFO HPT_CTL_CODE(21) 248b063a422SScott Long #define HPT_IOCTL_LOCK_DEVICE HPT_CTL_CODE(22) 249b063a422SScott Long #define HPT_IOCTL_UNLOCK_DEVICE HPT_CTL_CODE(23) 250b063a422SScott Long #define HPT_IOCTL_IDE_PASS_THROUGH HPT_CTL_CODE(24) 251b063a422SScott Long #define HPT_IOCTL_VERIFY_DATA_BLOCK HPT_CTL_CODE(25) 252b063a422SScott Long #define HPT_IOCTL_INITIALIZE_DATA_BLOCK HPT_CTL_CODE(26) 253b063a422SScott Long #define HPT_IOCTL_ADD_DEDICATED_SPARE HPT_CTL_CODE(27) 254b063a422SScott Long #define HPT_IOCTL_DEVICE_IO_EX HPT_CTL_CODE(28) 255b063a422SScott Long #define HPT_IOCTL_SET_BOOT_MARK HPT_CTL_CODE(29) 256b063a422SScott Long #define HPT_IOCTL_QUERY_REMOVE HPT_CTL_CODE(30) 257b063a422SScott Long #define HPT_IOCTL_REMOVE_DEVICES HPT_CTL_CODE(31) 258b063a422SScott Long #define HPT_IOCTL_CREATE_ARRAY_V2 HPT_CTL_CODE(32) 259b063a422SScott Long #define HPT_IOCTL_GET_DEVICE_INFO_V2 HPT_CTL_CODE(33) 260b063a422SScott Long #define HPT_IOCTL_SET_DEVICE_INFO_V2 HPT_CTL_CODE(34) 261b063a422SScott Long #define HPT_IOCTL_REBUILD_DATA_BLOCK_V2 HPT_CTL_CODE(35) 262b063a422SScott Long #define HPT_IOCTL_VERIFY_DATA_BLOCK_V2 HPT_CTL_CODE(36) 263b063a422SScott Long #define HPT_IOCTL_INITIALIZE_DATA_BLOCK_V2 HPT_CTL_CODE(37) 264b063a422SScott Long #define HPT_IOCTL_LOCK_DEVICE_V2 HPT_CTL_CODE(38) 265b063a422SScott Long #define HPT_IOCTL_DEVICE_IO_V2 HPT_CTL_CODE(39) 266b063a422SScott Long #define HPT_IOCTL_DEVICE_IO_EX_V2 HPT_CTL_CODE(40) 267b063a422SScott Long #define HPT_IOCTL_CREATE_TRANSFORM HPT_CTL_CODE(41) 268b063a422SScott Long #define HPT_IOCTL_STEP_TRANSFORM HPT_CTL_CODE(42) 269b063a422SScott Long #define HPT_IOCTL_SET_VDEV_INFO HPT_CTL_CODE(43) 270b063a422SScott Long #define HPT_IOCTL_CALC_MAX_CAPACITY HPT_CTL_CODE(44) 271b063a422SScott Long #define HPT_IOCTL_INIT_DISKS HPT_CTL_CODE(45) 272b063a422SScott Long #define HPT_IOCTL_GET_DEVICE_INFO_V3 HPT_CTL_CODE(46) 273b063a422SScott Long #define HPT_IOCTL_GET_CONTROLLER_INFO_V2 HPT_CTL_CODE(47) 274b063a422SScott Long #define HPT_IOCTL_I2C_TRANSACTION HPT_CTL_CODE(48) 275b063a422SScott Long #define HPT_IOCTL_GET_PARAMETER_LIST HPT_CTL_CODE(49) 276b063a422SScott Long #define HPT_IOCTL_GET_PARAMETER HPT_CTL_CODE(50) 277b063a422SScott Long #define HPT_IOCTL_SET_PARAMETER HPT_CTL_CODE(51) 278b063a422SScott Long #define HPT_IOCTL_GET_DRIVER_CAPABILITIES_V2 HPT_CTL_CODE(52) 279b063a422SScott Long #define HPT_IOCTL_GET_CHANNEL_INFO_V2 HPT_CTL_CODE(53) 280b063a422SScott Long #define HPT_IOCTL_GET_CONTROLLER_INFO_V3 HPT_CTL_CODE(54) 281b063a422SScott Long #define HPT_IOCTL_GET_DEVICE_INFO_V4 HPT_CTL_CODE(55) 282b063a422SScott Long #define HPT_IOCTL_CREATE_ARRAY_V3 HPT_CTL_CODE(56) 283b063a422SScott Long #define HPT_IOCTL_CREATE_TRANSFORM_V2 HPT_CTL_CODE(57) 284b063a422SScott Long #define HPT_IOCTL_CALC_MAX_CAPACITY_V2 HPT_CTL_CODE(58) 2854fdb276aSScott Long #define HPT_IOCTL_SCSI_PASSTHROUGH HPT_CTL_CODE(59) 286b063a422SScott Long 287b063a422SScott Long 288b063a422SScott Long #define HPT_IOCTL_GET_CONTROLLER_IDS HPT_CTL_CODE(100) 289b063a422SScott Long #define HPT_IOCTL_GET_DCB HPT_CTL_CODE(101) 290b063a422SScott Long 291b063a422SScott Long #define HPT_IOCTL_EPROM_IO HPT_CTL_CODE(102) 292b063a422SScott Long #define HPT_IOCTL_GET_CONTROLLER_VENID HPT_CTL_CODE(103) 293b063a422SScott Long 294b063a422SScott Long /************************************************************************ 295b063a422SScott Long * shared data structures 296b063a422SScott Long ************************************************************************/ 297b063a422SScott Long 298b063a422SScott Long /* 299b063a422SScott Long * Chip Type 300b063a422SScott Long */ 301b063a422SScott Long #define CHIP_TYPE_HPT366 1 302b063a422SScott Long #define CHIP_TYPE_HPT368 2 303b063a422SScott Long #define CHIP_TYPE_HPT370 3 304b063a422SScott Long #define CHIP_TYPE_HPT370A 4 305b063a422SScott Long #define CHIP_TYPE_HPT370B 5 306b063a422SScott Long #define CHIP_TYPE_HPT374 6 307b063a422SScott Long #define CHIP_TYPE_HPT372 7 308b063a422SScott Long #define CHIP_TYPE_HPT372A 8 309b063a422SScott Long #define CHIP_TYPE_HPT302 9 310b063a422SScott Long #define CHIP_TYPE_HPT371 10 311b063a422SScott Long #define CHIP_TYPE_HPT372N 11 312b063a422SScott Long #define CHIP_TYPE_HPT302N 12 313b063a422SScott Long #define CHIP_TYPE_HPT371N 13 314b063a422SScott Long #define CHIP_TYPE_SI3112A 14 315b063a422SScott Long #define CHIP_TYPE_ICH5 15 316b063a422SScott Long #define CHIP_TYPE_ICH5R 16 3174fdb276aSScott Long #define CHIP_TYPE_MV50XX 20 3184fdb276aSScott Long #define CHIP_TYPE_MV60X1 21 3194fdb276aSScott Long #define CHIP_TYPE_MV60X2 22 3204fdb276aSScott Long #define CHIP_TYPE_MV70X2 23 3214fdb276aSScott Long #define CHIP_TYPE_MV5182 24 3224fdb276aSScott Long #define CHIP_TYPE_IOP331 31 3234fdb276aSScott Long #define CHIP_TYPE_IOP333 32 3244fdb276aSScott Long #define CHIP_TYPE_IOP341 33 3254fdb276aSScott Long #define CHIP_TYPE_IOP348 34 326b063a422SScott Long 327b063a422SScott Long /* 328b063a422SScott Long * Chip Flags 329b063a422SScott Long */ 330b063a422SScott Long #define CHIP_SUPPORT_ULTRA_66 0x20 331b063a422SScott Long #define CHIP_SUPPORT_ULTRA_100 0x40 332b063a422SScott Long #define CHIP_HPT3XX_DPLL_MODE 0x80 333b063a422SScott Long #define CHIP_SUPPORT_ULTRA_133 0x01 334b063a422SScott Long #define CHIP_SUPPORT_ULTRA_150 0x02 335b063a422SScott Long #define CHIP_MASTER 0x04 336b063a422SScott Long #define CHIP_SUPPORT_SATA_300 0x08 337b063a422SScott Long 338b063a422SScott Long #define HPT_SPIN_UP_MODE_NOSUPPORT 0 339b063a422SScott Long #define HPT_SPIN_UP_MODE_FULL 1 340b063a422SScott Long #define HPT_SPIN_UP_MODE_STANDBY 2 341b063a422SScott Long 342b063a422SScott Long typedef struct _DRIVER_CAPABILITIES { 343b063a422SScott Long HPT_U32 dwSize; 344b063a422SScott Long 345b063a422SScott Long HPT_U8 MaximumControllers; /* maximum controllers the driver can support */ 346b063a422SScott Long HPT_U8 SupportCrossControllerRAID; /* 1-support, 0-not support */ 347b063a422SScott Long HPT_U8 MinimumBlockSizeShift; /* minimum block size shift */ 348b063a422SScott Long HPT_U8 MaximumBlockSizeShift; /* maximum block size shift */ 349b063a422SScott Long 350b063a422SScott Long HPT_U8 SupportDiskModeSetting; 351b063a422SScott Long HPT_U8 SupportSparePool; 352b063a422SScott Long HPT_U8 MaximumArrayNameLength; 353b063a422SScott Long /* only one HPT_U8 left here! */ 354b063a422SScott Long #ifdef __BIG_ENDIAN_BITFIELD 3554fdb276aSScott Long HPT_U8 reserved: 3; 3564fdb276aSScott Long HPT_U8 SupportVariableSectorSize: 1; 357b063a422SScott Long HPT_U8 SupportHotSwap: 1; 358b063a422SScott Long HPT_U8 HighPerformanceRAID1: 1; 359b063a422SScott Long HPT_U8 RebuildProcessInDriver: 1; 360b063a422SScott Long HPT_U8 SupportDedicatedSpare: 1; 361b063a422SScott Long #else 362b063a422SScott Long HPT_U8 SupportDedicatedSpare: 1; /* call hpt_add_dedicated_spare() for dedicated spare. */ 363b063a422SScott Long HPT_U8 RebuildProcessInDriver: 1; /* Windows only. used by mid layer for rebuild control. */ 364b063a422SScott Long HPT_U8 HighPerformanceRAID1: 1; 365b063a422SScott Long HPT_U8 SupportHotSwap: 1; 3664fdb276aSScott Long HPT_U8 SupportVariableSectorSize: 1; 3674fdb276aSScott Long HPT_U8 reserved: 3; 368b063a422SScott Long #endif 369b063a422SScott Long 370b063a422SScott Long 371b063a422SScott Long HPT_U8 SupportedRAIDTypes[16]; 372b063a422SScott Long /* maximum members in an array corresponding to SupportedRAIDTypes */ 373b063a422SScott Long HPT_U8 MaximumArrayMembers[16]; 374b063a422SScott Long } 375b063a422SScott Long DRIVER_CAPABILITIES, *PDRIVER_CAPABILITIES; 376b063a422SScott Long 377b063a422SScott Long typedef struct _DRIVER_CAPABILITIES_V2 { 378b063a422SScott Long DRIVER_CAPABILITIES v1; 379b063a422SScott Long HPT_U8 SupportedCachePolicies[16]; 380b063a422SScott Long HPT_U32 reserved[17]; 381b063a422SScott Long } 382b063a422SScott Long DRIVER_CAPABILITIES_V2, *PDRIVER_CAPABILITIES_V2; 383b063a422SScott Long 384b063a422SScott Long /* 385b063a422SScott Long * Controller information. 386b063a422SScott Long */ 387b063a422SScott Long typedef struct _CONTROLLER_INFO { 388b063a422SScott Long HPT_U8 ChipType; /* chip type */ 389b063a422SScott Long HPT_U8 InterruptLevel; /* IRQ level */ 390b063a422SScott Long HPT_U8 NumBuses; /* bus count */ 391b063a422SScott Long HPT_U8 ChipFlags; 392b063a422SScott Long 393b063a422SScott Long HPT_U8 szProductID[MAX_NAME_LENGTH];/* product name */ 394b063a422SScott Long HPT_U8 szVendorID[MAX_NAME_LENGTH]; /* vender name */ 395b063a422SScott Long 396b063a422SScott Long } CONTROLLER_INFO, *PCONTROLLER_INFO; 397b063a422SScott Long 398b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01020000 399b063a422SScott Long typedef struct _CONTROLLER_INFO_V2 { 400b063a422SScott Long HPT_U8 ChipType; /* chip type */ 401b063a422SScott Long HPT_U8 InterruptLevel; /* IRQ level */ 402b063a422SScott Long HPT_U8 NumBuses; /* bus count */ 403b063a422SScott Long HPT_U8 ChipFlags; 404b063a422SScott Long 405b063a422SScott Long HPT_U8 szProductID[MAX_NAME_LENGTH];/* product name */ 406b063a422SScott Long HPT_U8 szVendorID[MAX_NAME_LENGTH]; /* vender name */ 407b063a422SScott Long 408b063a422SScott Long HPT_U32 GroupId; /* low 32bit of vbus pointer the controller belongs 409b063a422SScott Long * the master controller has CHIP_MASTER flag set*/ 410b063a422SScott Long HPT_U8 pci_tree; 411b063a422SScott Long HPT_U8 pci_bus; 412b063a422SScott Long HPT_U8 pci_device; 413b063a422SScott Long HPT_U8 pci_function; 414b063a422SScott Long 415b063a422SScott Long HPT_U32 ExFlags; 416b063a422SScott Long } CONTROLLER_INFO_V2, *PCONTROLLER_INFO_V2; 417b063a422SScott Long 418b063a422SScott Long 419b063a422SScott Long #define CEXF_IOPModel 1 420b063a422SScott Long #define CEXF_SDRAMSize 2 421b063a422SScott Long #define CEXF_BatteryInstalled 4 422b063a422SScott Long #define CEXF_BatteryStatus 8 423b063a422SScott Long #define CEXF_BatteryVoltage 0x10 424b063a422SScott Long #define CEXF_BatteryBackupTime 0x20 425b063a422SScott Long #define CEXF_FirmwareVersion 0x40 426b063a422SScott Long #define CEXF_SerialNumber 0x80 4274fdb276aSScott Long #define CEXF_BatteryTemperature 0x100 428b063a422SScott Long 429b063a422SScott Long typedef struct _CONTROLLER_INFO_V3 { 430b063a422SScott Long HPT_U8 ChipType; 431b063a422SScott Long HPT_U8 InterruptLevel; 432b063a422SScott Long HPT_U8 NumBuses; 433b063a422SScott Long HPT_U8 ChipFlags; 434b063a422SScott Long HPT_U8 szProductID[MAX_NAME_LENGTH]; 435b063a422SScott Long HPT_U8 szVendorID[MAX_NAME_LENGTH]; 436b063a422SScott Long HPT_U32 GroupId; 437b063a422SScott Long HPT_U8 pci_tree; 438b063a422SScott Long HPT_U8 pci_bus; 439b063a422SScott Long HPT_U8 pci_device; 440b063a422SScott Long HPT_U8 pci_function; 441b063a422SScott Long HPT_U32 ExFlags; 442b063a422SScott Long HPT_U8 IOPModel[32]; 443b063a422SScott Long HPT_U32 SDRAMSize; 444b063a422SScott Long HPT_U8 BatteryInstalled; 445b063a422SScott Long HPT_U8 BatteryStatus; 446b063a422SScott Long HPT_U16 BatteryVoltage; 447b063a422SScott Long HPT_U32 BatteryBackupTime; 448b063a422SScott Long HPT_U32 FirmwareVersion; 449b063a422SScott Long HPT_U8 SerialNumber[32]; 4504fdb276aSScott Long HPT_U8 BatteryMBInstalled; 4514fdb276aSScott Long HPT_U8 BatteryTemperature; 4524fdb276aSScott Long HPT_U8 reserve[86]; 453b063a422SScott Long } 454b063a422SScott Long CONTROLLER_INFO_V3, *PCONTROLLER_INFO_V3; 455b063a422SScott Long typedef char check_CONTROLLER_INFO_V3[sizeof(CONTROLLER_INFO_V3)==256? 1:-1]; 456b063a422SScott Long #endif 457b063a422SScott Long /* 458b063a422SScott Long * Channel information. 459b063a422SScott Long */ 460b063a422SScott Long typedef struct _CHANNEL_INFO { 461b063a422SScott Long HPT_U32 IoPort; /* IDE Base Port Address */ 462b063a422SScott Long HPT_U32 ControlPort; /* IDE Control Port Address */ 463b063a422SScott Long 464b063a422SScott Long DEVICEID Devices[2]; /* device connected to this channel */ 465b063a422SScott Long 466b063a422SScott Long } CHANNEL_INFO, *PCHANNEL_INFO; 467b063a422SScott Long 468b063a422SScott Long typedef struct _CHANNEL_INFO_V2 { 469b063a422SScott Long HPT_U32 IoPort; /* IDE Base Port Address */ 470b063a422SScott Long HPT_U32 ControlPort; /* IDE Control Port Address */ 471b063a422SScott Long 472b063a422SScott Long DEVICEID Devices[2+13]; /* device connected to this channel, PMPort max=15 */ 473b063a422SScott Long } CHANNEL_INFO_V2, *PCHANNEL_INFO_V2; 474b063a422SScott Long 475b063a422SScott Long #ifndef __KERNEL__ 476b063a422SScott Long /* 477b063a422SScott Long * time represented in HPT_U32 format 478b063a422SScott Long */ 479b063a422SScott Long typedef struct _TIME_RECORD { 480b063a422SScott Long HPT_U32 seconds:6; /* 0 - 59 */ 481b063a422SScott Long HPT_U32 minutes:6; /* 0 - 59 */ 482b063a422SScott Long HPT_U32 month:4; /* 1 - 12 */ 483b063a422SScott Long HPT_U32 hours:6; /* 0 - 59 */ 484b063a422SScott Long HPT_U32 day:5; /* 1 - 31 */ 485b063a422SScott Long HPT_U32 year:5; /* 0=2000, 31=2031 */ 486b063a422SScott Long } TIME_RECORD; 487b063a422SScott Long #endif 488b063a422SScott Long 489b063a422SScott Long /* 490b063a422SScott Long * Array information. 491b063a422SScott Long */ 492b063a422SScott Long typedef struct _HPT_ARRAY_INFO { 493b063a422SScott Long HPT_U8 Name[MAX_ARRAYNAME_LEN];/* array name */ 494b063a422SScott Long HPT_U8 Description[64]; /* array description */ 495b063a422SScott Long HPT_U8 CreateManager[16]; /* who created it */ 496b063a422SScott Long TIME_RECORD CreateTime; /* when created it */ 497b063a422SScott Long 498b063a422SScott Long HPT_U8 ArrayType; /* array type */ 499b063a422SScott Long HPT_U8 BlockSizeShift; /* stripe size */ 500b063a422SScott Long HPT_U8 nDisk; /* member count: Number of ID in Members[] */ 5014fdb276aSScott Long HPT_U8 SubArrayType; 502b063a422SScott Long 503b063a422SScott Long HPT_U32 Flags; /* working flags, see ARRAY_FLAG_XXX */ 504b063a422SScott Long HPT_U32 Members[MAX_ARRAY_MEMBERS_V1]; /* member array/disks */ 505b063a422SScott Long 506b063a422SScott Long /* 507b063a422SScott Long * rebuilding progress, xx.xx% = sprintf(s, "%.2f%%", RebuildingProgress/100.0); 508b063a422SScott Long * only valid if rebuilding is done by driver code. 509b063a422SScott Long * Member Flags will have ARRAY_FLAG_REBUILDING set at this case. 510b063a422SScott Long * Verify operation use same fields below, the only difference is 511b063a422SScott Long * ARRAY_FLAG_VERIFYING is set. 512b063a422SScott Long */ 513b063a422SScott Long HPT_U32 RebuildingProgress; 514b063a422SScott Long HPT_U32 RebuiltSectors; /* rebuilding point (LBA) for single member */ 515b063a422SScott Long 516b063a422SScott Long } HPT_ARRAY_INFO, *PHPT_ARRAY_INFO; 517b063a422SScott Long 518b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01010000 519b063a422SScott Long typedef struct _HPT_ARRAY_INFO_V2 { 520b063a422SScott Long HPT_U8 Name[MAX_ARRAYNAME_LEN];/* array name */ 521b063a422SScott Long HPT_U8 Description[64]; /* array description */ 522b063a422SScott Long HPT_U8 CreateManager[16]; /* who created it */ 523b063a422SScott Long TIME_RECORD CreateTime; /* when created it */ 524b063a422SScott Long 525b063a422SScott Long HPT_U8 ArrayType; /* array type */ 526b063a422SScott Long HPT_U8 BlockSizeShift; /* stripe size */ 527b063a422SScott Long HPT_U8 nDisk; /* member count: Number of ID in Members[] */ 5284fdb276aSScott Long HPT_U8 SubArrayType; 529b063a422SScott Long 530b063a422SScott Long HPT_U32 Flags; /* working flags, see ARRAY_FLAG_XXX */ 531b063a422SScott Long HPT_U32 Members[MAX_ARRAY_MEMBERS_V2]; /* member array/disks */ 532b063a422SScott Long 533b063a422SScott Long HPT_U32 RebuildingProgress; 534b063a422SScott Long HPT_U64 RebuiltSectors; /* rebuilding point (LBA) for single member */ 535b063a422SScott Long 536b063a422SScott Long HPT_U32 reserve4[4]; 537b063a422SScott Long } HPT_ARRAY_INFO_V2, *PHPT_ARRAY_INFO_V2; 538b063a422SScott Long #endif 539b063a422SScott Long 540b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01020000 541b063a422SScott Long typedef struct _HPT_ARRAY_INFO_V3 { 542b063a422SScott Long HPT_U8 Name[MAX_ARRAYNAME_LEN];/* array name */ 543b063a422SScott Long HPT_U8 Description[64]; /* array description */ 544b063a422SScott Long HPT_U8 CreateManager[16]; /* who created it */ 545b063a422SScott Long TIME_RECORD CreateTime; /* when created it */ 546b063a422SScott Long 547b063a422SScott Long HPT_U8 ArrayType; /* array type */ 548b063a422SScott Long HPT_U8 BlockSizeShift; /* stripe size */ 549b063a422SScott Long HPT_U8 nDisk; /* member count: Number of ID in Members[] */ 5504fdb276aSScott Long HPT_U8 SubArrayType; 551b063a422SScott Long 552b063a422SScott Long HPT_U32 Flags; /* working flags, see ARRAY_FLAG_XXX */ 553b063a422SScott Long HPT_U32 Members[MAX_ARRAY_MEMBERS_V2]; /* member array/disks */ 554b063a422SScott Long 555b063a422SScott Long HPT_U32 RebuildingProgress; 556b063a422SScott Long HPT_U64 RebuiltSectors; /* rebuilding point (LBA) for single member */ 557b063a422SScott Long 558b063a422SScott Long DEVICEID TransformSource; 559b063a422SScott Long DEVICEID TransformTarget; /* destination device ID */ 560b063a422SScott Long HPT_U32 TransformingProgress; 561b063a422SScott Long HPT_U32 Signature; /* persistent identification*/ 562b063a422SScott Long #if MAX_ARRAY_MEMBERS_V2==16 563b063a422SScott Long HPT_U16 Critical_Members; /* bit mask of critical members */ 564b063a422SScott Long HPT_U16 reserve2; 565b063a422SScott Long HPT_U32 reserve; 566b063a422SScott Long #else 567b063a422SScott Long HPT_U32 Critical_Members; 568b063a422SScott Long HPT_U32 reserve; 569b063a422SScott Long #endif 570b063a422SScott Long } HPT_ARRAY_INFO_V3, *PHPT_ARRAY_INFO_V3; 571b063a422SScott Long #endif 572b063a422SScott Long 573b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x02000001 574b063a422SScott Long typedef struct _HPT_ARRAY_INFO_V4 { 575b063a422SScott Long HPT_U8 Name[MAX_ARRAYNAME_LEN];/* array name */ 576b063a422SScott Long HPT_U8 Description[64]; /* array description */ 577b063a422SScott Long HPT_U8 CreateManager[16]; /* who created it */ 578b063a422SScott Long TIME_RECORD CreateTime; /* when created it */ 579b063a422SScott Long 580b063a422SScott Long HPT_U8 ArrayType; /* array type */ 581b063a422SScott Long HPT_U8 BlockSizeShift; /* stripe size */ 582b063a422SScott Long HPT_U8 nDisk; /* member count: Number of ID in Members[] */ 5834fdb276aSScott Long HPT_U8 SubArrayType; 584b063a422SScott Long 585b063a422SScott Long HPT_U32 Flags; /* working flags, see ARRAY_FLAG_XXX */ 586b063a422SScott Long 587b063a422SScott Long HPT_U32 RebuildingProgress; 588b063a422SScott Long HPT_U64 RebuiltSectors; /* rebuilding point (LBA) for single member */ 589b063a422SScott Long 590b063a422SScott Long DEVICEID TransformSource; 591b063a422SScott Long DEVICEID TransformTarget; /* destination device ID */ 592b063a422SScott Long HPT_U32 TransformingProgress; 593b063a422SScott Long HPT_U32 Signature; /* persistent identification*/ 5944fdb276aSScott Long HPT_U8 SectorSizeShift; /*sector size = 512B<<SectorSizeShift*/ 5954fdb276aSScott Long HPT_U8 reserved2[7]; 596b063a422SScott Long HPT_U64 Critical_Members; 597b063a422SScott Long HPT_U32 Members[MAX_ARRAY_MEMBERS_V3]; /* member array/disks */ 598b063a422SScott Long } HPT_ARRAY_INFO_V4, *PHPT_ARRAY_INFO_V4; 599b063a422SScott Long #endif 600b063a422SScott Long 601b063a422SScott Long 602b063a422SScott Long #ifndef __KERNEL__ 603b063a422SScott Long /* 604b063a422SScott Long * ATA/ATAPI Device identify data without the Reserved4. 605b063a422SScott Long */ 606b063a422SScott Long typedef struct _IDENTIFY_DATA2 { 607b063a422SScott Long HPT_U16 GeneralConfiguration; 608b063a422SScott Long HPT_U16 NumberOfCylinders; 609b063a422SScott Long HPT_U16 Reserved1; 610b063a422SScott Long HPT_U16 NumberOfHeads; 611b063a422SScott Long HPT_U16 UnformattedBytesPerTrack; 612b063a422SScott Long HPT_U16 UnformattedBytesPerSector; 613b063a422SScott Long HPT_U16 SectorsPerTrack; 614b063a422SScott Long HPT_U16 VendorUnique1[3]; 615b063a422SScott Long HPT_U16 SerialNumber[10]; 616b063a422SScott Long HPT_U16 BufferType; 617b063a422SScott Long HPT_U16 BufferSectorSize; 618b063a422SScott Long HPT_U16 NumberOfEccBytes; 619b063a422SScott Long HPT_U16 FirmwareRevision[4]; 620b063a422SScott Long HPT_U16 ModelNumber[20]; 621b063a422SScott Long HPT_U8 MaximumBlockTransfer; 622b063a422SScott Long HPT_U8 VendorUnique2; 623b063a422SScott Long HPT_U16 DoubleWordIo; 624b063a422SScott Long HPT_U16 Capabilities; 625b063a422SScott Long HPT_U16 Reserved2; 626b063a422SScott Long HPT_U8 VendorUnique3; 627b063a422SScott Long HPT_U8 PioCycleTimingMode; 628b063a422SScott Long HPT_U8 VendorUnique4; 629b063a422SScott Long HPT_U8 DmaCycleTimingMode; 630b063a422SScott Long HPT_U16 TranslationFieldsValid; 631b063a422SScott Long HPT_U16 NumberOfCurrentCylinders; 632b063a422SScott Long HPT_U16 NumberOfCurrentHeads; 633b063a422SScott Long HPT_U16 CurrentSectorsPerTrack; 634b063a422SScott Long HPT_U32 CurrentSectorCapacity; 635b063a422SScott Long HPT_U16 CurrentMultiSectorSetting; 636b063a422SScott Long HPT_U32 UserAddressableSectors; 637b063a422SScott Long HPT_U8 SingleWordDMASupport; 638b063a422SScott Long HPT_U8 SingleWordDMAActive; 639b063a422SScott Long HPT_U8 MultiWordDMASupport; 640b063a422SScott Long HPT_U8 MultiWordDMAActive; 641b063a422SScott Long HPT_U8 AdvancedPIOModes; 642b063a422SScott Long HPT_U8 Reserved4; 643b063a422SScott Long HPT_U16 MinimumMWXferCycleTime; 644b063a422SScott Long HPT_U16 RecommendedMWXferCycleTime; 645b063a422SScott Long HPT_U16 MinimumPIOCycleTime; 646b063a422SScott Long HPT_U16 MinimumPIOCycleTimeIORDY; 647b063a422SScott Long HPT_U16 Reserved5[2]; 648b063a422SScott Long HPT_U16 ReleaseTimeOverlapped; 649b063a422SScott Long HPT_U16 ReleaseTimeServiceCommand; 650b063a422SScott Long HPT_U16 MajorRevision; 651b063a422SScott Long HPT_U16 MinorRevision; 6524fdb276aSScott Long } __attribute__((packed)) IDENTIFY_DATA2, *PIDENTIFY_DATA2; 653b063a422SScott Long #endif 654b063a422SScott Long 655b063a422SScott Long /* 656b063a422SScott Long * physical device information. 657b063a422SScott Long * IdentifyData.ModelNumber[] is HPT_U8-swapped from the original identify data. 658b063a422SScott Long */ 659b063a422SScott Long typedef struct _DEVICE_INFO { 660b063a422SScott Long HPT_U8 ControllerId; /* controller id */ 661b063a422SScott Long HPT_U8 PathId; /* bus */ 662b063a422SScott Long HPT_U8 TargetId; /* id */ 663b063a422SScott Long HPT_U8 DeviceModeSetting; /* Current Data Transfer mode: 0-4 PIO 0-4 */ 664b063a422SScott Long /* 5-7 MW DMA0-2, 8-13 UDMA0-5 */ 665b063a422SScott Long HPT_U8 DeviceType; /* device type */ 666b063a422SScott Long HPT_U8 UsableMode; /* highest usable mode */ 667b063a422SScott Long 668b063a422SScott Long #ifdef __BIG_ENDIAN_BITFIELD 669b063a422SScott Long HPT_U8 NCQEnabled: 1; 670b063a422SScott Long HPT_U8 NCQSupported: 1; 671b063a422SScott Long HPT_U8 TCQEnabled: 1; 672b063a422SScott Long HPT_U8 TCQSupported: 1; 673b063a422SScott Long HPT_U8 WriteCacheEnabled: 1; 674b063a422SScott Long HPT_U8 WriteCacheSupported: 1; 675b063a422SScott Long HPT_U8 ReadAheadEnabled: 1; 676b063a422SScott Long HPT_U8 ReadAheadSupported: 1; 677b063a422SScott Long HPT_U8 reserved6: 6; 678b063a422SScott Long HPT_U8 SpinUpMode: 2; 679b063a422SScott Long #else 680b063a422SScott Long HPT_U8 ReadAheadSupported: 1; 681b063a422SScott Long HPT_U8 ReadAheadEnabled: 1; 682b063a422SScott Long HPT_U8 WriteCacheSupported: 1; 683b063a422SScott Long HPT_U8 WriteCacheEnabled: 1; 684b063a422SScott Long HPT_U8 TCQSupported: 1; 685b063a422SScott Long HPT_U8 TCQEnabled: 1; 686b063a422SScott Long HPT_U8 NCQSupported: 1; 687b063a422SScott Long HPT_U8 NCQEnabled: 1; 688b063a422SScott Long HPT_U8 SpinUpMode: 2; 689b063a422SScott Long HPT_U8 reserved6: 6; 690b063a422SScott Long #endif 691b063a422SScott Long 692b063a422SScott Long HPT_U32 Flags; /* working flags, see DEVICE_FLAG_XXX */ 693b063a422SScott Long 694b063a422SScott Long IDENTIFY_DATA2 IdentifyData; /* Identify Data of this device */ 695b063a422SScott Long 696b063a422SScott Long } 697b063a422SScott Long __attribute__((packed)) DEVICE_INFO, *PDEVICE_INFO; 698b063a422SScott Long 699b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01020000 700b063a422SScott Long #define MAX_PARENTS_PER_DISK 8 701b063a422SScott Long /* 702b063a422SScott Long * physical device information. 703b063a422SScott Long * IdentifyData.ModelNumber[] is HPT_U8-swapped from the original identify data. 704b063a422SScott Long */ 705b063a422SScott Long typedef struct _DEVICE_INFO_V2 { 706b063a422SScott Long HPT_U8 ControllerId; /* controller id */ 707b063a422SScott Long HPT_U8 PathId; /* bus */ 708b063a422SScott Long HPT_U8 TargetId; /* id */ 709b063a422SScott Long HPT_U8 DeviceModeSetting; /* Current Data Transfer mode: 0-4 PIO 0-4 */ 710b063a422SScott Long /* 5-7 MW DMA0-2, 8-13 UDMA0-5 */ 711b063a422SScott Long HPT_U8 DeviceType; /* device type */ 712b063a422SScott Long HPT_U8 UsableMode; /* highest usable mode */ 713b063a422SScott Long 714b063a422SScott Long #ifdef __BIG_ENDIAN_BITFIELD 715b063a422SScott Long HPT_U8 NCQEnabled: 1; 716b063a422SScott Long HPT_U8 NCQSupported: 1; 717b063a422SScott Long HPT_U8 TCQEnabled: 1; 718b063a422SScott Long HPT_U8 TCQSupported: 1; 719b063a422SScott Long HPT_U8 WriteCacheEnabled: 1; 720b063a422SScott Long HPT_U8 WriteCacheSupported: 1; 721b063a422SScott Long HPT_U8 ReadAheadEnabled: 1; 722b063a422SScott Long HPT_U8 ReadAheadSupported: 1; 723b063a422SScott Long HPT_U8 reserved6: 6; 724b063a422SScott Long HPT_U8 SpinUpMode: 2; 725b063a422SScott Long #else 726b063a422SScott Long HPT_U8 ReadAheadSupported: 1; 727b063a422SScott Long HPT_U8 ReadAheadEnabled: 1; 728b063a422SScott Long HPT_U8 WriteCacheSupported: 1; 729b063a422SScott Long HPT_U8 WriteCacheEnabled: 1; 730b063a422SScott Long HPT_U8 TCQSupported: 1; 731b063a422SScott Long HPT_U8 TCQEnabled: 1; 732b063a422SScott Long HPT_U8 NCQSupported: 1; 733b063a422SScott Long HPT_U8 NCQEnabled: 1; 734b063a422SScott Long HPT_U8 SpinUpMode: 2; 735b063a422SScott Long HPT_U8 reserved6: 6; 736b063a422SScott Long #endif 737b063a422SScott Long 738b063a422SScott Long HPT_U32 Flags; /* working flags, see DEVICE_FLAG_XXX */ 739b063a422SScott Long 740b063a422SScott Long IDENTIFY_DATA2 IdentifyData; /* Identify Data of this device */ 741b063a422SScott Long 742b063a422SScott Long HPT_U64 TotalFree; 743b063a422SScott Long HPT_U64 MaxFree; 744b063a422SScott Long HPT_U64 BadSectors; 745b063a422SScott Long DEVICEID ParentArrays[MAX_PARENTS_PER_DISK]; 746b063a422SScott Long 747b063a422SScott Long } 748b063a422SScott Long __attribute__((packed)) DEVICE_INFO_V2, *PDEVICE_INFO_V2, DEVICE_INFO_V3, *PDEVICE_INFO_V3; 749b063a422SScott Long 750b063a422SScott Long /* 751b063a422SScott Long * HPT601 information 752b063a422SScott Long */ 753b063a422SScott Long #endif 754b063a422SScott Long /* 755b063a422SScott Long * HPT601 information 756b063a422SScott Long */ 757b063a422SScott Long #define HPT601_INFO_DEVICEID 1 758b063a422SScott Long #define HPT601_INFO_TEMPERATURE 2 759b063a422SScott Long #define HPT601_INFO_FANSTATUS 4 760b063a422SScott Long #define HPT601_INFO_BEEPERCONTROL 8 761b063a422SScott Long #define HPT601_INFO_LED1CONTROL 0x10 762b063a422SScott Long #define HPT601_INFO_LED2CONTROL 0x20 763b063a422SScott Long #define HPT601_INFO_POWERSTATUS 0x40 764b063a422SScott Long 765b063a422SScott Long typedef struct _HPT601_INFO_ { 766b063a422SScott Long HPT_U16 ValidFields; /* mark valid fields below */ 767b063a422SScott Long HPT_U16 DeviceId; /* 0x5A3E */ 768b063a422SScott Long HPT_U16 Temperature; /* Read: temperature sensor value. Write: temperature limit */ 769b063a422SScott Long HPT_U16 FanStatus; /* Fan status */ 770b063a422SScott Long HPT_U16 BeeperControl; /* bit4: beeper control bit. bit0-3: frequency bits */ 771b063a422SScott Long HPT_U16 LED1Control; /* bit4: twinkling control bit. bit0-3: frequency bits */ 772b063a422SScott Long HPT_U16 LED2Control; /* bit4: twinkling control bit. bit0-3: frequency bits */ 773b063a422SScott Long HPT_U16 PowerStatus; /* 1: has power 2: no power */ 774b063a422SScott Long } HPT601_INFO, *PHPT601_INFO; 775b063a422SScott Long 776b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01010000 777b063a422SScott Long #ifndef __KERNEL__ 778b063a422SScott Long /* cache policy for each vdev, copied from ldm.h */ 779b063a422SScott Long #define CACHE_POLICY_NONE 0 780b063a422SScott Long #define CACHE_POLICY_WRITE_THROUGH 1 781b063a422SScott Long #define CACHE_POLICY_WRITE_BACK 2 782b063a422SScott Long 783b063a422SScott Long #endif 784b063a422SScott Long #endif 785b063a422SScott Long /* 786b063a422SScott Long * Logical device information. 787b063a422SScott Long * Union of ArrayInfo and DeviceInfo. 788b063a422SScott Long * Common properties will be put in logical device information. 789b063a422SScott Long */ 790b063a422SScott Long typedef struct _LOGICAL_DEVICE_INFO { 791b063a422SScott Long HPT_U8 Type; /* LDT_ARRAY or LDT_DEVICE */ 792b063a422SScott Long HPT_U8 reserved[3]; 793b063a422SScott Long 794b063a422SScott Long HPT_U32 Capacity; /* array capacity */ 795b063a422SScott Long DEVICEID ParentArray; 796b063a422SScott Long 797b063a422SScott Long union { 798b063a422SScott Long HPT_ARRAY_INFO array; 799b063a422SScott Long DEVICE_INFO device; 800b063a422SScott Long } __attribute__((packed)) u; 801b063a422SScott Long 802b063a422SScott Long } __attribute__((packed)) LOGICAL_DEVICE_INFO, *PLOGICAL_DEVICE_INFO; 803b063a422SScott Long 804b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01010000 805b063a422SScott Long typedef struct _LOGICAL_DEVICE_INFO_V2 { 806b063a422SScott Long HPT_U8 Type; /* LDT_ARRAY or LDT_DEVICE */ 807b063a422SScott Long HPT_U8 reserved[3]; 808b063a422SScott Long 809b063a422SScott Long HPT_U64 Capacity; /* array capacity */ 810b063a422SScott Long DEVICEID ParentArray; /* for physical device, Please don't use this field. 811b063a422SScott Long * use ParentArrays field in DEVICE_INFO_V2 812b063a422SScott Long */ 813b063a422SScott Long 814b063a422SScott Long union { 815b063a422SScott Long HPT_ARRAY_INFO_V2 array; 816b063a422SScott Long DEVICE_INFO device; 817b063a422SScott Long } __attribute__((packed)) u; 818b063a422SScott Long 819b063a422SScott Long } __attribute__((packed)) LOGICAL_DEVICE_INFO_V2, *PLOGICAL_DEVICE_INFO_V2; 820b063a422SScott Long #endif 821b063a422SScott Long 822b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01020000 823b063a422SScott Long #define INVALID_TARGET_ID 0xFF 824b063a422SScott Long #define INVALID_BUS_ID 0xFF 825b063a422SScott Long typedef struct _LOGICAL_DEVICE_INFO_V3 { 826b063a422SScott Long HPT_U8 Type; /* LDT_ARRAY or LDT_DEVICE */ 827b063a422SScott Long HPT_U8 CachePolicy; /* refer to CACHE_POLICY_xxx */ 828b063a422SScott Long HPT_U8 VBusId; /* vbus sequence in vbus_list */ 829b063a422SScott Long HPT_U8 TargetId; /* OS target id. Value 0xFF is invalid */ 830b063a422SScott Long /* OS disk name: HPT DISK $VBusId_$TargetId */ 831b063a422SScott Long HPT_U64 Capacity; /* array capacity */ 832b063a422SScott Long DEVICEID ParentArray; /* for physical device, don't use this field. 833b063a422SScott Long * use ParentArrays field in DEVICE_INFO_V2 instead. 834b063a422SScott Long */ 835b063a422SScott Long HPT_U32 TotalIOs; 836b063a422SScott Long HPT_U32 TobalMBs; 837b063a422SScott Long HPT_U32 IOPerSec; 838b063a422SScott Long HPT_U32 MBPerSec; 839b063a422SScott Long 840b063a422SScott Long union { 841b063a422SScott Long HPT_ARRAY_INFO_V3 array; 842b063a422SScott Long DEVICE_INFO_V2 device; 843b063a422SScott Long } __attribute__((packed)) u; 844b063a422SScott Long 845b063a422SScott Long } 846b063a422SScott Long __attribute__((packed)) LOGICAL_DEVICE_INFO_V3, *PLOGICAL_DEVICE_INFO_V3; 847b063a422SScott Long #endif 848b063a422SScott Long 849b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x02000001 850b063a422SScott Long typedef struct _LOGICAL_DEVICE_INFO_V4 { 851b063a422SScott Long HPT_U32 dwSize; 852b063a422SScott Long HPT_U8 revision; 853b063a422SScott Long HPT_U8 reserved[7]; 854b063a422SScott Long 855b063a422SScott Long HPT_U8 Type; /* LDT_ARRAY or LDT_DEVICE */ 856b063a422SScott Long HPT_U8 CachePolicy; /* refer to CACHE_POLICY_xxx */ 857b063a422SScott Long HPT_U8 VBusId; /* vbus sequence in vbus_list */ 858b063a422SScott Long HPT_U8 TargetId; /* OS target id. Value 0xFF is invalid */ 859b063a422SScott Long /* OS disk name: HPT DISK $VBusId_$TargetId */ 860b063a422SScott Long HPT_U64 Capacity; /* array capacity */ 861b063a422SScott Long DEVICEID ParentArray; /* for physical device, don't use this field. 862b063a422SScott Long * use ParentArrays field in DEVICE_INFO_V2 instead. 863b063a422SScott Long */ 864b063a422SScott Long HPT_U32 TotalIOs; 865b063a422SScott Long HPT_U32 TobalMBs; 866b063a422SScott Long HPT_U32 IOPerSec; 867b063a422SScott Long HPT_U32 MBPerSec; 868b063a422SScott Long 869b063a422SScott Long union { 870b063a422SScott Long HPT_ARRAY_INFO_V4 array; 871b063a422SScott Long DEVICE_INFO_V3 device; 872b063a422SScott Long } __attribute__((packed)) u; 873b063a422SScott Long } 874b063a422SScott Long __attribute__((packed)) LOGICAL_DEVICE_INFO_V4, *PLOGICAL_DEVICE_INFO_V4; 875b063a422SScott Long 876b063a422SScott Long /*LOGICAL_DEVICE_INFO_V4 max revision number*/ 877b063a422SScott Long #define LOGICAL_DEVICE_INFO_V4_REVISION 0 878b063a422SScott Long /*If new revision was defined please check evey revision size*/ 879b063a422SScott Long #define LOGICAL_DEVICE_INFO_V4_R0_SIZE (sizeof(LOGICAL_DEVICE_INFO_V4)) 880b063a422SScott Long #endif 881b063a422SScott Long 882b063a422SScott Long /* 883b063a422SScott Long * ALTERABLE_ARRAY_INFO and ALTERABLE_DEVICE_INFO, used in set_array_info() 884b063a422SScott Long * and set_device_info(). 885b063a422SScott Long * When set_xxx_info() is called, the ValidFields member indicates which 886b063a422SScott Long * fields in the structure are valid. 887b063a422SScott Long */ 888b063a422SScott Long /* field masks */ 889b063a422SScott Long #define AAIF_NAME 1 890b063a422SScott Long #define AAIF_DESCRIPTION 2 891b063a422SScott Long 892b063a422SScott Long #define ADIF_MODE 1 893b063a422SScott Long #define ADIF_TCQ 2 894b063a422SScott Long #define ADIF_NCQ 4 895b063a422SScott Long #define ADIF_WRITE_CACHE 8 896b063a422SScott Long #define ADIF_READ_AHEAD 0x10 897b063a422SScott Long #define ADIF_SPIN_UP_MODE 0x20 898b063a422SScott Long 899b063a422SScott Long typedef struct _ALTERABLE_ARRAY_INFO { 900b063a422SScott Long HPT_U32 ValidFields; /* mark valid fields below */ 901b063a422SScott Long HPT_U8 Name[MAX_ARRAYNAME_LEN]; /* array name */ 902b063a422SScott Long HPT_U8 Description[64]; /* array description */ 9034fdb276aSScott Long }__attribute__((packed))ALTERABLE_ARRAY_INFO, *PALTERABLE_ARRAY_INFO; 904b063a422SScott Long 905b063a422SScott Long typedef struct _ALTERABLE_DEVICE_INFO { 906b063a422SScott Long HPT_U32 ValidFields; /* mark valid fields below */ 907b063a422SScott Long HPT_U8 DeviceModeSetting; /* 0-4 PIO 0-4, 5-7 MW DMA0-2, 8-13 UDMA0-5 */ 9084fdb276aSScott Long }__attribute__((packed))ALTERABLE_DEVICE_INFO, *PALTERABLE_DEVICE_INFO; 909b063a422SScott Long 910b063a422SScott Long typedef struct _ALTERABLE_DEVICE_INFO_V2 { 911b063a422SScott Long HPT_U32 ValidFields; /* mark valid fields below */ 912b063a422SScott Long HPT_U8 DeviceModeSetting; /* 0-4 PIO 0-4, 5-7 MW DMA0-2, 8-13 UDMA0-5 */ 913b063a422SScott Long HPT_U8 TCQEnabled; 914b063a422SScott Long HPT_U8 NCQEnabled; 915b063a422SScott Long HPT_U8 WriteCacheEnabled; 916b063a422SScott Long HPT_U8 ReadAheadEnabled; 917b063a422SScott Long HPT_U8 SpinUpMode; 918b063a422SScott Long HPT_U8 reserve[2]; 919b063a422SScott Long HPT_U32 reserve2[13]; /* pad to 64 bytes */ 9204fdb276aSScott Long }__attribute__((packed))ALTERABLE_DEVICE_INFO_V2, *PALTERABLE_DEVICE_INFO_V2; 921b063a422SScott Long 922b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01020000 923b063a422SScott Long 924b063a422SScott Long #define TARGET_TYPE_DEVICE 0 925b063a422SScott Long #define TARGET_TYPE_ARRAY 1 926b063a422SScott Long 927b063a422SScott Long 928b063a422SScott Long #define AIT_NAME 0 929b063a422SScott Long #define AIT_DESCRIPTION 1 930b063a422SScott Long #define AIT_CACHE_POLICY 2 931b063a422SScott Long 932b063a422SScott Long 933b063a422SScott Long #define DIT_MODE 0 934b063a422SScott Long #define DIT_READ_AHEAD 1 935b063a422SScott Long #define DIT_WRITE_CACHE 2 936b063a422SScott Long #define DIT_TCQ 3 937b063a422SScott Long #define DIT_NCQ 4 938b063a422SScott Long 939b063a422SScott Long /* param type is determined by target_type and info_type*/ 940b063a422SScott Long typedef struct _SET_DEV_INFO 941b063a422SScott Long { 942b063a422SScott Long HPT_U8 target_type; 943b063a422SScott Long HPT_U8 infor_type; 944b063a422SScott Long HPT_U16 param_length; 945b063a422SScott Long #define SET_VDEV_INFO_param(p) ((HPT_U8 *)(p)+sizeof(SET_VDEV_INFO)) 946b063a422SScott Long /* HPT_U8 param[0]; */ 947b063a422SScott Long } SET_VDEV_INFO, * PSET_VDEV_INFO; 948b063a422SScott Long 949b063a422SScott Long typedef HPT_U8 PARAM_ARRAY_NAME[MAX_ARRAYNAME_LEN] ; 950b063a422SScott Long typedef HPT_U8 PARAM_ARRAY_DES[64]; 951b063a422SScott Long typedef HPT_U8 PARAM_DEVICE_MODE, PARAM_TCQ, PARAM_NCQ, PARAM_READ_AHEAD, PARAM_WRITE_CACHE, PARAM_CACHE_POLICY; 952b063a422SScott Long 953b063a422SScott Long #endif 954b063a422SScott Long 955b063a422SScott Long /* 956b063a422SScott Long * CREATE_ARRAY_PARAMS 957b063a422SScott Long * Param structure used to create an array. 958b063a422SScott Long */ 959b063a422SScott Long typedef struct _CREATE_ARRAY_PARAMS { 960b063a422SScott Long HPT_U8 ArrayType; /* 1-level array type */ 961b063a422SScott Long HPT_U8 nDisk; /* number of elements in Members[] array */ 962b063a422SScott Long HPT_U8 BlockSizeShift; /* Stripe size if ArrayType==AT_RAID0 / AT_RAID5 */ 963b063a422SScott Long HPT_U8 CreateFlags; /* See CAF_xxx */ 964b063a422SScott Long 965b063a422SScott Long HPT_U8 ArrayName[MAX_ARRAYNAME_LEN];/* Array name */ 966b063a422SScott Long HPT_U8 Description[64]; /* array description */ 967b063a422SScott Long HPT_U8 CreateManager[16]; /* who created it */ 968b063a422SScott Long TIME_RECORD CreateTime; /* when created it */ 969b063a422SScott Long 970b063a422SScott Long HPT_U32 Members[MAX_ARRAY_MEMBERS_V1];/* ID of array members, a member can be an array */ 971b063a422SScott Long 972b063a422SScott Long } CREATE_ARRAY_PARAMS, *PCREATE_ARRAY_PARAMS; 973b063a422SScott Long 974b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01010000 975b063a422SScott Long typedef struct _CREATE_ARRAY_PARAMS_V2 { 976b063a422SScott Long HPT_U8 ArrayType; /* 1-level array type */ 977b063a422SScott Long HPT_U8 nDisk; /* number of elements in Members[] array */ 978b063a422SScott Long HPT_U8 BlockSizeShift; /* Stripe size if ArrayType==AT_RAID0 / AT_RAID5 */ 979b063a422SScott Long HPT_U8 CreateFlags; /* See CAF_xxx */ 980b063a422SScott Long 981b063a422SScott Long HPT_U8 ArrayName[MAX_ARRAYNAME_LEN];/* Array name */ 982b063a422SScott Long HPT_U8 Description[64]; /* array description */ 983b063a422SScott Long HPT_U8 CreateManager[16]; /* who created it */ 984b063a422SScott Long TIME_RECORD CreateTime; /* when created it */ 985b063a422SScott Long HPT_U64 Capacity; 986b063a422SScott Long 987b063a422SScott Long HPT_U32 Members[MAX_ARRAY_MEMBERS_V2];/* ID of array members, a member can be an array */ 988b063a422SScott Long 989b063a422SScott Long } CREATE_ARRAY_PARAMS_V2, *PCREATE_ARRAY_PARAMS_V2; 990b063a422SScott Long #endif 991b063a422SScott Long 992b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x02000001 993b063a422SScott Long typedef struct _CREATE_ARRAY_PARAMS_V3 { 994b063a422SScott Long HPT_U32 dwSize; 995b063a422SScott Long HPT_U8 revision; /*CREATE_ARRAY_PARAMS_V3_REVISION*/ 9964fdb276aSScott Long HPT_U8 reserved[6]; 9974fdb276aSScott Long HPT_U8 SectorSizeShift; /*sector size = 512B<<SectorSizeShift*/ 998b063a422SScott Long HPT_U8 ArrayType; /* 1-level array type */ 999b063a422SScott Long HPT_U8 nDisk; /* number of elements in Members[] array */ 1000b063a422SScott Long HPT_U8 BlockSizeShift; /* Stripe size if ArrayType==AT_RAID0 / AT_RAID5 */ 1001b063a422SScott Long HPT_U8 CreateFlags; /* See CAF_xxx */ 1002b063a422SScott Long 1003b063a422SScott Long HPT_U8 ArrayName[MAX_ARRAYNAME_LEN];/* Array name */ 1004b063a422SScott Long HPT_U8 Description[64]; /* array description */ 1005b063a422SScott Long HPT_U8 CreateManager[16]; /* who created it */ 1006b063a422SScott Long TIME_RECORD CreateTime; /* when created it */ 1007b063a422SScott Long HPT_U64 Capacity; 1008b063a422SScott Long 1009b063a422SScott Long HPT_U32 Members[MAX_ARRAY_MEMBERS_V3];/* ID of array members, a member can be an array */ 1010b063a422SScott Long } CREATE_ARRAY_PARAMS_V3, *PCREATE_ARRAY_PARAMS_V3; 1011b063a422SScott Long 1012b063a422SScott Long /*CREATE_ARRAY_PARAMS_V3 current max revision*/ 1013b063a422SScott Long #define CREATE_ARRAY_PARAMS_V3_REVISION 0 1014b063a422SScott Long /*If new revision defined please check evey revision size*/ 1015b063a422SScott Long #define CREATE_ARRAY_PARAMS_V3_R0_SIZE (sizeof(CREATE_ARRAY_PARAMS_V3)) 1016b063a422SScott Long #endif 1017b063a422SScott Long 1018b063a422SScott Long #if HPT_INTERFACE_VERSION < 0x01020000 1019b063a422SScott Long /* 1020b063a422SScott Long * Flags used for creating an RAID 1 array 1021b063a422SScott Long * 1022b063a422SScott Long * CAF_CREATE_AND_DUPLICATE 1023b063a422SScott Long * Copy source disk contents to target for RAID 1. If user choose "create and duplicate" 1024b063a422SScott Long * to create an array, GUI will call CreateArray() with this flag set. Then GUI should 1025b063a422SScott Long * call hpt_get_device_info() with the returned array ID and check returned flags to 1026b063a422SScott Long * see if ARRAY_FLAG_REBUILDING is set. If not set, driver does not support rebuilding 1027b063a422SScott Long * and GUI must do duplication itself. 1028b063a422SScott Long * CAF_DUPLICATE_MUST_DONE 1029b063a422SScott Long * If the duplication is aborted or fails, do not create the array. 1030b063a422SScott Long */ 1031b063a422SScott Long #define CAF_CREATE_AND_DUPLICATE 1 1032b063a422SScott Long #define CAF_DUPLICATE_MUST_DONE 2 1033b063a422SScott Long #define CAF_CREATE_AS_RAID15 4 1034b063a422SScott Long /* 1035b063a422SScott Long * Flags used for creating an RAID 5 array 1036b063a422SScott Long */ 1037b063a422SScott Long #define CAF_CREATE_R5_NO_BUILD 1 1038b063a422SScott Long #define CAF_CREATE_R5_ZERO_INIT 2 1039b063a422SScott Long #define CAF_CREATE_R5_BUILD_PARITY 4 1040b063a422SScott Long 1041b063a422SScott Long #else 1042b063a422SScott Long /* 1043b063a422SScott Long * Flags used for creating 1044b063a422SScott Long */ 1045b063a422SScott Long #define CAF_FOREGROUND_INITIALIZE 1 1046b063a422SScott Long #define CAF_BACKGROUND_INITIALIZE 2 1047b063a422SScott Long #define CAF_CREATE_R5_WRITE_BACK (CACHE_POLICY_WRITE_BACK<<CAF_CACHE_POLICY_SHIFT) 1048b063a422SScott Long 1049b063a422SScott Long 1050b063a422SScott Long #define CAF_CACHE_POLICY_MASK 0x1C 1051b063a422SScott Long #define CAF_CACHE_POLICY_SHIFT 2 1052b063a422SScott Long 1053b063a422SScott Long #endif 1054b063a422SScott Long 1055b063a422SScott Long #define CAF_KEEP_DATA_ALWAYS 0x80 1056b063a422SScott Long 1057b063a422SScott Long /* Flags used for deleting an array 1058b063a422SScott Long * 1059b063a422SScott Long * DAF_KEEP_DATA_IF_POSSIBLE 1060b063a422SScott Long * If this flag is set, deleting a RAID 1 array will not destroy the data on both disks. 1061b063a422SScott Long * Deleting a JBOD should keep partitions on first disk ( not implement now ). 1062b063a422SScott Long * Deleting a RAID 0/1 should result as two RAID 0 array ( not implement now ). 1063b063a422SScott Long */ 1064b063a422SScott Long #define DAF_KEEP_DATA_IF_POSSIBLE 1 1065b063a422SScott Long #define DAF_KEEP_DATA_ALWAYS 2 1066b063a422SScott Long 1067b063a422SScott Long /* 1068b063a422SScott Long * event types 1069b063a422SScott Long */ 1070b063a422SScott Long #define ET_DEVICE_REMOVED 1 /* device removed */ 1071b063a422SScott Long #define ET_DEVICE_PLUGGED 2 /* device plugged */ 1072b063a422SScott Long #define ET_DEVICE_ERROR 3 /* device I/O error */ 1073b063a422SScott Long #define ET_REBUILD_STARTED 4 1074b063a422SScott Long #define ET_REBUILD_ABORTED 5 1075b063a422SScott Long #define ET_REBUILD_FINISHED 6 1076b063a422SScott Long #define ET_SPARE_TOOK_OVER 7 1077b063a422SScott Long #define ET_REBUILD_FAILED 8 1078b063a422SScott Long #define ET_VERIFY_STARTED 9 1079b063a422SScott Long #define ET_VERIFY_ABORTED 10 1080b063a422SScott Long #define ET_VERIFY_FAILED 11 1081b063a422SScott Long #define ET_VERIFY_FINISHED 12 1082b063a422SScott Long #define ET_INITIALIZE_STARTED 13 1083b063a422SScott Long #define ET_INITIALIZE_ABORTED 14 1084b063a422SScott Long #define ET_INITIALIZE_FAILED 15 1085b063a422SScott Long #define ET_INITIALIZE_FINISHED 16 1086b063a422SScott Long #define ET_VERIFY_DATA_ERROR 17 1087b063a422SScott Long #define ET_TRANSFORM_STARTED 18 1088b063a422SScott Long #define ET_TRANSFORM_ABORTED 19 1089b063a422SScott Long #define ET_TRANSFORM_FAILED 20 1090b063a422SScott Long #define ET_TRANSFORM_FINISHED 21 1091b063a422SScott Long #define ET_SMART_FAILED 22 1092b063a422SScott Long #define ET_SMART_PASSED 23 1093b063a422SScott Long #define ET_SECTOR_REPAIR_FAIL 24 1094b063a422SScott Long #define ET_SECTOR_REPAIR_SUCCESS 25 10954fdb276aSScott Long #define ET_ERASE_FAIL 26 10964fdb276aSScott Long #define ET_ERASE_SUCCESS 27 10974fdb276aSScott Long #define ET_CONTINUE_REBUILD_ON_ERROR 28 10984fdb276aSScott Long 1099b063a422SScott Long 1100b063a422SScott Long /* 1101b063a422SScott Long * event structure 1102b063a422SScott Long */ 1103b063a422SScott Long typedef struct _HPT_EVENT { 1104b063a422SScott Long TIME_RECORD Time; 1105b063a422SScott Long DEVICEID DeviceID; 1106b063a422SScott Long HPT_U8 EventType; 1107b063a422SScott Long HPT_U8 reserved[3]; 1108b063a422SScott Long 1109b063a422SScott Long HPT_U8 Data[32]; /* various data depend on EventType */ 1110b063a422SScott Long } HPT_EVENT, *PHPT_EVENT; 1111b063a422SScott Long 1112b063a422SScott Long /* 1113b063a422SScott Long * IDE pass-through command. Use it at your own risk! 1114b063a422SScott Long */ 1115b063a422SScott Long #ifdef _MSC_VER 1116b063a422SScott Long #pragma warning(disable:4200) 1117b063a422SScott Long #endif 1118b063a422SScott Long typedef struct _IDE_PASS_THROUGH_HEADER { 1119b063a422SScott Long DEVICEID idDisk; /* disk ID */ 1120b063a422SScott Long HPT_U8 bFeaturesReg; /* feature register */ 1121b063a422SScott Long HPT_U8 bSectorCountReg; /* IDE sector count register. */ 1122b063a422SScott Long HPT_U8 bLbaLowReg; /* IDE LBA low value. */ 1123b063a422SScott Long HPT_U8 bLbaMidReg; /* IDE LBA mid register. */ 1124b063a422SScott Long HPT_U8 bLbaHighReg; /* IDE LBA high value. */ 1125b063a422SScott Long HPT_U8 bDriveHeadReg; /* IDE drive/head register. */ 1126b063a422SScott Long HPT_U8 bCommandReg; /* Actual IDE command. Checked for validity by driver. */ 1127b063a422SScott Long HPT_U8 nSectors; /* data size in sectors, if the command has data transfer */ 1128b063a422SScott Long HPT_U8 protocol; /* IO_COMMAND_(READ,WRITE) or zero for non-DATA */ 1129b063a422SScott Long HPT_U8 reserve[3]; 1130b063a422SScott Long #define IDE_PASS_THROUGH_buffer(p) ((HPT_U8 *)(p) + sizeof(IDE_PASS_THROUGH_HEADER)) 1131b063a422SScott Long /* HPT_U8 DataBuffer[0]; */ 1132b063a422SScott Long } 1133b063a422SScott Long IDE_PASS_THROUGH_HEADER, *PIDE_PASS_THROUGH_HEADER; 1134b063a422SScott Long 11354fdb276aSScott Long typedef struct _HPT_SCSI_PASSTHROUGH_IN { 11364fdb276aSScott Long DEVICEID idDisk; 11374fdb276aSScott Long HPT_U8 protocol; 11384fdb276aSScott Long HPT_U8 reserve1; 11394fdb276aSScott Long HPT_U8 reserve2; 11404fdb276aSScott Long HPT_U8 cdbLength; 11414fdb276aSScott Long HPT_U8 cdb[16]; 11424fdb276aSScott Long HPT_U32 dataLength; 11434fdb276aSScott Long /* data follows, if any */ 11444fdb276aSScott Long } 11454fdb276aSScott Long HPT_SCSI_PASSTHROUGH_IN, *PHPT_SCSI_PASSTHROUGH_IN; 11464fdb276aSScott Long 11474fdb276aSScott Long typedef struct _HPT_SCSI_PASSTHROUGH_OUT { 11484fdb276aSScott Long HPT_U8 scsiStatus; 11494fdb276aSScott Long HPT_U8 reserve1; 11504fdb276aSScott Long HPT_U8 reserve2; 11514fdb276aSScott Long HPT_U8 reserve3; 11524fdb276aSScott Long HPT_U32 dataLength; 11534fdb276aSScott Long /* data/sense follows if any */ 11544fdb276aSScott Long } 11554fdb276aSScott Long HPT_SCSI_PASSTHROUGH_OUT, *PHPT_SCSI_PASSTHROUGH_OUT; 11564fdb276aSScott Long 1157b063a422SScott Long /* 1158b063a422SScott Long * device io packet format 1159b063a422SScott Long */ 1160b063a422SScott Long typedef struct _DEVICE_IO_EX_PARAMS { 1161b063a422SScott Long DEVICEID idDisk; 1162b063a422SScott Long HPT_U32 Lba; 1163b063a422SScott Long HPT_U16 nSectors; 1164b063a422SScott Long HPT_U8 Command; /* IO_COMMAD_xxx */ 1165b063a422SScott Long HPT_U8 BufferType; /* BUFFER_TYPE_xxx, see below */ 1166b063a422SScott Long HPT_U32 BufferPtr; 1167b063a422SScott Long } 1168b063a422SScott Long DEVICE_IO_EX_PARAMS, *PDEVICE_IO_EX_PARAMS; 1169b063a422SScott Long 1170b063a422SScott Long #define BUFFER_TYPE_LOGICAL 1 /* logical pointer to buffer */ 1171b063a422SScott Long #define BUFFER_TYPE_PHYSICAL 2 /* physical address of buffer */ 1172b063a422SScott Long #define BUFFER_TYPE_LOGICAL_LOGICAL_SG 3 /* logical pointer to logical S/G table */ 1173b063a422SScott Long #define BUFFER_TYPE_LOGICAL_PHYSICAL_SG 4 /* logical pointer to physical S/G table */ 1174b063a422SScott Long #define BUFFER_TYPE_PHYSICAL_LOGICAL_SG 5 /* physical address to logical S/G table */ 1175b063a422SScott Long #define BUFFER_TYPE_PHYSICAL_PHYSICAL_SG 6 /* physical address of physical S/G table */ 1176b063a422SScott Long #define BUFFER_TYPE_PHYSICAL_PHYSICAL_SG_PIO 7 /* non DMA capable physical address of physical S/G table */ 1177b063a422SScott Long 1178b063a422SScott Long typedef struct _HPT_DRIVER_PARAMETER { 1179b063a422SScott Long char name[32]; 1180b063a422SScott Long HPT_U8 value[32]; 1181b063a422SScott Long HPT_U8 type; /* HPT_DRIVER_PARAMETER_TYPE_* */ 1182b063a422SScott Long HPT_U8 persistent; 1183b063a422SScott Long HPT_U8 reserve2[2]; 1184b063a422SScott Long HPT_U8 location; /* 0 - system */ 1185b063a422SScott Long HPT_U8 controller; 1186b063a422SScott Long HPT_U8 bus; 1187b063a422SScott Long HPT_U8 reserve1; 1188b063a422SScott Long char desc[128]; 1189b063a422SScott Long } 1190b063a422SScott Long HPT_DRIVER_PARAMETER, *PHPT_DRIVER_PARAMETER; 1191b063a422SScott Long 1192b063a422SScott Long #define HPT_DRIVER_PARAMETER_TYPE_INT 1 1193b063a422SScott Long #define HPT_DRIVER_PARAMETER_TYPE_BOOL 2 1194b063a422SScott Long 1195b063a422SScott Long 1196b063a422SScott Long 1197b063a422SScott Long /* 1198b063a422SScott Long * ioctl structure 1199b063a422SScott Long */ 1200b063a422SScott Long #define HPT_IOCTL_MAGIC32 0x1A2B3C4D 1201b063a422SScott Long #define HPT_IOCTL_MAGIC 0xA1B2C3D4 1202b063a422SScott Long 1203b063a422SScott Long typedef struct _HPT_IOCTL_PARAM { 1204b063a422SScott Long HPT_U32 Magic; /* used to check if it's a valid ioctl packet */ 1205b063a422SScott Long HPT_U32 dwIoControlCode; /* operation control code */ 1206b063a422SScott Long HPT_PTR lpInBuffer; /* input data buffer */ 1207b063a422SScott Long HPT_U32 nInBufferSize; /* size of input data buffer */ 1208b063a422SScott Long HPT_PTR lpOutBuffer; /* output data buffer */ 1209b063a422SScott Long HPT_U32 nOutBufferSize; /* size of output data buffer */ 1210b063a422SScott Long HPT_PTR lpBytesReturned; /* count of HPT_U8s returned */ 1211b063a422SScott Long } 1212b063a422SScott Long HPT_IOCTL_PARAM, *PHPT_IOCTL_PARAM; 1213b063a422SScott Long 1214b063a422SScott Long /* for 32-bit app running on 64-bit system */ 1215b063a422SScott Long typedef struct _HPT_IOCTL_PARAM32 { 1216b063a422SScott Long HPT_U32 Magic; 1217b063a422SScott Long HPT_U32 dwIoControlCode; 1218b063a422SScott Long HPT_U32 lpInBuffer; 1219b063a422SScott Long HPT_U32 nInBufferSize; 1220b063a422SScott Long HPT_U32 lpOutBuffer; 1221b063a422SScott Long HPT_U32 nOutBufferSize; 1222b063a422SScott Long HPT_U32 lpBytesReturned; 1223b063a422SScott Long } 1224b063a422SScott Long HPT_IOCTL_PARAM32, *PHPT_IOCTL_PARAM32; 1225b063a422SScott Long 1226b063a422SScott Long #if !defined(__KERNEL__) || defined(SIMULATE) 1227b063a422SScott Long /* 1228b063a422SScott Long * User-mode ioctl parameter passing conventions: 1229b063a422SScott Long * The ioctl function implementation is platform specific, so we don't 1230b063a422SScott Long * have forced rules for it. However, it's suggested to use a parameter 1231b063a422SScott Long * passing method as below 1232b063a422SScott Long * 1) Put all input data continuously in an input buffer. 1233b063a422SScott Long * 2) Prepare an output buffer with enough size if needed. 1234b063a422SScott Long * 3) Fill a HPT_IOCTL_PARAM structure. 1235b063a422SScott Long * 4) Pass the structure to driver through a platform-specific method. 1236b063a422SScott Long * This is implemented in the mid-layer user-mode library. The UI 1237b063a422SScott Long * programmer needn't care about it. 1238b063a422SScott Long */ 1239b063a422SScott Long 1240b063a422SScott Long /************************************************************************ 1241b063a422SScott Long * User mode functions 1242b063a422SScott Long ************************************************************************/ 1243b063a422SScott Long /* 1244b063a422SScott Long * hpt_get_version 1245b063a422SScott Long * Version compatibility: all versions 1246b063a422SScott Long * Parameters: 1247b063a422SScott Long * None 1248b063a422SScott Long * Returns: 1249b063a422SScott Long * interface version. 0 when fail. 1250b063a422SScott Long */ 1251b063a422SScott Long HPT_U32 hpt_get_version(void); 1252b063a422SScott Long 1253b063a422SScott Long /* 1254b063a422SScott Long * hpt_get_driver_capabilities 1255b063a422SScott Long * Version compatibility: v1.0.0.2 or later 1256b063a422SScott Long * Parameters: 1257b063a422SScott Long * Pointer to receive a DRIVE_CAPABILITIES structure. The caller must set 1258b063a422SScott Long * dwSize member to sizeof(DRIVER_CAPABILITIES). The callee must check this 1259b063a422SScott Long * member to see if it's correct. 1260b063a422SScott Long * Returns: 1261b063a422SScott Long * 0 - Success 1262b063a422SScott Long */ 1263b063a422SScott Long int hpt_get_driver_capabilities(PDRIVER_CAPABILITIES cap); 1264b063a422SScott Long int hpt_get_driver_capabilities_v2(PDRIVER_CAPABILITIES_V2 cap); 1265b063a422SScott Long 1266b063a422SScott Long /* 1267b063a422SScott Long * hpt_get_controller_count 1268b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1269b063a422SScott Long * Parameters: 1270b063a422SScott Long * None 1271b063a422SScott Long * Returns: 1272b063a422SScott Long * number of controllers 1273b063a422SScott Long */ 1274b063a422SScott Long int hpt_get_controller_count(void); 1275b063a422SScott Long 1276b063a422SScott Long /* hpt_get_controller_info 1277b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1278b063a422SScott Long * Parameters: 1279b063a422SScott Long * id Controller id 1280b063a422SScott Long * pInfo pointer to CONTROLLER_INFO buffer 1281b063a422SScott Long * Returns: 1282b063a422SScott Long * 0 Success, controller info is put into (*pInfo ). 1283b063a422SScott Long */ 1284b063a422SScott Long int hpt_get_controller_info(int id, PCONTROLLER_INFO pInfo); 1285b063a422SScott Long 1286b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01020000 1287b063a422SScott Long /* hpt_get_controller_info_v2 1288b063a422SScott Long * Version compatibility: v2.0.0.0 or later 1289b063a422SScott Long * Parameters: 1290b063a422SScott Long * id Controller id 1291b063a422SScott Long * pInfo pointer to CONTROLLER_INFO_V2 buffer 1292b063a422SScott Long * Returns: 1293b063a422SScott Long * 0 Success, controller info is put into (*pInfo ). 1294b063a422SScott Long */ 1295b063a422SScott Long int hpt_get_controller_info_v2(int id, PCONTROLLER_INFO_V2 pInfo); 1296b063a422SScott Long 1297b063a422SScott Long /* hpt_get_controller_info_v3 1298b063a422SScott Long * Version compatibility: v2.0.0.0 or later 1299b063a422SScott Long * Parameters: 1300b063a422SScott Long * id Controller id 1301b063a422SScott Long * pInfo pointer to CONTROLLER_INFO_V3 buffer 1302b063a422SScott Long * Returns: 1303b063a422SScott Long * 0 Success, controller info is put into (*pInfo ). 1304b063a422SScott Long */ 1305b063a422SScott Long int hpt_get_controller_info_v3(int id, PCONTROLLER_INFO_V3 pInfo); 1306b063a422SScott Long #endif 1307b063a422SScott Long 1308b063a422SScott Long /* hpt_get_channel_info 1309b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1310b063a422SScott Long * Parameters: 1311b063a422SScott Long * id Controller id 1312b063a422SScott Long * bus bus number 1313b063a422SScott Long * pInfo pointer to CHANNEL_INFO buffer 1314b063a422SScott Long * Returns: 1315b063a422SScott Long * 0 Success, channel info is put into (*pInfo ). 1316b063a422SScott Long */ 1317b063a422SScott Long int hpt_get_channel_info(int id, int bus, PCHANNEL_INFO pInfo); 1318b063a422SScott Long 1319b063a422SScott Long /* hpt_get_channel_info_v2 1320b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1321b063a422SScott Long * Parameters: 1322b063a422SScott Long * id Controller id 1323b063a422SScott Long * bus bus number 1324b063a422SScott Long * pInfo pointer to CHANNEL_INFO buffer 1325b063a422SScott Long * Returns: 1326b063a422SScott Long * 0 Success, channel info is put into (*pInfo ). 1327b063a422SScott Long */ 1328b063a422SScott Long int hpt_get_channel_info_v2(int id, int bus, PCHANNEL_INFO_V2 pInfo); 1329b063a422SScott Long 1330b063a422SScott Long /* hpt_get_logical_devices 1331b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1332b063a422SScott Long * Parameters: 1333b063a422SScott Long * pIds pointer to a DEVICEID array 1334b063a422SScott Long * nMaxCount array size 1335b063a422SScott Long * Returns: 1336b063a422SScott Long * Number of ID returned. All logical device IDs are put into pIds array. 1337b063a422SScott Long * Note: A spare disk is not a logical device. 1338b063a422SScott Long */ 1339b063a422SScott Long int hpt_get_logical_devices(DEVICEID * pIds, int nMaxCount); 1340b063a422SScott Long 1341b063a422SScott Long /* hpt_get_device_info 1342b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1343b063a422SScott Long * Parameters: 1344b063a422SScott Long * id logical device id 1345b063a422SScott Long * pInfo pointer to LOGICAL_DEVICE_INFO structure 1346b063a422SScott Long * Returns: 1347b063a422SScott Long * 0 - Success 1348b063a422SScott Long */ 1349b063a422SScott Long int hpt_get_device_info(DEVICEID id, PLOGICAL_DEVICE_INFO pInfo); 1350b063a422SScott Long 1351b063a422SScott Long /* hpt_create_array 1352b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1353b063a422SScott Long * Parameters: 1354b063a422SScott Long * pParam pointer to CREATE_ARRAY_PARAMS structure 1355b063a422SScott Long * Returns: 1356b063a422SScott Long * 0 failed 1357b063a422SScott Long * else return array id 1358b063a422SScott Long */ 1359b063a422SScott Long DEVICEID hpt_create_array(PCREATE_ARRAY_PARAMS pParam); 1360b063a422SScott Long 1361b063a422SScott Long /* hpt_delete_array 1362b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1363b063a422SScott Long * Parameters: 1364b063a422SScott Long * id array id 1365b063a422SScott Long * Returns: 1366b063a422SScott Long * 0 Success 1367b063a422SScott Long */ 1368b063a422SScott Long int hpt_delete_array(DEVICEID id, HPT_U32 options); 1369b063a422SScott Long 1370b063a422SScott Long /* hpt_device_io 1371b063a422SScott Long * Read/write data on array and physcal device. 1372b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1373b063a422SScott Long * Parameters: 1374b063a422SScott Long * id device id. If it's an array ID, IO will be performed on the array. 1375b063a422SScott Long * If it's a physical device ID, IO will be performed on the device. 1376b063a422SScott Long * cmd IO_COMMAND_READ or IO_COMMAND_WRITE 1377b063a422SScott Long * buffer data buffer 1378b063a422SScott Long * length data size 1379b063a422SScott Long * Returns: 1380b063a422SScott Long * 0 Success 1381b063a422SScott Long */ 1382b063a422SScott Long int hpt_device_io(DEVICEID id, int cmd, HPT_U32 lba, HPT_U32 nSector, void * buffer); 1383b063a422SScott Long 1384b063a422SScott Long /* hpt_add_disk_to_array 1385b063a422SScott Long * Used to dynamicly add a disk to an RAID1, RAID0/1, RAID1/0 or RAID5 array. 1386b063a422SScott Long * Auto-rebuild will start. 1387b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1388b063a422SScott Long * Parameters: 1389b063a422SScott Long * idArray array id 1390b063a422SScott Long * idDisk disk id 1391b063a422SScott Long * Returns: 1392b063a422SScott Long * 0 Success 1393b063a422SScott Long */ 1394b063a422SScott Long int hpt_add_disk_to_array(DEVICEID idArray, DEVICEID idDisk); 1395b063a422SScott Long 1396b063a422SScott Long /* hpt_add_spare_disk 1397b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1398b063a422SScott Long * Add a disk to spare pool. 1399b063a422SScott Long * Parameters: 1400b063a422SScott Long * idDisk disk id 1401b063a422SScott Long * Returns: 1402b063a422SScott Long * 0 Success 1403b063a422SScott Long */ 1404b063a422SScott Long int hpt_add_spare_disk(DEVICEID idDisk); 1405b063a422SScott Long 1406b063a422SScott Long /* hpt_add_dedicated_spare 1407b063a422SScott Long * Version compatibility: v1.0.0.3 or later 1408b063a422SScott Long * Add a spare disk to an array 1409b063a422SScott Long * Parameters: 1410b063a422SScott Long * idDisk disk id 1411b063a422SScott Long * idArray array id 1412b063a422SScott Long * Returns: 1413b063a422SScott Long * 0 Success 1414b063a422SScott Long */ 1415b063a422SScott Long int hpt_add_dedicated_spare(DEVICEID idDisk, DEVICEID idArray); 1416b063a422SScott Long 1417b063a422SScott Long /* hpt_remove_spare_disk 1418b063a422SScott Long * remove a disk from spare pool. 1419b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1420b063a422SScott Long * Parameters: 1421b063a422SScott Long * idDisk disk id 1422b063a422SScott Long * Returns: 1423b063a422SScott Long * 0 Success 1424b063a422SScott Long */ 1425b063a422SScott Long int hpt_remove_spare_disk(DEVICEID idDisk); 1426b063a422SScott Long 1427b063a422SScott Long /* hpt_get_event 1428b063a422SScott Long * Used to poll events from driver. 1429b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1430b063a422SScott Long * Parameters: 1431b063a422SScott Long * pEvent pointer to HPT_EVENT structure 1432b063a422SScott Long * Returns: 1433b063a422SScott Long * 0 Success, event info is filled in *pEvent 1434b063a422SScott Long */ 1435b063a422SScott Long int hpt_get_event(PHPT_EVENT pEvent); 1436b063a422SScott Long 1437b063a422SScott Long /* hpt_rebuild_data_block 1438b063a422SScott Long * Used to copy data from source disk and mirror disk. 1439b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1440b063a422SScott Long * Parameters: 1441b063a422SScott Long * idArray Array ID (RAID1, 0/1 or RAID5) 1442b063a422SScott Long * Lba Start LBA for each array member 1443b063a422SScott Long * nSector Number of sectors for each array member (RAID 5 will ignore this parameter) 1444b063a422SScott Long * 1445b063a422SScott Long * Returns: 1446b063a422SScott Long * 0 Success, event info is filled in *pEvent 1447b063a422SScott Long */ 1448b063a422SScott Long int hpt_rebuild_data_block(DEVICEID idMirror, HPT_U32 Lba, HPT_U8 nSector); 1449b063a422SScott Long #define hpt_rebuild_mirror(p1, p2, p3) hpt_rebuild_data_block(p1, p2, p3) 1450b063a422SScott Long 1451b063a422SScott Long /* hpt_set_array_state 1452b063a422SScott Long * set array state. 1453b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1454b063a422SScott Long * Parameters: 1455b063a422SScott Long * idArray Array ID 1456b063a422SScott Long * state See above 'array states' constants, possible values are: 1457b063a422SScott Long * MIRROR_REBUILD_START 1458b063a422SScott Long * Indicate that GUI wants to rebuild a mirror array 1459b063a422SScott Long * MIRROR_REBUILD_ABORT 1460b063a422SScott Long * GUI wants to abort rebuilding an array 1461b063a422SScott Long * MIRROR_REBUILD_COMPLETE 1462b063a422SScott Long * GUI finished to rebuild an array. If rebuild is done by driver this 1463b063a422SScott Long * state has no use 1464b063a422SScott Long * 1465b063a422SScott Long * Returns: 1466b063a422SScott Long * 0 Success 1467b063a422SScott Long */ 1468b063a422SScott Long int hpt_set_array_state(DEVICEID idArray, HPT_U32 state); 1469b063a422SScott Long 1470b063a422SScott Long /* hpt_set_array_info 1471b063a422SScott Long * set array info. 1472b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1473b063a422SScott Long * Parameters: 1474b063a422SScott Long * idArray Array ID 1475b063a422SScott Long * pInfo pointer to new info 1476b063a422SScott Long * 1477b063a422SScott Long * Returns: 1478b063a422SScott Long * 0 Success 1479b063a422SScott Long */ 1480b063a422SScott Long int hpt_set_array_info(DEVICEID idArray, PALTERABLE_ARRAY_INFO pInfo); 1481b063a422SScott Long 1482b063a422SScott Long /* hpt_set_device_info 1483b063a422SScott Long * set device info. 1484b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1485b063a422SScott Long * Parameters: 1486b063a422SScott Long * idDisk device ID 1487b063a422SScott Long * pInfo pointer to new info 1488b063a422SScott Long * 1489b063a422SScott Long * Returns: 1490b063a422SScott Long * 0 Success 1491b063a422SScott Long * Additional notes: 1492b063a422SScott Long * If idDisk==0, call to this function will stop buzzer on the adapter 1493b063a422SScott Long * (if supported by driver). 1494b063a422SScott Long */ 1495b063a422SScott Long int hpt_set_device_info(DEVICEID idDisk, PALTERABLE_DEVICE_INFO pInfo); 1496b063a422SScott Long 1497b063a422SScott Long #if HPT_INTERFACE_VERSION >= 0x01000004 1498b063a422SScott Long int hpt_set_device_info_v2(DEVICEID idDisk, PALTERABLE_DEVICE_INFO_V2 pInfo); 1499b063a422SScott Long #endif 1500b063a422SScott Long 1501b063a422SScott Long /* hpt_rescan_devices 1502b063a422SScott Long * rescan devices 1503b063a422SScott Long * Version compatibility: v1.0.0.1 or later 1504b063a422SScott Long * Parameters: 1505b063a422SScott Long * None 1506b063a422SScott Long * Returns: 1507b063a422SScott Long * 0 Success 1508b063a422SScott Long */ 1509b063a422SScott Long int hpt_rescan_devices(void); 1510b063a422SScott Long 1511b063a422SScott Long /* hpt_get_601_info 1512b063a422SScott Long * Get HPT601 status 1513b063a422SScott Long * Version compatibiilty: v1.0.0.3 or later 1514b063a422SScott Long * Parameters: 1515b063a422SScott Long * idDisk - Disk handle 1516b063a422SScott Long * PHPT601_INFO - pointer to HPT601 info buffer 1517b063a422SScott Long * Returns: 1518b063a422SScott Long * 0 Success 1519b063a422SScott Long */ 1520b063a422SScott Long int hpt_get_601_info(DEVICEID idDisk, PHPT601_INFO pInfo); 1521b063a422SScott Long 1522b063a422SScott Long /* hpt_set_601_info 1523b063a422SScott Long * HPT601 function control 1524b063a422SScott Long * Version compatibiilty: v1.0.0.3 or later 1525b063a422SScott Long * Parameters: 1526b063a422SScott Long * idDisk - Disk handle 1527b063a422SScott Long * PHPT601_INFO - pointer to HPT601 info buffer 1528b063a422SScott Long * Returns: 1529b063a422SScott Long * 0 Success 1530b063a422SScott Long */ 1531b063a422SScott Long int hpt_set_601_info(DEVICEID idDisk, PHPT601_INFO pInfo); 1532b063a422SScott Long 1533b063a422SScott Long /* hpt_lock_device 1534b063a422SScott Long * Lock a block on a device (prevent OS accessing it) 1535b063a422SScott Long * Version compatibiilty: v1.0.0.3 or later 1536b063a422SScott Long * Parameters: 1537b063a422SScott Long * idDisk - Disk handle 1538b063a422SScott Long * Lba - Start LBA 1539b063a422SScott Long * nSectors - number of sectors 1540b063a422SScott Long * Returns: 1541b063a422SScott Long * 0 Success 1542b063a422SScott Long */ 1543b063a422SScott Long int hpt_lock_device(DEVICEID idDisk, HPT_U32 Lba, HPT_U8 nSectors); 1544b063a422SScott Long 1545b063a422SScott Long /* hpt_lock_device 1546b063a422SScott Long * Unlock a device 1547b063a422SScott Long * Version compatibiilty: v1.0.0.3 or later 1548b063a422SScott Long * Parameters: 1549b063a422SScott Long * idDisk - Disk handle 1550b063a422SScott Long * Returns: 1551b063a422SScott Long * 0 Success 1552b063a422SScott Long */ 1553b063a422SScott Long int hpt_unlock_device(DEVICEID idDisk); 1554b063a422SScott Long 1555b063a422SScott Long /* hpt_ide_pass_through 15564fdb276aSScott Long * send a ATA passthrough command to a device. 1557b063a422SScott Long * Version compatibility: v1.0.0.3 or later 1558b063a422SScott Long * Parameters: 1559b063a422SScott Long * p - IDE_PASS_THROUGH header pointer 1560b063a422SScott Long * Returns: 1561b063a422SScott Long * 0 Success 1562b063a422SScott Long */ 1563b063a422SScott Long int hpt_ide_pass_through(PIDE_PASS_THROUGH_HEADER p); 1564b063a422SScott Long 15654fdb276aSScott Long /* hpt_scsi_passthrough 15664fdb276aSScott Long * send a SCSI passthrough command to a device. 15674fdb276aSScott Long * Version compatibility: v2.0.0.0 or later 15684fdb276aSScott Long * Parameters: 15694fdb276aSScott Long * in - HPT_SCSI_PASSTHROUGH_IN header pointer 15704fdb276aSScott Long * out - PHPT_SCSI_PASSTHROUGH_OUT header pointer 15714fdb276aSScott Long * insize, outsize - in/out buffer size 15724fdb276aSScott Long * Returns: 15734fdb276aSScott Long * 0 Success 15744fdb276aSScott Long */ 15754fdb276aSScott Long int hpt_scsi_passthrough(PHPT_SCSI_PASSTHROUGH_IN in, HPT_U32 insize, 15764fdb276aSScott Long PHPT_SCSI_PASSTHROUGH_OUT out, HPT_U32 outsize); 15774fdb276aSScott Long 1578b063a422SScott Long /* hpt_verify_data_block 1579b063a422SScott Long * verify data block on RAID1 or RAID5. 1580b063a422SScott Long * Version compatibility: v1.0.0.3 or later 1581b063a422SScott Long * Parameters: 1582b063a422SScott Long * idArray - Array ID 1583b063a422SScott Long * Lba - block number (on each array member, not logical block!) 1584b063a422SScott Long * nSectors - Sectors for each member (RAID 5 will ignore this parameter) 1585b063a422SScott Long * Returns: 1586b063a422SScott Long * 0 Success 1587b063a422SScott Long * 1 Data compare error 1588b063a422SScott Long * 2 I/O error 1589b063a422SScott Long */ 1590b063a422SScott Long int hpt_verify_data_block(DEVICEID idArray, HPT_U32 Lba, HPT_U8 nSectors); 1591b063a422SScott Long 1592b063a422SScott Long /* hpt_initialize_data_block 1593b063a422SScott Long * initialize data block (fill with zero) on RAID5 1594b063a422SScott Long * Version compatibility: v1.0.0.3 or later 1595b063a422SScott Long * Parameters: 1596b063a422SScott Long * idArray - Array ID 1597b063a422SScott Long * Lba - block number (on each array member, not logical block!) 1598b063a422SScott Long * nSectors - Sectors for each member (RAID 5 will ignore this parameter) 1599b063a422SScott Long * Returns: 1600b063a422SScott Long * 0 Success 1601b063a422SScott Long */ 1602b063a422SScott Long int hpt_initialize_data_block(DEVICEID idArray, HPT_U32 Lba, HPT_U8 nSectors); 1603b063a422SScott Long 1604b063a422SScott Long /* hpt_device_io_ex 1605b063a422SScott Long * extended device I/O function 1606b063a422SScott Long * Version compatibility: v1.0.0.3 or later 1607b063a422SScott Long * Parameters: 1608b063a422SScott Long * idArray - Array ID 1609b063a422SScott Long * Lba - block number (on each array member, not logical block!) 1610b063a422SScott Long * nSectors - Sectors for each member 1611b063a422SScott Long * buffer - I/O buffer or s/g address 1612b063a422SScott Long * Returns: 1613b063a422SScott Long * 0 Success 1614b063a422SScott Long */ 1615b063a422SScott Long int hpt_device_io_ex(PDEVICE_IO_EX_PARAMS param); 1616b063a422SScott Long 1617b063a422SScott Long /* hpt_set_boot_mark 1618b063a422SScott Long * select boot device 1619b063a422SScott Long * Version compatibility: v1.0.0.3 or later 1620b063a422SScott Long * Parameters: 1621b063a422SScott Long * id - logical device ID. If id is 0 the boot mark will be removed. 1622b063a422SScott Long * Returns: 1623b063a422SScott Long * 0 Success 1624b063a422SScott Long */ 1625b063a422SScott Long int hpt_set_boot_mark(DEVICEID id); 1626b063a422SScott Long 1627b063a422SScott Long /* hpt_query_remove 1628b063a422SScott Long * check if device can be removed safely 1629b063a422SScott Long * Version compatibility: v1.0.0.4 or later 1630b063a422SScott Long * Parameters: 1631b063a422SScott Long * ndev - number of devices 1632b063a422SScott Long * pIds - device ID list 1633b063a422SScott Long * Returns: 1634b063a422SScott Long * 0 - Success 1635b063a422SScott Long * -1 - unknown error 1636b063a422SScott Long * n - the n-th device that can't be removed 1637b063a422SScott Long */ 1638b063a422SScott Long int hpt_query_remove(HPT_U32 ndev, DEVICEID *pIds); 1639b063a422SScott Long 1640b063a422SScott Long /* hpt_remove_devices 1641b063a422SScott Long * remove a list of devices 1642b063a422SScott Long * Version compatibility: v1.0.0.4 or later 1643b063a422SScott Long * Parameters: 1644b063a422SScott Long * ndev - number of devices 1645b063a422SScott Long * pIds - device ID list 1646b063a422SScott Long * Returns: 1647b063a422SScott Long * 0 - Success 1648b063a422SScott Long * -1 - unknown error 1649b063a422SScott Long * n - the n-th device that can't be removed 1650b063a422SScott Long */ 1651b063a422SScott Long int hpt_remove_devices(HPT_U32 ndev, DEVICEID *pIds); 1652b063a422SScott Long 1653b063a422SScott Long /* hpt_create_array_v2 1654b063a422SScott Long * Version compatibility: v1.1.0.0 or later 1655b063a422SScott Long * Parameters: 1656b063a422SScott Long * pParam pointer to CREATE_ARRAY_PARAMS_V2 structure 1657b063a422SScott Long * Returns: 1658b063a422SScott Long * 0 failed 1659b063a422SScott Long * else return array id 1660b063a422SScott Long */ 1661b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01010000 1662b063a422SScott Long DEVICEID hpt_create_array_v2(PCREATE_ARRAY_PARAMS_V2 pParam); 1663b063a422SScott Long #endif 1664b063a422SScott Long 1665b063a422SScott Long /* hpt_create_array_v3 1666b063a422SScott Long * Version compatibility: v2.0.0.1 or later 1667b063a422SScott Long * Parameters: 1668b063a422SScott Long * pParam pointer to CREATE_ARRAY_PARAMS_V3 structure 1669b063a422SScott Long * Returns: 1670b063a422SScott Long * 0 failed 1671b063a422SScott Long * else return array id 1672b063a422SScott Long */ 1673b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x02000001 1674b063a422SScott Long DEVICEID hpt_create_array_v3(PCREATE_ARRAY_PARAMS_V3 pParam); 1675b063a422SScott Long #endif 1676b063a422SScott Long 1677b063a422SScott Long /* hpt_get_device_info_v2 1678b063a422SScott Long * Version compatibility: v1.1.0.0 or later 1679b063a422SScott Long * Parameters: 1680b063a422SScott Long * id logical device id 1681b063a422SScott Long * pInfo pointer to LOGICAL_DEVICE_INFO_V2 structure 1682b063a422SScott Long * Returns: 1683b063a422SScott Long * 0 - Success 1684b063a422SScott Long */ 1685b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01010000 1686b063a422SScott Long int hpt_get_device_info_v2(DEVICEID id, PLOGICAL_DEVICE_INFO_V2 pInfo); 1687b063a422SScott Long #endif 1688b063a422SScott Long 1689b063a422SScott Long /* hpt_get_device_info_v3 1690b063a422SScott Long * Version compatibility: v1.2.0.0 or later 1691b063a422SScott Long * Parameters: 1692b063a422SScott Long * id logical device id 1693b063a422SScott Long * pInfo pointer to LOGICAL_DEVICE_INFO_V3 structure 1694b063a422SScott Long * Returns: 1695b063a422SScott Long * 0 - Success 1696b063a422SScott Long */ 1697b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01020000 1698b063a422SScott Long int hpt_get_device_info_v3(DEVICEID id, PLOGICAL_DEVICE_INFO_V3 pInfo); 1699b063a422SScott Long #endif 1700b063a422SScott Long 1701b063a422SScott Long /* hpt_get_device_info_v4 1702b063a422SScott Long * Version compatibility: v2.0.0.1 or later 1703b063a422SScott Long * Parameters: 1704b063a422SScott Long * id logical device id 1705b063a422SScott Long * pInfo pointer to LOGICAL_DEVICE_INFO_V4 structure 1706b063a422SScott Long * Returns: 1707b063a422SScott Long * 0 - Success 1708b063a422SScott Long */ 1709b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x02000001 1710b063a422SScott Long int hpt_get_device_info_v4(DEVICEID id, PLOGICAL_DEVICE_INFO_V4 pInfo); 1711b063a422SScott Long #endif 1712b063a422SScott Long 1713b063a422SScott Long /* hpt_create_transform 1714b063a422SScott Long * create a transform instance. 1715b063a422SScott Long * Version compatibility: v2.0.0.0 or later 1716b063a422SScott Long * Parameters: 1717b063a422SScott Long * idArray - source array 1718b063a422SScott Long * destInfo - destination array info 1719b063a422SScott Long * Returns: 1720b063a422SScott Long * destination array id 1721b063a422SScott Long */ 1722b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x02000000 1723b063a422SScott Long DEVICEID hpt_create_transform(DEVICEID idArray, PCREATE_ARRAY_PARAMS_V2 destInfo); 1724b063a422SScott Long #endif 1725b063a422SScott Long 1726b063a422SScott Long /* hpt_create_transform_v2 1727b063a422SScott Long * create a transform instance. 1728b063a422SScott Long * Version compatibility: v2.0.0.1 or later 1729b063a422SScott Long * Parameters: 1730b063a422SScott Long * idArray - source array 1731b063a422SScott Long * destInfo - destination array info 1732b063a422SScott Long * Returns: 1733b063a422SScott Long * destination array id 1734b063a422SScott Long */ 1735b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x02000001 1736b063a422SScott Long DEVICEID hpt_create_transform_v2(DEVICEID idArray, PCREATE_ARRAY_PARAMS_V3 destInfo); 1737b063a422SScott Long #endif 1738b063a422SScott Long 1739b063a422SScott Long /* hpt_step_transform 1740453130d9SPedro F. Giffuni * move a block in a transform progress. 1741b063a422SScott Long * This function is called by mid-layer, not GUI (which uses set_array_state instead). 1742b063a422SScott Long * Version compatibility: v2.0.0.0 or later 1743b063a422SScott Long * Parameters: 1744b063a422SScott Long * idArray - destination array ID 1745b063a422SScott Long * the source ID will be invalid when transform complete. 1746b063a422SScott Long * Returns: 1747b063a422SScott Long * 0 - Success 1748b063a422SScott Long */ 1749b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x02000000 1750b063a422SScott Long int hpt_step_transform(DEVICEID idArray); 1751b063a422SScott Long #endif 1752b063a422SScott Long 1753b063a422SScott Long /* hpt_set_vdev_info 1754b063a422SScott Long * set information for disk or array 1755b063a422SScott Long * Version compatibility: v1.2.0.0 or later 1756b063a422SScott Long * Parameters: 1757b063a422SScott Long * dev - destination device 1758b063a422SScott Long * 1759b063a422SScott Long * Returns: 1760b063a422SScott Long * 0 - Success 1761b063a422SScott Long */ 1762b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01020000 1763b063a422SScott Long int hpt_set_vdev_info(DEVICEID dev, PSET_VDEV_INFO pInfo); 1764b063a422SScott Long #endif 1765b063a422SScott Long 1766b063a422SScott Long /* hpt_init_disks 1767b063a422SScott Long * initialize disks for use 1768b063a422SScott Long * Version compatibility: v2.0.0.0 or later 1769b063a422SScott Long * Parameters: 1770b063a422SScott Long * ndev - number of disks to initialize 1771b063a422SScott Long * pIds - array of DEVICEID 1772b063a422SScott Long * 1773b063a422SScott Long * Returns: 1774b063a422SScott Long * 0 - Success 1775b063a422SScott Long */ 1776b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x02000000 1777b063a422SScott Long int hpt_init_disks(HPT_U32 ndev, DEVICEID * pIds); 1778b063a422SScott Long #endif 1779b063a422SScott Long 1780b063a422SScott Long /* hpt_calc_max_array_capacity 1781b063a422SScott Long * cap max capacity of the array user want to create or transform 1782b063a422SScott Long * Version compatibility: v1.2.0.0 or later 1783b063a422SScott Long * Parameters: 1784b063a422SScott Long * source - if transform, this is the source array, otherwise, it should be zero 1785b063a422SScott Long * destInfo - target array params 1786b063a422SScott Long * Returns: 1787b063a422SScott Long * 0 - Success 1788b063a422SScott Long * cap - max capacity of the target array 1789b063a422SScott Long */ 1790b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01020000 1791b063a422SScott Long int hpt_calc_max_array_capacity(DEVICEID source, PCREATE_ARRAY_PARAMS_V2 destInfo, HPT_U64 * cap); 1792b063a422SScott Long #endif 1793b063a422SScott Long 1794b063a422SScott Long /* hpt_calc_max_array_capacity_v2 1795b063a422SScott Long * cap max capacity of the array user want to create or transform 1796b063a422SScott Long * Version compatibility: v2.0.0.1 or later 1797b063a422SScott Long * Parameters: 1798b063a422SScott Long * source - if transform, this is the source array, otherwise, it should be zero 1799b063a422SScott Long * destInfo - target array params 1800b063a422SScott Long * Returns: 1801b063a422SScott Long * 0 - Success 1802b063a422SScott Long * cap - max capacity of the target array 1803b063a422SScott Long */ 1804b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x02000001 1805b063a422SScott Long int hpt_calc_max_array_capacity_v2(DEVICEID source, PCREATE_ARRAY_PARAMS_V3 destInfo, HPT_U64 * cap); 1806b063a422SScott Long #endif 1807b063a422SScott Long 1808b063a422SScott Long /* hpt_rebuild_data_block2 1809b063a422SScott Long * Used to copy data from source disk and mirror disk. 1810b063a422SScott Long * Version compatibility: v1.1.0.0 or later 1811b063a422SScott Long * Parameters: 1812b063a422SScott Long * idArray Array ID (RAID1, 0/1 or RAID5) 1813b063a422SScott Long * Lba Start LBA for each array member 1814b063a422SScott Long * nSector Number of sectors for each array member (RAID 5 will ignore this parameter) 1815b063a422SScott Long * 1816b063a422SScott Long * Returns: 1817b063a422SScott Long * 0 Success, event info is filled in *pEvent 1818b063a422SScott Long */ 1819b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01010000 1820b063a422SScott Long int hpt_rebuild_data_block_v2(DEVICEID idMirror, HPT_U64 Lba, HPT_U16 nSector); 1821b063a422SScott Long #endif 1822b063a422SScott Long 1823b063a422SScott Long /* hpt_verify_data_block2 1824b063a422SScott Long * verify data block on RAID1 or RAID5. 1825b063a422SScott Long * Version compatibility: v1.1.0.0 or later 1826b063a422SScott Long * Parameters: 1827b063a422SScott Long * idArray - Array ID 1828b063a422SScott Long * Lba - block number (on each array member, not logical block!) 1829b063a422SScott Long * nSectors - Sectors for each member (RAID 5 will ignore this parameter) 1830b063a422SScott Long * Returns: 1831b063a422SScott Long * 0 Success 1832b063a422SScott Long * 1 Data compare error 1833b063a422SScott Long * 2 I/O error 1834b063a422SScott Long */ 1835b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01010000 1836b063a422SScott Long int hpt_verify_data_block_v2(DEVICEID idArray, HPT_U64 Lba, HPT_U16 nSectors); 1837b063a422SScott Long #endif 1838b063a422SScott Long 1839b063a422SScott Long /* hpt_initialize_data_block2 1840b063a422SScott Long * initialize data block (fill with zero) on RAID5 1841b063a422SScott Long * Version compatibility: v1.1.0.0 or later 1842b063a422SScott Long * Parameters: 1843b063a422SScott Long * idArray - Array ID 1844b063a422SScott Long * Lba - block number (on each array member, not logical block!) 1845b063a422SScott Long * nSectors - Sectors for each member (RAID 5 will ignore this parameter) 1846b063a422SScott Long * Returns: 1847b063a422SScott Long * 0 Success 1848b063a422SScott Long */ 1849b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01010000 1850b063a422SScott Long int hpt_initialize_data_block_v2(DEVICEID idArray, HPT_U64 Lba, HPT_U16 nSectors); 1851b063a422SScott Long #endif 1852b063a422SScott Long 1853b063a422SScott Long /* hpt_i2c_transaction 1854b063a422SScott Long * perform an transaction on i2c bus 1855b063a422SScott Long * Version compatibility: v2.0.0.0 or later 1856b063a422SScott Long * Parameters: 1857b063a422SScott Long * indata[0] - controller ID 1858b063a422SScott Long * Returns: 1859b063a422SScott Long * 0 Success 1860b063a422SScott Long */ 1861b063a422SScott Long #if HPT_INTERFACE_VERSION>=0x01020000 1862b063a422SScott Long int hpt_i2c_transaction(HPT_U8 *indata, HPT_U32 inlen, HPT_U8 *outdata, HPT_U32 outlen, HPT_U32 *poutlen); 1863b063a422SScott Long #endif 1864b063a422SScott Long 1865b063a422SScott Long /* hpt_get_parameter_list 1866b063a422SScott Long * get a list of driver parameters. 1867b063a422SScott Long * Version compatibility: v1.0.0.0 or later 1868b063a422SScott Long * Parameters: 1869b063a422SScott Long * location - parameter location 1870b063a422SScott Long * outBuffer - a buffer to hold the output 1871b063a422SScott Long * outBufferSize - size of outBuffer 1872b063a422SScott Long * Returns: 1873b063a422SScott Long * 0 Success 1874b063a422SScott Long * put in outBuffer a list of zero terminated parameter names. the whole list 1875b063a422SScott Long * is terminated with an additional zero byte. 1876b063a422SScott Long */ 1877b063a422SScott Long int hpt_get_parameter_list(HPT_U32 location, char *outBuffer, HPT_U32 outBufferSize); 1878b063a422SScott Long 1879b063a422SScott Long /* hpt_{get,set}_parameter 1880b063a422SScott Long * get/set a parameter value. 1881b063a422SScott Long * Version compatibility: v1.0.0.0 or later 1882b063a422SScott Long * Parameters: 1883b063a422SScott Long * pParam - a pointer to HPT_DRIVER_PARAMETER. 1884b063a422SScott Long * Returns: 1885b063a422SScott Long * 0 Success 1886b063a422SScott Long */ 1887b063a422SScott Long int hpt_get_parameter(PHPT_DRIVER_PARAMETER pParam); 1888b063a422SScott Long int hpt_set_parameter(PHPT_DRIVER_PARAMETER pParam); 1889b063a422SScott Long int hpt_reenumerate_device(DEVICEID id); 1890b063a422SScott Long 1891b063a422SScott Long #endif 1892b063a422SScott Long 1893b063a422SScott Long #pragma pack() 1894b063a422SScott Long 1895b063a422SScott Long #ifdef __cplusplus 1896b063a422SScott Long } 1897b063a422SScott Long #endif 1898b063a422SScott Long #endif 1899