📄 inia100.h
字号:
/************************************************************************** * Initio A100 device driver for Linux. * * Copyright (c) 1994-1998 Initio Corporation * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * * -------------------------------------------------------------------------- * * 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, * without modification, immediately at the beginning of the file. * 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. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * Where this Software is combined with software released under the terms of * the GNU General Public License ("GPL") and the terms of the GPL would require the * combined work to also be released under the terms of the GPL, the terms * and conditions of this License will apply in addition to those of the * GPL with the exception of any terms or conditions of this License that * conflict with, or are expressly prohibited by, the GPL. * * 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. * ************************************************************************** * * Module: inia100.h * Description: INI-A100U2W LINUX device driver header * Revision History: * 06/18/98 HL, Initial production Version 1.02 * 12/19/98 bv, Use spinlocks for 2.1.95 and up ****************************************************************************/#ifndef CVT_LINUX_VERSION#define CVT_LINUX_VERSION(V,P,S) (((V) * 65536) + ((P) * 256) + (S))#endif#ifndef LINUX_VERSION_CODE#include <linux/version.h>#endif#include <linux/types.h>#include "sd.h"extern int inia100_detect(Scsi_Host_Template *);extern int inia100_release(struct Scsi_Host *);extern int inia100_command(Scsi_Cmnd *);extern int inia100_queue(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));extern int inia100_abort(Scsi_Cmnd *);extern int inia100_reset(Scsi_Cmnd *, unsigned int);extern int inia100_biosparam(Scsi_Disk *, kdev_t, int *); /*for linux v2.0 */#define inia100_REVID "Initio INI-A100U2W SCSI device driver; Revision: 1.02c"#define INIA100 { \ next: NULL, \ module: NULL, \ proc_name: "INIA100", \ proc_info: NULL, \ name: inia100_REVID, \ detect: inia100_detect, \ release: inia100_release, \ info: NULL, \ command: inia100_command, \ queuecommand: inia100_queue, \ eh_strategy_handler: NULL, \ eh_abort_handler: NULL, \ eh_device_reset_handler: NULL, \ eh_bus_reset_handler: NULL, \ eh_host_reset_handler: NULL, \ abort: inia100_abort, \ reset: inia100_reset, \ slave_attach: NULL, \ bios_param: inia100_biosparam, \ can_queue: 1, \ this_id: 1, \ sg_tablesize: SG_ALL, \ cmd_per_lun: 1, \ present: 0, \ unchecked_isa_dma: 0, \ use_clustering: ENABLE_CLUSTERING, \ use_new_eh_code: 0 \}#define VIRT_TO_BUS(i) (unsigned int) virt_to_bus((void *)(i))#define ULONG unsigned long#define PVOID void *#define USHORT unsigned short#define UCHAR unsigned char#define BYTE unsigned char#define WORD unsigned short#define DWORD unsigned long#define UBYTE unsigned char#define UWORD unsigned short#define UDWORD unsigned long#define U32 u32#ifndef NULL#define NULL 0 /* zero */#endif#ifndef TRUE#define TRUE (1) /* boolean true */#endif#ifndef FALSE#define FALSE (0) /* boolean false */#endif#ifndef FAILURE#define FAILURE (-1)#endif#if 1#define ORC_MAXQUEUE 245#else#define ORC_MAXQUEUE 25#endif#define TOTAL_SG_ENTRY 32#define MAX_TARGETS 16#define IMAX_CDB 15#define SENSE_SIZE 14#define MAX_SUPPORTED_ADAPTERS 4#define SUCCESSFUL 0x00#define I920_DEVICE_ID 0x0002 /* Initio's inic-950 product ID *//************************************************************************//* Scatter-Gather Element Structure *//************************************************************************/typedef struct ORC_SG_Struc { U32 SG_Ptr; /* Data Pointer */ U32 SG_Len; /* Data Length */} ORC_SG;/* SCSI related definition */#define DISC_NOT_ALLOW 0x80 /* Disconnect is not allowed */#define DISC_ALLOW 0xC0 /* Disconnect is allowed */#define ORC_OFFSET_SCB 16#define ORC_MAX_SCBS 250#define MAX_CHANNELS 2#define MAX_ESCB_ELE 64#define TCF_DRV_255_63 0x0400/********************************************************//* Orchid Configuration Register Set *//********************************************************/#define ORC_PVID 0x00 /* Vendor ID */#define ORC_VENDOR_ID 0x1101 /* Orchid vendor ID */#define ORC_PDID 0x02 /* Device ID */#define ORC_DEVICE_ID 0x1060 /* Orchid device ID */#define ORC_COMMAND 0x04 /* Command */#define BUSMS 0x04 /* BUS MASTER Enable */#define IOSPA 0x01 /* IO Space Enable */#define ORC_STATUS 0x06 /* Status register */#define ORC_REVISION 0x08 /* Revision number */#define ORC_BASE 0x10 /* Base address */#define ORC_BIOS 0x50 /* Expansion ROM base address */#define ORC_INT_NUM 0x3C /* Interrupt line */#define ORC_INT_PIN 0x3D /* Interrupt pin *//********************************************************//* Orchid Host Command Set *//********************************************************/#define ORC_CMD_NOP 0x00 /* Host command - NOP */#define ORC_CMD_VERSION 0x01 /* Host command - Get F/W version */#define ORC_CMD_ECHO 0x02 /* Host command - ECHO */#define ORC_CMD_SET_NVM 0x03 /* Host command - Set NVRAM */#define ORC_CMD_GET_NVM 0x04 /* Host command - Get NVRAM */#define ORC_CMD_GET_BUS_STATUS 0x05 /* Host command - Get SCSI bus status */#define ORC_CMD_ABORT_SCB 0x06 /* Host command - Abort SCB */#define ORC_CMD_ISSUE_SCB 0x07 /* Host command - Issue SCB *//********************************************************//* Orchid Register Set *//********************************************************/#define ORC_GINTS 0xA0 /* Global Interrupt Status */#define QINT 0x04 /* Reply Queue Interrupt */#define ORC_GIMSK 0xA1 /* Global Interrupt MASK */#define MQINT 0x04 /* Mask Reply Queue Interrupt */#define ORC_GCFG 0xA2 /* Global Configure */#define EEPRG 0x01 /* Enable EEPROM programming */#define ORC_GSTAT 0xA3 /* Global status */#define WIDEBUS 0x10 /* Wide SCSI Devices connected */#define ORC_HDATA 0xA4 /* Host Data */#define ORC_HCTRL 0xA5 /* Host Control */#define SCSIRST 0x80 /* SCSI bus reset */#define HDO 0x40 /* Host data out */#define HOSTSTOP 0x02 /* Host stop RISC engine */#define DEVRST 0x01 /* Device reset */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -