33 #define PACKED __attribute__((packed))
40 #define BusLogic_MaxHostAdapters 16
47 #define BusLogic_MaxTargetDevices 16
56 #define BusLogic_ScatterGatherLimit 128
65 #define BusLogic_MaxTaggedQueueDepth 64
66 #define BusLogic_MaxAutomaticTaggedQueueDepth 28
67 #define BusLogic_MinAutomaticTaggedQueueDepth 7
68 #define BusLogic_TaggedQueueDepthBB 3
69 #define BusLogic_UntaggedQueueDepth 3
70 #define BusLogic_UntaggedQueueDepthBB 2
80 #define BusLogic_DefaultBusSettleTime 2
90 #define BusLogic_MaxMailboxes 211
98 #define BusLogic_CCB_AllocationGroupSize 7
105 #define BusLogic_LineBufferSize 100
106 #define BusLogic_MessageBufferSize 9700
128 #define BusLogic_Announce(Format, Arguments...) \
129 BusLogic_Message(BusLogic_AnnounceLevel, Format, ##Arguments)
131 #define BusLogic_Info(Format, Arguments...) \
132 BusLogic_Message(BusLogic_InfoLevel, Format, ##Arguments)
134 #define BusLogic_Notice(Format, Arguments...) \
135 BusLogic_Message(BusLogic_NoticeLevel, Format, ##Arguments)
137 #define BusLogic_Warning(Format, Arguments...) \
138 BusLogic_Message(BusLogic_WarningLevel, Format, ##Arguments)
140 #define BusLogic_Error(Format, Arguments...) \
141 BusLogic_Message(BusLogic_ErrorLevel, Format, ##Arguments)
154 #define BusLogic_MultiMasterAddressCount 4
155 #define BusLogic_FlashPointAddressCount 256
164 #ifdef CONFIG_SCSI_FLASHPOINT
166 #define BusLogic_MultiMasterHostAdapterP(HostAdapter) \
167 (HostAdapter->HostAdapterType == BusLogic_MultiMaster)
169 #define BusLogic_FlashPointHostAdapterP(HostAdapter) \
170 (HostAdapter->HostAdapterType == BusLogic_FlashPoint)
174 #define BusLogic_MultiMasterHostAdapterP(HostAdapter) \
177 #define BusLogic_FlashPointHostAdapterP(HostAdapter) \
196 static char *BusLogic_HostAdapterBusNames[] = {
"Unknown",
"ISA",
"EISA",
"PCI",
"VESA",
"MCA" };
287 #define BusLogic_ControlRegisterOffset 0
288 #define BusLogic_StatusRegisterOffset 0
289 #define BusLogic_CommandParameterRegisterOffset 1
290 #define BusLogic_DataInRegisterOffset 1
291 #define BusLogic_InterruptRegisterOffset 2
292 #define BusLogic_GeometryRegisterOffset 3
553 #define BusLogic_BIOS_BaseOffset 0
554 #define BusLogic_AutoSCSI_BaseOffset 64
649 #define BusLogic_BIOS_DriveMapOffset 17
779 #define BusLogic_CDB_MaxLength 12
857 #ifdef CONFIG_SCSI_FLASHPOINT
859 unsigned short OS_Flags;
860 unsigned char Private[48];
932 #define BusLogic_SizeBuckets 10
960 #define FlashPoint_BadCardHandle 0xFFFFFFFF
1154 ControlRegister.
All = 0;
1155 ControlRegister.
cr.SCSIBusReset =
true;
1162 ControlRegister.
All = 0;
1163 ControlRegister.cr.InterruptReset =
true;
1170 ControlRegister.
All = 0;
1171 ControlRegister.cr.SoftReset =
true;
1178 ControlRegister.
All = 0;
1179 ControlRegister.cr.HardReset =
true;
1183 static inline unsigned char BusLogic_ReadStatusRegister(
struct BusLogic_HostAdapter *HostAdapter)
1189 *HostAdapter,
unsigned char Value)
1194 static inline unsigned char BusLogic_ReadDataInRegister(
struct BusLogic_HostAdapter *HostAdapter)
1199 static inline unsigned char BusLogic_ReadInterruptRegister(
struct BusLogic_HostAdapter *HostAdapter)
1204 static inline unsigned char BusLogic_ReadGeometryRegister(
struct BusLogic_HostAdapter *HostAdapter)
1224 static inline void BusLogic_Delay(
int Seconds)
1234 static inline u32 Virtual_to_Bus(
void *VirtualAddress)
1250 static inline u32 Virtual_to_32Bit_Virtual(
void *VirtualAddress)
1252 return (
u32) (
unsigned long) VirtualAddress;
1260 static inline void BusLogic_IncrementErrorCounter(
unsigned short *ErrorCounter)
1262 if (*ErrorCounter < 65535)
1271 *ByteCounter,
unsigned int Amount)
1273 ByteCounter->
Units += Amount;
1274 if (ByteCounter->
Units > 999999999) {
1275 ByteCounter->
Units -= 1000000000;
1287 if (Amount < 8 * 1024) {
1288 if (Amount < 2 * 1024)
1289 Index = (Amount < 1 * 1024 ? 0 : 1);
1291 Index = (Amount < 4 * 1024 ? 2 : 3);
1292 }
else if (Amount < 128 * 1024) {
1293 if (Amount < 32 * 1024)
1294 Index = (Amount < 16 * 1024 ? 4 : 5);
1296 Index = (Amount < 64 * 1024 ? 6 : 7);
1298 Index = (Amount < 256 * 1024 ? 8 : 9);
1299 CommandSizeBuckets[Index]++;
1306 #define FlashPoint_FirmwareVersion "5.02"
1312 #define FlashPoint_NormalInterrupt 0x00
1313 #define FlashPoint_InternalError 0xFE
1314 #define FlashPoint_ExternalBusReset 0xFF
1321 static const char *BusLogic_DriverInfo(
struct Scsi_Host *);
1324 static int BusLogic_ProcDirectoryInfo(
struct Scsi_Host *,
char *,
char **,
off_t,
int,
int);
1325 static int BusLogic_SlaveConfigure(
struct scsi_device *);
1326 static void BusLogic_QueueCompletedCCB(
struct BusLogic_CCB *);
1327 static irqreturn_t BusLogic_InterruptHandler(
int,
void *);
1330 static int __init BusLogic_Setup(
char *);