hptintf.h (139749) | hptintf.h (149871) |
---|---|
1/*- 2 * Copyright (c) 2003-2004 HighPoint Technologies, Inc. | 1/* 2 * Copyright (c) 2004-2005 HighPoint Technologies, Inc. |
3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright --- 7 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright --- 7 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/dev/hptmv/hptintf.h 139749 2005-01-06 01:43:34Z imp $ | 26 * $FreeBSD: head/sys/dev/hptmv/hptintf.h 149871 2005-09-07 23:33:26Z scottl $ |
27 */ 28 29#ifndef HPT_INTF_H 30#define HPT_INTF_H 31#pragma pack(1) 32 33/* 34 * Version of this interface. --- 122 unchanged lines hidden (view full) --- 157#define AS_VERIFY_FAILED 10 158#define AS_REBUILD_STOP 11 159#define AS_SAVE_STATE 12 160/************************************************************************ 161 * ioctl code 162 * It would be better if ioctl code are the same on different platforms, 163 * but we must not conflict with system defined ioctl code. 164 ************************************************************************/ | 27 */ 28 29#ifndef HPT_INTF_H 30#define HPT_INTF_H 31#pragma pack(1) 32 33/* 34 * Version of this interface. --- 122 unchanged lines hidden (view full) --- 157#define AS_VERIFY_FAILED 10 158#define AS_REBUILD_STOP 11 159#define AS_SAVE_STATE 12 160/************************************************************************ 161 * ioctl code 162 * It would be better if ioctl code are the same on different platforms, 163 * but we must not conflict with system defined ioctl code. 164 ************************************************************************/ |
165#if defined(LINUX) || defined(__FreeBSD_version) | 165#if defined(LINUX) || defined(__FreeBSD_version) || defined(_MACOSX_) |
166#define HPT_CTL_CODE(x) (x+0xFF00) 167#elif defined(_MS_WIN32_) || defined(WIN32) 168 169#ifndef CTL_CODE 170#define CTL_CODE( DeviceType, Function, Method, Access ) \ 171 (((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method)) 172#endif 173#define HPT_CTL_CODE(x) CTL_CODE(0x370, 0x900+(x), 0, 0) --- 148 unchanged lines hidden (view full) --- 322 DEVICEID Devices[2]; /* device connected to this channel */ 323 324} CHANNEL_INFO, *PCHANNEL_INFO; 325 326/* 327 * time represented in DWORD format 328 */ 329#ifndef __KERNEL__ | 166#define HPT_CTL_CODE(x) (x+0xFF00) 167#elif defined(_MS_WIN32_) || defined(WIN32) 168 169#ifndef CTL_CODE 170#define CTL_CODE( DeviceType, Function, Method, Access ) \ 171 (((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method)) 172#endif 173#define HPT_CTL_CODE(x) CTL_CODE(0x370, 0x900+(x), 0, 0) --- 148 unchanged lines hidden (view full) --- 322 DEVICEID Devices[2]; /* device connected to this channel */ 323 324} CHANNEL_INFO, *PCHANNEL_INFO; 325 326/* 327 * time represented in DWORD format 328 */ 329#ifndef __KERNEL__ |
330#error "BAM" | |
331typedef struct _TIME_RECORD { 332 UINT seconds:6; /* 0 - 59 */ 333 UINT minutes:6; /* 0 - 59 */ 334 UINT month:4; /* 1 - 12 */ 335 UINT hours:6; /* 0 - 59 */ 336 UINT day:5; /* 1 - 31 */ 337 UINT year:5; /* 0=2000, 31=2031 */ 338} TIME_RECORD; --- 55 unchanged lines hidden (view full) --- 394 395} HPT_ARRAY_INFO_V2, *PHPT_ARRAY_INFO_V2; 396#endif 397 398/* 399 * ATA/ATAPI Device identify data without the Reserved4. 400 */ 401#ifndef __KERNEL__ | 330typedef struct _TIME_RECORD { 331 UINT seconds:6; /* 0 - 59 */ 332 UINT minutes:6; /* 0 - 59 */ 333 UINT month:4; /* 1 - 12 */ 334 UINT hours:6; /* 0 - 59 */ 335 UINT day:5; /* 1 - 31 */ 336 UINT year:5; /* 0=2000, 31=2031 */ 337} TIME_RECORD; --- 55 unchanged lines hidden (view full) --- 393 394} HPT_ARRAY_INFO_V2, *PHPT_ARRAY_INFO_V2; 395#endif 396 397/* 398 * ATA/ATAPI Device identify data without the Reserved4. 399 */ 400#ifndef __KERNEL__ |
402#error "BAM" | |
403typedef struct _IDENTIFY_DATA2 { 404 USHORT GeneralConfiguration; /* 00 00 */ 405 USHORT NumberOfCylinders; /* 02 1 */ 406 USHORT Reserved1; /* 04 2 */ 407 USHORT NumberOfHeads; /* 06 3 */ 408 USHORT UnformattedBytesPerTrack; /* 08 4 */ 409 USHORT UnformattedBytesPerSector; /* 0A 5 */ 410 USHORT SectorsPerTrack; /* 0C 6 */ --- 365 unchanged lines hidden (view full) --- 776/* 777 * hpt_get_version 778 * Version compatibility: all versions 779 * Parameters: 780 * None 781 * Returns: 782 * interface version. 0 when fail. 783 */ | 401typedef struct _IDENTIFY_DATA2 { 402 USHORT GeneralConfiguration; /* 00 00 */ 403 USHORT NumberOfCylinders; /* 02 1 */ 404 USHORT Reserved1; /* 04 2 */ 405 USHORT NumberOfHeads; /* 06 3 */ 406 USHORT UnformattedBytesPerTrack; /* 08 4 */ 407 USHORT UnformattedBytesPerSector; /* 0A 5 */ 408 USHORT SectorsPerTrack; /* 0C 6 */ --- 365 unchanged lines hidden (view full) --- 774/* 775 * hpt_get_version 776 * Version compatibility: all versions 777 * Parameters: 778 * None 779 * Returns: 780 * interface version. 0 when fail. 781 */ |
784DWORD hpt_get_version(void); | 782DWORD hpt_get_version(); |
785 786/*-------------------------------------------------------------------------- */ 787 788/* 789 * hpt_get_driver_capabilities 790 * Version compatibility: v1.0.0.2 or later 791 * Parameters: 792 * Pointer to receive a DRIVE_CAPABILITIES structure. The caller must set --- 9 unchanged lines hidden (view full) --- 802/* 803 * hpt_get_controller_count 804 * Version compatibility: v1.0.0.1 or later 805 * Parameters: 806 * None 807 * Returns: 808 * number of controllers 809 */ | 783 784/*-------------------------------------------------------------------------- */ 785 786/* 787 * hpt_get_driver_capabilities 788 * Version compatibility: v1.0.0.2 or later 789 * Parameters: 790 * Pointer to receive a DRIVE_CAPABILITIES structure. The caller must set --- 9 unchanged lines hidden (view full) --- 800/* 801 * hpt_get_controller_count 802 * Version compatibility: v1.0.0.1 or later 803 * Parameters: 804 * None 805 * Returns: 806 * number of controllers 807 */ |
810int hpt_get_controller_count(void); | 808int hpt_get_controller_count(); |
811 812/*-------------------------------------------------------------------------- */ 813 814/* hpt_get_controller_info 815 * Version compatibility: v1.0.0.1 or later 816 * Parameters: 817 * id Controller id 818 * pInfo pointer to CONTROLLER_INFO buffer --- 225 unchanged lines hidden (view full) --- 1044/* hpt_rescan_devices 1045 * rescan devices 1046 * Version compatibility: v1.0.0.1 or later 1047 * Parameters: 1048 * None 1049 * Returns: 1050 * 0 Success 1051 */ | 809 810/*-------------------------------------------------------------------------- */ 811 812/* hpt_get_controller_info 813 * Version compatibility: v1.0.0.1 or later 814 * Parameters: 815 * id Controller id 816 * pInfo pointer to CONTROLLER_INFO buffer --- 225 unchanged lines hidden (view full) --- 1042/* hpt_rescan_devices 1043 * rescan devices 1044 * Version compatibility: v1.0.0.1 or later 1045 * Parameters: 1046 * None 1047 * Returns: 1048 * 0 Success 1049 */ |
1052int hpt_rescan_devices(void); | 1050int hpt_rescan_devices(); |
1053/*-------------------------------------------------------------------------- */ 1054 1055/* hpt_get_601_info 1056 * Get HPT601 status 1057 * Version compatibiilty: v1.0.0.3 or later 1058 * Parameters: 1059 * idDisk - Disk handle 1060 * PHPT601_INFO - pointer to HPT601 info buffer --- 144 unchanged lines hidden (view full) --- 1205 * -1 - unknown error 1206 * n - the n-th device that can't be removed 1207 */ 1208int hpt_remove_devices(DWORD ndev, DEVICEID *pIds); 1209/*-------------------------------------------------------------------------- */ 1210 1211#endif 1212 | 1051/*-------------------------------------------------------------------------- */ 1052 1053/* hpt_get_601_info 1054 * Get HPT601 status 1055 * Version compatibiilty: v1.0.0.3 or later 1056 * Parameters: 1057 * idDisk - Disk handle 1058 * PHPT601_INFO - pointer to HPT601 info buffer --- 144 unchanged lines hidden (view full) --- 1203 * -1 - unknown error 1204 * n - the n-th device that can't be removed 1205 */ 1206int hpt_remove_devices(DWORD ndev, DEVICEID *pIds); 1207/*-------------------------------------------------------------------------- */ 1208 1209#endif 1210 |
1213#if BITS_PER_LONG > 32 1214#define VDEV_TO_ID(pVDev) (DEVICEID)(ULONG_PTR)(pVDev) 1215#define ID_TO_VDEV(id) (PVDevice)(((ULONG_PTR)gIal_Adapter & 0xffffffff00000000) | (id)) 1216#else 1217#define VDEV_TO_ID(pVDev) (DEVICEID)(pVDev) 1218#define ID_TO_VDEV(id) (PVDevice)(id) 1219#endif 1220 1221#define INVALID_DEVICEID (-1) 1222#define INVALID_STRIPSIZE (-1) 1223 1224#define shortswap(w) ((WORD)((w)>>8 | ((w) & 0xFF)<<8)) 1225 1226#ifndef MinBlockSizeShift 1227#define MinBlockSizeShift 5 1228#define MaxBlockSizeShift 12 1229#endif 1230 1231typedef struct _HPT_IOCTL_TRANSFER_PARAM 1232{ 1233 ULONG nInBufferSize; 1234 ULONG nOutBufferSize; 1235 UCHAR buffer[0]; 1236}HPT_IOCTL_TRANSFER_PARAM, *PHPT_IOCTL_TRANSFER_PARAM; 1237 1238typedef struct _HPT_SET_STATE_PARAM 1239{ 1240 DEVICEID idArray; 1241 DWORD state; 1242} HPT_SET_STATE_PARAM, *PHPT_SET_STATE_PARAM; 1243 1244typedef struct _HPT_SET_ARRAY_INFO 1245{ 1246 DEVICEID idArray; 1247 ALTERABLE_ARRAY_INFO Info; 1248} HPT_SET_ARRAY_INFO, *PHPT_SET_ARRAY_INFO; 1249 1250typedef struct _HPT_SET_DEVICE_INFO 1251{ 1252 DEVICEID idDisk; 1253 ALTERABLE_DEVICE_INFO Info; 1254} HPT_SET_DEVICE_INFO, *PHPT_SET_DEVICE_INFO; 1255 1256typedef struct _HPT_ADD_DISK_TO_ARRAY 1257{ 1258 DEVICEID idArray; 1259 DEVICEID idDisk; 1260} HPT_ADD_DISK_TO_ARRAY, *PHPT_ADD_DISK_TO_ARRAY; 1261 1262int check_VDevice_valid(PVDevice); 1263int hpt_default_ioctl(_VBUS_ARG DWORD, PVOID, DWORD, PVOID, DWORD, PDWORD); 1264 1265#define HPT_NULL_ID 0 1266 | |
1267#pragma pack() 1268#endif | 1211#pragma pack() 1212#endif |