⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 buslogic.h

📁 讲述linux的初始化过程
💻 H
📖 第 1 页 / 共 4 页
字号:
/*  Linux Driver for BusLogic MultiMaster and FlashPoint SCSI Host Adapters  Copyright 1995-1998 by Leonard N. Zubkoff <lnz@dandelion.com>  This program is free software; you may redistribute and/or modify it under  the terms of the GNU General Public License Version 2 as published by the  Free Software Foundation.  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 complete details.  The author respectfully requests that any modifications to this software be  sent directly to him for evaluation and testing.  Special thanks to Wayne Yen, Jin-Lon Hon, and Alex Win of BusLogic, whose  advice has been invaluable, to David Gentzel, for writing the original Linux  BusLogic driver, and to Paul Gortmaker, for being such a dedicated test site.  Finally, special thanks to Mylex/BusLogic for making the FlashPoint SCCB  Manager available as freely redistributable source code.*/#include <linux/config.h>/*  Define types for some of the structures that interface with the rest  of the Linux Kernel and SCSI Subsystem.*/typedef kdev_t KernelDevice_T;typedef unsigned long ProcessorFlags_T;typedef struct pt_regs Registers_T;typedef struct partition PartitionTable_T;typedef struct pci_dev PCI_Device_T;typedef Scsi_Host_Template SCSI_Host_Template_T;typedef struct Scsi_Host SCSI_Host_T;typedef struct scsi_device SCSI_Device_T;typedef struct scsi_disk SCSI_Disk_T;typedef struct scsi_cmnd SCSI_Command_T;typedef struct scatterlist SCSI_ScatterList_T;/*  Define prototypes for the BusLogic Driver Interface Functions.*/extern const char *BusLogic_DriverInfo(SCSI_Host_T *);extern int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *);extern int BusLogic_ReleaseHostAdapter(SCSI_Host_T *);extern int BusLogic_QueueCommand(SCSI_Command_T *,				 void (*CompletionRoutine)(SCSI_Command_T *));extern int BusLogic_AbortCommand(SCSI_Command_T *);extern int BusLogic_ResetCommand(SCSI_Command_T *, unsigned int);extern int BusLogic_BIOSDiskParameters(SCSI_Disk_T *, KernelDevice_T, int *);extern int BusLogic_ProcDirectoryInfo(char *, char **, off_t, int, int, int);/*  Define the BusLogic SCSI Host Template structure.*/#define BUSLOGIC							       \  { proc_name:      "BusLogic",			  /* ProcFS Directory Entry */ \    proc_info:      BusLogic_ProcDirectoryInfo,	  /* ProcFS Info Function   */ \    name:           "BusLogic",			  /* Driver Name            */ \    detect:         BusLogic_DetectHostAdapter,	  /* Detect Host Adapter    */ \    release:        BusLogic_ReleaseHostAdapter,  /* Release Host Adapter   */ \    info:           BusLogic_DriverInfo,	  /* Driver Info Function   */ \    queuecommand:   BusLogic_QueueCommand,	  /* Queue Command Function */ \    abort:          BusLogic_AbortCommand,	  /* Abort Command Function */ \    reset:          BusLogic_ResetCommand,	  /* Reset Command Function */ \    bios_param:     BusLogic_BIOSDiskParameters,  /* BIOS Disk Parameters   */ \    unchecked_isa_dma: 1,			  /* Default Initial Value  */ \    use_clustering: ENABLE_CLUSTERING }		  /* Enable Clustering	    *//*  BusLogic_DriverVersion protects the private portion of this file.*/#ifdef BusLogic_DriverVersion/*  FlashPoint support is only available for the Intel x86 Architecture with  CONFIG_PCI set.*/#ifndef __i386__#undef CONFIG_SCSI_OMIT_FLASHPOINT#define CONFIG_SCSI_OMIT_FLASHPOINT#endif#ifndef CONFIG_PCI#undef CONFIG_SCSI_OMIT_FLASHPOINT#define CONFIG_SCSI_OMIT_FLASHPOINT#define BusLogic_InitializeProbeInfoListISA \  BusLogic_InitializeProbeInfoList#endif/*  Define the maximum number of BusLogic Host Adapters supported by this driver.*/#define BusLogic_MaxHostAdapters		16/*  Define the maximum number of Target Devices supported by this driver.*/#define BusLogic_MaxTargetDevices		16/*  Define the maximum number of Scatter/Gather Segments used by this driver.  For optimal performance, it is important that this limit be at least as  large as the largest single request generated by the I/O Subsystem.*/#define BusLogic_ScatterGatherLimit		128/*  Define the maximum, maximum automatic, minimum automatic, and default Queue  Depth to allow for Target Devices depending on whether or not they support  Tagged Queuing and whether or not ISA Bounce Buffers are required.*/#define BusLogic_MaxTaggedQueueDepth		64#define BusLogic_MaxAutomaticTaggedQueueDepth	28#define BusLogic_MinAutomaticTaggedQueueDepth	7#define BusLogic_TaggedQueueDepthBB		3#define BusLogic_UntaggedQueueDepth		3#define BusLogic_UntaggedQueueDepthBB		2/*  Define the default amount of time in seconds to wait between a Host Adapter  Hard Reset which initiates a SCSI Bus Reset and issuing any SCSI commands.  Some SCSI devices get confused if they receive SCSI commands too soon after  a SCSI Bus Reset.*/#define BusLogic_DefaultBusSettleTime		2/*  Define the maximum number of Mailboxes that should be used for MultiMaster  Host Adapters.  This number is chosen to be larger than the maximum Host  Adapter Queue Depth and small enough so that the Host Adapter structure  does not cross an allocation block size boundary.*/#define BusLogic_MaxMailboxes			211/*  Define the number of CCBs that should be allocated as a group to optimize  Kernel memory allocation.*/#define BusLogic_CCB_AllocationGroupSize	7/*  Define the Host Adapter Line and Message Buffer Sizes.*/#define BusLogic_LineBufferSize			100#define BusLogic_MessageBufferSize		9700/*  Define the Driver Message Levels.*/typedef enum BusLogic_MessageLevel{  BusLogic_AnnounceLevel =			0,  BusLogic_InfoLevel =				1,  BusLogic_NoticeLevel =			2,  BusLogic_WarningLevel =			3,  BusLogic_ErrorLevel =				4}BusLogic_MessageLevel_T;static char  *BusLogic_MessageLevelMap[] =    { KERN_NOTICE, KERN_NOTICE, KERN_NOTICE, KERN_WARNING, KERN_ERR };/*  Define Driver Message macros.*/#define BusLogic_Announce(Format, Arguments...) \  BusLogic_Message(BusLogic_AnnounceLevel, Format, ##Arguments)#define BusLogic_Info(Format, Arguments...) \  BusLogic_Message(BusLogic_InfoLevel, Format, ##Arguments)#define BusLogic_Notice(Format, Arguments...) \  BusLogic_Message(BusLogic_NoticeLevel, Format, ##Arguments)#define BusLogic_Warning(Format, Arguments...) \  BusLogic_Message(BusLogic_WarningLevel, Format, ##Arguments)#define BusLogic_Error(Format, Arguments...) \  BusLogic_Message(BusLogic_ErrorLevel, Format, ##Arguments)/*  Define the types of BusLogic Host Adapters that are supported and the number  of I/O Addresses required by each type.*/typedef enum{  BusLogic_MultiMaster =			1,  BusLogic_FlashPoint =				2}__attribute__ ((packed))BusLogic_HostAdapterType_T;#define BusLogic_MultiMasterAddressCount	4#define BusLogic_FlashPointAddressCount		256static int  BusLogic_HostAdapterAddressCount[3] =    { 0, BusLogic_MultiMasterAddressCount, BusLogic_FlashPointAddressCount };/*  Define macros for testing the Host Adapter Type.*/#ifndef CONFIG_SCSI_OMIT_FLASHPOINT#define BusLogic_MultiMasterHostAdapterP(HostAdapter) \  (HostAdapter->HostAdapterType == BusLogic_MultiMaster)#define BusLogic_FlashPointHostAdapterP(HostAdapter) \  (HostAdapter->HostAdapterType == BusLogic_FlashPoint)#else#define BusLogic_MultiMasterHostAdapterP(HostAdapter) \  (true)#define BusLogic_FlashPointHostAdapterP(HostAdapter) \  (false)#endif/*  Define the possible Host Adapter Bus Types.*/typedef enum{  BusLogic_Unknown_Bus =			0,  BusLogic_ISA_Bus =				1,  BusLogic_EISA_Bus =				2,  BusLogic_PCI_Bus =				3,  BusLogic_VESA_Bus =				4,  BusLogic_MCA_Bus =				5}__attribute__ ((packed))BusLogic_HostAdapterBusType_T;static char  *BusLogic_HostAdapterBusNames[] =    { "Unknown", "ISA", "EISA", "PCI", "VESA", "MCA" };static BusLogic_HostAdapterBusType_T  BusLogic_HostAdapterBusTypes[] =    { BusLogic_VESA_Bus,				/* BT-4xx */      BusLogic_ISA_Bus,					/* BT-5xx */      BusLogic_MCA_Bus,					/* BT-6xx */      BusLogic_EISA_Bus,				/* BT-7xx */      BusLogic_Unknown_Bus,				/* BT-8xx */      BusLogic_PCI_Bus };				/* BT-9xx *//*  Define the possible Host Adapter BIOS Disk Geometry Translations.*/typedef enum BusLogic_BIOS_DiskGeometryTranslation{  BusLogic_BIOS_Disk_Not_Installed =		0,  BusLogic_BIOS_Disk_Installed_64x32 =		1,  BusLogic_BIOS_Disk_Installed_128x32 =		2,  BusLogic_BIOS_Disk_Installed_255x63 =		3}__attribute__ ((packed))BusLogic_BIOS_DiskGeometryTranslation_T;/*  Define a Boolean data type.*/typedef enum { false, true } __attribute__ ((packed)) boolean;/*  Define a 32 bit I/O Address data type.*/typedef unsigned int BusLogic_IO_Address_T;/*  Define a 32 bit PCI Bus Address data type.*/typedef unsigned int BusLogic_PCI_Address_T;/*  Define a 32 bit Base Address data type.*/typedef unsigned int BusLogic_Base_Address_T;/*  Define a 32 bit Bus Address data type.*/typedef unsigned int BusLogic_BusAddress_T;/*  Define a 32 bit Byte Count data type.*/typedef unsigned int BusLogic_ByteCount_T;/*  Define a 10^18 Statistics Byte Counter data type.*/typedef struct BusLogic_ByteCounter{  unsigned int Units;  unsigned int Billions;}BusLogic_ByteCounter_T;/*  Define the structure for I/O Address and Bus Probing Information.*/typedef struct BusLogic_ProbeInfo{  BusLogic_HostAdapterType_T HostAdapterType;  BusLogic_HostAdapterBusType_T HostAdapterBusType;  BusLogic_IO_Address_T IO_Address;  BusLogic_PCI_Address_T PCI_Address;  unsigned char Bus;  unsigned char Device;  unsigned char IRQ_Channel;}BusLogic_ProbeInfo_T;/*  Define the Probe Options.*/typedef struct BusLogic_ProbeOptions{  boolean NoProbe:1;					/* Bit 0 */  boolean NoProbeISA:1;					/* Bit 1 */  boolean NoProbePCI:1;					/* Bit 2 */  boolean NoSortPCI:1;					/* Bit 3 */  boolean MultiMasterFirst:1;				/* Bit 4 */  boolean FlashPointFirst:1;				/* Bit 5 */  boolean LimitedProbeISA:1;				/* Bit 6 */  boolean Probe330:1;					/* Bit 7 */  boolean Probe334:1;					/* Bit 8 */  boolean Probe230:1;					/* Bit 9 */  boolean Probe234:1;					/* Bit 10 */  boolean Probe130:1;					/* Bit 11 */  boolean Probe134:1;					/* Bit 12 */}BusLogic_ProbeOptions_T;/*  Define the Global Options.*/typedef struct BusLogic_GlobalOptions{  boolean TraceProbe:1;					/* Bit 0 */  boolean TraceHardwareReset:1;				/* Bit 1 */  boolean TraceConfiguration:1;				/* Bit 2 */  boolean TraceErrors:1;				/* Bit 3 */}BusLogic_GlobalOptions_T;/*  Define the Local Options.*/typedef struct BusLogic_LocalOptions{  boolean InhibitTargetInquiry:1;			/* Bit 0 */}BusLogic_LocalOptions_T;/*  Define the Error Recovery Strategy Options.*/typedef enum{  BusLogic_ErrorRecovery_Default =		0,  BusLogic_ErrorRecovery_BusDeviceReset =	1,  BusLogic_ErrorRecovery_HardReset =		2,  BusLogic_ErrorRecovery_None =			3}__attribute__ ((packed))BusLogic_ErrorRecoveryStrategy_T;static char  *BusLogic_ErrorRecoveryStrategyNames[] =    { "Default", "Bus Device Reset", "Hard Reset", "None" },  BusLogic_ErrorRecoveryStrategyLetters[] =    { 'D', 'B', 'H', 'N' };/*  Define the BusLogic SCSI Host Adapter I/O Register Offsets.*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -