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

📄 buslogic.h

📁 Linux Kernel 2.6.9 for OMAP1710
💻 H
📖 第 1 页 / 共 3 页
字号:
	unsigned char CommonQueueDepth;	unsigned char QueueDepth[BusLogic_MaxTargetDevices];};/*  Define the Host Adapter Target Flags structure.*/struct BusLogic_TargetFlags {	boolean TargetExists:1;	boolean TaggedQueuingSupported:1;	boolean WideTransfersSupported:1;	boolean TaggedQueuingActive:1;	boolean WideTransfersActive:1;	boolean CommandSuccessfulFlag:1;	boolean TargetInfoReported:1;};/*  Define the Host Adapter Target Statistics structure.*/#define BusLogic_SizeBuckets			10typedef unsigned int BusLogic_CommandSizeBuckets_T[BusLogic_SizeBuckets];struct BusLogic_TargetStatistics {	unsigned int CommandsAttempted;	unsigned int CommandsCompleted;	unsigned int ReadCommands;	unsigned int WriteCommands;	struct BusLogic_ByteCounter TotalBytesRead;	struct BusLogic_ByteCounter TotalBytesWritten;	BusLogic_CommandSizeBuckets_T ReadCommandSizeBuckets;	BusLogic_CommandSizeBuckets_T WriteCommandSizeBuckets;	unsigned short CommandAbortsRequested;	unsigned short CommandAbortsAttempted;	unsigned short CommandAbortsCompleted;	unsigned short BusDeviceResetsRequested;	unsigned short BusDeviceResetsAttempted;	unsigned short BusDeviceResetsCompleted;	unsigned short HostAdapterResetsRequested;	unsigned short HostAdapterResetsAttempted;	unsigned short HostAdapterResetsCompleted;};/*  Define the FlashPoint Card Handle data type.*/#define FlashPoint_BadCardHandle		0xFFFFFFFFtypedef unsigned int FlashPoint_CardHandle_T;/*  Define the FlashPoint Information structure.  This structure is defined  by the FlashPoint SCCB Manager.*/struct FlashPoint_Info {	u32 BaseAddress;	/* Bytes 0-3 */	boolean Present;	/* Byte 4 */	unsigned char IRQ_Channel;	/* Byte 5 */	unsigned char SCSI_ID;	/* Byte 6 */	unsigned char SCSI_LUN;	/* Byte 7 */	unsigned short FirmwareRevision;	/* Bytes 8-9 */	unsigned short SynchronousPermitted;	/* Bytes 10-11 */	unsigned short FastPermitted;	/* Bytes 12-13 */	unsigned short UltraPermitted;	/* Bytes 14-15 */	unsigned short DisconnectPermitted;	/* Bytes 16-17 */	unsigned short WidePermitted;	/* Bytes 18-19 */	boolean ParityCheckingEnabled:1;	/* Byte 20 Bit 0 */	boolean HostWideSCSI:1;	/* Byte 20 Bit 1 */	boolean HostSoftReset:1;	/* Byte 20 Bit 2 */	boolean ExtendedTranslationEnabled:1;	/* Byte 20 Bit 3 */	boolean LowByteTerminated:1;	/* Byte 20 Bit 4 */	boolean HighByteTerminated:1;	/* Byte 20 Bit 5 */	boolean ReportDataUnderrun:1;	/* Byte 20 Bit 6 */	boolean SCAM_Enabled:1;	/* Byte 20 Bit 7 */	boolean SCAM_Level2:1;	/* Byte 21 Bit 0 */	unsigned char:7;	/* Byte 21 Bits 1-7 */	unsigned char Family;	/* Byte 22 */	unsigned char BusType;	/* Byte 23 */	unsigned char ModelNumber[3];	/* Bytes 24-26 */	unsigned char RelativeCardNumber;	/* Byte 27 */	unsigned char Reserved[4];	/* Bytes 28-31 */	unsigned int OS_Reserved;	/* Bytes 32-35 */	unsigned char TranslationInfo[4];	/* Bytes 36-39 */	unsigned int Reserved2[5];	/* Bytes 40-59 */	unsigned int SecondaryRange;	/* Bytes 60-63 */};/*  Define the BusLogic Driver Host Adapter structure.*/struct BusLogic_HostAdapter {	struct Scsi_Host *SCSI_Host;	struct pci_dev *PCI_Device;	enum BusLogic_HostAdapterType HostAdapterType;	enum BusLogic_HostAdapterBusType HostAdapterBusType;	unsigned long IO_Address;	unsigned long PCI_Address;	unsigned short AddressCount;	unsigned char HostNumber;	unsigned char ModelName[9];	unsigned char FirmwareVersion[6];	unsigned char FullModelName[18];	unsigned char Bus;	unsigned char Device;	unsigned char IRQ_Channel;	unsigned char DMA_Channel;	unsigned char SCSI_ID;	boolean IRQ_ChannelAcquired:1;	boolean DMA_ChannelAcquired:1;	boolean ExtendedTranslationEnabled:1;	boolean ParityCheckingEnabled:1;	boolean BusResetEnabled:1;	boolean LevelSensitiveInterrupt:1;	boolean HostWideSCSI:1;	boolean HostDifferentialSCSI:1;	boolean HostSupportsSCAM:1;	boolean HostUltraSCSI:1;	boolean ExtendedLUNSupport:1;	boolean TerminationInfoValid:1;	boolean LowByteTerminated:1;	boolean HighByteTerminated:1;	boolean BounceBuffersRequired:1;	boolean StrictRoundRobinModeSupport:1;	boolean SCAM_Enabled:1;	boolean SCAM_Level2:1;	boolean HostAdapterInitialized:1;	boolean HostAdapterExternalReset:1;	boolean HostAdapterInternalError:1;	boolean ProcessCompletedCCBsActive;	volatile boolean HostAdapterCommandCompleted;	unsigned short HostAdapterScatterGatherLimit;	unsigned short DriverScatterGatherLimit;	unsigned short MaxTargetDevices;	unsigned short MaxLogicalUnits;	unsigned short MailboxCount;	unsigned short InitialCCBs;	unsigned short IncrementalCCBs;	unsigned short AllocatedCCBs;	unsigned short DriverQueueDepth;	unsigned short HostAdapterQueueDepth;	unsigned short UntaggedQueueDepth;	unsigned short CommonQueueDepth;	unsigned short BusSettleTime;	unsigned short SynchronousPermitted;	unsigned short FastPermitted;	unsigned short UltraPermitted;	unsigned short WidePermitted;	unsigned short DisconnectPermitted;	unsigned short TaggedQueuingPermitted;	unsigned short ExternalHostAdapterResets;	unsigned short HostAdapterInternalErrors;	unsigned short TargetDeviceCount;	unsigned short MessageBufferLength;	u32 BIOS_Address;	struct BusLogic_DriverOptions *DriverOptions;	struct FlashPoint_Info FlashPointInfo;	FlashPoint_CardHandle_T CardHandle;	struct BusLogic_HostAdapter *Next;	struct BusLogic_CCB *All_CCBs;	struct BusLogic_CCB *Free_CCBs;	struct BusLogic_CCB *FirstCompletedCCB;	struct BusLogic_CCB *LastCompletedCCB;	struct BusLogic_CCB *BusDeviceResetPendingCCB[BusLogic_MaxTargetDevices];	struct BusLogic_TargetFlags TargetFlags[BusLogic_MaxTargetDevices];	unsigned char QueueDepth[BusLogic_MaxTargetDevices];	unsigned char SynchronousPeriod[BusLogic_MaxTargetDevices];	unsigned char SynchronousOffset[BusLogic_MaxTargetDevices];	unsigned char ActiveCommands[BusLogic_MaxTargetDevices];	unsigned int CommandsSinceReset[BusLogic_MaxTargetDevices];	unsigned long LastSequencePoint[BusLogic_MaxTargetDevices];	unsigned long LastResetAttempted[BusLogic_MaxTargetDevices];	unsigned long LastResetCompleted[BusLogic_MaxTargetDevices];	struct BusLogic_OutgoingMailbox *FirstOutgoingMailbox;	struct BusLogic_OutgoingMailbox *LastOutgoingMailbox;	struct BusLogic_OutgoingMailbox *NextOutgoingMailbox;	struct BusLogic_IncomingMailbox *FirstIncomingMailbox;	struct BusLogic_IncomingMailbox *LastIncomingMailbox;	struct BusLogic_IncomingMailbox *NextIncomingMailbox;	struct BusLogic_TargetStatistics TargetStatistics[BusLogic_MaxTargetDevices];	unsigned char *MailboxSpace;	dma_addr_t MailboxSpaceHandle;	unsigned int MailboxSize;	unsigned long CCB_Offset;	char MessageBuffer[BusLogic_MessageBufferSize];};/*  Define a structure for the BIOS Disk Parameters.*/struct BIOS_DiskParameters {	int Heads;	int Sectors;	int Cylinders;};/*  Define a structure for the SCSI Inquiry command results.*/struct SCSI_Inquiry {	unsigned char PeripheralDeviceType:5;	/* Byte 0 Bits 0-4 */	unsigned char PeripheralQualifier:3;	/* Byte 0 Bits 5-7 */	unsigned char DeviceTypeModifier:7;	/* Byte 1 Bits 0-6 */	boolean RMB:1;		/* Byte 1 Bit 7 */	unsigned char ANSI_ApprovedVersion:3;	/* Byte 2 Bits 0-2 */	unsigned char ECMA_Version:3;	/* Byte 2 Bits 3-5 */	unsigned char ISO_Version:2;	/* Byte 2 Bits 6-7 */	unsigned char ResponseDataFormat:4;	/* Byte 3 Bits 0-3 */	unsigned char:2;	/* Byte 3 Bits 4-5 */	boolean TrmIOP:1;	/* Byte 3 Bit 6 */	boolean AENC:1;		/* Byte 3 Bit 7 */	unsigned char AdditionalLength;	/* Byte 4 */	unsigned char:8;	/* Byte 5 */	unsigned char:8;	/* Byte 6 */	boolean SftRe:1;	/* Byte 7 Bit 0 */	boolean CmdQue:1;	/* Byte 7 Bit 1 */	 boolean:1;		/* Byte 7 Bit 2 */	boolean Linked:1;	/* Byte 7 Bit 3 */	boolean Sync:1;		/* Byte 7 Bit 4 */	boolean WBus16:1;	/* Byte 7 Bit 5 */	boolean WBus32:1;	/* Byte 7 Bit 6 */	boolean RelAdr:1;	/* Byte 7 Bit 7 */	unsigned char VendorIdentification[8];	/* Bytes 8-15 */	unsigned char ProductIdentification[16];	/* Bytes 16-31 */	unsigned char ProductRevisionLevel[4];	/* Bytes 32-35 */};/*  BusLogic_AcquireHostAdapterLock acquires exclusive access to Host Adapter.*/static inline void BusLogic_AcquireHostAdapterLock(struct BusLogic_HostAdapter *HostAdapter){	spin_lock_irq(HostAdapter->SCSI_Host->host_lock);}/*  BusLogic_ReleaseHostAdapterLock releases exclusive access to Host Adapter.*/static inline void BusLogic_ReleaseHostAdapterLock(struct BusLogic_HostAdapter *HostAdapter){	spin_unlock_irq(HostAdapter->SCSI_Host->host_lock);}/*  BusLogic_AcquireHostAdapterLockIH acquires exclusive access to Host Adapter,  but is only called from the interrupt handler.*/static inline void BusLogic_AcquireHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter, unsigned long *ProcessorFlags){	spin_lock_irqsave(HostAdapter->SCSI_Host->host_lock, *ProcessorFlags);}/*  BusLogic_ReleaseHostAdapterLockIH releases exclusive access to Host Adapter,  but is only called from the interrupt handler.*/static inline void BusLogic_ReleaseHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter, unsigned long *ProcessorFlags){	spin_unlock_irqrestore(HostAdapter->SCSI_Host->host_lock, *ProcessorFlags);}/*  Define functions to provide an abstraction for reading and writing the  Host Adapter I/O Registers.*/static inline void BusLogic_SCSIBusReset(struct BusLogic_HostAdapter *HostAdapter){	union BusLogic_ControlRegister ControlRegister;	ControlRegister.All = 0;	ControlRegister.cr.SCSIBusReset = true;	outb(ControlRegister.All, HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);}static inline void BusLogic_InterruptReset(struct BusLogic_HostAdapter *HostAdapter){	union BusLogic_ControlRegister ControlRegister;	ControlRegister.All = 0;	ControlRegister.cr.InterruptReset = true;	outb(ControlRegister.All, HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);}static inline void BusLogic_SoftReset(struct BusLogic_HostAdapter *HostAdapter){	union BusLogic_ControlRegister ControlRegister;	ControlRegister.All = 0;	ControlRegister.cr.SoftReset = true;	outb(ControlRegister.All, HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);}static inline void BusLogic_HardReset(struct BusLogic_HostAdapter *HostAdapter){	union BusLogic_ControlRegister ControlRegister;	ControlRegister.All = 0;	ControlRegister.cr.HardReset = true;	outb(ControlRegister.All, HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);}static inline unsigned char BusLogic_ReadStatusRegister(struct BusLogic_HostAdapter *HostAdapter){	return inb(HostAdapter->IO_Address + BusLogic_StatusRegisterOffset);}static inline void BusLogic_WriteCommandParameterRegister(struct BusLogic_HostAdapter							  *HostAdapter, unsigned char Value){	outb(Value, HostAdapter->IO_Address + BusLogic_CommandParameterRegisterOffset);}static inline unsigned char BusLogic_ReadDataInRegister(struct BusLogic_HostAdapter *HostAdapter){	return inb(HostAdapter->IO_Address + BusLogic_DataInRegisterOffset);}static inline unsigned char BusLogic_ReadInterruptRegister(struct BusLogic_HostAdapter *HostAdapter){	return inb(HostAdapter->IO_Address + BusLogic_InterruptRegisterOffset);}static inline unsigned char BusLogic_ReadGeometryRegister(struct BusLogic_HostAdapter *HostAdapter){	return inb(HostAdapter->IO_Address + BusLogic_GeometryRegisterOffset);}/*  BusLogic_StartMailboxCommand issues an Execute Mailbox Command, which  notifies the Host Adapter that an entry has been made in an Outgoing  Mailbox.*/static inline void BusLogic_StartMailboxCommand(struct BusLogic_HostAdapter *HostAdapter){	BusLogic_WriteCommandParameterRegister(HostAdapter, BusLogic_ExecuteMailboxCommand);}/*  BusLogic_Delay waits for Seconds to elapse.*/static inline void BusLogic_Delay(int Seconds){	mdelay(1000 * Seconds);}/*  Virtual_to_Bus and Bus_to_Virtual map between Kernel Virtual Addresses  and PCI/VLB/EISA/ISA Bus Addresses.*/static inline u32 Virtual_to_Bus(void *VirtualAddress){	return (u32) virt_to_bus(VirtualAddress);}static inline void *Bus_to_Virtual(u32 BusAddress){	return (void *) bus_to_virt(BusAddress);}/*  Virtual_to_32Bit_Virtual maps between Kernel Virtual Addresses and  32 bit Kernel Virtual Addresses.  This avoids compilation warnings  on 64 bit architectures.*/static inline u32 Virtual_to_32Bit_Virtual(void *VirtualAddress){	return (u32) (unsigned long) VirtualAddress;}/*  BusLogic_IncrementErrorCounter increments Error Counter by 1, stopping at  65535 rather than wrapping around to 0.*/static inline void BusLogic_IncrementErrorCounter(unsigned short *ErrorCounter){	if (*ErrorCounter < 65535)		(*ErrorCounter)++;}/*  BusLogic_IncrementByteCounter increments Byte Counter by Amount.*/static inline void BusLogic_IncrementByteCounter(struct BusLogic_ByteCounter						 *ByteCounter, unsigned int Amount){	ByteCounter->Units += Amount;	if (ByteCounter->Units > 999999999) {		ByteCounter->Units -= 1000000000;		ByteCounter->Billions++;	}}/*  BusLogic_IncrementSizeBucket increments the Bucket for Amount.*/static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T CommandSizeBuckets, unsigned int Amount){	int Index = 0;	if (Amount < 8 * 1024) {		if (Amount < 2 * 1024)			Index = (Amount < 1 * 1024 ? 0 : 1);		else			Index = (Amount < 4 * 1024 ? 2 : 3);	} else if (Amount < 128 * 1024) {		if (Amount < 32 * 1024)			Index = (Amount < 16 * 1024 ? 4 : 5);		else			Index = (Amount < 64 * 1024 ? 6 : 7);	} else		Index = (Amount < 256 * 1024 ? 8 : 9);	CommandSizeBuckets[Index]++;}/*  Define the version number of the FlashPoint Firmware (SCCB Manager).*/#define FlashPoint_FirmwareVersion		"5.02"/*  Define the possible return values from FlashPoint_HandleInterrupt.*/#define FlashPoint_NormalInterrupt		0x00#define FlashPoint_InternalError		0xFE#define FlashPoint_ExternalBusReset		0xFF/*  Define prototypes for the forward referenced BusLogic Driver  Internal Functions.*/static const char *BusLogic_DriverInfo(struct Scsi_Host *);static int BusLogic_DetectHostAdapter(struct scsi_host_template *);static int BusLogic_ReleaseHostAdapter(struct Scsi_Host *);static int BusLogic_QueueCommand(struct scsi_cmnd *, void (*CompletionRoutine) (struct scsi_cmnd *));static int BusLogic_BIOSDiskParameters(struct scsi_device *, struct block_device *, sector_t, int *);static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *, char **, off_t, int, int);static int BusLogic_SlaveConfigure(struct scsi_device *);static void BusLogic_QueueCompletedCCB(struct BusLogic_CCB *);static irqreturn_t BusLogic_InterruptHandler(int, void *, struct pt_regs *);static int BusLogic_ResetHostAdapter(struct BusLogic_HostAdapter *, boolean HardReset);static void BusLogic_Message(enum BusLogic_MessageLevel, char *, struct BusLogic_HostAdapter *, ...);static int __init BusLogic_Setup(char *);#endif				/* _BUSLOGIC_H */

⌨️ 快捷键说明

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