Remove the rr232x driver. It has been superceded by the hptrr driver.

This commit is contained in:
Scott Long 2008-02-03 07:07:30 +00:00
parent 120da7bd62
commit 593c873471
23 changed files with 0 additions and 13127 deletions

View File

@ -133,7 +133,6 @@ device ciss # Compaq Smart RAID 5*
device dpt # DPT Smartcache III, IV - See NOTES for options
device hptmv # Highpoint RocketRAID 182x
device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx
device rr232x # Highpoint RocketRAID 232x
device iir # Intel Integrated RAID
device ips # IBM (Adaptec) ServeRAID
device mly # Mylex AcceleRAID/eXtremeRAID

View File

@ -380,11 +380,6 @@ device hptmv
# RR2210, RR174x, RR2522, RR231x, RR230x.
device hptrr
#
# Highpoint RocketRAID 232x. This is software RAID but with hardware
# acceleration assistance for RAID_5.
device rr232x
#
# Highpoint RocketRaid 3xxx series SATA RAID
device hptiop

View File

@ -77,11 +77,6 @@ hptrr_lib.o optional hptrr \
compile-with "uudecode < $S/dev/hptrr/amd64-elf.hptrr_lib.o.uu" \
no-implicit-rule
#
rr232x_lib.o optional rr232x \
dependency "$S/dev/rr232x/amd64-elf.rr232x_lib.o.uu" \
compile-with "uudecode < $S/dev/rr232x/amd64-elf.rr232x_lib.o.uu" \
no-implicit-rule
#
amd64/acpica/OsdEnvironment.c optional acpi
amd64/acpica/acpi_machdep.c optional acpi
amd64/acpica/acpi_wakeup.c optional acpi
@ -199,9 +194,6 @@ dev/mem/memutil.c optional mem
dev/nfe/if_nfe.c optional nfe pci
dev/nve/if_nve.c optional nve pci
dev/nvram/nvram.c optional nvram isa
dev/rr232x/os_bsd.c optional rr232x
dev/rr232x/osm_bsd.c optional rr232x
dev/rr232x/rr232x_config.c optional rr232x
dev/sio/sio.c optional sio
dev/sio/sio_isa.c optional sio isa
dev/sio/sio_pccard.c optional sio pccard

View File

@ -82,11 +82,6 @@ hptrr_lib.o optional hptrr \
compile-with "uudecode < $S/dev/hptrr/i386-elf.hptrr_lib.o.uu" \
no-implicit-rule
#
rr232x_lib.o optional rr232x \
dependency "$S/dev/rr232x/i386-elf.rr232x_lib.o.uu" \
compile-with "uudecode < $S/dev/rr232x/i386-elf.rr232x_lib.o.uu" \
no-implicit-rule
#
compat/linprocfs/linprocfs.c optional linprocfs
compat/linsysfs/linsysfs.c optional linsysfs
compat/linux/linux_emul.c optional compat_linux
@ -231,9 +226,6 @@ dev/nve/if_nve.c optional nve pci
dev/nvram/nvram.c optional nvram isa
dev/pcf/pcf_isa.c optional pcf
dev/random/nehemiah.c optional random
dev/rr232x/os_bsd.c optional rr232x
dev/rr232x/osm_bsd.c optional rr232x
dev/rr232x/rr232x_config.c optional rr232x
dev/sbni/if_sbni.c optional sbni
dev/sbni/if_sbni_isa.c optional sbni isa
dev/sbni/if_sbni_pci.c optional sbni pci

View File

@ -1,30 +0,0 @@
$FreeBSD$
Unless otherwise noted, all program source, header, and binary data files
in this directory are governed by the following copyright and license:
/*
* Copyright (C) 2005 HighPoint Technologies, Inc. All Rights Reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/

View File

@ -1,202 +0,0 @@
RocketRAID 232x Controller Driver for FreeBSD
Copyright (C) 2005 HighPoint Technologies, Inc. All rights reserved.
#############################################################################
Revision History:
v1.02 02/20/2006
Add RR2322 support
v1.01 2005-8-30
First source code release
$FreeBSD$
#############################################################################
1. Overview
---------------------
This package contains FreeBSD driver source code for HighPoint RocketRAID
232x SATA controller.
NO WARRANTY
THE DRIVER SOURCE CODE HIGHPOINT PROVIDED IS FREE OF CHARGE, AND THERE IS
NO WARRANTY FOR THE PROGRAM. THERE ARE NO RESTRICTIONS ON THE USE OF THIS
FREE SOURCE CODE. HIGHPOINT DOES NOT PROVIDE ANY TECHNICAL SUPPORT IF THE
CODE HAS BEEN CHANGED FROM ORIGINAL SOURCE CODE.
LIMITATION OF LIABILITY
IN NO EVENT WILL HIGHPOINT BE LIABLE FOR DIRECT, INDIRECT, SPECIAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF OR
INABILITY TO USE THIS PRODUCT OR DOCUMENTATION, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. IN PARTICULAR, HIGHPOINT SHALL NOT HAVE
LIABILITY FOR ANY HARDWARE, SOFTWARE, OR DATA STORED USED WITH THE
PRODUCT, INCLUDING THE COSTS OF REPAIRING, REPLACING, OR RECOVERING
SUCH HARDWARE, OR DATA.
2. Rebuild the kernel with RR232x support
--------------------------------------------
1) Install kernel source package and building tools.
2) Extract the driver files under the kernel source tree:
# cd /usr/src/sys/
# tar xvzf /your/path/to/rr232x-freebsd-src.tgz
3) Update the kernel configuration file to include the HighPoint source.
Assume the configure file is GENERIC, and new kernel configure file is
MYKERNEL:
# cd i386/conf (or amd64/conf for AMD64)
# cp GENERIC MYKERNEL
4) Edit MYKERNEL, and add the following line under "RAID controllers
interfaced to the SCSI subsystem":
device "rr232x" #HighPoint RocketRAID 232x
5) For i386 system, edit /usr/src/sys/conf/files.i386 and append the lines
shown below:
rr232x_lib.o optional rr232x \
dependency "$S/dev/rr232x/i386-elf.rr232x_lib.o.uu" \
compile-with "uudecode < $S/dev/rr232x/i386-elf.rr232x_lib.o.uu" \
no-implicit-rule
dev/rr232x/os_bsd.c optional rr232x
dev/rr232x/osm_bsd.c optional rr232x
dev/rr232x/rr232x_config.c optional rr232x
For amd64 system, edit /usr/src/sys/conf/files.amd64 and append the lines
shown below:
rr232x_lib.o optional rr232x \
dependency "$S/dev/rr232x/amd64-elf.rr232x_lib.o.uu" \
compile-with "uudecode < $S/dev/rr232x/amd64-elf.rr232x_lib.o.uu" \
no-implicit-rule
dev/rr232x/os_bsd.c optional rr232x
dev/rr232x/osm_bsd.c optional rr232x
dev/rr232x/rr232x_config.c optional rr232x
Note FreeBSD 5.3/5.4 i386 already have a built-in RR232x driver, you should
replace the old configuration lines with the lines listed above.
6) Rebuild and install the kernel:
a) for FreeBSD 5.x-i386:
# cd /usr/src/sys/i386/conf/
# /usr/sbin/config MYKERNEL
# cd ../compile/MYKERNEL/
# make depend
# make
# make install
b) for FreeBSD 5.x-amd64:
# cd /usr/src/sys/amd64/conf/
# /usr/sbin/config MYKERNEL
# cd ../compile/MYKERNEL/
# make depend
# make
# make install
c) for FreeBSD 4.x:
# cd /usr/src/sys/i386/conf/
# /usr/sbin/config MYKERNEL
# cd ../../compile/MYKERNEL/
# make depend
# make
# make install
If the driver was previously configured as an auto-loaded module by
/boot/defaults/loader.conf, please remove the entry rr232x_load="YES"
from loader.conf to prevent the driver from being loaded twice.
7) Reboot from the new kernel.
3. Build/Load the driver as a kernel module
------------------------------------------------
1) Install kernel source package and building tools.
2) Extract the driver files under the kernel source tree:
# cd /usr/src/sys/
# tar xvzf /your/path/to/rr232x-opensource-v1.12-bsd.tgz
4) Build the driver module:
# cd modules/rr232x
# make
5) Copy the driver module to the kernel module directory
For FreeBSD 4.x:
# cp rr232x.ko /modules/
For FreeBSD 5.x:
# cp rr232x.ko /boot/kernel/
6) Reboot and load the driver under loader prompt. e.g:
BTX loader 1.00 BTX version is 1.01
Console: internal video/keyboard
BIOS driver A: is disk0
BIOS driver C: is disk2
BIOS 636kB/74512kB available memory
FreeBSD/i386 bootstrap loader, Revision 0.8
(mailto:jkh@narf.osd.bsdi.com, Sat Apr 21 08:46:19 GMT 2001)
Loading /boot/defaults/loader.conf
/kernel text=0x24f1db data=0x3007ec+0x2062c -
Hit [Enter] to boot immediagely, or any other key for command prompt.
Booting [kernel] in 9 seconds¡­
<-- press SPACE key here
Type '?' for a list of commands, 'help' for more detailed help.
ok load rr232x
/modules/rr232x.ko text=0xf571 data=0x2c8+0x254
ok boot
For FreeBSD 5.x, you can select 6 on the boot menu to get a loader prompt.
7) You can add a below line into /boot/defaults/loader.conf to load the
driver automatically:
rr232x_load="YES"
Please refer to the installation guide in HighPoint FreeBSD driver release
package for more information.
#############################################################################
Technical support and service
If you have questions about installing or using your HighPoint product,
check the user's guide or readme file first, and you will find answers to
most of your questions here. If you need further assistance, please
contact us. We offer the following support and information services:
1) The HighPoint Web Site provides information on software upgrades,
answers to common questions, and other topics. The Web Site is
available from Internet 24 hours a day, 7 days a week, at
http://www.highpoint-tech.com.
2) For technical support, send e-mail to support@highpoint-tech.com
NOTE: Before you send an e-mail, please visit our Web Site
(http://www.highpoint-tech.com) to check if there is a new or
updated device driver for your system.

File diff suppressed because it is too large Load Diff

View File

@ -1,179 +0,0 @@
#include <dev/rr232x/rr232x_config.h>
/*
* $Id: array.h,v 1.37 2006/02/21 06:11:19 gmm Exp $
* Copyright (C) 2004-2005 HighPoint Technologies, Inc. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _HPT_ARRAY_H_
#define _HPT_ARRAY_H_
#define VERMAGIC_ARRAY 37
#if defined(__cplusplus)
extern "C" {
#endif
#define MAX_ARRAY_NAME 16
#ifndef MAX_MEMBERS
#define MAX_MEMBERS 16
#endif
#if MAX_MEMBERS<=16
typedef HPT_U16 HPT_MMASK;
#elif MAX_MEMBERS<=32
typedef HPT_U32 HPT_MMASK;
#elif MAX_MEMBERS<=64
typedef HPT_U64 HPT_MMASK;
#else
#error "MAX_MEMBERS too large"
#endif
#define HPT_MMASK_VALUE(x) ((HPT_MMASK)1<<(x))
#define HPT_MMASK_VALUE_SAFE(x) ((x)>=MAX_MEMBERS? (HPT_MMASK)0 : HPT_MMASK_VALUE(x))
#define MAX_REBUILD_SECTORS 128
typedef struct _RAID_FLAGS {
HPT_UINT rf_need_initialize : 1;
HPT_UINT rf_need_rebuild: 1;
HPT_UINT rf_need_sync: 1;
/* ioctl flags */
HPT_UINT rf_auto_rebuild: 1;
HPT_UINT rf_rebuilding: 1;
HPT_UINT rf_verifying: 1;
HPT_UINT rf_initializing: 1;
HPT_UINT rf_abort_rebuild: 1;
HPT_UINT rf_raid15: 1;
HPT_UINT rf_v3_format : 1;
HPT_UINT rf_need_transform : 1;
HPT_UINT rf_transforming : 1;
HPT_UINT rf_abort_transform : 1;
HPT_UINT rf_log_write: 1;
} RAID_FLAGS;
typedef struct transform_cmd_ext
{
HPT_LBA lba;
HPT_U16 total_sectors;
HPT_U16 finished_sectors;
} TRANSFORM_CMD_EXT , *PTRANSFORM_CMD_EXT;
#define TO_MOVE_DATA 0
#define TO_INITIALIZE 1
#define TO_INITIALIZE_ONLY 2
#define TO_MOVE_DATA_ONLY 3
typedef struct hpt_transform
{
HPT_U32 stamp;
PVDEV source;
PVDEV target;
struct list_head link;
HPT_U8 transform_from_tail;
struct tq_item task;
struct lock_request lock;
TRANSFORM_CMD_EXT cmdext;
HPT_U64 transform_point;
HPT_U16 transform_sectors_per_step;
HPT_U8 operation;
HPT_U8 disabled;
} HPT_TRANSFORM, *PHPT_TRANSFORM;
typedef struct hpt_array
{
HPT_U32 array_stamp;
HPT_U32 data_stamp;
HPT_U8 ndisk;
HPT_U8 block_size_shift;
HPT_U16 strip_width;
HPT_MMASK outdated_members;
HPT_MMASK offline_members;
PVDEV member[MAX_MEMBERS];
RAID_FLAGS flags;
HPT_U64 rebuilt_sectors;
HPT_U8 name[MAX_ARRAY_NAME];
PHPT_TRANSFORM transform;
TIME_RECORD create_time;
HPT_U8 description[64];
HPT_U8 create_manager[16];
#ifdef OS_SUPPORT_TASK
int floating_priority;
OSM_TASK ioctl_task;
IOCTL_ARG ioctl_arg;
char ioctl_inbuf[sizeof(PVDEV)+sizeof(HPT_U64)+sizeof(HPT_U16)];
char ioctl_outbuf[sizeof(HPT_UINT)];
#endif
} HPT_ARRAY, *PHPT_ARRAY;
#ifdef OS_SUPPORT_TASK
void ldm_start_rebuild(struct _VDEV *pArray);
#else
#define ldm_start_rebuild(pArray)
#endif
typedef struct _raw_partition{
struct _raw_partition * next;
HPT_RAW_LBA start;
HPT_RAW_LBA capacity;
PVDEV vd_part;
} RAW_PARTITION, *PRAW_PARTITION;
typedef struct hpt_partiton
{
PVDEV raw_disk;
HPT_RAW_LBA des_location;
PRAW_PARTITION raw_part;
struct tq_item failed_task;
HPT_U8 del_mbr;
HPT_U8 reserved[3];
} HPT_PARTITION, *PHPT_PARTITION;
HPT_U16 get_strip_size(PVDEV vd);
void ldm_check_array_online(PVDEV pArray);
void ldm_generic_member_failed(PVDEV member);
void ldm_sync_array_info(PVDEV pArray);
void ldm_sync_array_stamp(PVDEV pArray);
void ldm_add_spare_to_array(PVDEV pArray, PVDEV spare_partition);
#if defined(__cplusplus)
}
#endif
#endif

View File

@ -1,440 +0,0 @@
#include <dev/rr232x/rr232x_config.h>
/*
* $Id: him.h,v 1.34 2006/02/21 06:11:19 gmm Exp $
* Copyright (C) 2004-2005 HighPoint Technologies, Inc. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _HPT_HIM_H_
#define _HPT_HIM_H_
#define VERMAGIC_HIM 34
#if defined(__cplusplus)
extern "C" {
#endif
#include <dev/rr232x/list.h>
#define SECTOR_TO_BYTE_SHIFT 9
#define SECTOR_TO_BYTE(x) ((HPT_U32)(x) << SECTOR_TO_BYTE_SHIFT)
#define BYTE_TO_SECTOR(x) ((x)>>SECTOR_TO_BYTE_SHIFT)
typedef struct _PCI_ID
{
HPT_U16 vid;
HPT_U16 did;
HPT_U32 subsys;
HPT_U8 rev;
HPT_U8 nbase;
HPT_U16 reserve;
}
PCI_ID;
typedef struct _PCI_ADDRESS
{
HPT_U8 tree;
HPT_U8 bus;
HPT_U8 device;
HPT_U8 function;
}
PCI_ADDRESS;
typedef struct _HIM_ADAPTER_CONFIG
{
PCI_ADDRESS pci_addr;
PCI_ID pci_id;
HPT_U8 max_devices;
HPT_U8 max_sg_descriptors;
HPT_U8 bDevsPerBus;
HPT_U8 first_on_slot;
HPT_U8 bChipType;
HPT_U8 bChipIntrNum;
HPT_U8 bChipFlags;
HPT_U8 bNumBuses;
HPT_U8 szVendorID[36];
HPT_U8 szProductID[36];
}
HIM_ADAPTER_CONFIG, *PHIM_ADAPTER_CONFIG;
typedef struct _HIM_CHANNEL_CONFIG
{
HPT_U32 io_port;
HPT_U32 ctl_port;
} HIM_CHANNEL_CONFIG, *PHIM_CHANNEL_CONFIG;
typedef struct _HIM_DEVICE_FLAGS
{
HPT_U32 df_atapi :1;
HPT_U32 df_removable_drive :1;
HPT_U32 df_on_line :1;
HPT_U32 df_reduce_mode :1;
HPT_U32 df_sata :1;
HPT_U32 df_with_601 :1;
HPT_U32 df_support_read_ahead :1;
HPT_U32 df_read_ahead_enabled :1;
HPT_U32 df_support_write_cache :1;
HPT_U32 df_write_cache_enabled :1;
HPT_U32 df_cdrom_device :1;
HPT_U32 df_tape_device :1;
HPT_U32 df_support_tcq :1;
HPT_U32 df_tcq_enabled :1;
HPT_U32 df_support_ncq :1;
HPT_U32 df_ncq_enabled :1;
} DEVICE_FLAGS, *PDEVICE_FLAGS;
#pragma pack(1)
typedef struct _IDENTIFY_DATA2 {
HPT_U16 GeneralConfiguration;
HPT_U16 NumberOfCylinders;
HPT_U16 Reserved1;
HPT_U16 NumberOfHeads;
HPT_U16 UnformattedBytesPerTrack;
HPT_U16 UnformattedBytesPerSector;
HPT_U16 SectorsPerTrack;
HPT_U16 VendorUnique1[3];
HPT_U16 SerialNumber[10];
HPT_U16 BufferType;
HPT_U16 BufferSectorSize;
HPT_U16 NumberOfEccBytes;
HPT_U16 FirmwareRevision[4];
HPT_U16 ModelNumber[20];
HPT_U8 MaximumBlockTransfer;
HPT_U8 VendorUnique2;
HPT_U16 DoubleWordIo;
HPT_U16 Capabilities;
HPT_U16 Reserved2;
HPT_U8 VendorUnique3;
HPT_U8 PioCycleTimingMode;
HPT_U8 VendorUnique4;
HPT_U8 DmaCycleTimingMode;
HPT_U16 TranslationFieldsValid;
HPT_U16 NumberOfCurrentCylinders;
HPT_U16 NumberOfCurrentHeads;
HPT_U16 CurrentSectorsPerTrack;
HPT_U32 CurrentSectorCapacity;
HPT_U16 CurrentMultiSectorSetting;
HPT_U32 UserAddressableSectors;
HPT_U8 SingleWordDMASupport;
HPT_U8 SingleWordDMAActive;
HPT_U8 MultiWordDMASupport;
HPT_U8 MultiWordDMAActive;
HPT_U8 AdvancedPIOModes;
HPT_U8 Reserved4;
HPT_U16 MinimumMWXferCycleTime;
HPT_U16 RecommendedMWXferCycleTime;
HPT_U16 MinimumPIOCycleTime;
HPT_U16 MinimumPIOCycleTimeIORDY;
HPT_U16 Reserved5[2];
HPT_U16 ReleaseTimeOverlapped;
HPT_U16 ReleaseTimeServiceCommand;
HPT_U16 MajorRevision;
HPT_U16 MinorRevision;
}
#ifdef __GNUC__
__attribute__((packed))
#endif
IDENTIFY_DATA2, *PIDENTIFY_DATA2;
#pragma pack()
#define _HPT601_INFO_DEVICEID 1
#define _HPT601_INFO_TEMPERATURE 2
#define _HPT601_INFO_FANSTATUS 4
#define _HPT601_INFO_BEEPERCONTROL 8
#define _HPT601_INFO_LED1CONTROL 0x10
#define _HPT601_INFO_LED2CONTROL 0x20
#define _HPT601_INFO_POWERSTATUS 0x40
typedef struct __HPT601_INFO {
HPT_U16 ValidFields;
HPT_U16 DeviceId;
HPT_U16 Temperature;
HPT_U16 FanStatus;
HPT_U16 BeeperControl;
HPT_U16 LED1Control;
HPT_U16 LED2Control;
HPT_U16 PowerStatus;
} _HPT601_INFO, *_PHPT601_INFO;
typedef struct _HIM_DEVICE_CONFIG
{
HPT_U64 capacity;
DEVICE_FLAGS flags;
HPT_U8 path_id;
HPT_U8 target_id;
HPT_U8 max_queue_depth;
HPT_U8 spin_up_mode;
HPT_U8 reserved;
HPT_U8 transfer_mode;
HPT_U8 bMaxShowMode;
HPT_U8 bDeUsable_Mode;
HPT_U16 max_sectors_per_cmd;
PIDENTIFY_DATA2 pIdentifyData;
_HPT601_INFO chip601;
}
HIM_DEVICE_CONFIG, *PHIM_DEVICE_CONFIG;
#define _DIT_MODE 0
#define _DIT_601 1
#define _DIT_READ_AHEAD 2
#define _DIT_WRITE_CACHE 3
#define _DIT_TCQ 4
#define _DIT_NCQ 5
#define _DIT_BEEP_OFF 6
#define _DIT_SPIN_UP_MODE 7
#define SPIN_UP_MODE_NOSUPPORT 0
#define SPIN_UP_MODE_FULL 1
#define SPIN_UP_MODE_STANDBY 2
struct tcq_control {
HPT_U8 enable;
HPT_U8 depth;
};
struct ncq_control {
HPT_U8 enable;
HPT_U8 depth;
};
typedef struct _HIM_ALTERABLE_DEV_INFO{
HPT_U8 type;
union {
HPT_U8 mode;
HPT_U8 enable_read_ahead;
HPT_U8 enable_read_cache;
HPT_U8 enable_write_cache;
struct tcq_control tcq;
struct ncq_control ncq;
_HPT601_INFO chip601;
void * adapter;
HPT_U8 spin_up_mode;
}u;
} HIM_ALTERABLE_DEV_INFO, *PHIM_ALTERABLE_DEV_INFO;
struct _COMMAND;
struct _IOCTL_ARG;
typedef void (*PROBE_CALLBACK)(void *arg, void *dev, int index);
typedef struct _HIM {
char *name;
struct _HIM *next;
HPT_U8 max_sg_descriptors;
#define _HIM_INTERFACE(_type, _fn, _args) _type (* _fn) _args;
#include <dev/rr232x/himfuncs.h>
}
HIM, *PHIM;
#pragma pack(1)
#ifdef SG_FLAG_EOT
#error "don't use SG_FLAG_EOT with _SG.eot. clean the code!"
#endif
typedef struct _SG {
HPT_U32 size;
HPT_UINT eot;
union {
HPT_U8 FAR * _logical;
BUS_ADDRESS bus;
}
addr;
}
SG, *PSG;
#pragma pack()
typedef struct _AtaCommand
{
HPT_U64 Lba;
HPT_U16 nSectors;
HPT_U16 pad;
} AtaComm, *PAtaComm;
typedef struct _PassthroughCmd {
HPT_U8 bFeaturesReg;
HPT_U8 bSectorCountReg;
HPT_U8 bLbaLowReg;
HPT_U8 bLbaMidReg;
HPT_U8 bLbaHighReg;
HPT_U8 bDriveHeadReg;
HPT_U8 bCommandReg;
HPT_U8 nSectors;
HPT_U8 *pDataBuffer;
}
PassthroughCmd;
#define CTRL_CMD_REBUILD 1
#define CTRL_CMD_VERIFY 2
#define CTRL_CMD_INIT 3
typedef struct _R5ControlCmd {
HPT_U64 StripeLine;
HPT_U16 Offset;
HPT_U8 Command;
HPT_U8 reserve1;
}
R5ControlCmd, *PR5ControlCmd;
typedef struct _HPT_ADDRESS
{
HPT_U8 * logical;
BUS_ADDRESS bus;
}
HPT_ADDRESS;
typedef struct ctl_pages {
HPT_ADDRESS *pages;
HPT_UINT page_size;
HPT_UINT npages;
HPT_U8 min_sg_descriptors;
} CONTROL_PAGES, *PCONTROL_PAGES;
typedef struct _R1ControlCmd {
HPT_U64 Lba;
HPT_U16 nSectors;
HPT_U8 Command; /* CTRL_CMD_XXX */
HPT_U8 reserve1;
PCONTROL_PAGES ctl_pages;
}
R1ControlCmd, *PR1ControlCmd;
typedef void (*TQ_PROC)(void *arg);
struct tq_item {
TQ_PROC proc;
void *arg;
struct tq_item *next;
};
#define INIT_TQ_ITEM(t, p, a) \
do { (t)->proc = p; (t)->arg = a; (t)->next = 0; } while (0)
typedef struct _COMMAND
{
struct _VBUS * vbus;
struct freelist *grplist;
HPT_UINT grpcnt;
HPT_UINT freecnt;
struct list_head q_link;
struct tq_item done_dpc;
HPT_UINT extsize;
void *ext;
void *target;
void *priv;
HPT_UPTR priv2;
int priority;
struct lock_request *owned_lock;
struct lock_request *lock_req;
union{
/* Ide Command */
AtaComm Ide;
PassthroughCmd Passthrough;
/* Atapi Command */
HPT_U8 Atapi[12];
/* Control command */
R5ControlCmd R5Control;
R1ControlCmd R1Control;
} uCmd;
HPT_U8 type; /* CMD_TYPE_* */
struct {
HPT_U8 physical_sg: 1;
HPT_U8 data_in: 1;
HPT_U8 data_out: 1;
HPT_U8 transform : 1;
HPT_U8 hard_flush: 2;
} flags;
/* return status */
HPT_U8 Result;
/* retry count */
HPT_U8 RetryCount;
PSG psg;
int (*buildsgl)(struct _COMMAND *cmd, PSG psg, int logical);
void (*done)(struct _COMMAND *cmd);
}
COMMAND, *PCOMMAND;
/* command types */
#define CMD_TYPE_IO 0
#define CMD_TYPE_CONTROL 1
#define CMD_TYPE_ATAPI 2
#define CMD_TYPE_PASSTHROUGH 3
#define CMD_TYPE_FLUSH 4
/* flush command flags */
#define CF_HARD_FLUSH_CACHE 1
#define CF_HARD_FLUSH_STANDBY 2
/* command return values */
#define RETURN_PENDING 0
#define RETURN_SUCCESS 1
#define RETURN_BAD_DEVICE 2
#define RETURN_BAD_PARAMETER 3
#define RETURN_WRITE_NO_DRQ 4
#define RETURN_DEVICE_BUSY 5
#define RETURN_INVALID_REQUEST 6
#define RETURN_SELECTION_TIMEOUT 7
#define RETURN_IDE_ERROR 8
#define RETURN_NEED_LOGICAL_SG 9
#define RETURN_NEED_PHYSICAL_SG 10
#define RETURN_RETRY 11
#define RETURN_DATA_ERROR 12
#define RETURN_BUS_RESET 13
#define RETURN_BAD_TRANSFER_LENGTH 14
#define RETURN_INSUFFICIENT_MEMORY 15
#if defined(__cplusplus)
}
#endif
#endif

View File

@ -1,100 +0,0 @@
#include <dev/rr232x/rr232x_config.h>
/* $Id: himfuncs.h,v 1.14 2005/12/22 00:13:11 gmm Exp $
* Copyright (C) 2004-2005 HighPoint Technologies, Inc. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*
* define _HIM_INTERFACE before include this file, and
* undef it after include this file.
*/
#ifndef _HIM_INTERFACE
#error "you must define _HIM_INTERFACE before this file"
#endif
_HIM_INTERFACE(HPT_BOOL, get_supported_device_id, (int index, PCI_ID *id))
_HIM_INTERFACE(HPT_U8, get_controller_count, (PCI_ID *id, HPT_U8 *reached))
_HIM_INTERFACE(HPT_UINT, get_adapter_size, (const PCI_ID *id))
_HIM_INTERFACE(HPT_BOOL, create_adapter, (const PCI_ID *id, PCI_ADDRESS pciAddress, void *adapter, void *osext))
_HIM_INTERFACE(void, get_adapter_config, (void *adapter, HIM_ADAPTER_CONFIG *config))
_HIM_INTERFACE(HPT_BOOL, get_meminfo, (void *adapter))
_HIM_INTERFACE(HPT_BOOL, adapter_on_same_vbus, (void *adapter1, void *adapter2))
_HIM_INTERFACE(void, route_irq, (void *adapter, HPT_BOOL enable))
_HIM_INTERFACE(HPT_BOOL, initialize, (void *adapter))
_HIM_INTERFACE(HPT_UINT, get_device_size, (void *adapter))
_HIM_INTERFACE(HPT_BOOL, probe_device, (void *adapter, int index, void *devhandle, PROBE_CALLBACK done, void *arg))
_HIM_INTERFACE(void *, get_device, (void *adapter, int index))
_HIM_INTERFACE(void, get_device_config, (void *dev, HIM_DEVICE_CONFIG *config))
_HIM_INTERFACE(void, remove_device, (void *dev))
_HIM_INTERFACE(void, reset_device, (void * dev, void (*done)(void *arg), void *arg))
_HIM_INTERFACE(HPT_U32, get_cmdext_size, (void))
_HIM_INTERFACE(void, queue_cmd, (void *dev, struct _COMMAND *cmd))
_HIM_INTERFACE(int, read_write, (void *dev,HPT_LBA lba, HPT_U16 nsector, HPT_U8 *buffer, HPT_BOOL read))
_HIM_INTERFACE(HPT_BOOL, intr_handler, (void *adapter))
_HIM_INTERFACE(HPT_BOOL, intr_control, (void * adapter, HPT_BOOL enable))
_HIM_INTERFACE(int, get_channel_config, (void * adapter, int index, PHIM_CHANNEL_CONFIG pInfo))
_HIM_INTERFACE(int, set_device_info, (void * dev, PHIM_ALTERABLE_DEV_INFO pInfo))
_HIM_INTERFACE(void, unplug_device, (void * dev))
_HIM_INTERFACE(void, shutdown, (void *adapter))
_HIM_INTERFACE(void, suspend, (void *adapter))
_HIM_INTERFACE(void, resume, (void *adapter))
_HIM_INTERFACE(void, release_adapter, (void *adapter))
/*called after ldm_register_adapter*/
_HIM_INTERFACE(HPT_BOOL, verify_adapter, (void *adapter))
/* (optional) */
_HIM_INTERFACE(void, ioctl, (void * adapter, struct _IOCTL_ARG *arg))
_HIM_INTERFACE(int, compare_slot_seq, (void *adapter1, void *adapter2))
_HIM_INTERFACE(HPT_BOOL, flash_access, (void *adapter, HPT_U32 offset, void *value, int size, HPT_BOOL reading))
#undef _HIM_INTERFACE

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,484 +0,0 @@
#include <dev/rr232x/rr232x_config.h>
/*
* $Id: ldm.h,v 1.48 2006/02/21 06:11:19 gmm Exp $
* Copyright (C) 2004-2005 HighPoint Technologies, Inc. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _HPT_LDM_H_
#define _HPT_LDM_H_
#define VERMAGIC_LDM 48
#if defined(__cplusplus)
extern "C" {
#endif
#define __hpt_set_ver(x, v1, v2, v3, v4, v5) x ## _R_ ## v1 ## _ ## v2 ## _ ## v3 ## _ ## v4 ## _ ## v5
#define _hpt_set_ver(x, v1, v2, v3, v4, v5) __hpt_set_ver(x, v1, v2, v3, v4, v5)
#define hpt_set_ver(x) _hpt_set_ver(x, VERMAGIC_OSM, VERMAGIC_HIM, VERMAGIC_LDM, VERMAGIC_ARRAY, MAX_MEMBERS)
#define ldm_register_him hpt_set_ver(ldm_register_him)
#define ldm_register_vdev_class hpt_set_ver(ldm_register_vdev_class)
#define ldm_alloc_cmds hpt_set_ver(ldm_alloc_cmds)
#ifndef HPT_INTERFACE_VERSION
#define HPT_INTERFACE_VERSION 0x02000000
#endif
#define MAX_PARTITIONS_PER_DISK 4
#if defined(__MAX_PARTITIONS_PER_DISK) && MAX_PARTITIONS_PER_DISK > __MAX_PARTITIONS_PER_DISK
#error "Please redefine MAX_PARTITIONS_PER_DISK!!!"
#endif
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
struct freelist {
int dma;
HPT_UINT alignment;
HPT_UINT count;
HPT_UINT size;
void * head;
struct freelist *next;
#if DBG
char *tag;
HPT_UINT reserved_count;
#define freelist_debug_tag(list, _tag) (list)->tag = _tag
#else
#define freelist_debug_tag(list, _tag)
#endif
};
void freelist_reserve(struct freelist *list, void *osext, HPT_UINT size, HPT_UINT count);
void *freelist_get(struct freelist *);
void freelist_put(struct freelist *, void *p);
void freelist_reserve_dma(struct freelist *list, void *osext, HPT_UINT size, HPT_UINT alignment, HPT_UINT count);
void *freelist_get_dma(struct freelist *, BUS_ADDRESS *busaddr);
void freelist_put_dma(struct freelist *, void *p, BUS_ADDRESS busaddr);
#define freelist_reserve_with_tag(list, osext, size, count) \
do {\
freelist_debug_tag(list, #list " at " __FILE__);\
freelist_reserve(list, osext, size, count);\
}while(0)
#define freelist_reserve_dma_with_tag(list, osext, size, alignment, count) \
do {\
freelist_debug_tag(list, #list " at " __FILE__);\
freelist_reserve_dma(list, osext, size, alignment, count);\
}while(0)
struct lock_request {
HPT_U64 start, end;
struct lock_request *next;
struct list_head waiters; /* blocked commands */
struct tq_item callback;
};
#define INIT_LOCK_REQUEST(req, _start, _end, _cb, _arg) \
do {\
(req)->next = 0;\
(req)->start = _start;\
(req)->end = _end;\
INIT_TQ_ITEM(&(req)->callback, _cb, _arg);\
INIT_LIST_HEAD(&(req)->waiters);\
} while (0)
struct task_queue {
struct tq_item *head, *tail;
};
#define TQ_EMPTY(tq) ((tq)->head==0)
struct dmapool_order {
HPT_UINT npages;
struct tq_item wakeup_fn;
struct dmapool_order *next;
};
struct dmapool_client {
void * handle;
HPT_UINT (*shrink)(void *handle, HPT_UINT npages);
struct dmapool_client *next;
};
typedef struct _VBUS * PVBUS;
typedef struct _VDEV * PVDEV;
void dmapool_register_client(PVBUS vbus, struct dmapool_client *client);
void dmapool_active(PVBUS vbus);
/* return 0 if the request is immediately satisfied, non-zero otherwise. */
int dmapool_make_order(PVBUS vbus, struct dmapool_order *order);
void *dmapool_get_page(PVBUS vbus, BUS_ADDRESS *busaddr);
void dmapool_put_page(PVBUS vbus, void *p, BUS_ADDRESS busaddr);
struct timer_call {
HPT_U32 interval; /*microseconds*/
HPT_TIME expire_time; /*microseconds*/
void (*proc)(void * arg);
void * arg;
struct timer_call ** pprev;
struct timer_call * next;
};
#define ldm_init_timer(timer) do { (timer)->next=0; (timer)->pprev=0; } while (0)
#define INIT_TIMER_CALL(timer, _interval, _proc, _arg) \
do { \
HPT_ASSERT((timer)->next==0 && (timer)->pprev==0);\
(timer)->interval = _interval;\
(timer)->proc = _proc;\
(timer)->arg = _arg;\
} while(0)
void ldm_request_timer(PVBUS vbus, struct timer_call * tc);
void ldm_remove_timer(PVBUS vbus, struct timer_call * tc);
void ldm_on_timer(PVBUS vbus);
typedef struct _LDM_ADAPTER
{
struct _LDM_ADAPTER *next;
HIM *him;
void *him_handle;
PVBUS vbus;
struct freelist freelist_dev;
struct freelist freelist_plugged_dpc;
HPT_BOOL master;
}
LDM_ADAPTER, *PLDM_ADAPTER;
typedef struct _IOCTL_ARG
{
struct list_head link;
PVBUS vbus;
HPT_U32 dwIoControlCode;
HPT_U32 nInBufferSize;
HPT_U32 nOutBufferSize;
void * lpInBuffer;
void * lpOutBuffer;
HPT_U32 *lpBytesReturned;
void * ioctl_cmnd;
void (* done)(struct _IOCTL_ARG *);
int result; /* HPT_IOCTL_RESULT_ */
struct tq_item dpc;
} IOCTL_ARG;
#define HPT_IOCTL_RESULT_OK 0
#define HPT_IOCTL_RESULT_FAILED (-1)
#define HPT_IOCTL_RESULT_INVALID (-2)
#define HPT_IOCTL_RESULT_RETRY (-3)
#define HPT_IOCTL_RESULT_WRONG_VBUS (-4)
void ldm_ioctl( PVBUS vbus, IOCTL_ARG *IAPnt);
HPT_U32 ldm_get_device_id(PVDEV vd); /* for ioctl */
void ldm_set_rebuild_priority(PVBUS vbus, int priority);
#include <dev/rr232x/array.h>
typedef struct hpt_raw_disk
{
#ifdef SUPPORT_ARRAY
PRAW_PARTITION raw_part_list;
HPT_RAW_LBA max_available_capacity;
HPT_RAW_LBA total_available_capacity;
#endif
HPT_RAW_LBA real_capacity;
HPT_RAW_LBA head_position;
HPT_U16 max_sectors_per_cmd;
HPT_U8 user_select_mode;
HPT_U8 uninitialized : 1;
HPT_U8 legacy_disk : 1;
HPT_U8 is_spare : 1;
HPT_U8 v3_format : 1;
HPT_U8 need_sync : 1;
HPT_U8 reserved1 : 1;
HPT_U8 need_check_array : 1;
HPT_U8 df_user_mode_set: 1;
HPT_U8 df_read_ahead_set: 1;
HPT_U8 enable_read_ahead : 1;
HPT_U8 df_write_cache_set: 1;
HPT_U8 enable_write_cache : 1;
HPT_U8 df_tcq_set: 1;
HPT_U8 enable_tcq : 1;
HPT_U8 df_ncq_set: 1;
HPT_U8 enable_ncq : 1;
HIM * him;
int index;
PLDM_ADAPTER adapter;
void * phy_dev;
PIDENTIFY_DATA2 identify_data;
char model[40];
}
HPT_RAW_DISK, *PHPT_RAW_DISK;
struct vdev_class
{
struct vdev_class *next;
HPT_U8 type;
HPT_U8 stripped; /* RAID0,3,5,6 */
HPT_U8 redundancy; /* RAID1-1, RAID3/5-1, RAID6-2 */
HPT_U8 must_init; /* RAID3,5,6 */
HPT_UINT vbus_ext_size;
HPT_UINT vbus_ext_offset; /* used by LDM */
HPT_UINT dev_ext_size;
HPT_UINT cmd_ext_size;
void (*get_mem_info)(PVBUS vbus, void *osext, int phydev_count);
void (*queue_cmd)(PCOMMAND cmd);
void (*member_failed)(struct _VDEV * vd);
void (*initialize)(PVBUS vbus);
void (*release)(PVBUS vbus);
int (*add)(PVDEV vd);
void (*remove)(PVDEV vd);
void (*reset)(PVDEV vd);
};
#define VDEV_CLASS_CONSTRUCTOR(type, prefix) { \
0, \
type, \
prefix ## _stripped, \
prefix ## _redundancy, \
prefix ## _must_init, \
prefix ## _vbus_ext_size, \
0, \
prefix ## _dev_ext_size, \
prefix ## _cmd_ext_size, \
prefix ## _get_mem_info, \
prefix ## _queue_cmd, \
prefix ## _member_failed, \
prefix ## _initialize, \
prefix ## _release, \
prefix ## _add, \
prefix ## _remove, \
prefix ## _reset, \
}
#define VD_RAW 1
#define VD_PARTITION 4
#define mIsArray(vdev_type) ((vdev_type)>VD_PARTITION)
#define VD_RAID0 5
#define VD_RAID1 6
#define VD_JBOD 7
#define VD_RAID5 8
#define VD_RAID6 9
#define MAX_VD_TYPE_ID 9
struct vdev_class *ldm_find_vdev_class(HPT_U8 type);
typedef struct _VDEV {
PVBUS vbus;
PVDEV parent;
void * ext;
HPT_U64 capacity;
int target_id;
int cmds_per_request;
union {
#ifdef SUPPORT_ARRAY
HPT_ARRAY array;
HPT_PARTITION partition;
#endif
HPT_RAW_DISK raw;
} u;
HPT_UINT vf_online : 1;
HPT_UINT vf_bootmark : 1;
HPT_UINT vf_bootable : 1;
HPT_UINT vf_resetting: 1;
HPT_U8 cq_len;
HPT_U8 cmds_sent;
HPT_U8 max_queue_depth;
HPT_U8 cache_policy; /* see CACHE_POLICY_* */
struct list_head link;
struct vdev_class *Class;
struct list_head cq_wait_send;
struct list_head cq_sent;
struct task_queue tq_idle;
int cq_priority;
struct list_head cq_wait_lock;
struct lock_request *locks_granted;
struct lock_request *locks_wait;
HPT_U32 ioctl_id;
}
VDEV;
#define CACHE_POLICY_NONE 0
#define CACHE_POLICY_WRITE_THROUGH 1
#define CACHE_POLICY_WRITE_BACK 2
extern HIM *him_list;
void ldm_register_him(PHIM him);
void ldm_register_vdev_class(struct vdev_class *Class);
HPT_BOOL ldm_register_adapter(PLDM_ADAPTER adapter);
int init_config(void);
HPT_UINT ldm_get_vbus_size(void);
void ldm_create_vbus(PVBUS vbus, void *osext);
void ldm_get_mem_info(PVBUS vbus, void *osext);
void *ldm_get_vbus_ext(PVBUS vbus, struct vdev_class *Class);
PVBUS ldm_get_next_vbus(PVBUS vbus, void **posext);
#define ldm_for_each_vbus(vbus, vbus_ext) \
for (vbus = ldm_get_next_vbus(0, (void **)(void *)&vbus_ext); vbus; \
vbus = ldm_get_next_vbus(vbus, (void **)(void *)&vbus_ext))
void ldm_initialize_vbus_async(PVBUS vbus, PLDM_ADAPTER master_adapter, void (*done)(void *osext));
/* ldm_initialize_vbus is deprecated since it will hold the CPU too long. */
#define ldm_initialize_vbus(vbus, adapter) ldm_initialize_vbus_async(vbus, adapter, 0)
void ldm_release_vbus(PVBUS vbus);
PVDEV ldm_create_vdev(PVBUS vbus, HPT_U8 type);
void ldm_release_vdev(PVDEV vd);
PVDEV ldm_find_target(PVBUS vbus, int id);
PCOMMAND ldm_alloc_cmds(PVBUS vbus, HPT_UINT cnt);
void ldm_free_cmds(PCOMMAND cmd);
HPT_UINT ldm_get_cmd_size(void);
PCOMMAND ldm_alloc_cmds_from_list(PVBUS vbus, struct freelist *list, HPT_UINT cnt);
void ldm_free_cmds_to_list(struct freelist *list, PCOMMAND cmd);
PCOMMAND __ldm_alloc_cmd(struct freelist *list);
#ifdef OS_SUPPORT_TASK
#define CMD_SET_PRIORITY(cmd, pri) cmd->priority = (pri)
#else
#define CMD_SET_PRIORITY(cmd, pri)
#endif
#define CMD_GROUP_GET(grp, cmd) \
do {\
HPT_ASSERT(grp->freecnt);\
grp->freecnt--;\
grp->grplist->count++;\
cmd = __ldm_alloc_cmd(grp->grplist);\
cmd->vbus = grp->vbus;\
cmd->grplist = grp->grplist;\
CMD_SET_PRIORITY(cmd, grp->priority);\
} while(0)
#define CMD_GROUP_PUT(grp, cmd) \
do {\
grp->freecnt++;\
freelist_put(grp->grplist, cmd);\
grp->grplist->count--;\
} while (0)
void ldm_queue_cmd(PCOMMAND cmd);
void vdev_queue_cmd(PCOMMAND cmd);
void ldm_finish_cmd(PCOMMAND cmd);
int ldm_acquire_lock(PVDEV vd, struct lock_request *req);
void ldm_release_lock(PVDEV vd, struct lock_request *req);
void ldm_queue_task(struct task_queue *tq, struct tq_item *t);
void ldm_queue_vbus_dpc(PVBUS vbus, struct tq_item *t);
HPT_BOOL ldm_intr(PVBUS vbus);
void ldm_run(PVBUS vbus);
int ldm_reset_vbus(PVBUS vbus);
void ldm_suspend(PVBUS vbus);
void ldm_resume(PVBUS vbus);
void ldm_shutdown(PVBUS vbus);/*shutdown all the controllers*/
#define HIM_EVENT_DEVICE_REMOVED 1
#define HIM_EVENT_DEVICE_PLUGGED 2
#define HIM_EVENT_DEVICE_ERROR 3
#define HIM_EVENT_RESET_REQUIRED 4
void ldm_event_notify(HPT_U32 event, void *arg1, void *arg2);
void ldm_register_device(PVDEV vd);
void ldm_unregister_device(PVDEV vd);
PVBUS him_handle_to_vbus(void * him_handle);
#if defined(__cplusplus)
}
#endif
#endif

View File

@ -1,121 +0,0 @@
#include <dev/rr232x/rr232x_config.h>
/*
* $Id: list.h,v 1.4 2006/02/15 07:24:38 gmm Exp $
* Copyright (C) 2004-2005 HighPoint Technologies, Inc. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _HPT_LIST_H_
#define _HPT_LIST_H_
#ifndef _LINUX_LIST_H
#define HPT_INLINE __inline
struct list_head {
struct list_head *next, *prev;
};
#define INIT_LIST_HEAD(ptr) do { (ptr)->next = (ptr); (ptr)->prev = (ptr); } while (0)
static HPT_INLINE void __list_add(struct list_head * _new, struct list_head * prev, struct list_head * next)
{
next->prev = _new;
_new->next = next;
_new->prev = prev;
prev->next = _new;
}
static HPT_INLINE void list_add(struct list_head *_new, struct list_head *head)
{
__list_add(_new, head, head->next);
}
static HPT_INLINE void list_add_tail(struct list_head *_new, struct list_head *head)
{
__list_add(_new, head->prev, head);
}
static HPT_INLINE void __list_del(struct list_head * prev, struct list_head * next)
{
next->prev = prev;
prev->next = next;
}
static HPT_INLINE void list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
}
static HPT_INLINE void list_del_init(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
INIT_LIST_HEAD(entry);
}
static HPT_INLINE int list_empty(struct list_head *head)
{
HPT_ASSERT(!(head->next==head && head->prev!=head));
return head->next == head;
}
static HPT_INLINE void __list_splice(struct list_head *list,
struct list_head *head)
{
struct list_head *first = list->next;
struct list_head *last = list->prev;
struct list_head *at = head->next;
first->prev = head;
head->next = first;
last->next = at;
at->prev = last;
}
static HPT_INLINE void list_splice(struct list_head *list, struct list_head *head)
{
if (!list_empty(list))
__list_splice(list, head);
}
static HPT_INLINE void list_splice_init(struct list_head *list, struct list_head *head)
{
if (!list_empty(list)) {
__list_splice(list, head);
INIT_LIST_HEAD(list);
}
}
#define list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(HPT_UPTR)(&((type *)0)->member)))
#define list_for_each(pos, head) \
for (pos = (head)->next; pos != (head); pos = pos->next)
#define get_first_item(attached, type, member) \
((type *)((char *)((attached)->next)-(HPT_UPTR)(&((type *)0)->member)))
#endif
#endif

View File

@ -1,297 +0,0 @@
#include <dev/rr232x/rr232x_config.h>
/* $Id: os_bsd.c,v 1.11 2005/06/03 14:06:38 kdh Exp $
*
* HighPoint RAID Driver for FreeBSD
* Copyright (C) 2005 HighPoint Technologies, Inc. All Rights Reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#include <dev/rr232x/os_bsd.h>
/* hardware access */
HPT_U8 os_inb (void *port) { return inb((unsigned)(HPT_UPTR)port); }
HPT_U16 os_inw (void *port) { return inw((unsigned)(HPT_UPTR)port); }
HPT_U32 os_inl (void *port) { return inl((unsigned)(HPT_UPTR)port); }
void os_outb (void *port, HPT_U8 value) { outb((unsigned)(HPT_UPTR)port, (value)); }
void os_outw (void *port, HPT_U16 value) { outw((unsigned)(HPT_UPTR)port, (value)); }
void os_outl (void *port, HPT_U32 value) { outl((unsigned)(HPT_UPTR)port, (value)); }
void os_insw (void *port, HPT_U16 *buffer, HPT_U32 count)
{ insw((unsigned)(HPT_UPTR)port, (void *)buffer, count); }
void os_outsw(void *port, HPT_U16 *buffer, HPT_U32 count)
{ outsw((unsigned)(HPT_UPTR)port, (void *)buffer, count); }
HPT_U32 __dummy_reg = 0;
/* PCI configuration space */
HPT_U8 os_pci_readb (void *osext, HPT_U8 offset)
{
return pci_read_config(((PHBA)osext)->pcidev, offset, 1);
}
HPT_U16 os_pci_readw (void *osext, HPT_U8 offset)
{
return pci_read_config(((PHBA)osext)->pcidev, offset, 2);
}
HPT_U32 os_pci_readl (void *osext, HPT_U8 offset)
{
return pci_read_config(((PHBA)osext)->pcidev, offset, 4);
}
void os_pci_writeb (void *osext, HPT_U8 offset, HPT_U8 value)
{
pci_write_config(((PHBA)osext)->pcidev, offset, value, 1);
}
void os_pci_writew (void *osext, HPT_U8 offset, HPT_U16 value)
{
pci_write_config(((PHBA)osext)->pcidev, offset, value, 2);
}
void os_pci_writel (void *osext, HPT_U8 offset, HPT_U32 value)
{
pci_write_config(((PHBA)osext)->pcidev, offset, value, 4);
}
void *os_map_pci_bar(
void *osext,
int index,
HPT_U32 offset,
HPT_U32 length
)
{
PHBA hba = (PHBA)osext;
hba->pcibar[index].rid = 0x10 + index * 4;
if (pci_read_config(hba->pcidev, hba->pcibar[index].rid, 4) & 1)
hba->pcibar[index].type = SYS_RES_IOPORT;
else
hba->pcibar[index].type = SYS_RES_MEMORY;
hba->pcibar[index].res = bus_alloc_resource(hba->pcidev,
hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE);
hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset;
return hba->pcibar[index].base;
}
void os_unmap_pci_bar(void *osext, void *base)
{
PHBA hba = (PHBA)osext;
int index;
for (index=0; index<6; index++) {
if (hba->pcibar[index].base==base) {
bus_release_resource(hba->pcidev, hba->pcibar[index].type,
hba->pcibar[index].rid, hba->pcibar[index].res);
hba->pcibar[index].base = 0;
return;
}
}
}
void freelist_reserve(struct freelist *list, void *osext, HPT_UINT size, HPT_UINT count)
{
PVBUS_EXT vbus_ext = osext;
if (vbus_ext->ext_type!=EXT_TYPE_VBUS)
vbus_ext = ((PHBA)osext)->vbus_ext;
list->next = vbus_ext->freelist_head;
vbus_ext->freelist_head = list;
list->dma = 0;
list->size = size;
list->head = 0;
#if DBG
list->reserved_count =
#endif
list->count = count;
}
void *freelist_get(struct freelist *list)
{
void * result;
if (list->count) {
HPT_ASSERT(list->head);
result = list->head;
list->head = *(void **)result;
list->count--;
return result;
}
return 0;
}
void freelist_put(struct freelist * list, void *p)
{
HPT_ASSERT(list->dma==0);
list->count++;
*(void **)p = list->head;
list->head = p;
}
void freelist_reserve_dma(struct freelist *list, void *osext, HPT_UINT size, HPT_UINT alignment, HPT_UINT count)
{
PVBUS_EXT vbus_ext = osext;
if (vbus_ext->ext_type!=EXT_TYPE_VBUS)
vbus_ext = ((PHBA)osext)->vbus_ext;
list->next = vbus_ext->freelist_dma_head;
vbus_ext->freelist_dma_head = list;
list->dma = 1;
list->alignment = alignment;
list->size = size;
list->head = 0;
#if DBG
list->reserved_count =
#endif
list->count = count;
}
void *freelist_get_dma(struct freelist *list, BUS_ADDRESS *busaddr)
{
void *result;
HPT_ASSERT(list->dma);
result = freelist_get(list);
if (result)
*busaddr = *(BUS_ADDRESS *)((void **)result+1);
return result;
}
void freelist_put_dma(struct freelist *list, void *p, BUS_ADDRESS busaddr)
{
HPT_ASSERT(list->dma);
list->count++;
*(void **)p = list->head;
*(BUS_ADDRESS *)((void **)p+1) = busaddr;
list->head = p;
}
HPT_U32 os_get_stamp(void)
{
HPT_U32 stamp;
do { stamp = random(); } while (stamp==0);
return stamp;
}
void os_stallexec(HPT_U32 microseconds)
{
DELAY(microseconds);
}
static void os_timer_for_ldm(void *arg)
{
PVBUS_EXT vbus_ext = (PVBUS_EXT)arg;
ldm_on_timer((PVBUS)vbus_ext->vbus);
}
void os_request_timer(void * osext, HPT_U32 interval)
{
PVBUS_EXT vbus_ext = osext;
HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS);
untimeout(os_timer_for_ldm, vbus_ext, vbus_ext->timer);
vbus_ext->timer = timeout(os_timer_for_ldm, vbus_ext, interval * hz / 1000000);
}
HPT_TIME os_query_time(void)
{
return ticks * (1000000 / hz);
}
void os_schedule_task(void *osext, OSM_TASK *task)
{
PVBUS_EXT vbus_ext = osext;
HPT_ASSERT(task->next==0);
if (vbus_ext->tasks==0)
vbus_ext->tasks = task;
else {
OSM_TASK *t = vbus_ext->tasks;
while (t->next) t = t->next;
t->next = task;
}
if (vbus_ext->worker.ta_context)
TASK_ENQUEUE(&vbus_ext->worker);
}
int os_revalidate_device(void *osext, int id)
{
return 0;
}
int os_query_remove_device(void *osext, int id)
{
PVBUS_EXT vbus_ext = (PVBUS_EXT)osext;
struct cam_periph *periph = NULL;
struct cam_path *path;
int status,retval = 0;
status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0);
if (status == CAM_REQ_CMP) {
if((periph = cam_periph_find(path, "da")) != NULL){
if(periph->refcount >= 1)
retval = -1;
}
xpt_free_path(path);
}
return retval;
}
HPT_U8 os_get_vbus_seq(void *osext)
{
return ((PVBUS_EXT)osext)->sim->path_id;
}
int os_printk(char *fmt, ...)
{
va_list args;
static char buf[512];
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
return printf("%s: %s\n", driver_name, buf);
}
#if DBG
void os_check_stack(const char *location, int size){}
void __os_dbgbreak(const char *file, int line)
{
printf("*** break at %s:%d ***", file, line);
while (1);
}
int hpt_dbg_level = 1;
#endif

View File

@ -1,258 +0,0 @@
#include <dev/rr232x/rr232x_config.h>
/* $Id: os_bsd.h,v 1.18 2006/04/11 08:19:02 gmm Exp $
*
* HighPoint RAID Driver for FreeBSD
* Copyright (C) 2005 HighPoint Technologies, Inc. All Rights Reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _OS_BSD_H
#define _OS_BSD_H
#ifndef DBG
#define DBG 0
#endif
#include <sys/param.h>
#include <sys/types.h>
#include <sys/cons.h>
#if (__FreeBSD_version >= 500000)
#include <sys/time.h>
#include <sys/systm.h>
#else
#include <machine/clock.h> /*to support DELAY function under 4.x BSD versions*/
#endif
#include <sys/stat.h>
#include <sys/malloc.h>
#include <sys/conf.h>
#include <sys/libkern.h>
#include <sys/kernel.h>
#if (__FreeBSD_version >= 500000)
#include <sys/kthread.h>
#include <sys/mutex.h>
#include <sys/module.h>
#endif
#include <sys/eventhandler.h>
#include <sys/bus.h>
#include <sys/taskqueue.h>
#include <sys/ioccom.h>
#include <machine/resource.h>
#include <machine/bus.h>
#include <machine/stdarg.h>
#include <sys/rman.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#if (__FreeBSD_version >= 500000)
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#else
#include <pci/pcivar.h>
#include <pci/pcireg.h>
#endif
#if (__FreeBSD_version <= 500043)
#include <sys/devicestat.h>
#endif
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_sim.h>
#include <cam/cam_xpt_sim.h>
#include <cam/cam_debug.h>
#include <cam/cam_periph.h>
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_message.h>
#if (__FreeBSD_version < 500043)
#include <sys/bus_private.h>
#endif
typedef struct _INQUIRYDATA {
u_char DeviceType : 5;
u_char DeviceTypeQualifier : 3;
u_char DeviceTypeModifier : 7;
u_char RemovableMedia : 1;
u_char Versions;
u_char ResponseDataFormat;
u_char AdditionalLength;
u_char Reserved[2];
u_char SoftReset : 1;
u_char CommandQueue : 1;
u_char Reserved2 : 1;
u_char LinkedCommands : 1;
u_char Synchronous : 1;
u_char Wide16Bit : 1;
u_char Wide32Bit : 1;
u_char RelativeAddressing : 1;
u_char VendorId[8];
u_char ProductId[16];
u_char ProductRevisionLevel[4];
u_char VendorSpecific[20];
u_char Reserved3[40];
}
__attribute__((packed))
INQUIRYDATA, *PINQUIRYDATA;
#endif
/* private headers */
#include <dev/rr232x/osm.h>
#include <dev/rr232x/him.h>
#include <dev/rr232x/ldm.h>
/* driver parameters */
extern char driver_name[];
extern char driver_name_long[];
extern char driver_ver[];
extern int osm_max_targets;
/*
* adapter/vbus extensions:
* each physical controller has an adapter_ext, passed to him.create_adapter()
* each vbus has a vbus_ext passed to ldm_create_vbus().
*/
#define EXT_TYPE_HBA 1
#define EXT_TYPE_VBUS 2
typedef struct _hba {
int ext_type;
LDM_ADAPTER ldm_adapter;
device_t pcidev;
PCI_ADDRESS pciaddr;
struct _vbus_ext *vbus_ext;
struct _hba *next;
struct {
struct resource *res;
int type;
int rid;
void *base;
}
pcibar[6];
struct resource *irq_res;
void *irq_handle;
}
HBA, *PHBA;
typedef struct _os_cmdext {
struct _vbus_ext *vbus_ext;
struct _os_cmdext *next;
union ccb *ccb;
bus_dmamap_t dma_map;
SG psg[os_max_sg_descriptors];
}
OS_CMDEXT, *POS_CMDEXT;
typedef struct _vbus_ext {
int ext_type;
struct _vbus_ext *next;
PHBA hba_list;
struct freelist *freelist_head;
struct freelist *freelist_dma_head;
struct cam_sim *sim; /* sim for this vbus */
struct cam_path *path; /* peripheral, path, tgt, lun with this vbus */
#if (__FreeBSD_version >= 500000)
struct mtx lock; /* general purpose lock */
#else
int hpt_splx;
#endif
bus_dma_tag_t io_dmat; /* I/O buffer DMA tag */
POS_CMDEXT cmdext_list;
OSM_TASK *tasks;
struct task worker;
struct callout_handle timer;
eventhandler_tag shutdown_eh;
/* the LDM vbus instance continues */
unsigned long vbus[0] __attribute__((aligned(sizeof(unsigned long))));
}
VBUS_EXT, *PVBUS_EXT;
#if __FreeBSD_version >= 500000
#define hpt_lock_vbus(vbus_ext) mtx_lock(&(vbus_ext)->lock)
#define hpt_unlock_vbus(vbus_ext) mtx_unlock(&(vbus_ext)->lock)
#else
static __inline void hpt_lock_vbus(PVBUS_EXT vbus_ext)
{
vbus_ext->hpt_splx = splcam();
}
static __inline void hpt_unlock_vbus(PVBUS_EXT vbus_ext)
{
splx(vbus_ext->hpt_splx);
}
#endif
#define HPT_OSM_TIMEOUT (20*hz) /* timeout value for OS commands */
#define HPT_DO_IOCONTROL _IOW('H', 0, HPT_IOCTL_PARAM)
#define HPT_SCAN_BUS _IO('H', 1)
#if __FreeBSD_version >= 501000
#define TASK_ENQUEUE(task) taskqueue_enqueue(taskqueue_swi_giant,(task));
#else
#define TASK_ENQUEUE(task) taskqueue_enqueue(taskqueue_swi,(task));
#endif
#if __FreeBSD_version >= 500000
static __inline int hpt_sleep(PVBUS_EXT vbus_ext, void *ident, int priority, const char *wmesg, int timo)
{
return msleep(ident, &vbus_ext->lock, priority, wmesg, timo);
}
#else
static __inline int hpt_sleep(PVBUS_EXT vbus_ext, void *ident, int priority, const char *wmesg, int timo)
{
int retval = 0;
asleep(ident, priority, wmesg, timo);
hpt_unlock_vbus(vbus_ext);
retval = await(priority, timo);
hpt_lock_vbus(vbus_ext);
return retval;
}
#endif
#if __FreeBSD_version < 501000
#define READ_16 0x88
#define WRITE_16 0x8a
#define SERVICE_ACTION_IN 0x9e
#endif
#define HPT_DEV_MAJOR 200

View File

@ -1,199 +0,0 @@
#include <dev/rr232x/rr232x_config.h>
/*
* $Id: osm.h,v 1.5 2005/08/18 05:17:43 gmm Exp $
* Copyright (C) 2005 HighPoint Technologies, Inc. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _HPT_OSM_H_
#define _HPT_OSM_H_
#define VERMAGIC_OSM 5
#define os_max_queue_comm 32
#define os_max_sg_descriptors 18
#define DMAPOOL_PAGE_SIZE 0x1000 /* PAGE_SIZE (i386/x86_64) */
#define os_max_cache_size 0x800000 /* 8MB */
#define os_max_cache_pages (os_max_cache_size/DMAPOOL_PAGE_SIZE)
/* data types */
typedef unsigned int HPT_UINT, HPT_U32;
typedef unsigned long HPT_UPTR;
typedef unsigned short HPT_U16;
typedef unsigned char HPT_U8;
typedef unsigned long HPT_TIME;
typedef unsigned long long HPT_U64;
#define CPU_TO_LE64(x) (x)
#define CPU_TO_LE32(x) (x)
#define CPU_TO_LE16(x) (x)
#define LE32_TO_CPU(x) (x)
#define LE16_TO_CPU(x) (x)
#define LE64_TO_CPU(x) (x)
#define FAR
#define EXTERN_C
typedef void * HPT_PTR;
typedef HPT_U64 HPT_LBA;
typedef HPT_U32 HPT_RAW_LBA;
#define MAX_LBA_VALUE 0xffffffffffffffffull
#define MAX_RAW_LBA_VALUE 0xfffffffful
#define RAW_LBA(x) ((HPT_U32)(x))
#define LO_LBA(x) ((HPT_U32)(x))
#define HI_LBA(x) (sizeof(HPT_LBA)>4? (HPT_U32)((x)>>32) : 0)
#define LBA_FORMAT_STR "0x%llX"
typedef HPT_U64 BUS_ADDRESS;
#define LO_BUSADDR(x) ((HPT_U32)(x))
#define HI_BUSADDR(x) (sizeof(BUS_ADDRESS)>4? (x)>>32 : 0)
typedef unsigned char HPT_BOOL;
#define HPT_TRUE 1
#define HPT_FALSE 0
typedef struct _TIME_RECORD {
HPT_U32 seconds:6; /* 0 - 59 */
HPT_U32 minutes:6; /* 0 - 59 */
HPT_U32 month:4; /* 1 - 12 */
HPT_U32 hours:6; /* 0 - 59 */
HPT_U32 day:5; /* 1 - 31 */
HPT_U32 year:5; /* 0=2000, 31=2031 */
} TIME_RECORD;
/* hardware access */
HPT_U8 os_inb (void *port);
HPT_U16 os_inw (void *port);
HPT_U32 os_inl (void *port);
void os_outb (void *port, HPT_U8 value);
void os_outw (void *port, HPT_U16 value);
void os_outl (void *port, HPT_U32 value);
void os_insw (void *port, HPT_U16 *buffer, HPT_U32 count);
void os_outsw(void *port, HPT_U16 *buffer, HPT_U32 count);
extern HPT_U32 __dummy_reg; /* to avoid the compiler warning */
#define os_readb(addr) (*(HPT_U8 *)&__dummy_reg = *(volatile HPT_U8 *)(addr))
#define os_readw(addr) (*(HPT_U16 *)&__dummy_reg = *(volatile HPT_U16 *)(addr))
#define os_readl(addr) (*(HPT_U32 *)&__dummy_reg = *(volatile HPT_U32 *)(addr))
#define os_writeb(addr, val) *(volatile HPT_U8 *)(addr) = (HPT_U8)(val)
#define os_writew(addr, val) *(volatile HPT_U16 *)(addr) = (HPT_U16)(val)
#define os_writel(addr, val) *(volatile HPT_U32 *)(addr) = (HPT_U32)(val)
/* PCI configuration space for specified device*/
HPT_U8 os_pci_readb (void *osext, HPT_U8 offset);
HPT_U16 os_pci_readw (void *osext, HPT_U8 offset);
HPT_U32 os_pci_readl (void *osext, HPT_U8 offset);
void os_pci_writeb(void *osext, HPT_U8 offset, HPT_U8 value);
void os_pci_writew(void *osext, HPT_U8 offset, HPT_U16 value);
void os_pci_writel(void *osext, HPT_U8 offset, HPT_U32 value);
/* obsolute interface */
#define MAX_PCI_BUS_NUMBER 0xff
#define MAX_PCI_DEVICE_NUMBER 32
#define MAX_PCI_FUNC_NUMBER 8
#define pcicfg_read_dword(bus, dev, fn, reg) 0xffff
void *os_map_pci_bar(
void *osext,
int index,
HPT_U32 offset,
HPT_U32 length
);
void os_unmap_pci_bar(void *osext, void *base);
#define os_kmap_sgptr(psg) (psg->addr._logical)
#define os_kunmap_sgptr(ptr)
#define os_set_sgptr(psg, ptr) (psg)->addr._logical = (ptr)
/* timer */
void *os_add_timer(void *osext, HPT_U32 microseconds, void (*proc)(void *), void *arg);
void os_del_timer(void *handle);
void os_request_timer(void * osext, HPT_U32 interval);
HPT_TIME os_query_time(void);
/* task */
#define OS_SUPPORT_TASK
typedef struct _OSM_TASK {
struct _OSM_TASK *next;
void (*func)(void *vbus, void *data);
void *data;
}
OSM_TASK;
void os_schedule_task(void *osext, OSM_TASK *task);
/* misc */
HPT_U32 os_get_stamp(void);
void os_stallexec(HPT_U32 microseconds);
#ifndef _SYS_LIBKERN_H_
#define memcpy(dst, src, size) __builtin_memcpy((dst), (src), (size))
#define memcmp(dst, src, size) __builtin_memcmp((dst), (src), (size))
#define strcpy(dst, src) __builtin_strcpy((dst), (src))
static __inline void * memset(void *dst, int c, unsigned long size)
{
char *p;
for (p=(char*)dst; size; size--,p++) *p = c;
return dst;
}
#endif
#define farMemoryCopy(a,b,c) memcpy((char *)(a), (char *)(b), (HPT_U32)c)
#define os_register_device(osext, target_id)
#define os_unregister_device(osext, target_id)
int os_query_remove_device(void *osext, int target_id);
int os_revalidate_device(void *osext, int target_id);
HPT_U8 os_get_vbus_seq(void *osext);
/* debug support */
int os_printk(char *fmt, ...);
#if DBG
extern int hpt_dbg_level;
#define KdPrint(x) do { if (hpt_dbg_level) os_printk x; } while (0)
void __os_dbgbreak(const char *file, int line);
#define os_dbgbreak() __os_dbgbreak(__FILE__, __LINE__)
#define HPT_ASSERT(x) do { if (!(x)) os_dbgbreak(); } while (0)
void os_check_stack(const char *location, int size);
#define HPT_CHECK_STACK(size) os_check_stack(__FUNCTION__, (size))
#else
#define KdPrint(x)
#define HPT_ASSERT(x)
#define HPT_CHECK_STACK(size)
#endif
#define OsPrint(x) do { os_printk x; } while (0)
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +0,0 @@
#include <dev/rr232x/rr232x_config.h>
/****************************************************************************
* config.c - auto-generated file
* $FreeBSD$
****************************************************************************/
#include <dev/rr232x/os_bsd.h>
extern int init_module_him_sx508x(void);
extern int init_module_vdev_raw(void);
extern int init_module_partition(void);
extern int init_module_raid0(void);
extern int init_module_raid1(void);
extern int init_module_raid5(void);
extern int init_module_jbod(void);
int init_config(void)
{
init_module_him_sx508x();
init_module_vdev_raw();
init_module_partition();
init_module_raid0();
init_module_raid1();
init_module_raid5();
init_module_jbod();
return 0;
}
char driver_name[] = "rr232x";
char driver_name_long[] = "RocketRAID 232x controller driver";
char driver_ver[] = "v1.02 (" __DATE__ " " __TIME__ ")";
int osm_max_targets = 0xff;

View File

@ -1,107 +0,0 @@
/*
* $FreeBSD$
*/
#ifndef rr232x_CONFIG_H
#define rr232x_CONFIG_H
#define SUPPORT_ARRAY
#define __KERNEL__ 1
#define DRIVER_MINOR 1
#define TARGETNAME rr232x
#define __dummy_reg rr232x___dummy_reg
#define __ldm_alloc_cmd rr232x___ldm_alloc_cmd
#define dmapool_active rr232x_dmapool_active
#define dmapool_get_page rr232x_dmapool_get_page
#define dmapool_make_order rr232x_dmapool_make_order
#define dmapool_put_page rr232x_dmapool_put_page
#define dmapool_register_client rr232x_dmapool_register_client
#define driver_name rr232x_driver_name
#define driver_name_long rr232x_driver_name_long
#define driver_ver rr232x_driver_ver
#define freelist_get rr232x_freelist_get
#define freelist_get_dma rr232x_freelist_get_dma
#define freelist_put rr232x_freelist_put
#define freelist_put_dma rr232x_freelist_put_dma
#define freelist_reserve rr232x_freelist_reserve
#define freelist_reserve_dma rr232x_freelist_reserve_dma
#define him_handle_to_vbus rr232x_him_handle_to_vbus
#define him_list rr232x_him_list
#define init_config rr232x_init_config
#define init_module_him_sx508x rr232x_init_module_him_sx508x
#define init_module_jbod rr232x_init_module_jbod
#define init_module_partition rr232x_init_module_partition
#define init_module_raid0 rr232x_init_module_raid0
#define init_module_raid1 rr232x_init_module_raid1
#define init_module_raid5 rr232x_init_module_raid5
#define init_module_vdev_raw rr232x_init_module_vdev_raw
#define ldm_acquire_lock rr232x_ldm_acquire_lock
#define ldm_add_spare_to_array rr232x_ldm_add_spare_to_array
#define ldm_alloc_cmds_R_5_34_48_37_16 rr232x_ldm_alloc_cmds_R_5_34_48_37_16
#define ldm_alloc_cmds_from_list rr232x_ldm_alloc_cmds_from_list
#define ldm_check_array_online rr232x_ldm_check_array_online
#define ldm_create_vbus rr232x_ldm_create_vbus
#define ldm_create_vdev rr232x_ldm_create_vdev
#define ldm_event_notify rr232x_ldm_event_notify
#define ldm_find_target rr232x_ldm_find_target
#define ldm_finish_cmd rr232x_ldm_finish_cmd
#define ldm_free_cmds rr232x_ldm_free_cmds
#define ldm_free_cmds_to_list rr232x_ldm_free_cmds_to_list
#define ldm_generic_member_failed rr232x_ldm_generic_member_failed
#define ldm_get_cmd_size rr232x_ldm_get_cmd_size
#define ldm_get_device_id rr232x_ldm_get_device_id
#define ldm_get_mem_info rr232x_ldm_get_mem_info
#define ldm_get_next_vbus rr232x_ldm_get_next_vbus
#define ldm_get_vbus_ext rr232x_ldm_get_vbus_ext
#define ldm_get_vbus_size rr232x_ldm_get_vbus_size
#define ldm_initialize_vbus_async rr232x_ldm_initialize_vbus_async
#define ldm_intr rr232x_ldm_intr
#define ldm_ioctl rr232x_ldm_ioctl
#define ldm_on_timer rr232x_ldm_on_timer
#define ldm_queue_cmd rr232x_ldm_queue_cmd
#define ldm_queue_task rr232x_ldm_queue_task
#define ldm_queue_vbus_dpc rr232x_ldm_queue_vbus_dpc
#define ldm_register_adapter rr232x_ldm_register_adapter
#define ldm_register_device rr232x_ldm_register_device
#define ldm_register_him_R_5_34_48_37_16 rr232x_ldm_register_him_R_5_34_48_37_16
#define ldm_register_vdev_class_R_5_34_48_37_16 rr232x_ldm_register_vdev_class_R_5_34_48_37_16
#define ldm_release_lock rr232x_ldm_release_lock
#define ldm_release_vbus rr232x_ldm_release_vbus
#define ldm_release_vdev rr232x_ldm_release_vdev
#define ldm_remove_timer rr232x_ldm_remove_timer
#define ldm_request_timer rr232x_ldm_request_timer
#define ldm_reset_vbus rr232x_ldm_reset_vbus
#define ldm_resume rr232x_ldm_resume
#define ldm_shutdown rr232x_ldm_shutdown
#define ldm_suspend rr232x_ldm_suspend
#define ldm_sync_array_info rr232x_ldm_sync_array_info
#define ldm_sync_array_stamp rr232x_ldm_sync_array_stamp
#define ldm_timer_probe_device rr232x_ldm_timer_probe_device
#define ldm_unregister_device rr232x_ldm_unregister_device
#define num_drives_per_spinup rr232x_num_drives_per_spinup
#define os_get_stamp rr232x_os_get_stamp
#define os_get_vbus_seq rr232x_os_get_vbus_seq
#define os_inb rr232x_os_inb
#define os_inl rr232x_os_inl
#define os_insw rr232x_os_insw
#define os_inw rr232x_os_inw
#define os_map_pci_bar rr232x_os_map_pci_bar
#define os_outb rr232x_os_outb
#define os_outl rr232x_os_outl
#define os_outsw rr232x_os_outsw
#define os_outw rr232x_os_outw
#define os_pci_readb rr232x_os_pci_readb
#define os_pci_readl rr232x_os_pci_readl
#define os_pci_readw rr232x_os_pci_readw
#define os_pci_writeb rr232x_os_pci_writeb
#define os_pci_writel rr232x_os_pci_writel
#define os_pci_writew rr232x_os_pci_writew
#define os_printk rr232x_os_printk
#define os_query_remove_device rr232x_os_query_remove_device
#define os_query_time rr232x_os_query_time
#define os_request_timer rr232x_os_request_timer
#define os_revalidate_device rr232x_os_revalidate_device
#define os_schedule_task rr232x_os_schedule_task
#define os_stallexec rr232x_os_stallexec
#define os_unmap_pci_bar rr232x_os_unmap_pci_bar
#define osm_max_targets rr232x_osm_max_targets
#define vdev_queue_cmd rr232x_vdev_queue_cmd
#endif

View File

@ -140,7 +140,6 @@ device ciss # Compaq Smart RAID 5*
device dpt # DPT Smartcache III, IV - See NOTES for options
device hptmv # Highpoint RocketRAID 182x
device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx
device rr232x # Highpoint RocketRAID 232x
device iir # Intel Integrated RAID
device ips # IBM (Adaptec) ServeRAID
device mly # Mylex AcceleRAID/eXtremeRAID

View File

@ -737,11 +737,6 @@ device hptmv
# RR2210, RR174x, RR2522, RR231x, RR230x.
device hptrr
#
# Highpoint RocketRAID 232x. This is software RAID but with hardware
# acceleration assistance for RAID_5.
device rr232x
#
# Highpoint RocketRaid 3xxx series SATA RAID
device hptiop

View File

@ -1,14 +0,0 @@
# $Id: Makefile.def,v 1.14 2006/04/06 09:23:49 gmm Exp $
# $FreeBSD$
RR232X= ${.CURDIR}/../../dev/rr232x
.PATH: ${RR232X}
KMOD = rr232x
SRCS = opt_scsi.h opt_cam.h bus_if.h device_if.h pci_if.h os_bsd.h os_bsd.c osm_bsd.c rr232x_config.c
OBJS = rr232x_lib.o
rr232x_lib.o:
uudecode -p < ${RR232X}/$(MACHINE_ARCH)-elf.rr232x_lib.o.uu > ${.TARGET}
.include <bsd.kmod.mk>