📄 i950.h
字号:
/*************************************************************************
Copyright (c) 1994-1995 Initio Corp.
Initio Windows NT/95/97 device driver are copyrighted by Initio Corporation.
Your rights of ownership are subject to the limitations and restrictions
imposed by the copyright laws. Initio makes no warranty of any kind in
regard to this material, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose.
Initio is not liable for any errors contained herein or incidental or
consequential damages in connection with furnishing, performance or use
of this material.
-----------------------------------------------------------------------
Module: i950.h
Description: winNT/win95/win97 mini port driver
History: 02/27/97 TC ver 2.04 release to Microsoft Memphis team
03/11/97 TC ver 2.05 delete MAX_PCI_CHANL,Since _HW_DEVICE_EXTENSION
is allocated by OS, so Windows NT and Windows 95 can
to support unlimited PCI chanl and 9400 crad
03/26/97 TC add LinkList support
*************************************************************************/
#ifndef _I950_H_
#define _I950_H_
#include "miniport.h" /* from NT DDK */
#include "scsi.h" /* from NT DDK */
#define TULDBG 0
#define DISABLE_ISA 0
#define LINKLIST 1
#define SG_SUPPORT 1
#define TAG_QUEUING 1
#define ULONG unsigned long
#define ulong unsigned long
#define uint unsigned long
#define USHORT unsigned short
#define ushort unsigned short
#define UWORD unsigned short
#define uword unsigned short
#define UCHAR unsigned char
#define uchar unsigned char
#define UBYTE unsigned char
#define ubyte unsigned char
#ifndef NULL
#define NULL 0 /* zero */
#endif
#ifndef TRUE
#define TRUE (1) /* boolean true */
#endif
#ifndef FALSE
#define FALSE (0) /* boolean false */
#endif
#define isodd_word( val ) ( ( ( ( uint )val) & ( uint )0x0001 ) != 0 )
/******************************************************************
Serial EEProm
*******************************************************************/
/* bit definition for TUL_SE2 */
#define SE2CS 0x008
#define SE2CLK 0x004
#define SE2DO 0x002
#define SE2DI 0x001
typedef struct _NVRAM {
/*----------header ---------------*/
USHORT Signature; /* 0,1: Signature */
UCHAR Size; /* 2: Size of data structure */
UCHAR Revision; /* 3: Revision of data structure */
/* ----Host Adapter Structure ----*/
UCHAR ModelByte0; /* 4: Model number (byte 0) */
UCHAR ModelByte1; /* 5: Model number (byte 1) */
UCHAR ModelInfo; /* 6: Model information */
UCHAR NumOfCh; /* 7: Number of SCSI channel*/
UCHAR BIOSConfig1; /* 8: BIOS configuration 1 */
UCHAR BIOSConfig2; /* 9: BIOS configuration 2 */
UCHAR HAConfig1; /* A: Hoat adapter configuration 1 */
UCHAR HAConfig2; /* B: Hoat adapter configuration 2 */
/* ----SCSI channel Structure ---- */
/* from "CTRL-I SCSI Host Adapter SetUp menu " */
UCHAR SCSIid; /* C: Channel SCSIId; */
UCHAR SCSIconfig1; /* D: Channel SCSI config 1 */
UCHAR SCSIconfig2; /* E: Channel SCSI config 2 */
UCHAR NumSCSItarget; /* F: # of SCSI target */
/* ----SCSI target Structure ---- */
/* from "CTRL-I SCSI device SetUp menu " */
UCHAR Target0Config; /* 0x10:Target 0 configuration */
UCHAR Target1Config; /* 0x11:Target 1 configuration */
UCHAR Target2Config; /* 0x12:Target 2 configuration */
UCHAR Target3Config; /* 0x13:Target 3 configuration */
UCHAR Target4Config; /* 0x14:Target 4 configuration */
UCHAR Target5Config; /* 0x15:Target 5 configuration */
UCHAR Target6Config; /* 0x16:Target 6 configuration */
UCHAR Target7Config; /* 0x17:Target 7 configuration */
UCHAR reserved[38]; /* for SCSI channel 1-3 */
/* ---------- CheckSum ---------- */
USHORT CheckSum; /* 0x3E, 0x3F: Checksum of NVRam */
} NVRAM, *PNVRAM;
/* Bios Configuration for nvram->BIOSConfig1 */
#define NBC1_ENABLE 0x01 /* BIOS enable */
#define NBC1_8DRIVE 0x02 /* Support more than 2 drives */
#define NBC1_REMOVABLE 0x04 /* Support removable drive */
#define NBC1_INT19 0x08 /* Intercept int 19h */
#define NBC1_NOBIOSSCAN 0x10 /* Dynamic BIOS scan */
#define NBC1_DISCONNECT 0x20 /* Enable SCSI disconnect */
/* Bit definition for nvram->SCSIconfig1 */
#define NCC1_BUSRESET 0x01 /* Reset SCSI bus at power up */
#define NCC1_PARITYCHK 0x02 /* SCSI parity enable */
#define NCC1_ACTTERM1 0x04 /* Enable active terminator 1 */
#define NCC1_ACTTERM2 0x08 /* Enable active terminator 2 */
#define NCC1_AUTOTERM 0x10 /* Enable auto termination */
#define NCC1_PWRMGR 0x80 /* Enable power management */
/* Bit definition for nvram->TargetxConfig */
#define NTC_SYNC 0x01 /* SYNC_NEGO */
#define NTC_FASTSCSI 0x02 /* Fast SCSI */
#define NTC_1GIGA 0x04 /* 255 head / 63 sectors (64/32) */
#define NTC_SPINUP 0x08 /* Start disk drive */
#define NTC_NOBIOSSCAN 0x10 /* Under dynamic BIOS scan */
/* Default NVRam values */
#define INI_SIGNATURE 0xC925
#define NBC1_DEFAULT (NBC1_ENABLE | NBC1_NOBIOSSCAN)
#define NCC1_DEFAULT (NCC1_BUSRESET | NCC1_ACTTERM1 |NCC1_ACTTERM2 | NCC1_AUTOTERM | NCC1_PARITYCHK)
#define NTC_DEFAULT (NTC_FASTSCSI | NTC_SPINUP)
/* SCSI related definition */
#define DISC_ALLOW 0x40
#define SCSICMD_RequestSense 0x03
/*------------------------------------------------------------------*/
/* PCI */
/*------------------------------------------------------------------*/
#define PCI_FUNCTION_ID 0xB1
#define PCI_BIOS_PRESENT 0x01
#define FIND_PCI_DEVICE 0x02
#define FIND_PCI_CLASS_CODE 0x03
#define GENERATE_SPECIAL_CYCLE 0x06
#define READ_CONFIG_BYTE 0x08
#define READ_CONFIG_WORD 0x09
#define READ_CONFIG_DWORD 0x0A
#define WRITE_CONFIG_BYTE 0x0B
#define WRITE_CONFIG_WORD 0x0C
#define WRITE_CONFIG_DWORD 0x0D
#define SUCCESSFUL 0x00
#define FUNC_NOT_SUPPORTED 0x81
#define BAD_VENDOR_ID 0x83 /* Bad vendor ID */
#define DEVICE_NOT_FOUND 0x86 /* PCI device not found */
#define BAD_REGISTER_NUMBER 0x87
#define MAX_PCI_DEVICES 21 /* Maximum devices supportted */
/* #define MAX_PCI_CHANL 12 support 3 ini-9400 */
#define BYTE unsigned char
#define WORD unsigned short
#define DWORD unsigned long
typedef void(* CALL_FUNCTION)(); /* Function type */
typedef struct _BIOS32_ENTRY_STRUCTURE {
DWORD Signatures; /* Should be "_32_" */
DWORD BIOS32Entry; /* 32-bit physical address */
BYTE Revision; /* Revision level, should be 0 */
BYTE Length; /* Multiply of 16, should be 1 */
BYTE CheckSum; /* Checksum of whole structure */
BYTE Reserved[5]; /* Reserved */
} BIOS32_ENTRY_STRUCTURE, *PBIOS32_ENTRY_STRUCTURE;
typedef struct
{
union
{
unsigned int eax;
struct
{
unsigned short ax;
} word;
struct
{
unsigned char al;
unsigned char ah;
} byte;
} eax;
union
{
unsigned int ebx;
struct
{
unsigned short bx;
} word;
struct
{
unsigned char bl;
unsigned char bh;
} byte;
} ebx;
union
{
unsigned int ecx;
struct
{
unsigned short cx;
} word;
struct
{
unsigned char cl;
unsigned char ch;
} byte;
} ecx;
union
{
unsigned int edx;
struct
{
unsigned short dx;
} word;
struct
{
unsigned char dl;
unsigned char dh;
} byte;
} edx;
union
{
unsigned int edi;
struct
{
unsigned short di;
} word;
} edi;
union
{
unsigned int esi;
struct
{
unsigned short si;
} word;
} esi;
} REGS;
typedef union /* Union define for mechanism 1 */
{
struct
{
unsigned char RegNum;
unsigned char FcnNum:3;
unsigned char DeviceNum:5;
unsigned char BusNum;
unsigned char Reserved:7;
unsigned char Enable:1;
} sConfigAdr;
unsigned long lConfigAdr;
} CONFIG_ADR;
typedef union /* Union define for mechanism 2 */
{
struct
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -