This source file includes following definitions.
- BusLogic_LockHostAdapter
- BusLogic_UnlockHostAdapter
- BusLogic_LockHostAdapterID
- BusLogic_UnlockHostAdapterID
- BusLogic_WriteControlRegister
- BusLogic_ReadStatusRegister
- BusLogic_WriteCommandParameterRegister
- BusLogic_ReadDataInRegister
- BusLogic_ReadInterruptRegister
- BusLogic_ReadGeometryRegister
- BusLogic_StartMailboxScan
- BusLogic_Delay
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 typedef struct pt_regs Registers_T;
18 typedef Scsi_Host_Template SCSI_Host_Template_T;
19 typedef struct Scsi_Host SCSI_Host_T;
20 typedef struct scsi_disk SCSI_Disk_T;
21 typedef struct scsi_cmnd SCSI_Command_T;
22 typedef struct scatterlist SCSI_ScatterList_T;
23 typedef kdev_t KernelDevice_T;
24
25
26
27
28
29
30 const char *BusLogic_DriverInfo(SCSI_Host_T *);
31 int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *);
32 int BusLogic_ReleaseHostAdapter(SCSI_Host_T *);
33 int BusLogic_QueueCommand(SCSI_Command_T *,
34 void (*CompletionRoutine)(SCSI_Command_T *));
35 int BusLogic_AbortCommand(SCSI_Command_T *);
36 int BusLogic_ResetCommand(SCSI_Command_T *);
37 int BusLogic_BIOSDiskParameters(SCSI_Disk_T *, KernelDevice_T, int *);
38
39
40
41
42
43
44 #define BUSLOGIC \
45 { NULL, \
46 NULL, \
47 NULL, \
48 NULL, \
49 "BusLogic", \
50 BusLogic_DetectHostAdapter, \
51 BusLogic_ReleaseHostAdapter, \
52 BusLogic_DriverInfo, \
53 NULL, \
54 BusLogic_QueueCommand, \
55 BusLogic_AbortCommand, \
56 BusLogic_ResetCommand, \
57 NULL, \
58 BusLogic_BIOSDiskParameters, \
59 0, \
60 0, \
61 0, \
62 0, \
63 0, \
64 1, \
65 ENABLE_CLUSTERING }
66
67
68
69
70
71
72 #ifdef BusLogic_DriverVersion
73
74
75
76
77
78
79 #define BusLogic_MaxHostAdapters 10
80
81
82
83
84
85
86 #define BusLogic_IO_MaxProbeAddresses 16
87
88
89
90
91
92
93 #define BusLogic_MaxTargetIDs 16
94
95
96
97
98
99
100
101
102 #define BusLogic_MailboxCount 64
103
104
105
106
107
108
109
110
111 #define BusLogic_InitialCCBs 32
112
113
114
115
116
117
118
119
120 #define BusLogic_ScatterGatherLimit 128
121
122
123
124
125
126
127
128
129 #define BusLogic_Concurrency 7
130 #define BusLogic_Concurrency_BB 1
131
132
133
134
135
136
137
138
139
140 #define BusLogic_DefaultBusSettleTime 2
141
142
143
144
145
146
147 #define BusLogic_InhibitTargetInquiry 1
148
149
150
151
152
153
154 #define BusLogic_TraceProbe 1
155 #define BusLogic_TraceHardReset 2
156 #define BusLogic_TraceConfiguration 4
157 #define BusLogic_TraceErrors 8
158
159
160
161
162
163
164 #define BusLogic_ErrorRecoveryDefault 0
165 #define BusLogic_ErrorRecoveryHardReset 1
166 #define BusLogic_ErrorRecoveryBusDeviceReset 2
167 #define BusLogic_ErrorRecoveryNone 3
168
169 static char
170 *BusLogic_ErrorRecoveryOptions[] =
171 { "Default", "Hard Reset", "Bus Device Reset", "None" },
172 *BusLogic_ErrorRecoveryOptions2[] =
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_StartMailboxCommand = 0x02,
254 BusLogic_StartBIOSCommand = 0x03,
255 BusLogic_InquireBoardID = 0x04,
256 BusLogic_EnableOutgoingMailboxAvailableIRQ = 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_InitializeExtendedMailbox = 0x81,
274 BusLogic_InquireFirmwareVersion3rdDigit = 0x84,
275 BusLogic_InquireFirmwareVersionLetter = 0x85,
276 BusLogic_InquireBoardModelNumber = 0x8B,
277 BusLogic_InquireSynchronousPeriod = 0x8C,
278 BusLogic_InquireExtendedSetupInformation = 0x8D,
279 BusLogic_EnableStrictRoundRobinMode = 0x8F,
280 BusLogic_ModifyIOAddress = 0x95,
281 BusLogic_EnableWideModeCCB = 0x96
282 }
283 BusLogic_OperationCode_T;
284
285
286
287
288
289
290 typedef struct BusLogic_BoardID
291 {
292 unsigned char BoardType;
293 unsigned char CustomFeatures;
294 unsigned char FirmwareVersion1stDigit;
295 unsigned char FirmwareVersion2ndDigit;
296 }
297 BusLogic_BoardID_T;
298
299
300
301
302
303
304
305
306
307 typedef unsigned char BusLogic_InstalledDevices8_T[8];
308
309 typedef unsigned char BusLogic_InstalledDevices_T[BusLogic_MaxTargetIDs];
310
311
312
313
314
315
316 typedef struct BusLogic_Configuration
317 {
318 unsigned char :5;
319 boolean DMA_Channel5:1;
320 boolean DMA_Channel6:1;
321 boolean DMA_Channel7:1;
322 boolean IRQ_Channel9:1;
323 boolean IRQ_Channel10:1;
324 boolean IRQ_Channel11:1;
325 boolean IRQ_Channel12:1;
326 unsigned char :1;
327 boolean IRQ_Channel14:1;
328 boolean IRQ_Channel15:1;
329 unsigned char :1;
330 unsigned char HostAdapterID:4;
331 unsigned char :4;
332 }
333 BusLogic_Configuration_T;
334
335
336
337
338
339
340 typedef struct BusLogic_SynchronousValue
341 {
342 unsigned char Offset:4;
343 unsigned char TransferPeriod:3;
344 boolean Synchronous:1;
345 }
346 BusLogic_SynchronousValue_T;
347
348 typedef BusLogic_SynchronousValue_T
349 BusLogic_SynchronousValues8_T[8];
350
351 typedef BusLogic_SynchronousValue_T
352 BusLogic_SynchronousValues_T[BusLogic_MaxTargetIDs];
353
354 typedef struct BusLogic_SetupInformation
355 {
356 boolean SynchronousInitiationEnabled:1;
357 boolean ParityCheckEnabled:1;
358 unsigned char :6;
359 unsigned char BusTransferRate;
360 unsigned char PreemptTimeOnBus;
361 unsigned char TimeOffBus;
362 unsigned char MailboxCount;
363 unsigned char MailboxAddress[3];
364 BusLogic_SynchronousValues8_T SynchronousValuesID0to7;
365 unsigned char DisconnectPermittedID0to7;
366 unsigned char Signature;
367 unsigned char CharacterD;
368 unsigned char BusLetter;
369 unsigned char :8;
370 unsigned char :8;
371 BusLogic_SynchronousValues8_T SynchronousValuesID8to15;
372 unsigned char DisconnectPermittedID8to15;
373 }
374 BusLogic_SetupInformation_T;
375
376
377
378
379
380
381 typedef struct BusLogic_ExtendedMailboxRequest
382 {
383 unsigned char MailboxCount;
384 void *BaseMailboxAddress __attribute__ ((packed));
385 }
386 BusLogic_ExtendedMailboxRequest_T;
387
388
389
390
391
392
393 typedef unsigned char BusLogic_FirmwareVersion3rdDigit_T;
394
395
396
397
398
399
400 typedef unsigned char BusLogic_FirmwareVersionLetter_T;
401
402
403
404
405
406
407 typedef unsigned char BusLogic_BoardModelNumber_T[5];
408
409
410
411
412
413
414
415
416 typedef unsigned char BusLogic_SynchronousPeriod_T[BusLogic_MaxTargetIDs];
417
418
419
420
421
422
423 typedef struct BusLogic_ExtendedSetupInformation
424 {
425 unsigned char BusType;
426 unsigned char BIOS_Address;
427 unsigned short ScatterGatherLimit;
428 unsigned char MailboxCount;
429 void *BaseMailboxAddress __attribute__ ((packed));
430 struct { unsigned char :6;
431 boolean LevelSensitiveInterrupts:1;
432 unsigned char :1; } Misc;
433 unsigned char FirmwareRevision[3];
434 boolean HostWideSCSI:1;
435 boolean HostDifferentialSCSI:1;
436 unsigned char :6;
437 }
438 BusLogic_ExtendedSetupInformation_T;
439
440
441
442
443
444
445 #define BusLogic_AggressiveRoundRobinMode 0x00
446 #define BusLogic_StrictRoundRobinMode 0x01
447
448 typedef unsigned char BusLogic_RoundRobinModeRequest_T;
449
450
451
452
453
454
455
456
457
458 #define BusLogic_ModifyIO_330 0x00
459 #define BusLogic_ModifyIO_334 0x01
460 #define BusLogic_ModifyIO_230 0x02
461 #define BusLogic_ModifyIO_234 0x03
462 #define BusLogic_ModifyIO_130 0x04
463 #define BusLogic_ModifyIO_134 0x05
464 #define BusLogic_ModifyIO_Disable 0x06
465 #define BusLogic_ModifyIO_Disable2 0x07
466
467 typedef unsigned char BusLogic_ModifyIOAddressRequest_T;
468
469
470
471
472
473
474
475 #define BusLogic_NormalModeCCB 0x00
476 #define BusLogic_WideModeCCB 0x01
477
478 typedef unsigned char BusLogic_WideModeCCBRequest_T;
479
480
481
482
483
484
485
486
487 typedef unsigned char BusLogic_RequestedReplyLength_T;
488
489
490
491
492
493
494
495
496 typedef unsigned long BusLogic_Lock_T;
497
498
499
500
501
502
503 typedef enum
504 {
505 BusLogic_OutgoingMailboxFree = 0,
506 BusLogic_MailboxStartCommand = 1,
507 BusLogic_MailboxAbortCommand = 2
508 }
509 BusLogic_ActionCode_T;
510
511
512
513
514
515
516 typedef enum
517 {
518 BusLogic_IncomingMailboxFree = 0,
519 BusLogic_CommandCompletedWithoutError = 1,
520 BusLogic_CommandAbortedAtHostRequest = 2,
521 BusLogic_AbortedCommandNotFound = 3,
522 BusLogic_CommandCompletedWithError = 4
523 }
524 BusLogic_CompletionCode_T;
525
526
527
528
529
530
531 typedef enum
532 {
533 BusLogic_InitiatorCCB = 0x00,
534 BusLogic_TargetCCB = 0x01,
535 BusLogic_InitiatorCCB_ScatterGather = 0x02,
536 BusLogic_InitiatorCCB_ResidualDataLength = 0x03,
537 BusLogic_InitiatorCCB_ScatterGatherResidual = 0x04,
538 BusLogic_SCSIBusDeviceReset = 0x81
539 }
540 BusLogic_CCB_Opcode_T;
541
542
543
544
545
546
547 typedef enum
548 {
549 BusLogic_UncheckedDataTransfer = 0x00,
550 BusLogic_DataInLengthChecked = 0x01,
551 BusLogic_DataOutLengthChecked = 0x02,
552 BusLogic_NoDataTransfer = 0x03
553 }
554 BusLogic_DataDirection_T;
555
556
557
558
559
560
561 typedef enum
562 {
563 BusLogic_CommandCompletedNormally = 0x00,
564 BusLogic_LinkedCommandCompleted = 0x0A,
565 BusLogic_LinkedCommandCompletedWithFlag = 0x0B,
566 BusLogic_SCSISelectionTimeout = 0x11,
567 BusLogic_DataOverUnderRun = 0x12,
568 BusLogic_UnexpectedBusFree = 0x13,
569 BusLogic_InvalidBusPhaseRequested = 0x14,
570 BusLogic_InvalidOutgoingMailboxActionCode = 0x15,
571 BusLogic_InvalidCommandOperationCode = 0x16,
572 BusLogic_LinkedCCBhasInvalidLUN = 0x17,
573 BusLogic_InvalidCommandParameter = 0x1A,
574 BusLogic_AutoRequestSenseFailed = 0x1B,
575 BusLogic_TaggedQueuingMessageRejected = 0x1C,
576 BusLogic_UnsupportedMessageReceived = 0x1D,
577 BusLogic_HostAdapterHardwareFailed = 0x20,
578 BusLogic_TargetFailedResponseToATN = 0x21,
579 BusLogic_HostAdapterAssertedRST = 0x22,
580 BusLogic_OtherDeviceAssertedRST = 0x23,
581 BusLogic_TargetDeviceReconnectedImproperly = 0x24,
582 BusLogic_HostAdapterAssertedBusDeviceReset = 0x25,
583 BusLogic_AbortQueueGenerated = 0x26,
584 BusLogic_HostAdapterSoftwareError = 0x27,
585 BusLogic_HostAdapterHardwareTimeoutError = 0x30,
586 BusLogic_SCSIParityErrorDetected = 0x34
587 }
588 BusLogic_HostAdapterStatus_T;
589
590
591
592
593
594
595 typedef enum
596 {
597 BusLogic_OperationGood = 0x00,
598 BusLogic_CheckCondition = 0x02,
599 BusLogic_DeviceBusy = 0x08
600 }
601 BusLogic_TargetDeviceStatus_T;
602
603
604
605
606
607
608 typedef enum
609 {
610 BusLogic_SimpleQueueTag = 0x00,
611 BusLogic_HeadOfQueueTag = 0x01,
612 BusLogic_OrderedQueueTag = 0x02,
613 BusLogic_ReservedQT = 0x03
614 }
615 BusLogic_QueueTag_T;
616
617
618
619
620
621
622 #define BusLogic_CDB_MaxLength 12
623
624 typedef unsigned char SCSI_CDB_T[BusLogic_CDB_MaxLength];
625
626
627
628
629
630
631 #define BusLogic_SenseDataMaxLength 255
632
633 typedef unsigned char SCSI_SenseData_T[BusLogic_SenseDataMaxLength];
634
635
636
637
638
639
640
641 typedef struct BusLogic_ScatterGatherSegment
642 {
643 unsigned long SegmentByteCount;
644 void *SegmentDataPointer;
645 }
646 BusLogic_ScatterGatherSegment_T;
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661 typedef struct BusLogic_CCB
662 {
663
664
665
666 BusLogic_CCB_Opcode_T Opcode:8;
667 unsigned char :3;
668 BusLogic_DataDirection_T DataDirection:2;
669 boolean WideModeTagEnable:1;
670 BusLogic_QueueTag_T WideModeQueueTag:2;
671 unsigned char CDB_Length;
672 unsigned char SenseDataLength;
673 unsigned long DataLength;
674 void *DataPointer;
675 unsigned char :8;
676 unsigned char :8;
677 BusLogic_HostAdapterStatus_T HostAdapterStatus:8;
678 BusLogic_TargetDeviceStatus_T TargetDeviceStatus:8;
679 unsigned char TargetID;
680 unsigned char LogicalUnit:5;
681 boolean TagEnable:1;
682 BusLogic_QueueTag_T QueueTag:2;
683 SCSI_CDB_T CDB;
684 unsigned char :8;
685 unsigned char :8;
686 unsigned long :32;
687 SCSI_SenseData_T *SenseDataPointer;
688
689
690
691 struct BusLogic_HostAdapter *HostAdapter;
692 SCSI_Command_T *Command;
693 enum { BusLogic_CCB_Free = 0,
694 BusLogic_CCB_Active = 1,
695 BusLogic_CCB_Completed = 2,
696 BusLogic_CCB_Reset = 3 } Status;
697 BusLogic_CompletionCode_T MailboxCompletionCode;
698 unsigned int SerialNumber;
699 struct BusLogic_CCB *Next;
700 struct BusLogic_CCB *NextAll;
701 BusLogic_ScatterGatherSegment_T
702 ScatterGatherList[BusLogic_ScatterGatherLimit];
703 }
704 BusLogic_CCB_T;
705
706
707
708
709
710
711 typedef struct BusLogic_OutgoingMailbox
712 {
713 BusLogic_CCB_T *CCB;
714 unsigned long :24;
715 BusLogic_ActionCode_T ActionCode:8;
716 }
717 BusLogic_OutgoingMailbox_T;
718
719
720
721
722
723
724 typedef struct BusLogic_IncomingMailbox
725 {
726 BusLogic_CCB_T *CCB;
727 BusLogic_HostAdapterStatus_T HostAdapterStatus:8;
728 BusLogic_TargetDeviceStatus_T TargetDeviceStatus:8;
729 unsigned char :8;
730 BusLogic_CompletionCode_T CompletionCode:8;
731 }
732 BusLogic_IncomingMailbox_T;
733
734
735
736
737
738
739 typedef enum
740 {
741 BusLogic_Unknown_Bus = 0,
742 BusLogic_ISA_Bus = 1,
743 BusLogic_MCA_Bus = 2,
744 BusLogic_EISA_Bus = 3,
745 BusLogic_VESA_Bus = 4,
746 BusLogic_PCI_Bus = 5
747 }
748 BusLogic_BusType_T;
749
750 static char
751 *BusLogic_BusNames[] =
752 { "Unknown", "ISA", "MCA", "EISA", "VESA", "PCI" };
753
754
755
756
757
758
759 typedef struct BusLogic_CommandLineEntry
760 {
761 unsigned short IO_Address;
762 unsigned short Concurrency;
763 unsigned short BusSettleTime;
764 unsigned short LocalOptions;
765 unsigned short TaggedQueuingPermitted;
766 unsigned short TaggedQueuingPermittedMask;
767 unsigned char ErrorRecoveryOption[BusLogic_MaxTargetIDs];
768 }
769 BusLogic_CommandLineEntry_T;
770
771
772
773
774
775
776 typedef struct BusLogic_HostAdapter
777 {
778 SCSI_Host_T *SCSI_Host;
779 unsigned char HostNumber;
780 unsigned char ModelName[9];
781 unsigned char FirmwareVersion[6];
782 unsigned char BoardName[18];
783 unsigned char InterruptLabel[62];
784 unsigned short IO_Address;
785 unsigned char IRQ_Channel;
786 unsigned char DMA_Channel;
787 unsigned char SCSI_ID;
788 BusLogic_BusType_T BusType:3;
789 boolean IRQ_ChannelAcquired:1;
790 boolean DMA_ChannelAcquired:1;
791 boolean SynchronousInitiation:1;
792 boolean ParityChecking:1;
793 boolean ExtendedTranslation:1;
794 boolean LevelSensitiveInterrupts:1;
795 boolean HostWideSCSI:1;
796 boolean HostDifferentialSCSI:1;
797 boolean HostAdapterResetPending:1;
798 boolean BounceBuffersRequired:1;
799 volatile boolean HostAdapterCommandCompleted:1;
800 unsigned short HostAdapterScatterGatherLimit;
801 unsigned short DriverScatterGatherLimit;
802 unsigned short MaxTargetIDs;
803 unsigned short MaxLogicalUnits;
804 unsigned short Concurrency;
805 unsigned short BusSettleTime;
806 unsigned short LocalOptions;
807 unsigned short DisconnectPermitted;
808 unsigned short TaggedQueuingPermitted;
809 unsigned long BIOS_Address;
810 BusLogic_InstalledDevices_T InstalledDevices;
811 BusLogic_SynchronousValues_T SynchronousValues;
812 BusLogic_SynchronousPeriod_T SynchronousPeriod;
813 BusLogic_Lock_T Lock;
814 struct BusLogic_HostAdapter *Next;
815 BusLogic_CommandLineEntry_T *CommandLineEntry;
816 BusLogic_CCB_T *All_CCBs;
817 BusLogic_CCB_T *Free_CCBs;
818 unsigned char ErrorRecoveryOption[BusLogic_MaxTargetIDs];
819 unsigned char CommandSuccessfulFlag[BusLogic_MaxTargetIDs];
820 unsigned long ReadWriteOperationCount[BusLogic_MaxTargetIDs];
821 unsigned char QueuedOperationCount[BusLogic_MaxTargetIDs];
822 unsigned long LastSequencePoint[BusLogic_MaxTargetIDs];
823 BusLogic_OutgoingMailbox_T *FirstOutgoingMailbox;
824 BusLogic_OutgoingMailbox_T *LastOutgoingMailbox;
825 BusLogic_OutgoingMailbox_T *NextOutgoingMailbox;
826 BusLogic_IncomingMailbox_T *FirstIncomingMailbox;
827 BusLogic_IncomingMailbox_T *LastIncomingMailbox;
828 BusLogic_IncomingMailbox_T *NextIncomingMailbox;
829 BusLogic_OutgoingMailbox_T OutgoingMailboxes[BusLogic_MailboxCount];
830 BusLogic_IncomingMailbox_T IncomingMailboxes[BusLogic_MailboxCount];
831 }
832 BusLogic_HostAdapter_T;
833
834
835
836
837
838
839 typedef struct BIOS_DiskParameters
840 {
841 int Heads;
842 int Sectors;
843 int Cylinders;
844 }
845 BIOS_DiskParameters_T;
846
847
848
849
850
851
852 static inline
853 void BusLogic_LockHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
854 {
855 save_flags(HostAdapter->Lock);
856 cli();
857 }
858
859
860
861
862
863
864 static inline
865 void BusLogic_UnlockHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
866 {
867 restore_flags(HostAdapter->Lock);
868 }
869
870
871
872
873
874
875
876 static inline
877 void BusLogic_LockHostAdapterID(BusLogic_HostAdapter_T *HostAdapter)
878 {
879 }
880
881
882
883
884
885
886
887 static inline
888 void BusLogic_UnlockHostAdapterID(BusLogic_HostAdapter_T *HostAdapter)
889 {
890 }
891
892
893
894
895
896
897
898 static inline
899 void BusLogic_WriteControlRegister(BusLogic_HostAdapter_T *HostAdapter,
900 unsigned char Value)
901 {
902 outb(Value, HostAdapter->IO_Address + BusLogic_ControlRegister);
903 }
904
905 static inline
906 unsigned char BusLogic_ReadStatusRegister(BusLogic_HostAdapter_T *HostAdapter)
907 {
908 return inb(HostAdapter->IO_Address + BusLogic_StatusRegister);
909 }
910
911 static inline
912 void BusLogic_WriteCommandParameterRegister(BusLogic_HostAdapter_T *HostAdapter,
913 unsigned char Value)
914 {
915 outb(Value, HostAdapter->IO_Address + BusLogic_CommandParameterRegister);
916 }
917
918 static inline
919 unsigned char BusLogic_ReadDataInRegister(BusLogic_HostAdapter_T *HostAdapter)
920 {
921 return inb(HostAdapter->IO_Address + BusLogic_DataInRegister);
922 }
923
924 static inline
925 unsigned char BusLogic_ReadInterruptRegister(BusLogic_HostAdapter_T
926 *HostAdapter)
927 {
928 return inb(HostAdapter->IO_Address + BusLogic_InterruptRegister);
929 }
930
931 static inline
932 unsigned char BusLogic_ReadGeometryRegister(BusLogic_HostAdapter_T *HostAdapter)
933 {
934 return inb(HostAdapter->IO_Address + BusLogic_GeometryRegister);
935 }
936
937
938
939
940
941
942
943
944 static inline
945 void BusLogic_StartMailboxScan(BusLogic_HostAdapter_T *HostAdapter)
946 {
947 BusLogic_WriteCommandParameterRegister(HostAdapter,
948 BusLogic_StartMailboxCommand);
949 }
950
951
952
953
954
955
956 static inline void BusLogic_Delay(int Seconds)
957 {
958 unsigned long TimeoutJiffies = jiffies + Seconds * HZ;
959 unsigned long ProcessorFlags;
960 save_flags(ProcessorFlags);
961 sti();
962 while (jiffies < TimeoutJiffies) ;
963 restore_flags(ProcessorFlags);
964 }
965
966
967
968
969
970
971
972 static void BusLogic_InterruptHandler(int, Registers_T *);
973 static int BusLogic_ResetHostAdapter(BusLogic_HostAdapter_T *,
974 SCSI_Command_T *);
975
976
977 #endif