📄 i91uscsi.h
字号:
UBYTE HCS_Semaph; /* 0E */ UBYTE HCS_Phase; /* 0F */ UBYTE HCS_JSStatus0; /* 10 */ UBYTE HCS_JSInt; /* 11 */ UBYTE HCS_JSStatus1; /* 12 */ UBYTE HCS_SConf1; /* 13 */ UBYTE HCS_Msg[8]; /* 14 */ SCB *HCS_NxtAvail; /* 1C */ SCB *HCS_Scb; /* 20 */ SCB *HCS_ScbEnd; /* 24 */ SCB *HCS_NxtPend; /* 28 */ SCB *HCS_NxtContig; /* 2C */ SCB *HCS_ActScb; /* 30 */ TCS *HCS_ActTcs; /* 34 */ SCB *HCS_FirstAvail; /* 38 */ SCB *HCS_LastAvail; /* 3C */ SCB *HCS_FirstPend; /* 40 */ SCB *HCS_LastPend; /* 44 */ SCB *HCS_FirstBusy; /* 48 */ SCB *HCS_LastBusy; /* 4C */ SCB *HCS_FirstDone; /* 50 */ SCB *HCS_LastDone; /* 54 */ UBYTE HCS_MaxTags[16]; /* 58 */ UBYTE HCS_ActTags[16]; /* 68 */ TCS HCS_Tcs[MAX_TARGETS]; /* 78 */ ULONG pSRB_head; /* SRB save queue header */ ULONG pSRB_tail; /* SRB save queue tail */#if LINUX_VERSION_CODE >= CVT_LINUX_VERSION(2,1,95) spinlock_t HCS_AvailLock; spinlock_t HCS_SemaphLock; spinlock_t pSRB_lock; /* SRB queue lock */#endif} HCS;/* Bit Definition for HCB_Config */#define HCC_SCSI_RESET 0x01#define HCC_EN_PAR 0x02#define HCC_ACT_TERM1 0x04#define HCC_ACT_TERM2 0x08#define HCC_AUTO_TERM 0x10#define HCC_EN_PWR 0x80/* Bit Definition for HCB_Flags */#define HCF_EXPECT_DISC 0x01#define HCF_EXPECT_SELECT 0x02#define HCF_EXPECT_RESET 0x10#define HCF_EXPECT_DONE_DISC 0x20/****************************************************************** Serial EEProm*******************************************************************/typedef struct _NVRAM_SCSI { /* SCSI channel configuration */ UCHAR NVM_ChSCSIID; /* 0Ch -> Channel SCSI ID */ UCHAR NVM_ChConfig1; /* 0Dh -> Channel config 1 */ UCHAR NVM_ChConfig2; /* 0Eh -> Channel config 2 */ UCHAR NVM_NumOfTarg; /* 0Fh -> Number of SCSI target */ /* SCSI target configuration */ UCHAR NVM_Targ0Config; /* 10h -> Target 0 configuration */ UCHAR NVM_Targ1Config; /* 11h -> Target 1 configuration */ UCHAR NVM_Targ2Config; /* 12h -> Target 2 configuration */ UCHAR NVM_Targ3Config; /* 13h -> Target 3 configuration */ UCHAR NVM_Targ4Config; /* 14h -> Target 4 configuration */ UCHAR NVM_Targ5Config; /* 15h -> Target 5 configuration */ UCHAR NVM_Targ6Config; /* 16h -> Target 6 configuration */ UCHAR NVM_Targ7Config; /* 17h -> Target 7 configuration */ UCHAR NVM_Targ8Config; /* 18h -> Target 8 configuration */ UCHAR NVM_Targ9Config; /* 19h -> Target 9 configuration */ UCHAR NVM_TargAConfig; /* 1Ah -> Target A configuration */ UCHAR NVM_TargBConfig; /* 1Bh -> Target B configuration */ UCHAR NVM_TargCConfig; /* 1Ch -> Target C configuration */ UCHAR NVM_TargDConfig; /* 1Dh -> Target D configuration */ UCHAR NVM_TargEConfig; /* 1Eh -> Target E configuration */ UCHAR NVM_TargFConfig; /* 1Fh -> Target F configuration */} NVRAM_SCSI;typedef struct _NVRAM {/*----------header ---------------*/ USHORT NVM_Signature; /* 0,1: Signature */ UCHAR NVM_Size; /* 2: Size of data structure */ UCHAR NVM_Revision; /* 3: Revision of data structure */ /* ----Host Adapter Structure ---- */ UCHAR NVM_ModelByte0; /* 4: Model number (byte 0) */ UCHAR NVM_ModelByte1; /* 5: Model number (byte 1) */ UCHAR NVM_ModelInfo; /* 6: Model information */ UCHAR NVM_NumOfCh; /* 7: Number of SCSI channel */ UCHAR NVM_BIOSConfig1; /* 8: BIOS configuration 1 */ UCHAR NVM_BIOSConfig2; /* 9: BIOS configuration 2 */ UCHAR NVM_HAConfig1; /* A: Hoat adapter configuration 1 */ UCHAR NVM_HAConfig2; /* B: Hoat adapter configuration 2 */ NVRAM_SCSI NVM_SCSIInfo[2]; UCHAR NVM_reserved[10]; /* ---------- CheckSum ---------- */ USHORT NVM_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_BIOSSCAN 0x10 /* Dynamic BIOS scan */#define NBC1_LUNSUPPORT 0x40 /* Support LUN *//* HA Configuration Byte 1 */#define NHC1_BOOTIDMASK 0x0F /* Boot ID number */#define NHC1_LUNMASK 0x70 /* Boot LUN number */#define NHC1_CHANMASK 0x80 /* Boot Channel number *//* 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 terminator */#define NCC1_PWRMGR 0x80 /* Enable power management *//* Bit definition for SCSI Target configuration byte */#define NTC_DISCONNECT 0x08 /* Enable SCSI disconnect */#define NTC_SYNC 0x10 /* SYNC_NEGO */#define NTC_NO_WDTR 0x20 /* SYNC_NEGO */#define NTC_1GIGA 0x40 /* 255 head / 63 sectors (64/32) */#define NTC_SPINUP 0x80 /* Start disk drive *//* Default NVRam values */#define INI_SIGNATURE 0xC925#define NBC1_DEFAULT (NBC1_ENABLE)#define NCC1_DEFAULT (NCC1_BUSRESET | NCC1_AUTOTERM | NCC1_PARITYCHK)#define NTC_DEFAULT (NTC_NO_WDTR | NTC_1GIGA | NTC_DISCONNECT)/* SCSI related definition */#define DISC_NOT_ALLOW 0x80 /* Disconnect is not allowed */#define DISC_ALLOW 0xC0 /* Disconnect is allowed */#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 4typedef 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 { unsigned char RegNum; unsigned char DeviceNum; unsigned short Reserved; } sHostAdr; unsigned long lHostAdr;} HOST_ADR;typedef struct _HCSinfo { ULONG base; UCHAR vec; UCHAR bios; /* High byte of BIOS address */ USHORT BaseAndBios; /* high byte: pHcsInfo->bios,low byte:pHcsInfo->base */} HCSINFO;#define TUL_RD(x,y) (UCHAR)(inb( (int)((ULONG)(x+y)) ))#define TUL_RDLONG(x,y) (ULONG)(inl((int)((ULONG)(x+y)) ))#define TUL_WR( adr,data) outb( (UCHAR)(data), (int)(adr))#define TUL_WRSHORT(adr,data) outw( (UWORD)(data), (int)(adr))#define TUL_WRLONG( adr,data) outl( (ULONG)(data), (int)(adr))#define SCSI_ABORT_SNOOZE 0#define SCSI_ABORT_SUCCESS 1#define SCSI_ABORT_PENDING 2#define SCSI_ABORT_BUSY 3#define SCSI_ABORT_NOT_RUNNING 4#define SCSI_ABORT_ERROR 5#define SCSI_RESET_SNOOZE 0#define SCSI_RESET_PUNT 1#define SCSI_RESET_SUCCESS 2#define SCSI_RESET_PENDING 3#define SCSI_RESET_WAKEUP 4#define SCSI_RESET_NOT_RUNNING 5#define SCSI_RESET_ERROR 6#define SCSI_RESET_SYNCHRONOUS 0x01#define SCSI_RESET_ASYNCHRONOUS 0x02#define SCSI_RESET_SUGGEST_BUS_RESET 0x04#define SCSI_RESET_SUGGEST_HOST_RESET 0x08#define SCSI_RESET_BUS_RESET 0x100#define SCSI_RESET_HOST_RESET 0x200#define SCSI_RESET_ACTION 0xff
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -