This source file includes following definitions.
- BusLogic_AcquireHostAdapterLock
- BusLogic_ReleaseHostAdapterLock
- BusLogic_AcquireHostAdapterLockID
- BusLogic_ReleaseHostAdapterLockID
- BusLogic_WriteControlRegister
- BusLogic_ReadStatusRegister
- BusLogic_WriteCommandParameterRegister
- BusLogic_ReadDataInRegister
- BusLogic_ReadInterruptRegister
- BusLogic_ReadGeometryRegister
- BusLogic_StartMailboxCommand
- BusLogic_Delay
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 typedef struct pt_regs Registers_T;
33 typedef Scsi_Host_Template SCSI_Host_Template_T;
34 typedef struct Scsi_Host SCSI_Host_T;
35 typedef struct scsi_device SCSI_Device_T;
36 typedef struct scsi_disk SCSI_Disk_T;
37 typedef struct scsi_cmnd SCSI_Command_T;
38 typedef struct scatterlist SCSI_ScatterList_T;
39 typedef kdev_t KernelDevice_T;
40
41
42
43
44
45
46 const char *BusLogic_DriverInfo(SCSI_Host_T *);
47 int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *);
48 int BusLogic_ReleaseHostAdapter(SCSI_Host_T *);
49 int BusLogic_QueueCommand(SCSI_Command_T *,
50 void (*CompletionRoutine)(SCSI_Command_T *));
51 int BusLogic_AbortCommand(SCSI_Command_T *);
52 int BusLogic_ResetCommand(SCSI_Command_T *, unsigned int);
53 int BusLogic_BIOSDiskParameters(SCSI_Disk_T *, KernelDevice_T, int *);
54
55
56
57
58
59
60 #define BUSLOGIC \
61 { NULL, \
62 NULL, \
63 NULL, \
64 NULL, \
65 "BusLogic", \
66 BusLogic_DetectHostAdapter, \
67 BusLogic_ReleaseHostAdapter, \
68 BusLogic_DriverInfo, \
69 NULL, \
70 BusLogic_QueueCommand, \
71 BusLogic_AbortCommand, \
72 BusLogic_ResetCommand, \
73 NULL, \
74 BusLogic_BIOSDiskParameters, \
75 0, \
76 0, \
77 0, \
78 0, \
79 0, \
80 1, \
81 ENABLE_CLUSTERING }
82
83
84
85
86
87
88 #ifdef BusLogic_DriverVersion
89
90
91
92
93
94
95 #define BusLogic_MaxHostAdapters 10
96
97
98
99
100
101
102 #define BusLogic_IO_MaxProbeAddresses 16
103
104
105
106
107
108
109 #define BusLogic_MaxTargetDevices 16
110
111
112
113
114
115
116
117
118 #define BusLogic_ScatterGatherLimit 128
119
120
121
122
123
124
125
126
127 #define BusLogic_MaxTaggedQueueDepth 31
128 #define BusLogic_TaggedQueueDepth_BB 2
129 #define BusLogic_UntaggedQueueDepth 3
130
131
132
133
134
135
136
137
138
139 #define BusLogic_DefaultBusSettleTime 2
140
141
142
143
144
145
146 #define BusLogic_InhibitTargetInquiry 1
147
148
149
150
151
152
153 #define BusLogic_TraceProbe 1
154 #define BusLogic_TraceHardReset 2
155 #define BusLogic_TraceConfiguration 4
156 #define BusLogic_TraceErrors 8
157 #define BusLogic_TraceQueueDepths 16
158
159
160
161
162
163
164 #define BusLogic_ErrorRecovery_Default 0
165 #define BusLogic_ErrorRecovery_HardReset 1
166 #define BusLogic_ErrorRecovery_BusDeviceReset 2
167 #define BusLogic_ErrorRecovery_None 3
168
169 static char
170 *BusLogic_ErrorRecoveryStrategyNames[] =
171 { "Default", "Hard Reset", "Bus Device Reset", "None" },
172 *BusLogic_ErrorRecoveryStrategyLetters[] =
173 { "D", "H", "B", "N" };
174
175
176
177
178
179
180 #define false 0
181 #define true 1
182 typedef unsigned char boolean;
183
184
185
186
187
188
189 #define BusLogic_IO_PortCount 4
190 #define BusLogic_ControlRegister 0
191 #define BusLogic_StatusRegister 0
192 #define BusLogic_CommandParameterRegister 1
193 #define BusLogic_DataInRegister 1
194 #define BusLogic_InterruptRegister 2
195 #define BusLogic_GeometryRegister 3
196
197
198
199
200
201
202 #define BusLogic_ReservedCR 0x0F
203 #define BusLogic_SCSIBusReset 0x10
204 #define BusLogic_InterruptReset 0x20
205 #define BusLogic_SoftReset 0x40
206 #define BusLogic_HardReset 0x80
207
208
209
210
211
212
213 #define BusLogic_CommandInvalid 0x01
214 #define BusLogic_ReservedSR 0x02
215 #define BusLogic_DataInRegisterReady 0x04
216 #define BusLogic_CommandParameterRegisterBusy 0x08
217 #define BusLogic_HostAdapterReady 0x10
218 #define BusLogic_InitializationRequired 0x20
219 #define BusLogic_DiagnosticFailure 0x40
220 #define BusLogic_DiagnosticActive 0x80
221
222
223
224
225
226
227 #define BusLogic_IncomingMailboxLoaded 0x01
228 #define BusLogic_OutgoingMailboxAvailable 0x02
229 #define BusLogic_CommandComplete 0x04
230 #define BusLogic_SCSIResetState 0x08
231 #define BusLogic_ReservedIR 0x70
232 #define BusLogic_InterruptValid 0x80
233
234
235
236
237
238
239 #define BusLogic_Drive0Geometry 0x03
240 #define BusLogic_Drive1Geometry 0x0C
241 #define BusLogic_ReservedGR 0x70
242 #define BusLogic_ExtendedTranslationEnabled 0x80
243
244
245
246
247
248
249 typedef enum
250 {
251 BusLogic_TestCommandCompleteInterrupt = 0x00,
252 BusLogic_InitializeMailbox = 0x01,
253 BusLogic_ExecuteMailboxCommand = 0x02,
254 BusLogic_ExecuteBIOSCommand = 0x03,
255 BusLogic_InquireBoardID = 0x04,
256 BusLogic_EnableOutgoingMailboxAvailableInt = 0x05,
257 BusLogic_SetSCSISelectionTimeout = 0x06,
258 BusLogic_SetPreemptTimeOnBus = 0x07,
259 BusLogic_SetTimeOffBus = 0x08,
260 BusLogic_SetBusTransferRate = 0x09,
261 BusLogic_InquireInstalledDevicesID0to7 = 0x0A,
262 BusLogic_InquireConfiguration = 0x0B,
263 BusLogic_SetTargetMode = 0x0C,
264 BusLogic_InquireSetupInformation = 0x0D,
265 BusLogic_WriteAdapterLocalRAM = 0x1A,
266 BusLogic_ReadAdapterLocalRAM = 0x1B,
267 BusLogic_WriteBusMasterChipFIFO = 0x1C,
268 BusLogic_ReadBusMasterChipFIFO = 0x1D,
269 BusLogic_EchoCommandData = 0x1F,
270 BusLogic_HostAdapterDiagnostic = 0x20,
271 BusLogic_SetAdapterOptions = 0x21,
272 BusLogic_InquireInstalledDevicesID8to15 = 0x23,
273 BusLogic_InquireDevices = 0x24,
274 BusLogic_InitializeExtendedMailbox = 0x81,
275 BusLogic_InquireFirmwareVersion3rdDigit = 0x84,
276 BusLogic_InquireFirmwareVersionLetter = 0x85,
277 BusLogic_InquireGenericIOPortInformation = 0x86,
278 BusLogic_InquireBoardModelNumber = 0x8B,
279 BusLogic_InquireSynchronousPeriod = 0x8C,
280 BusLogic_InquireExtendedSetupInformation = 0x8D,
281 BusLogic_EnableStrictRoundRobinMode = 0x8F,
282 BusLogic_FetchHostAdapterLocalRAM = 0x91,
283 BusLogic_ModifyIOAddress = 0x95,
284 BusLogic_EnableWideModeCCB = 0x96
285 }
286 BusLogic_OperationCode_T;
287
288
289
290
291
292
293 typedef struct BusLogic_BoardID
294 {
295 unsigned char BoardType;
296 unsigned char CustomFeatures;
297 unsigned char FirmwareVersion1stDigit;
298 unsigned char FirmwareVersion2ndDigit;
299 }
300 BusLogic_BoardID_T;
301
302
303
304
305
306
307
308
309
310 typedef unsigned char BusLogic_InstalledDevices8_T[8];
311
312
313
314
315
316
317
318
319
320 typedef unsigned short BusLogic_InstalledDevices_T;
321
322
323
324
325
326
327 typedef struct BusLogic_Configuration
328 {
329 unsigned char :5;
330 boolean DMA_Channel5:1;
331 boolean DMA_Channel6:1;
332 boolean DMA_Channel7:1;
333 boolean IRQ_Channel9:1;
334 boolean IRQ_Channel10:1;
335 boolean IRQ_Channel11:1;
336 boolean IRQ_Channel12:1;
337 unsigned char :1;
338 boolean IRQ_Channel14:1;
339 boolean IRQ_Channel15:1;
340 unsigned char :1;
341 unsigned char HostAdapterID:4;
342 unsigned char :4;
343 }
344 BusLogic_Configuration_T;
345
346
347
348
349
350
351 typedef struct BusLogic_SynchronousValue
352 {
353 unsigned char Offset:4;
354 unsigned char TransferPeriod:3;
355 boolean Synchronous:1;
356 }
357 BusLogic_SynchronousValue_T;
358
359 typedef BusLogic_SynchronousValue_T
360 BusLogic_SynchronousValues8_T[8];
361
362 typedef BusLogic_SynchronousValue_T
363 BusLogic_SynchronousValues_T[BusLogic_MaxTargetDevices];
364
365 typedef struct BusLogic_SetupInformation
366 {
367 boolean SynchronousInitiationEnabled:1;
368 boolean ParityCheckEnabled:1;
369 unsigned char :6;
370 unsigned char BusTransferRate;
371 unsigned char PreemptTimeOnBus;
372 unsigned char TimeOffBus;
373 unsigned char MailboxCount;
374 unsigned char MailboxAddress[3];
375 BusLogic_SynchronousValues8_T SynchronousValuesID0to7;
376 unsigned char DisconnectPermittedID0to7;
377 unsigned char Signature;
378 unsigned char CharacterD;
379 unsigned char BusLetter;
380 unsigned char :8;
381 unsigned char :8;
382 BusLogic_SynchronousValues8_T SynchronousValuesID8to15;
383 unsigned char DisconnectPermittedID8to15;
384 }
385 BusLogic_SetupInformation_T;
386
387
388
389
390
391
392 typedef struct BusLogic_ExtendedMailboxRequest
393 {
394 unsigned char MailboxCount;
395 void *BaseMailboxAddress __attribute__ ((packed));
396 }
397 BusLogic_ExtendedMailboxRequest_T;
398
399
400
401
402
403
404 typedef unsigned char BusLogic_FirmwareVersion3rdDigit_T;
405
406
407
408
409
410
411 typedef unsigned char BusLogic_FirmwareVersionLetter_T;
412
413
414
415
416
417
418 typedef struct BusLogic_GenericIOPortInformation
419 {
420 unsigned char ISACompatibleIOPort;
421 unsigned char PCIAssignedIRQChannel;
422 boolean LowByteTerminated:1;
423 boolean HighByteTerminated:1;
424 unsigned char :2;
425 boolean JP1:1;
426 boolean JP2:1;
427 boolean JP3:1;
428 boolean Valid:1;
429 unsigned char :8;
430 }
431 BusLogic_GenericIOPortInformation_T;
432
433
434
435
436
437
438 typedef unsigned char BusLogic_BoardModelNumber_T[5];
439
440
441
442
443
444
445
446
447 typedef unsigned char BusLogic_SynchronousPeriod_T[BusLogic_MaxTargetDevices];
448
449
450
451
452
453
454 typedef struct BusLogic_ExtendedSetupInformation
455 {
456 unsigned char BusType;
457 unsigned char BIOS_Address;
458 unsigned short ScatterGatherLimit;
459 unsigned char MailboxCount;
460 void *BaseMailboxAddress __attribute__ ((packed));
461 struct { unsigned char :6;
462 boolean LevelSensitiveInterrupts:1;
463 unsigned char :1; } Misc;
464 unsigned char FirmwareRevision[3];
465 boolean HostWideSCSI:1;
466 boolean HostDifferentialSCSI:1;
467 boolean HostAutomaticConfiguration:1;
468 boolean HostUltraSCSI:1;
469 unsigned char :4;
470 }
471 BusLogic_ExtendedSetupInformation_T;
472
473
474
475
476
477
478 #define BusLogic_AggressiveRoundRobinMode 0x00
479 #define BusLogic_StrictRoundRobinMode 0x01
480
481 typedef unsigned char BusLogic_RoundRobinModeRequest_T;
482
483
484
485
486
487
488 #define BusLogic_BIOS_BaseOffset 0
489 #define BusLogic_AutoSCSI_BaseOffset 64
490
491 typedef struct BusLogic_FetchHostAdapterLocalRAMRequest
492 {
493 unsigned char ByteOffset;
494 unsigned char ByteCount;
495 }
496 BusLogic_FetchHostAdapterLocalRAMRequest_T;
497
498
499
500
501
502
503 typedef struct BusLogic_AutoSCSIByte15
504 {
505 unsigned char LowByteTerminated:1;
506 unsigned char :1;
507 unsigned char HighByteTerminated:1;
508 unsigned char :5;
509 }
510 BusLogic_AutoSCSIByte15_T;
511
512
513
514
515
516
517 typedef struct BusLogic_AutoSCSIByte45
518 {
519 unsigned char ForceBusDeviceScanningOrder:1;
520 unsigned char :7;
521 }
522 BusLogic_AutoSCSIByte45_T;
523
524
525
526
527
528
529
530
531
532 #define BusLogic_ModifyIO_330 0x00
533 #define BusLogic_ModifyIO_334 0x01
534 #define BusLogic_ModifyIO_230 0x02
535 #define BusLogic_ModifyIO_234 0x03
536 #define BusLogic_ModifyIO_130 0x04
537 #define BusLogic_ModifyIO_134 0x05
538 #define BusLogic_ModifyIO_Disable 0x06
539 #define BusLogic_ModifyIO_Disable2 0x07
540
541 typedef unsigned char BusLogic_ModifyIOAddressRequest_T;
542
543
544
545
546
547
548
549 #define BusLogic_NormalModeCCB 0x00
550 #define BusLogic_WideModeCCB 0x01
551
552 typedef unsigned char BusLogic_WideModeCCBRequest_T;
553
554
555
556
557
558
559
560
561 typedef unsigned char BusLogic_RequestedReplyLength_T;
562
563
564
565
566
567
568
569
570
571 typedef unsigned long BusLogic_Lock_T;
572
573
574
575
576
577
578 typedef enum
579 {
580 BusLogic_OutgoingMailboxFree = 0,
581 BusLogic_MailboxStartCommand = 1,
582 BusLogic_MailboxAbortCommand = 2
583 }
584 BusLogic_ActionCode_T;
585
586
587
588
589
590
591 typedef enum
592 {
593 BusLogic_IncomingMailboxFree = 0,
594 BusLogic_CommandCompletedWithoutError = 1,
595 BusLogic_CommandAbortedAtHostRequest = 2,
596 BusLogic_AbortedCommandNotFound = 3,
597 BusLogic_CommandCompletedWithError = 4
598 }
599 BusLogic_CompletionCode_T;
600
601
602
603
604
605
606 typedef enum
607 {
608 BusLogic_InitiatorCCB = 0x00,
609 BusLogic_TargetCCB = 0x01,
610 BusLogic_InitiatorCCB_ScatterGather = 0x02,
611 BusLogic_InitiatorCCB_ResidualDataLength = 0x03,
612 BusLogic_InitiatorCCB_ScatterGatherResidual = 0x04,
613 BusLogic_BusDeviceReset = 0x81
614 }
615 BusLogic_CCB_Opcode_T;
616
617
618
619
620
621
622 typedef enum
623 {
624 BusLogic_UncheckedDataTransfer = 0x00,
625 BusLogic_DataInLengthChecked = 0x01,
626 BusLogic_DataOutLengthChecked = 0x02,
627 BusLogic_NoDataTransfer = 0x03
628 }
629 BusLogic_DataDirection_T;
630
631
632
633
634
635
636 typedef enum
637 {
638 BusLogic_CommandCompletedNormally = 0x00,
639 BusLogic_LinkedCommandCompleted = 0x0A,
640 BusLogic_LinkedCommandCompletedWithFlag = 0x0B,
641 BusLogic_SCSISelectionTimeout = 0x11,
642 BusLogic_DataOverUnderRun = 0x12,
643 BusLogic_UnexpectedBusFree = 0x13,
644 BusLogic_InvalidBusPhaseRequested = 0x14,
645 BusLogic_InvalidOutgoingMailboxActionCode = 0x15,
646 BusLogic_InvalidCommandOperationCode = 0x16,
647 BusLogic_LinkedCCBhasInvalidLUN = 0x17,
648 BusLogic_InvalidCommandParameter = 0x1A,
649 BusLogic_AutoRequestSenseFailed = 0x1B,
650 BusLogic_TaggedQueuingMessageRejected = 0x1C,
651 BusLogic_UnsupportedMessageReceived = 0x1D,
652 BusLogic_HostAdapterHardwareFailed = 0x20,
653 BusLogic_TargetFailedResponseToATN = 0x21,
654 BusLogic_HostAdapterAssertedRST = 0x22,
655 BusLogic_OtherDeviceAssertedRST = 0x23,
656 BusLogic_TargetDeviceReconnectedImproperly = 0x24,
657 BusLogic_HostAdapterAssertedBusDeviceReset = 0x25,
658 BusLogic_AbortQueueGenerated = 0x26,
659 BusLogic_HostAdapterSoftwareError = 0x27,
660 BusLogic_HostAdapterHardwareTimeoutError = 0x30,
661 BusLogic_SCSIParityErrorDetected = 0x34
662 }
663 BusLogic_HostAdapterStatus_T;
664
665
666
667
668
669
670 typedef enum
671 {
672 BusLogic_OperationGood = 0x00,
673 BusLogic_CheckCondition = 0x02,
674 BusLogic_DeviceBusy = 0x08
675 }
676 BusLogic_TargetDeviceStatus_T;
677
678
679
680
681
682
683 typedef enum
684 {
685 BusLogic_SimpleQueueTag = 0x00,
686 BusLogic_HeadOfQueueTag = 0x01,
687 BusLogic_OrderedQueueTag = 0x02,
688 BusLogic_ReservedQT = 0x03
689 }
690 BusLogic_QueueTag_T;
691
692
693
694
695
696
697 #define BusLogic_CDB_MaxLength 12
698
699 typedef unsigned char SCSI_CDB_T[BusLogic_CDB_MaxLength];
700
701
702
703
704
705
706 #define BusLogic_SenseDataMaxLength 255
707
708 typedef unsigned char SCSI_SenseData_T[BusLogic_SenseDataMaxLength];
709
710
711
712
713
714
715
716 typedef struct BusLogic_ScatterGatherSegment
717 {
718 unsigned long SegmentByteCount;
719 void *SegmentDataPointer;
720 }
721 BusLogic_ScatterGatherSegment_T;
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736 typedef struct BusLogic_CCB
737 {
738
739
740
741 BusLogic_CCB_Opcode_T Opcode:8;
742 unsigned char :3;
743 BusLogic_DataDirection_T DataDirection:2;
744 boolean WideModeTagEnable:1;
745 BusLogic_QueueTag_T WideModeQueueTag:2;
746 unsigned char CDB_Length;
747 unsigned char SenseDataLength;
748 unsigned long DataLength;
749 void *DataPointer;
750 unsigned char :8;
751 unsigned char :8;
752 BusLogic_HostAdapterStatus_T HostAdapterStatus:8;
753 BusLogic_TargetDeviceStatus_T TargetDeviceStatus:8;
754 unsigned char TargetID;
755 unsigned char LogicalUnit:5;
756 boolean TagEnable:1;
757 BusLogic_QueueTag_T QueueTag:2;
758 SCSI_CDB_T CDB;
759 unsigned char :8;
760 unsigned char :8;
761 unsigned long :32;
762 SCSI_SenseData_T *SenseDataPointer;
763
764
765
766 struct BusLogic_HostAdapter *HostAdapter;
767 SCSI_Command_T *Command;
768 enum { BusLogic_CCB_Free = 0,
769 BusLogic_CCB_Active = 1,
770 BusLogic_CCB_Completed = 2,
771 BusLogic_CCB_Reset = 3 } Status;
772 BusLogic_CompletionCode_T MailboxCompletionCode;
773 unsigned int SerialNumber;
774 struct BusLogic_CCB *Next;
775 struct BusLogic_CCB *NextAll;
776 BusLogic_ScatterGatherSegment_T
777 ScatterGatherList[BusLogic_ScatterGatherLimit];
778 }
779 BusLogic_CCB_T;
780
781
782
783
784
785
786 typedef struct BusLogic_OutgoingMailbox
787 {
788 BusLogic_CCB_T *CCB;
789 unsigned long :24;
790 BusLogic_ActionCode_T ActionCode:8;
791 }
792 BusLogic_OutgoingMailbox_T;
793
794
795
796
797
798
799 typedef struct BusLogic_IncomingMailbox
800 {
801 BusLogic_CCB_T *CCB;
802 BusLogic_HostAdapterStatus_T HostAdapterStatus:8;
803 BusLogic_TargetDeviceStatus_T TargetDeviceStatus:8;
804 unsigned char :8;
805 BusLogic_CompletionCode_T CompletionCode:8;
806 }
807 BusLogic_IncomingMailbox_T;
808
809
810
811
812
813
814 typedef enum
815 {
816 BusLogic_Unknown_Bus = 0,
817 BusLogic_ISA_Bus = 1,
818 BusLogic_MCA_Bus = 2,
819 BusLogic_EISA_Bus = 3,
820 BusLogic_VESA_Bus = 4,
821 BusLogic_PCI_Bus = 5
822 }
823 BusLogic_BusType_T;
824
825 static char
826 *BusLogic_BusNames[] =
827 { "Unknown", "ISA", "MCA", "EISA", "VESA", "PCI" };
828
829
830
831
832
833
834 typedef struct BusLogic_CommandLineEntry
835 {
836 unsigned short IO_Address;
837 unsigned short TaggedQueueDepth;
838 unsigned short BusSettleTime;
839 unsigned short LocalOptions;
840 unsigned short TaggedQueuingPermitted;
841 unsigned short TaggedQueuingPermittedMask;
842 unsigned char ErrorRecoveryStrategy[BusLogic_MaxTargetDevices];
843 }
844 BusLogic_CommandLineEntry_T;
845
846
847
848
849
850
851 typedef struct BusLogic_HostAdapter
852 {
853 SCSI_Host_T *SCSI_Host;
854 unsigned char HostNumber;
855 unsigned char ModelName[9];
856 unsigned char FirmwareVersion[6];
857 unsigned char BoardName[18];
858 unsigned char InterruptLabel[62];
859 unsigned short IO_Address;
860 unsigned char IRQ_Channel;
861 unsigned char DMA_Channel;
862 unsigned char SCSI_ID;
863 BusLogic_BusType_T BusType:3;
864 boolean IRQ_ChannelAcquired:1;
865 boolean DMA_ChannelAcquired:1;
866 boolean SynchronousInitiation:1;
867 boolean ParityChecking:1;
868 boolean ExtendedTranslation:1;
869 boolean LevelSensitiveInterrupts:1;
870 boolean HostWideSCSI:1;
871 boolean HostDifferentialSCSI:1;
872 boolean HostAutomaticConfiguration:1;
873 boolean HostUltraSCSI:1;
874 boolean TerminationInfoValid:1;
875 boolean LowByteTerminated:1;
876 boolean HighByteTerminated:1;
877 boolean BounceBuffersRequired:1;
878 boolean StrictRoundRobinModeSupported:1;
879 boolean HostAdapterResetRequested:1;
880 volatile boolean HostAdapterCommandCompleted:1;
881 unsigned short HostAdapterScatterGatherLimit;
882 unsigned short DriverScatterGatherLimit;
883 unsigned short MaxTargetDevices;
884 unsigned short MaxLogicalUnits;
885 unsigned short MailboxCount;
886 unsigned short InitialCCBs;
887 unsigned short IncrementalCCBs;
888 unsigned short TotalQueueDepth;
889 unsigned short TaggedQueueDepth;
890 unsigned short UntaggedQueueDepth;
891 unsigned short BusSettleTime;
892 unsigned short LocalOptions;
893 unsigned short DisconnectPermitted;
894 unsigned short TaggedQueuingPermitted;
895 unsigned long BIOS_Address;
896 BusLogic_InstalledDevices_T InstalledDevices;
897 BusLogic_SynchronousValues_T SynchronousValues;
898 BusLogic_SynchronousPeriod_T SynchronousPeriod;
899 BusLogic_CommandLineEntry_T *CommandLineEntry;
900 struct BusLogic_HostAdapter *Next;
901 BusLogic_CCB_T *All_CCBs;
902 BusLogic_CCB_T *Free_CCBs;
903 BusLogic_CCB_T *BusDeviceResetPendingCCB[BusLogic_MaxTargetDevices];
904 unsigned char ErrorRecoveryStrategy[BusLogic_MaxTargetDevices];
905 unsigned char TaggedQueuingActive[BusLogic_MaxTargetDevices];
906 unsigned char CommandSuccessfulFlag[BusLogic_MaxTargetDevices];
907 unsigned char ActiveCommandCount[BusLogic_MaxTargetDevices];
908 unsigned long TotalCommandCount[BusLogic_MaxTargetDevices];
909 unsigned long LastSequencePoint[BusLogic_MaxTargetDevices];
910 unsigned long LastResetTime[BusLogic_MaxTargetDevices];
911 BusLogic_OutgoingMailbox_T *FirstOutgoingMailbox;
912 BusLogic_OutgoingMailbox_T *LastOutgoingMailbox;
913 BusLogic_OutgoingMailbox_T *NextOutgoingMailbox;
914 BusLogic_IncomingMailbox_T *FirstIncomingMailbox;
915 BusLogic_IncomingMailbox_T *LastIncomingMailbox;
916 BusLogic_IncomingMailbox_T *NextIncomingMailbox;
917 }
918 BusLogic_HostAdapter_T;
919
920
921
922
923
924
925 typedef struct BIOS_DiskParameters
926 {
927 int Heads;
928 int Sectors;
929 int Cylinders;
930 }
931 BIOS_DiskParameters_T;
932
933
934
935
936
937
938 static inline
939 void BusLogic_AcquireHostAdapterLock(BusLogic_HostAdapter_T *HostAdapter,
940 BusLogic_Lock_T *Lock)
941 {
942 save_flags(*Lock);
943 cli();
944 }
945
946
947
948
949
950
951 static inline
952 void BusLogic_ReleaseHostAdapterLock(BusLogic_HostAdapter_T *HostAdapter,
953 BusLogic_Lock_T *Lock)
954 {
955 restore_flags(*Lock);
956 }
957
958
959
960
961
962
963
964 static inline
965 void BusLogic_AcquireHostAdapterLockID(BusLogic_HostAdapter_T *HostAdapter,
966 BusLogic_Lock_T *Lock)
967 {
968 }
969
970
971
972
973
974
975
976 static inline
977 void BusLogic_ReleaseHostAdapterLockID(BusLogic_HostAdapter_T *HostAdapter,
978 BusLogic_Lock_T *Lock)
979 {
980 }
981
982
983
984
985
986
987
988 static inline
989 void BusLogic_WriteControlRegister(BusLogic_HostAdapter_T *HostAdapter,
990 unsigned char Value)
991 {
992 outb(Value, HostAdapter->IO_Address + BusLogic_ControlRegister);
993 }
994
995 static inline
996 unsigned char BusLogic_ReadStatusRegister(BusLogic_HostAdapter_T *HostAdapter)
997 {
998 return inb(HostAdapter->IO_Address + BusLogic_StatusRegister);
999 }
1000
1001 static inline
1002 void BusLogic_WriteCommandParameterRegister(BusLogic_HostAdapter_T *HostAdapter,
1003 unsigned char Value)
1004 {
1005 outb(Value, HostAdapter->IO_Address + BusLogic_CommandParameterRegister);
1006 }
1007
1008 static inline
1009 unsigned char BusLogic_ReadDataInRegister(BusLogic_HostAdapter_T *HostAdapter)
1010 {
1011 return inb(HostAdapter->IO_Address + BusLogic_DataInRegister);
1012 }
1013
1014 static inline
1015 unsigned char BusLogic_ReadInterruptRegister(BusLogic_HostAdapter_T
1016 *HostAdapter)
1017 {
1018 return inb(HostAdapter->IO_Address + BusLogic_InterruptRegister);
1019 }
1020
1021 static inline
1022 unsigned char BusLogic_ReadGeometryRegister(BusLogic_HostAdapter_T *HostAdapter)
1023 {
1024 return inb(HostAdapter->IO_Address + BusLogic_GeometryRegister);
1025 }
1026
1027
1028
1029
1030
1031
1032
1033
1034 static inline
1035 void BusLogic_StartMailboxCommand(BusLogic_HostAdapter_T *HostAdapter)
1036 {
1037 BusLogic_WriteCommandParameterRegister(HostAdapter,
1038 BusLogic_ExecuteMailboxCommand);
1039 }
1040
1041
1042
1043
1044
1045
1046 static inline void BusLogic_Delay(int Seconds)
1047 {
1048 unsigned long TimeoutJiffies = jiffies + Seconds * HZ;
1049 unsigned long ProcessorFlags;
1050 save_flags(ProcessorFlags);
1051 sti();
1052 while (jiffies < TimeoutJiffies) ;
1053 restore_flags(ProcessorFlags);
1054 }
1055
1056
1057
1058
1059
1060
1061
1062 static void BusLogic_InterruptHandler(int, void *, Registers_T *);
1063 static int BusLogic_ResetHostAdapter(BusLogic_HostAdapter_T *,
1064 SCSI_Command_T *,
1065 unsigned int);
1066
1067
1068 #endif