ReactOS 0.4.15-dev-8146-gdc0ed6d
BusLogic958.h
Go to the documentation of this file.
1/*
2 * vmscsi-- Miniport driver for the Buslogic BT 958 SCSI Controller
3 * under Windows 2000/XP/Server 2003
4 *
5 * Based in parts on the buslogic driver for the same device
6 * available with the GNU Linux Operating System.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23//_________________________________________________________________________________________
24//
25// File description :The header file the driver for BusLogic-958 SCSI Host adapter card.
26// The technical reference for this driver is at :
27//
28// Author: Namita Lal, Sirish Raghuram ( Calsoft Pvt Ltd)
29// Date: 10th June 2002
30// Status: Released
31// Revision History: Changed queue depth to 191 - June 2002
32//
33//_________________________________________________________________________________________
34
35// Prototype for functions
36
37#pragma once
38
39#include <ntddk.h>
40#include <srb.h>
41#include <scsi.h>
42#include <ntddscsi.h>
43#include <scsiwmi.h>
44//#include <ntos/kefuncs.h>
45
46
47//#include "miniport.h"
48//#include "scsi.h"
49//#include "scsiwmi.h"
50//_________________________________________________________________________________________
51// #defines
52//_________________________________________________________________________________________
53
54// Debug levels
55#define ERROR 1
56#define WARNING 2
57#define TRACE 3
58#define INFO 4
59
60// Max transfer size
61#define MAX_TRANSFER_SIZE 64 * 1024
62// flag to turn on Scatter gather support
63#define SG_SUPPORT 1
64// flag to turn on tagged command queuing
65#define TAG_QUEUING 1
66
67#define BUSLOGIC_MAXIMUM_TAGS 128
68
69// Define the maximum, maximum automatic, minimum automatic, and default Queue
70// Depth to allow for Target Devices depending on whether or not they support
71// Tagged Queuing and whether or not ISA Bounce Buffers are required.
72#define BusLogic_MaxTaggedQueueDepth 128
73
74// Define the default amount of time in seconds to wait between a Host Adapter
75// Hard Reset which initiates a SCSI Bus Reset and issuing any SCSI commands.
76// Some SCSI devices get confused if they receive SCSI commands too soon after
77// a SCSI Bus Reset.
78#define BusLogic_DefaultBusSettleTime 2
79
80// Define the maximum number of Target Devices supported by this driver.
81#define BusLogic_MaxTargetDevices 16
82
83// Define the maximum number of Logical unit supported/Target Devices supported by this driver.
84#define BusLogic_MaxLogicalUnits 32
85
86// Define the maximum number of Mailboxes that should be used for MultiMaster
87// Host Adapters. This number is chosen to be larger than the maximum Host
88// Adapter Queue Depth and small enough so that the Host Adapter structure
89// does not cross an allocation block size boundary.
90#define BusLogic_MaxMailboxes 211
91
92// Define the Fetch Host Adapter Local RAM request type.
93#define BusLogic_BIOS_BaseOffset 0
94#define BusLogic_AutoSCSI_BaseOffset 64
95
96// Define the SCSI Command Descriptor Block (CDB).
97#define BusLogic_CDB_MaxLength 12
98
99// Define the maximum number of Scatter/Gather Segments used by this driver.
100// For optimal performance, it is important that this limit be at least as
101// large as the largest single request generated by the I/O Subsystem.
102#define BusLogic_ScatterGatherLimit 128
103#define MAX_SG_LIMIT BusLogic_ScatterGatherLimit
104
105#define BusLogic_AggressiveRoundRobinMode 0
106#define BusLogic_StrictRoundRobinMode 1
107
108// Define the Codes for byte 3 (Request sense allocation length) of the CCB structure.
109#define BusLogic_Allocate14Bytes 0x00
110#define BusLogic_DisableAutoReqSense 0x01
111//_________________________________________________________________________________________
112
113
114//_________________________________________________________________________________________
115// typedef
116//_________________________________________________________________________________________
117typedef enum
118{
164
165
166// Define the Requested Reply Length type used by the Inquire Setup Information,
167// Inquire Host Adapter Model Number, Inquire Synchronous Period, and Inquire
168// Extended Setup Information commands.
170
171// Define a 32 bit Bus Address data type.
172typedef unsigned int BusLogic_BusAddress_T;
173
174// Define the Inquire Host Adapter Model Number reply type.
176
177// Define the Inquire Firmware Version 3rd Digit reply type.
179
180// Define the Inquire Firmware Version Letter reply type.
182
183// Define a 32 bit Byte Count data type.
184typedef unsigned int BusLogic_ByteCount_T;
185
187{
188 UCHAR ByteOffset; // Byte 0
189 UCHAR ByteCount; // Byte 1
190}
192
193// Define the Inquire PCI Host Adapter Information reply type. The ISA
194// Compatible I/O Port values are defined here and are also used with
195// the Modify I/O Address command.
197{
208
209#pragma pack (1)
211{
214 BOOLEAN LowByteTerminated:1; /* Byte 2 Bit 0 */
215 BOOLEAN HighByteTerminated:1; /* Byte 2 Bit 1 */
216 UCHAR :2; /* Byte 2 Bits 2-3 */
217 BOOLEAN JP1:1; /* Byte 2 Bit 4 */
218 BOOLEAN JP2:1; /* Byte 2 Bit 5 */
219 BOOLEAN JP3:1; /* Byte 2 Bit 6 */
220 BOOLEAN GenericInfoValid:1; /* Byte 2 Bit 7 */
221 UCHAR :8; /* Byte 3 */
223
224// Define the Inquire Board ID reply structure.
225typedef struct BusLogic_BoardID
226{
227 UCHAR BoardType; /* Byte 0 */
228 UCHAR CustomFeatures; /* Byte 1 */
232#pragma pack ()
233
234// Define the Host Adapter Target Flags structure.
236{
244}
246
247// Define the Host Adapter Target Statistics structure.
248#define BusLogic_SizeBuckets 10
249
250// Define a 10^18 Statistics Byte Counter data type.
252{
253 unsigned int Units;
254 unsigned int Billions;
256
258
260{
261 unsigned int CommandsAttempted;
262 unsigned int CommandsCompleted;
263 unsigned int ReadCommands;
264 unsigned int WriteCommands;
278}
280
281#pragma pack (1)
282// Define the Inquire Configuration reply structure.
284{
285 UCHAR :5; /* Byte 0 Bits 0-4 */
286 BOOLEAN DMA_Channel5:1; /* Byte 0 Bit 5 */
287 BOOLEAN DMA_Channel6:1; /* Byte 0 Bit 6 */
288 BOOLEAN DMA_Channel7:1; /* Byte 0 Bit 7 */
289 BOOLEAN IRQ_Channel9:1; /* Byte 1 Bit 0 */
290 BOOLEAN IRQ_Channel10:1; /* Byte 1 Bit 1 */
291 BOOLEAN IRQ_Channel11:1; /* Byte 1 Bit 2 */
292 BOOLEAN IRQ_Channel12:1; /* Byte 1 Bit 3 */
293 UCHAR :1; /* Byte 1 Bit 4 */
294 BOOLEAN IRQ_Channel14:1; /* Byte 1 Bit 5 */
295 BOOLEAN IRQ_Channel15:1; /* Byte 1 Bit 6 */
296 UCHAR :1; /* Byte 1 Bit 7 */
297 UCHAR HostAdapterID:4; /* Byte 2 Bits 0-3 */
298 UCHAR :4; /* Byte 2 Bits 4-7 */
300
301// Define the Inquire Setup Information reply structure.
303{
304 UCHAR Offset:4; /* Bits 0-3 */
305 UCHAR TransferPeriod:3; /* Bits 4-6 */
306 BOOLEAN Synchronous:1; /* Bit 7 */
308
311
313{
315 BOOLEAN ParityCheckingEnabled:1; /* Byte 0 Bit 1 */
316 UCHAR :6; /* Byte 0 Bits 2-7 */
317 UCHAR BusTransferRate; /* Byte 1 */
319 UCHAR TimeOffBus; /* Byte 3 */
320 UCHAR MailboxCount; /* Byte 4 */
321 UCHAR MailboxAddress[3]; /* Bytes 5-7 */
324 UCHAR Signature; /* Byte 17 */
325 UCHAR CharacterD; /* Byte 18 */
326 UCHAR HostBusType; /* Byte 19 */
331 UCHAR :8; /* Byte 31 */
335
336// Something has to be done about the packing mechanism of these structures - Namita
337// Define the Inquire Extended Setup Information reply structure.
339{
340 UCHAR BusType; // Byte 0
342 unsigned short ScatterGatherLimit; // Bytes 2-3
345 struct
346 {
347 UCHAR :2; // Byte 9 Bits 0-1
348 BOOLEAN FastOnEISA:1; // Byte 9 Bit 2
349 UCHAR :3; // Byte 9 Bits 3-5
352 } Misc; // Byte 9 Bit 7
353 UCHAR FirmwareRevision[3]; // Bytes 10-12
354 BOOLEAN HostWideSCSI:1; // Byte 13 Bit 0
355 BOOLEAN HostDifferentialSCSI:1; // Byte 13 Bit 1
356 BOOLEAN HostSupportsSCAM:1; // Byte 13 Bit 2
357 BOOLEAN HostUltraSCSI:1; // Byte 13 Bit 3
358 BOOLEAN HostSmartTermination:1; // Byte 13 Bit 4
359 UCHAR :3; // Byte 13 Bits 5-7
361
362// Define the Host Adapter Local RAM AutoSCSI structure.
364{
367 UCHAR HostAdapterType[6]; /* Bytes 3-8 */
368 UCHAR :8; /* Byte 9 */
369 UCHAR FloppyEnabled:1; /* Byte 10 Bit 0 */
370 UCHAR FloppySecondary:1; /* Byte 10 Bit 1 */
371 UCHAR LevelSensitiveInterrupt:1; /* Byte 10 Bit 2 */
372 UCHAR :2; /* Byte 10 Bits 3-4 */
373 UCHAR SystemRAMAreaForBIOS:3; /* Byte 10 Bits 5-7 */
374 UCHAR DMA_Channel:7; /* Byte 11 Bits 0-6 */
375 UCHAR DMA_AutoConfiguration:1; /* Byte 11 Bit 7 */
376 UCHAR IRQ_Channel:7; /* Byte 12 Bits 0-6 */
377 UCHAR IRQ_AutoConfiguration:1; /* Byte 12 Bit 7 */
378 UCHAR DMA_TransferRate; /* Byte 13 */
379 UCHAR SCSI_ID; /* Byte 14 */
380 UCHAR LowByteTerminated:1; /* Byte 15 Bit 0 */
381 UCHAR ParityCheckingEnabled:1; /* Byte 15 Bit 1 */
382 UCHAR HighByteTerminated:1; /* Byte 15 Bit 2 */
383 UCHAR NoisyCablingEnvironment:1; /* Byte 15 Bit 3 */
384 UCHAR FastSynchronousNegotiation:1; /* Byte 15 Bit 4 */
385 UCHAR BusResetEnabled:1; /* Byte 15 Bit 5 */
386 UCHAR :1; /* Byte 15 Bit 6 */
387 UCHAR ActiveNegationEnabled:1; /* Byte 15 Bit 7 */
388 UCHAR BusOnDelay; /* Byte 16 */
389 UCHAR BusOffDelay; /* Byte 17 */
390 UCHAR HostAdapterBIOSEnabled:1; /* Byte 18 Bit 0 */
392 UCHAR ExtendedTranslationEnabled:1; /* Byte 18 Bit 2 */
393 UCHAR MapRemovableAsFixedEnabled:1; /* Byte 18 Bit 3 */
394 UCHAR :1; /* Byte 18 Bit 4 */
396 UCHAR BIOSInterruptModeEnabled:1; /* Byte 18 Bit 6 */
397 UCHAR FlopticalSupportEnabled:1; /* Byte 19 Bit 7 */
398 unsigned short DeviceEnabled:16; /* Bytes 19-20 */
399 unsigned short WidePermitted:16; /* Bytes 21-22 */
400 unsigned short FastPermitted:16; /* Bytes 23-24 */
401 unsigned short SynchronousPermitted:16; /* Bytes 25-26 */
402 unsigned short DisconnectPermitted:16; /* Bytes 27-28 */
403 unsigned short SendStartUnitCommand:16; /* Bytes 29-30 */
404 unsigned short IgnoreInBIOSScan:16; /* Bytes 31-32 */
405 UCHAR PCIInterruptPin:2; /* Byte 33 Bits 0-1 */
406 UCHAR HostAdapterIOPortAddress:2; /* Byte 33 Bits 2-3 */
407 UCHAR StrictRoundRobinModeEnabled:1; /* Byte 33 Bit 4 */
408 UCHAR VESABusSpeedGreaterThan33MHz:1; /* Byte 33 Bit 5 */
409 UCHAR VESABurstWriteEnabled:1; /* Byte 33 Bit 6 */
410 UCHAR VESABurstReadEnabled:1; /* Byte 33 Bit 7 */
411 unsigned short UltraPermitted:16; /* Bytes 34-35 */
412 unsigned int :32; /* Bytes 36-39 */
413 UCHAR :8; /* Byte 40 */
415 UCHAR :1; /* Byte 42 Bit 0 */
416 UCHAR SCAM_Dominant:1; /* Byte 42 Bit 1 */
417 UCHAR SCAM_Enabled:1; /* Byte 42 Bit 2 */
418 UCHAR SCAM_Level2:1; /* Byte 42 Bit 3 */
419 UCHAR :4; /* Byte 42 Bits 4-7 */
420 UCHAR INT13ExtensionEnabled:1; /* Byte 43 Bit 0 */
421 UCHAR :1; /* Byte 43 Bit 1 */
422 UCHAR CDROMBootEnabled:1; /* Byte 43 Bit 2 */
423 UCHAR :5; /* Byte 43 Bits 3-7 */
424 UCHAR BootTargetID:4; /* Byte 44 Bits 0-3 */
425 UCHAR BootChannel:4; /* Byte 44 Bits 4-7 */
426 UCHAR ForceBusDeviceScanningOrder:1; /* Byte 45 Bit 0 */
427 UCHAR :7; /* Byte 45 Bits 1-7 */
428 unsigned short NonTaggedToAlternateLUNPermitted; /* Bytes 46-47 */
429 unsigned short RenegotiateSyncAfterCheckCondition; /* Bytes 48-49 */
430 UCHAR Reserved[10]; /* Bytes 50-59 */
431 UCHAR ManufacturingDiagnostic[2]; /* Bytes 60-61 */
432 unsigned short Checksum:16; /* Bytes 62-63 */
434#pragma pack()
435
436// Define the Outgoing Mailbox Action Codes.
437typedef enum
438{
443
444
445// Define the Incoming Mailbox Completion Codes. The MultiMaster Firmware
446// only uses codes 0 - 4. The FlashPoint SCCB Manager has no mailboxes, so
447// completion codes are stored in the CCB; it only uses codes 1, 2, 4, and 5.
448typedef enum
449{
457
458// Define the Command Control Block (CCB) Opcodes.
459typedef enum
460{
468
469
470// Define the CCB Data Direction Codes.
471typedef enum
472{
478
479
480// Define the Host Adapter Status Codes. The MultiMaster Firmware does not
481// return status code 0x0C; it uses 0x12 for both overruns and underruns.
482typedef enum
483{
510
511// Define the SCSI Target Device Status Codes.
512typedef enum
513{
518
519// Define the Queue Tag Codes.
520typedef enum
521{
527
528// Define the Scatter/Gather Segment structure required by the MultiMaster
529// Firmware Interface and the FlashPoint SCCB Manager.
531{
535
536
538
539// Define the Driver CCB Status Codes.
540typedef enum
541{
547
548// Define the 32 Bit Mode Command Control Block (CCB) structure. The first 40
549// bytes are defined by the MultiMaster Firmware The remaining components are
550// defined by the Scsi MiniportDriver.
551// Extended LUN Format CCBs differ from Legacy LUN Format 32 Bit Mode
552// CCBs only in having the TagEnable and QueueTag fields moved from byte 17 to
553// byte 1, and the Logical Unit field in byte 17 expanded to 6 bits. In theory,
554// Extended LUN Format CCBs can support up to 64 Logical Units, but in practice
555// many devices will respond improperly to Logical Units between 32 and 63, and
556// the SCSI-2 specification defines Bit 5 as LUNTAR. Extended LUN Format CCBs
557// are used by recent versions of the MultiMaster Firmware.
558// Since 64 Logical Units are unlikely to be needed in practice, and
559// since they are problematic for the above reasons, and since limiting them to
560// 5 bits simplifies the CCB structure definition, this driver only supports
561// 32 Logical Units per Target Device.
562typedef struct BusLogic_CCB
563{
564 UCHAR Opcode; /* Byte 0 */
565 UCHAR :3; /* Byte 1 Bits 0-2 */
566 UCHAR DataDirection:2; /* Byte 1 Bits 3-4 */
567 UCHAR TagEnable:1; /* Byte 1 Bit 5 */
568 UCHAR QueueTag:2; /* Byte 1 Bits 6-7 */
569 UCHAR CDB_Length; /* Byte 2 */
570 UCHAR SenseDataLength; /* Byte 3 */
573 UCHAR :8; /* Byte 12 */
574 UCHAR :8; /* Byte 13 */
577 UCHAR TargetID; /* Byte 16 */
578 UCHAR LogicalUnit:5; /* Byte 17 Bits 0-4 */
579 UCHAR LegacyTagEnable:1; /* Byte 17 Bit 5 */
580 UCHAR LegacyQueueTag:2; /* Byte 17 Bits 6-7 */
581 SCSI_CDB_T CDB; /* Bytes 18-29 */
582 UCHAR :8; /* Byte 30 */
583 UCHAR :8; /* Byte 31 */
584 unsigned int :32; /* Bytes 32-35 */
586
587 // BusLogic Driver Defined Portion.
589 unsigned long SerialNumber;
593
595 // Pointer to the CCB
599
600#pragma pack(1)
601// Define the 32 Bit Mode Outgoing Mailbox structure.
603{
605 UCHAR :8; /* Bytes 4 */
606 UCHAR :8; /* Bytes 5 */
607 UCHAR :8; /* Bytes 6 */
608 UCHAR ActionCode; /* Byte 7 */
610
611// Define the 32 Bit Mode Incoming Mailbox structure.
613{
614 BusLogic_BusAddress_T CCB; /* Bytes 0-3 */
617 UCHAR :8; /* Byte 6 */
618 UCHAR CompletionCode; /* Byte 7 */
620#pragma pack ()
621
622//
623// The following structure is allocated
624// from noncached memory as data will be DMA'd to
625// and from it.
627{
628 // Physical base address of mailboxes
630
631 // Mailboxes
635
636// Define the types of BusLogic Host Adapters that are supported and the number
637// of I/O Addresses required by each type.
638typedef enum
639{
643
644// Define the possible Host Adapter Bus Types.
645typedef enum
646{
654
655#if 0
656static char *BusLogic_HostAdapterBusNames[] = { "Unknown", "ISA", "EISA", "PCI", "VESA", "MCA" };
657#endif
660 BusLogic_ISA_Bus, /* BT-5xx */
661 BusLogic_MCA_Bus, /* BT-6xx */
662 BusLogic_EISA_Bus, /* BT-7xx */
663 BusLogic_Unknown_Bus, /* BT-8xx */
664 BusLogic_PCI_Bus /* BT-9xx */
665 };
666
667// Define the BusLogic Driver Host Adapter structure
669{
670
673
678
682
702
707
710
711 unsigned short DriverQueueDepth;
712 unsigned short HostAdapterQueueDepth;
713 unsigned short UntaggedQueueDepth;
714 unsigned short CommonQueueDepth;
715 unsigned short BusSettleTime;
716 unsigned short SynchronousPermitted;
717 unsigned short FastPermitted;
718 unsigned short UltraPermitted;
719 unsigned short WidePermitted;
720 unsigned short DisconnectPermitted;
724 unsigned short TargetDeviceCount;
725
727
731
741
751
752
753// Buslogic specific port driver device object extension.
754typedef struct
756{
760
762
763
764// Define a structure for the SCSI Inquiry command results.
765#pragma pack (1)
766typedef struct SCSI_Inquiry
767{
768 UCHAR PeripheralDeviceType:5; /* Byte 0 Bits 0-4 */
769 UCHAR PeripheralQualifier:3; /* Byte 0 Bits 5-7 */
770 UCHAR DeviceTypeModifier:7; /* Byte 1 Bits 0-6 */
771 BOOLEAN RMB:1; /* Byte 1 Bit 7 */
772 UCHAR ANSI_ApprovedVersion:3; /* Byte 2 Bits 0-2 */
773 UCHAR ECMA_Version:3; /* Byte 2 Bits 3-5 */
774 UCHAR ISO_Version:2; /* Byte 2 Bits 6-7 */
775 UCHAR ResponseDataFormat:4; /* Byte 3 Bits 0-3 */
776 UCHAR :2; /* Byte 3 Bits 4-5 */
777 BOOLEAN TrmIOP:1; /* Byte 3 Bit 6 */
778 BOOLEAN AENC:1; /* Byte 3 Bit 7 */
780 UCHAR :8; /* Byte 5 */
781 UCHAR :8; /* Byte 6 */
782 BOOLEAN SftRe:1; /* Byte 7 Bit 0 */
783 BOOLEAN CmdQue:1; /* Byte 7 Bit 1 */
784 BOOLEAN :1; /* Byte 7 Bit 2 */
785 BOOLEAN Linked:1; /* Byte 7 Bit 3 */
786 BOOLEAN Sync:1; /* Byte 7 Bit 4 */
787 BOOLEAN WBus16:1; /* Byte 7 Bit 5 */
788 BOOLEAN WBus32:1; /* Byte 7 Bit 6 */
789 BOOLEAN RelAdr:1; /* Byte 7 Bit 7 */
790 UCHAR VendorIdentification[8];/* Bytes 8-15 */
791 UCHAR ProductIdentification[16];/* Bytes 16-31 */
792 UCHAR ProductRevisionLevel[4];/* Bytes 32-35 */
794
796{
797 UCHAR BusType; // Byte 0
799 unsigned short ScatterGatherLimit; // Bytes 2-3
804 UCHAR FirmwareRevision[3]; // Bytes 11-14
811
812#pragma pack ()
813
814//_________________________________________________________________________________________
815// function declarations
816//_________________________________________________________________________________________
817ULONG
818NTAPI
821 );
822
823ULONG
824NTAPI
825BT958HwFindAdapter(IN PVOID HwDeviceExtension,
828 IN PCHAR ArgumentString,
830 OUT PBOOLEAN Again
831 );
832
834NTAPI
835BT958HwInitialize(IN PVOID HwDeviceExtension);
836
838NTAPI
839BT958HwStartIO(IN PVOID HwDeviceExtension,
841 );
842
844NTAPI
845BT958HwInterrupt(IN PVOID HwDeviceExtension);
846
848NTAPI
849BT958HwResetBus(IN PVOID HwDeviceExtension,
851 );
852
854NTAPI
855BT958HwAdapterControl(IN PVOID HwDeviceExtension,
856 IN SCSI_ADAPTER_CONTROL_TYPE ControlType,
858 );
859#if 0
861BT958WmiSrb(IN PHW_DEVICE_EXTENSION HwDeviceExtension,
863#endif
864void
865BT958WmiInitialize( IN PHW_DEVICE_EXTENSION HwDeviceExtension);
866
867
871
874
877 BOOLEAN HardReset);
878
881
882int
884 BusLogic_OperationCode_T OperationCode,
885 void *ParameterData,
886 int ParameterLength,
887 void *ReplyData,
888 int ReplyLength);
889
892
896
899
900int
904
907 BusLogic_ActionCode_T ActionCode,
909
910void
912
913void
915
916void
918
919UCHAR
921 BusLogic_HostAdapterStatus_T HostAdapterStatus,
922 BusLogic_TargetDeviceStatus_T TargetDeviceStatus,
923 UCHAR SenseDataLength);
924
926BusLogic_SendBusDeviceReset(IN PVOID HwDeviceExtension,
928
929static UCHAR
931{
932 return ScsiPortReadPortUchar( adr );
933}
934
935static VOID
937 PUCHAR adr)
938{
940}
941
942//_________________________________________________________________________________________
943// Declarations for the device registers and reading and writing to them
944//_________________________________________________________________________________________
945
946// Define the BusLogic SCSI Host Adapter I/O Register Offsets.
947#define BusLogic_ControlRegisterOffset 0 // WO register
948#define BusLogic_StatusRegisterOffset 0 // RO register
949#define BusLogic_CommandParameterRegisterOffset 1 // WO register
950#define BusLogic_DataInRegisterOffset 1 // RO register
951#define BusLogic_InterruptRegisterOffset 2 // RO register
952#define BusLogic_GeometryRegisterOffset 3 // RO register
953
954
955// Define the structure of the write-only Control Register.
957{
959 struct
960 {
961 UCHAR :4; // Bits 0-3
964 BOOLEAN SoftReset:1; // Bit 6
965 BOOLEAN HardReset:1; // Bit 7
968
969
970// Define the structure of the read-only Status Register.
972{
974 struct
975 {
977 BOOLEAN Reserved:1; // Bit 1
986
987
988
989// Define the structure of the read-only Interrupt Register.
991{
993 struct
994 {
999 UCHAR Reserved:3; // Bits 4-6
1003
1004// Define the possible Host Adapter BIOS Disk Geometry Translations.
1006{
1012
1013// Define the structure of the read-only Geometry Register
1015{
1017 struct
1018 {
1021 UCHAR :3; // Bits 4-6
1024}
1026
1027static void
1029{
1030 BusLogic_ControlRegister_T ControlRegister;
1031 ControlRegister.All = 0;
1032 ControlRegister.Bits.InterruptReset = TRUE;
1033
1034 WriteBusLogicPort(ControlRegister.All,
1036}
1037
1038static void
1040{
1041 BusLogic_ControlRegister_T ControlRegister;
1042 ControlRegister.All = 0;
1043 ControlRegister.Bits.SoftReset = TRUE;
1044 WriteBusLogicPort(ControlRegister.All,
1046}
1047
1048static void
1050{
1051 BusLogic_ControlRegister_T ControlRegister;
1052 ControlRegister.All = 0;
1053 ControlRegister.Bits.HardReset = TRUE;
1054 WriteBusLogicPort(ControlRegister.All,
1056}
1057
1058static UCHAR
1060{
1062}
1063
1064static UCHAR
1066{
1068}
1069
1070static UCHAR
1072{
1074}
1075
1076static UCHAR
1078{
1080}
1081
1082static void
1084 UCHAR Value)
1085{
1088}
1089
1090// BusLogic_StartMailboxCommand issues an Execute Mailbox Command, which
1091// notifies the Host Adapter that an entry has been made in an Outgoing
1092// Mailbox.
1093static void
1095{
1098}
1099
1100// Define the Inquire Synchronous Period reply type. For each Target Device,
1101// a byte is returned which represents the Synchronous Transfer Period in units
1102// of 10 nanoseconds.
1104
1105// Define the Inquire Installed Devices ID 0 to 7 and Inquire Installed
1106// Devices ID 8 to 15 reply type. For each Target Device, a byte is returned
1107// where bit 0 set indicates that Logical Unit 0 exists, bit 1 set indicates
1108// that Logical Unit 1 exists, and so on.
1110
1111// Define the Inquire Target Devices reply type. Inquire Target Devices only
1112// tests Logical Unit 0 of each Target Device unlike the Inquire Installed
1113// Devices commands which test Logical Units 0 - 7. Two bytes are returned,
1114// where byte 0 bit 0 set indicates that Target Device 0 exists, and so on.
1115typedef unsigned short BusLogic_InstalledDevices_T;
1116
1117// Define the Initialize Extended Mailbox request structure.
1118#pragma pack (1)
1120{
1121 UCHAR MailboxCount; /* Byte 0 */
1122 ULONG BaseMailboxAddress; /* Bytes 1-4 */
1124#pragma pack ()
1125
1126// Define the Set CCB Format request type. Extended LUN Format CCBs are
1127// necessary to support more than 8 Logical Units per Target Device.
1129{
1133
1134//______________________________________________________________________________________
1135// Statistics
1136//______________________________________________________________________________________
1137// BusLogic_IncrementByteCounter increments Byte Counter by Amount.
1138static void
1140 unsigned int Amount)
1141{
1142 ByteCounter->Units += Amount;
1143 if (ByteCounter->Units > 999999999)
1144 {
1145 ByteCounter->Units -= 1000000000;
1146 ByteCounter->Billions++;
1147 }
1148}
1149
1150// BusLogic_IncrementSizeBucket increments the Bucket for Amount.
1151static void
1153 unsigned int Amount)
1154{
1155 int Index = 0;
1156 if (Amount < 8*1024)
1157 {
1158 if (Amount < 2*1024)
1159 Index = (Amount < 1*1024 ? 0 : 1);
1160 else
1161 Index = (Amount < 4*1024 ? 2 : 3);
1162 }
1163 else if (Amount < 128*1024)
1164 {
1165 if (Amount < 32*1024)
1166 Index = (Amount < 16*1024 ? 4 : 5);
1167 else
1168 Index = (Amount < 64*1024 ? 6 : 7);
1169 }
1170 else
1171 Index = (Amount < 256*1024 ? 8 : 9);
1172 CommandSizeBuckets[Index]++;
1173}
1174
1175
1176// BusLogic_IncrementErrorCounter increments Error Counter by 1, stopping at
1177// 65535 rather than wrapping around to 0.
1178static void
1179BusLogic_IncrementErrorCounter(unsigned short *ErrorCounter)
1180{
1181 if (*ErrorCounter < 65535) (*ErrorCounter)++;
1182}
1183//____________________________________________________________________________________________
struct BusLogic_CCB * PBuslogic_CCB_T
static void BusLogic_SoftReset(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1039
BusLogic_SetCCBFormatRequest
Definition: BusLogic958.h:1129
@ BusLogic_ExtendedLUNFormatCCB
Definition: BusLogic958.h:1131
@ BusLogic_LegacyLUNFormatCCB
Definition: BusLogic958.h:1130
void BusLogic_QueueCompletedCCB(PHW_DEVICE_EXTENSION deviceExtension, BusLogic_CCB_T *CCB)
Definition: BusLogic958.c:2108
struct BusLogic_PCIHostAdapterInformation BusLogic_PCIHostAdapterInformation_T
BusLogic_QueueTag_T
Definition: BusLogic958.h:521
@ BusLogic_OrderedQueueTag
Definition: BusLogic958.h:524
@ BusLogic_SimpleQueueTag
Definition: BusLogic958.h:522
@ BusLogic_ReservedQT
Definition: BusLogic958.h:525
@ BusLogic_HeadOfQueueTag
Definition: BusLogic958.h:523
static VOID WriteBusLogicPort(UCHAR data, PUCHAR adr)
Definition: BusLogic958.h:936
BOOLEAN BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.c:1316
BOOLEAN BusLogic_SendBusDeviceReset(IN PVOID HwDeviceExtension, PSCSI_REQUEST_BLOCK Srb)
Definition: BusLogic958.c:2535
struct _NONCACHED_EXTENSION * PNONCACHED_EXTENSION
static UCHAR BusLogic_ReadStatusRegister(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1059
#define BusLogic_CDB_MaxLength
Definition: BusLogic958.h:97
void BusLogic_ScanIncomingMailboxes(PHW_DEVICE_EXTENSION deviceExtension)
Definition: BusLogic958.c:2048
BOOLEAN BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.c:833
struct BusLogic_FetchHostAdapterLocalRAMRequest BusLogic_FetchHostAdapterLocalRAMRequest_T
enum BusLogic_BIOS_DiskGeometryTranslation BusLogic_BIOS_DiskGeometryTranslation_T
static void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T CommandSizeBuckets, unsigned int Amount)
Definition: BusLogic958.h:1152
unsigned int BusLogic_CommandSizeBuckets_T[BusLogic_SizeBuckets]
Definition: BusLogic958.h:257
union BusLogic_GeometryRegister BusLogic_GeometryRegister_T
BOOLEAN NTAPI BT958HwInitialize(IN PVOID HwDeviceExtension)
Definition: BusLogic958.c:2620
static BusLogic_HostAdapterBusType_T BusLogic_HostAdapterBusTypes[]
Definition: BusLogic958.h:659
static void BusLogic_IncrementErrorCounter(unsigned short *ErrorCounter)
Definition: BusLogic958.h:1179
static void BusLogic_StartMailboxCommand(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1094
BusLogic_OperationCode_T
Definition: BusLogic958.h:118
@ BusLogic_UploadAutoSCSICode
Definition: BusLogic958.h:155
@ BusLogic_InquirePCIHostAdapterInformation
Definition: BusLogic958.h:147
@ BusLogic_DisableHostAdapterInterrupt
Definition: BusLogic958.h:142
@ BusLogic_ExecuteSCSICommand
Definition: BusLogic958.h:144
@ BusLogic_WriteAdapterLocalRAM
Definition: BusLogic958.h:133
@ BusLogic_InquireExtendedSetupInformation
Definition: BusLogic958.h:150
@ BusLogic_ReadInquiryBuffer
Definition: BusLogic958.h:159
@ BusLogic_TestCommandCompleteInterrupt
Definition: BusLogic958.h:119
@ BusLogic_SetCCBFormat
Definition: BusLogic958.h:157
@ BusLogic_InitializeExtendedMailbox
Definition: BusLogic958.h:143
@ BusLogic_InquireInstalledDevicesID8to15
Definition: BusLogic958.h:140
@ BusLogic_HostAdapterDiagnostic
Definition: BusLogic958.h:138
@ BusLogic_InquireInstalledDevicesID0to7
Definition: BusLogic958.h:129
@ BusLogic_SetBusTransferRate
Definition: BusLogic958.h:128
@ BusLogic_ReadBusMasterChipFIFO
Definition: BusLogic958.h:136
@ BusLogic_ModifyIOAddress
Definition: BusLogic958.h:156
@ BusLogic_InquireHostAdapterModelNumber
Definition: BusLogic958.h:148
@ BusLogic_ReadAdapterLocalRAM
Definition: BusLogic958.h:134
@ BusLogic_EnableOutgoingMailboxAvailableInt
Definition: BusLogic958.h:124
@ BusLogic_SetTimeOffBus
Definition: BusLogic958.h:127
@ BusLogic_InquireTargetDevices
Definition: BusLogic958.h:141
@ BusLogic_SetAdapterOptions
Definition: BusLogic958.h:139
@ BusLogic_FlashROMUploadDownload
Definition: BusLogic958.h:160
@ BusLogic_InquireFirmwareVersionLetter
Definition: BusLogic958.h:146
@ BusLogic_EnableStrictRoundRobinMode
Definition: BusLogic958.h:151
@ BusLogic_ExecuteBIOSCommand
Definition: BusLogic958.h:122
@ BusLogic_EchoCommandData
Definition: BusLogic958.h:137
@ BusLogic_InquireSynchronousPeriod
Definition: BusLogic958.h:149
@ BusLogic_SetSCSISelectionTimeout
Definition: BusLogic958.h:125
@ BusLogic_WriteSCAMData
Definition: BusLogic958.h:162
@ BusLogic_StoreHostAdapterLocalRAM
Definition: BusLogic958.h:152
@ BusLogic_SetPreemptTimeOnBus
Definition: BusLogic958.h:126
@ BusLogic_StoreLocalDataInEEPROM
Definition: BusLogic958.h:154
@ BusLogic_InitializeMailbox
Definition: BusLogic958.h:120
@ BusLogic_FetchHostAdapterLocalRAM
Definition: BusLogic958.h:153
@ BusLogic_InquireBoardID
Definition: BusLogic958.h:123
@ BusLogic_InquireSetupInformation
Definition: BusLogic958.h:132
@ BusLogic_WriteInquiryBuffer
Definition: BusLogic958.h:158
@ BusLogic_ExecuteMailboxCommand
Definition: BusLogic958.h:121
@ BusLogic_WriteBusMasterChipFIFO
Definition: BusLogic958.h:135
@ BusLogic_ReadSCAMData
Definition: BusLogic958.h:161
@ BusLogic_InquireFirmwareVersion3rdDigit
Definition: BusLogic958.h:145
@ BusLogic_InquireConfiguration
Definition: BusLogic958.h:130
@ BusLogic_EnableTargetMode
Definition: BusLogic958.h:131
#define BusLogic_DataInRegisterOffset
Definition: BusLogic958.h:950
BusLogic_HostAdapterBusType_T
Definition: BusLogic958.h:646
@ BusLogic_EISA_Bus
Definition: BusLogic958.h:649
@ BusLogic_Unknown_Bus
Definition: BusLogic958.h:647
@ BusLogic_ISA_Bus
Definition: BusLogic958.h:648
@ BusLogic_VESA_Bus
Definition: BusLogic958.h:651
@ BusLogic_MCA_Bus
Definition: BusLogic958.h:652
@ BusLogic_PCI_Bus
Definition: BusLogic958.h:650
BOOLEAN BusLogic_WriteOutgoingMailbox(PHW_DEVICE_EXTENSION deviceExtension, BusLogic_ActionCode_T ActionCode, BusLogic_CCB_T *CCB)
Definition: BusLogic958.c:1679
UCHAR BusLogic_HostAdapterModelNumber_T[5]
Definition: BusLogic958.h:175
struct BusLogic_HostAdapter BusLogic_HostAdapter_T
struct BusLogic_TargetStatistics BusLogic_TargetStatistics_T
struct _NONCACHED_EXTENSION NONCACHED_EXTENSION
BusLogic_CCB_Opcode_T
Definition: BusLogic958.h:460
@ BusLogic_InitiatorCCB
Definition: BusLogic958.h:461
@ BusLogic_InitiatorCCB_ScatterGather
Definition: BusLogic958.h:463
@ BusLogic_InitiatorCCB_ScatterGatherResidual
Definition: BusLogic958.h:465
@ BusLogic_BusDeviceReset
Definition: BusLogic958.h:466
@ BusLogic_TargetCCB
Definition: BusLogic958.h:462
@ BusLogic_InitiatorCCB_ResidualDataLength
Definition: BusLogic958.h:464
unsigned short BusLogic_InstalledDevices_T
Definition: BusLogic958.h:1115
struct BusLogic_ScatterGatherSegment BusLogic_ScatterGatherSegment_T
BusLogic_ActionCode_T
Definition: BusLogic958.h:438
@ BusLogic_MailboxStartCommand
Definition: BusLogic958.h:440
@ BusLogic_MailboxAbortCommand
Definition: BusLogic958.h:441
@ BusLogic_OutgoingMailboxFree
Definition: BusLogic958.h:439
#define BusLogic_ControlRegisterOffset
Definition: BusLogic958.h:947
#define BusLogic_ScatterGatherLimit
Definition: BusLogic958.h:102
BusLogic_HostAdapterStatus_T
Definition: BusLogic958.h:483
@ BusLogic_AbortQueueGenerated
Definition: BusLogic958.h:505
@ BusLogic_UnsupportedMessageReceived
Definition: BusLogic958.h:498
@ BusLogic_TargetDeviceReconnectedImproperly
Definition: BusLogic958.h:503
@ BusLogic_DataUnderRun
Definition: BusLogic958.h:487
@ BusLogic_InvalidCommandParameter
Definition: BusLogic958.h:495
@ BusLogic_HostAdapterAssertedRST
Definition: BusLogic958.h:501
@ BusLogic_LinkedCommandCompleted
Definition: BusLogic958.h:485
@ BusLogic_DataOverRun
Definition: BusLogic958.h:489
@ BusLogic_HostAdapterAssertedBusDeviceReset
Definition: BusLogic958.h:504
@ BusLogic_SCSIParityErrorDetected
Definition: BusLogic958.h:508
@ BusLogic_OtherDeviceAssertedRST
Definition: BusLogic958.h:502
@ BusLogic_LinkedCCBhasInvalidLUN
Definition: BusLogic958.h:494
@ BusLogic_AutoRequestSenseFailed
Definition: BusLogic958.h:496
@ BusLogic_LinkedCommandCompletedWithFlag
Definition: BusLogic958.h:486
@ BusLogic_HostAdapterSoftwareError
Definition: BusLogic958.h:506
@ BusLogic_InvalidOutgoingMailboxActionCode
Definition: BusLogic958.h:492
@ BusLogic_SCSISelectionTimeout
Definition: BusLogic958.h:488
@ BusLogic_CommandCompletedNormally
Definition: BusLogic958.h:484
@ BusLogic_InvalidBusPhaseRequested
Definition: BusLogic958.h:491
@ BusLogic_InvalidCommandOperationCode
Definition: BusLogic958.h:493
@ BusLogic_TaggedQueuingMessageRejected
Definition: BusLogic958.h:497
@ BusLogic_HostAdapterHardwareFailed
Definition: BusLogic958.h:499
@ BusLogic_HostAdapterHardwareTimeoutError
Definition: BusLogic958.h:507
@ BusLogic_TargetFailedResponseToATN
Definition: BusLogic958.h:500
@ BusLogic_UnexpectedBusFree
Definition: BusLogic958.h:490
static UCHAR BusLogic_ReadInterruptRegister(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1065
static void BusLogic_InterruptReset(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1028
struct BusLogic_ExtendedMailboxRequest BusLogic_ExtendedMailboxRequest_T
UCHAR BusLogic_RequestedReplyLength_T
Definition: BusLogic958.h:169
BusLogic_CompletionCode_T
Definition: BusLogic958.h:449
@ BusLogic_CommandAbortedAtHostRequest
Definition: BusLogic958.h:452
@ BusLogic_AbortedCommandNotFound
Definition: BusLogic958.h:453
@ BusLogic_InvalidCCB
Definition: BusLogic958.h:455
@ BusLogic_CommandCompletedWithError
Definition: BusLogic958.h:454
@ BusLogic_CommandCompletedWithoutError
Definition: BusLogic958.h:451
@ BusLogic_IncomingMailboxFree
Definition: BusLogic958.h:450
BOOLEAN BusLogic_HardwareResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter, BOOLEAN HardReset)
Definition: BusLogic958.c:470
BusLogic_HostAdapterType_T
Definition: BusLogic958.h:639
@ BusLogic_MultiMaster
Definition: BusLogic958.h:640
@ BusLogic_FlashPoint
Definition: BusLogic958.h:641
BusLogic_ISACompatibleIOPort
Definition: BusLogic958.h:197
@ BusLogic_IO_334
Definition: BusLogic958.h:199
@ BusLogic_IO_230
Definition: BusLogic958.h:200
@ BusLogic_IO_234
Definition: BusLogic958.h:201
@ BusLogic_IO_130
Definition: BusLogic958.h:202
@ BusLogic_IO_Disable2
Definition: BusLogic958.h:205
@ BusLogic_IO_134
Definition: BusLogic958.h:203
@ BusLogic_IO_Disable
Definition: BusLogic958.h:204
@ BusLogic_IO_330
Definition: BusLogic958.h:198
BusLogic_TargetDeviceStatus_T
Definition: BusLogic958.h:513
@ BusLogic_DeviceBusy
Definition: BusLogic958.h:516
@ BusLogic_CheckCondition
Definition: BusLogic958.h:515
@ BusLogic_OperationGood
Definition: BusLogic958.h:514
#define BusLogic_StatusRegisterOffset
Definition: BusLogic958.h:948
#define BusLogic_SizeBuckets
Definition: BusLogic958.h:248
struct BusLogic_SetupInformation BusLogic_SetupInformation_T
struct BusLogic_ExtendedSetupInformation BusLogic_ExtendedSetupInformation_T
BOOLEAN Buslogic_InitBT958(PHW_DEVICE_EXTENSION deviceExtension, PPORT_CONFIGURATION_INFORMATION ConfigInfo)
Definition: BusLogic958.c:316
BusLogic_DataDirection_T
Definition: BusLogic958.h:472
@ BusLogic_NoDataTransfer
Definition: BusLogic958.h:476
@ BusLogic_UncheckedDataTransfer
Definition: BusLogic958.h:473
@ BusLogic_DataOutLengthChecked
Definition: BusLogic958.h:475
@ BusLogic_DataInLengthChecked
Definition: BusLogic958.h:474
BusLogic_CCB_Status_T
Definition: BusLogic958.h:541
@ BusLogic_CCB_Reset
Definition: BusLogic958.h:545
@ BusLogic_CCB_Active
Definition: BusLogic958.h:543
@ BusLogic_CCB_Free
Definition: BusLogic958.h:542
@ BusLogic_CCB_Completed
Definition: BusLogic958.h:544
int BusLogic_QueueCommand(IN PVOID HwDeviceExtension, IN PSCSI_REQUEST_BLOCK Srb, IN PBuslogic_CCB_T ccb)
struct BusLogic_BoardID BusLogic_BoardID_T
BusLogic_BIOS_DiskGeometryTranslation
Definition: BusLogic958.h:1006
@ BusLogic_BIOS_Disk_Installed_64x32
Definition: BusLogic958.h:1008
@ BusLogic_BIOS_Disk_Not_Installed
Definition: BusLogic958.h:1007
@ BusLogic_BIOS_Disk_Installed_255x63
Definition: BusLogic958.h:1010
@ BusLogic_BIOS_Disk_Installed_128x32
Definition: BusLogic958.h:1009
struct SCSI_Inquiry SCSI_Inquiry_T
union BusLogic_StatusRegister BusLogic_StatusRegister_T
SCSI_ADAPTER_CONTROL_STATUS NTAPI BT958HwAdapterControl(IN PVOID HwDeviceExtension, IN SCSI_ADAPTER_CONTROL_TYPE ControlType, IN PVOID Parameters)
Definition: BusLogic958.c:2651
struct _HW_DEVICE_EXTENSION * PHW_DEVICE_EXTENSION
struct _HW_DEVICE_EXTENSION HW_DEVICE_EXTENSION
struct BusLogic_Configuration BusLogic_Configuration_T
void BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension)
Definition: BusLogic958.c:2139
ULONG NTAPI BT958HwFindAdapter(IN PVOID HwDeviceExtension, IN PVOID Context, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
Definition: BusLogic958.c:173
#define BusLogic_GeometryRegisterOffset
Definition: BusLogic958.h:952
enum BusLogic_ISACompatibleIOPort BusLogic_ISACompatibleIOPort_T
union BusLogic_InterruptRegister BusLogic_InterruptRegister_T
BOOLEAN NTAPI BT958HwStartIO(IN PVOID HwDeviceExtension, IN PSCSI_REQUEST_BLOCK Srb)
Definition: BusLogic958.c:1458
UCHAR BusLogic_FirmwareVersion3rdDigit_T
Definition: BusLogic958.h:178
BOOLEAN NTAPI BT958HwInterrupt(IN PVOID HwDeviceExtension)
Definition: BusLogic958.c:1973
struct BusLogic_IncomingMailbox BusLogic_IncomingMailbox_T
struct BusLogic_SynchronousValue BusLogic_SynchronousValue_T
#define BusLogic_MaxLogicalUnits
Definition: BusLogic958.h:84
static void BusLogic_IncrementByteCounter(BusLogic_ByteCounter_T *ByteCounter, unsigned int Amount)
Definition: BusLogic958.h:1139
UCHAR BusLogic_ComputeResultCode(BusLogic_HostAdapter_T *HostAdapter, BusLogic_HostAdapterStatus_T HostAdapterStatus, BusLogic_TargetDeviceStatus_T TargetDeviceStatus, UCHAR SenseDataLength)
Definition: BusLogic958.c:2309
struct BusLogic_WmiExtendedSetupInformation * PBusLogic_WmiExtendedSetupInformation_T
BOOLEAN NTAPI BT958HwResetBus(IN PVOID HwDeviceExtension, IN ULONG PathId)
Definition: BusLogic958.c:2448
UCHAR BusLogic_SynchronousPeriod_T[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:1103
union BusLogic_ControlRegister BusLogic_ControlRegister_T
BusLogic_SynchronousValue_T BusLogic_SynchronousValues8_T[8]
Definition: BusLogic958.h:310
struct BusLogic_CCB BusLogic_CCB_T
unsigned int BusLogic_ByteCount_T
Definition: BusLogic958.h:184
void BT958WmiInitialize(IN PHW_DEVICE_EXTENSION HwDeviceExtension)
Definition: wmi.c:52
unsigned int BusLogic_BusAddress_T
Definition: BusLogic958.h:172
enum BusLogic_SetCCBFormatRequest BusLogic_SetCCBFormatRequest_T
static void BusLogic_HardReset(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1049
struct BusLogic_WmiExtendedSetupInformation BusLogic_WmiExtendedSetupInformation_T
static UCHAR ReadBusLogicPort(PUCHAR adr)
Definition: BusLogic958.h:930
UCHAR BusLogic_FirmwareVersionLetter_T
Definition: BusLogic958.h:181
#define BusLogic_CommandParameterRegisterOffset
Definition: BusLogic958.h:949
UCHAR BusLogic_InstalledDevices8_T[8]
Definition: BusLogic958.h:1109
static UCHAR BusLogic_ReadGeometryRegister(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1071
BOOLEAN BusLogic_CheckHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.c:569
#define BusLogic_MaxTargetDevices
Definition: BusLogic958.h:81
#define BusLogic_MaxMailboxes
Definition: BusLogic958.h:90
struct BusLogic_OutgoingMailbox BusLogic_OutgoingMailbox_T
UCHAR SCSI_CDB_T[BusLogic_CDB_MaxLength]
Definition: BusLogic958.h:537
struct BusLogic_AutoSCSIData BusLogic_AutoSCSIData_T
BOOLEAN BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.c:416
static void BusLogic_WriteCommandParameterRegister(BusLogic_HostAdapter_T *HostAdapter, UCHAR Value)
Definition: BusLogic958.h:1083
int BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, BusLogic_OperationCode_T OperationCode, void *ParameterData, int ParameterLength, void *ReplyData, int ReplyLength)
Definition: BusLogic958.c:606
struct BusLogic_ByteCounter BusLogic_ByteCounter_T
static UCHAR BusLogic_ReadDataInRegister(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1077
BOOLEAN BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, PPORT_CONFIGURATION_INFORMATION ConfigInfo)
Definition: BusLogic958.c:1175
struct BusLogic_TargetFlags BusLogic_TargetFlags_T
#define BusLogic_InterruptRegisterOffset
Definition: BusLogic958.h:951
unsigned char BOOLEAN
VOID NTAPI ScsiPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)
Definition: scsiport.c:1547
UCHAR NTAPI ScsiPortReadPortUchar(IN PUCHAR Port)
Definition: scsiport.c:1390
_In_ PSCSI_REQUEST_BLOCK Srb
Definition: cdrom.h:989
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR PathId
Definition: classpnp.h:1313
_In_ PVOID Argument2
Definition: classpnp.h:721
#define TRUE
Definition: types.h:120
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
enum _SCSI_ADAPTER_CONTROL_TYPE SCSI_ADAPTER_CONTROL_TYPE
enum _SCSI_ADAPTER_CONTROL_STATUS SCSI_ADAPTER_CONTROL_STATUS
BOOLEAN BT958WmiSrb(IN PHW_DEVICE_EXTENSION HwDeviceExtension, IN OUT PSCSI_WMI_REQUEST_BLOCK Srb)
Definition: wmi.c:73
_Must_inspect_result_ _In_ PFLT_PORT _In_ ULONG _Out_writes_bytes_opt_ ReplyLength PVOID _Inout_opt_ PULONG ReplyLength
Definition: fltkernel.h:1903
_Must_inspect_result_ _In_ LONGLONG _In_ LONGLONG Amount
Definition: fsrtlfuncs.h:551
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define BOOLEAN
Definition: pedump.c:73
UCHAR BIOSRedirectionOfINT19Enabled
Definition: BusLogic958.h:391
unsigned short WidePermitted
Definition: BusLogic958.h:399
unsigned short RenegotiateSyncAfterCheckCondition
Definition: BusLogic958.h:429
UCHAR MapRemovableAsFixedEnabled
Definition: BusLogic958.h:393
UCHAR VESABusSpeedGreaterThan33MHz
Definition: BusLogic958.h:408
UCHAR FastSynchronousNegotiation
Definition: BusLogic958.h:384
unsigned short SendStartUnitCommand
Definition: BusLogic958.h:403
UCHAR ForceBusDeviceScanningOrder
Definition: BusLogic958.h:426
unsigned short DisconnectPermitted
Definition: BusLogic958.h:402
UCHAR ExtendedTranslationEnabled
Definition: BusLogic958.h:392
UCHAR StrictRoundRobinModeEnabled
Definition: BusLogic958.h:407
unsigned short DeviceEnabled
Definition: BusLogic958.h:398
unsigned short FastPermitted
Definition: BusLogic958.h:400
unsigned short UltraPermitted
Definition: BusLogic958.h:411
unsigned short Checksum
Definition: BusLogic958.h:432
UCHAR BIOSSupportsMoreThan2DrivesEnabled
Definition: BusLogic958.h:395
unsigned short IgnoreInBIOSScan
Definition: BusLogic958.h:404
unsigned short SynchronousPermitted
Definition: BusLogic958.h:401
UCHAR ManufacturingDiagnostic[2]
Definition: BusLogic958.h:431
unsigned short NonTaggedToAlternateLUNPermitted
Definition: BusLogic958.h:428
UCHAR InternalFactorySignature[2]
Definition: BusLogic958.h:365
UCHAR FirmwareVersion1stDigit
Definition: BusLogic958.h:229
UCHAR FirmwareVersion2ndDigit
Definition: BusLogic958.h:230
unsigned int Billions
Definition: BusLogic958.h:254
unsigned int Units
Definition: BusLogic958.h:253
BusLogic_CompletionCode_T CompletionCode
Definition: BusLogic958.h:594
UCHAR HostAdapterStatus
Definition: BusLogic958.h:575
unsigned long SerialNumber
Definition: BusLogic958.h:589
UCHAR LegacyQueueTag
Definition: BusLogic958.h:580
BusLogic_CCB_Status_T Status
Definition: BusLogic958.h:588
UCHAR LogicalUnit
Definition: BusLogic958.h:578
UCHAR SenseDataLength
Definition: BusLogic958.h:570
PVOID SrbAddress
Definition: BusLogic958.h:596
UCHAR DataDirection
Definition: BusLogic958.h:566
BusLogic_ByteCount_T DataLength
Definition: BusLogic958.h:571
PVOID AbortSrb
Definition: BusLogic958.h:597
BusLogic_BusAddress_T DataPointer
Definition: BusLogic958.h:572
UCHAR CDB_Length
Definition: BusLogic958.h:569
UCHAR TagEnable
Definition: BusLogic958.h:567
UCHAR LegacyTagEnable
Definition: BusLogic958.h:579
UCHAR TargetID
Definition: BusLogic958.h:577
struct BusLogic_HostAdapter * HostAdapter
Definition: BusLogic958.h:590
SCSI_CDB_T CDB
Definition: BusLogic958.h:581
UCHAR TargetDeviceStatus
Definition: BusLogic958.h:576
BusLogic_ScatterGatherSegment_T ScatterGatherList[BusLogic_ScatterGatherLimit]
Definition: BusLogic958.h:592
struct BusLogic_CCB * Next
Definition: BusLogic958.h:591
unsigned int
Definition: BusLogic958.h:584
UCHAR QueueTag
Definition: BusLogic958.h:568
BusLogic_BusAddress_T SenseDataPointer
Definition: BusLogic958.h:585
struct BusLogic_ExtendedSetupInformation::@1328 Misc
BusLogic_BusAddress_T BaseMailboxAddress
Definition: BusLogic958.h:344
BusLogic_HostAdapterType_T HostAdapterType
Definition: BusLogic958.h:671
BOOLEAN ExtendedLUNSupport
Definition: BusLogic958.h:691
unsigned short TaggedQueuingPermitted
Definition: BusLogic958.h:721
unsigned short ExternalHostAdapterResets
Definition: BusLogic958.h:722
unsigned short DriverQueueDepth
Definition: BusLogic958.h:711
unsigned short HostAdapterInternalErrors
Definition: BusLogic958.h:723
BusLogic_CCB_T * BusDeviceResetPendingCCB[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:730
unsigned short DriverScatterGatherLimit
Definition: BusLogic958.h:706
unsigned short DisconnectPermitted
Definition: BusLogic958.h:720
BusLogic_OutgoingMailbox_T * FirstOutgoingMailbox
Definition: BusLogic958.h:743
unsigned long LastResetAttempted[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:739
unsigned short WidePermitted
Definition: BusLogic958.h:719
BOOLEAN ExtendedTranslationEnabled
Definition: BusLogic958.h:683
BusLogic_OutgoingMailbox_T * NextOutgoingMailbox
Definition: BusLogic958.h:745
unsigned long LastResetCompleted[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:740
BOOLEAN LevelSensitiveInterrupt
Definition: BusLogic958.h:686
unsigned short TargetDeviceCount
Definition: BusLogic958.h:724
UCHAR SynchronousPeriod[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:733
unsigned short BusSettleTime
Definition: BusLogic958.h:715
BOOLEAN HostDifferentialSCSI
Definition: BusLogic958.h:688
BusLogic_IncomingMailbox_T * LastIncomingMailbox
Definition: BusLogic958.h:747
BOOLEAN ParityCheckingEnabled
Definition: BusLogic958.h:684
UCHAR FirmwareVersion[6]
Definition: BusLogic958.h:675
BusLogic_IncomingMailbox_T * FirstIncomingMailbox
Definition: BusLogic958.h:746
unsigned short UntaggedQueueDepth
Definition: BusLogic958.h:713
unsigned short CommonQueueDepth
Definition: BusLogic958.h:714
BOOLEAN HostAdapterInitialized
Definition: BusLogic958.h:699
BOOLEAN BounceBuffersRequired
Definition: BusLogic958.h:695
BusLogic_TargetStatistics_T TargetStatistics[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:749
BOOLEAN TerminationInfoValid
Definition: BusLogic958.h:692
BusLogic_OutgoingMailbox_T * LastOutgoingMailbox
Definition: BusLogic958.h:744
BusLogic_CCB_T * FirstCompletedCCB
Definition: BusLogic958.h:728
BusLogic_IncomingMailbox_T * NextIncomingMailbox
Definition: BusLogic958.h:748
UCHAR SynchronousOffset[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:734
unsigned short UltraPermitted
Definition: BusLogic958.h:718
unsigned short HostAdapterQueueDepth
Definition: BusLogic958.h:712
BOOLEAN StrictRoundRobinModeSupport
Definition: BusLogic958.h:696
UCHAR FullModelName[18]
Definition: BusLogic958.h:676
BOOLEAN HighByteTerminated
Definition: BusLogic958.h:694
BusLogic_BusAddress_T BIOS_Address
Definition: BusLogic958.h:726
BOOLEAN ProcessCompletedCCBsActive
Definition: BusLogic958.h:703
UCHAR ActiveCommandsPerLun[BusLogic_MaxTargetDevices][BusLogic_MaxLogicalUnits]
Definition: BusLogic958.h:736
BusLogic_HostAdapterBusType_T HostAdapterBusType
Definition: BusLogic958.h:672
volatile BOOLEAN HostAdapterCommandCompleted
Definition: BusLogic958.h:704
unsigned int CommandsSinceReset[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:737
BOOLEAN HostAdapterInternalError
Definition: BusLogic958.h:701
unsigned short FastPermitted
Definition: BusLogic958.h:717
UCHAR ActiveCommandsPerTarget[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:735
unsigned short SynchronousPermitted
Definition: BusLogic958.h:716
BusLogic_CCB_T * LastCompletedCCB
Definition: BusLogic958.h:729
BusLogic_TargetFlags_T TargetFlags[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:732
unsigned short HostAdapterScatterGatherLimit
Definition: BusLogic958.h:705
BOOLEAN HostAdapterExternalReset
Definition: BusLogic958.h:700
unsigned long LastSequencePoint[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:738
BusLogic_BusAddress_T CCB
Definition: BusLogic958.h:614
BusLogic_BusAddress_T CCB
Definition: BusLogic958.h:604
BusLogic_ByteCount_T SegmentByteCount
Definition: BusLogic958.h:532
BusLogic_BusAddress_T SegmentDataPointer
Definition: BusLogic958.h:533
BusLogic_SynchronousValues8_T SynchronousValuesID0to7
Definition: BusLogic958.h:322
BusLogic_SynchronousValues8_T SynchronousValuesID8to15
Definition: BusLogic958.h:329
BOOLEAN SynchronousInitiationEnabled
Definition: BusLogic958.h:314
BOOLEAN WideTransfersActive
Definition: BusLogic958.h:241
BOOLEAN TaggedQueuingActive
Definition: BusLogic958.h:240
BOOLEAN WideTransfersSupported
Definition: BusLogic958.h:239
BOOLEAN CommandSuccessfulFlag
Definition: BusLogic958.h:242
BOOLEAN TargetInfoReported
Definition: BusLogic958.h:243
BOOLEAN TaggedQueuingSupported
Definition: BusLogic958.h:238
unsigned int CommandsCompleted
Definition: BusLogic958.h:262
BusLogic_CommandSizeBuckets_T ReadCommandSizeBuckets
Definition: BusLogic958.h:267
unsigned int WriteCommands
Definition: BusLogic958.h:264
unsigned short HostAdapterResetsRequested
Definition: BusLogic958.h:275
unsigned short CommandAbortsCompleted
Definition: BusLogic958.h:271
unsigned short BusDeviceResetsAttempted
Definition: BusLogic958.h:273
unsigned short CommandAbortsRequested
Definition: BusLogic958.h:269
unsigned int CommandsAttempted
Definition: BusLogic958.h:261
unsigned short HostAdapterResetsAttempted
Definition: BusLogic958.h:276
BusLogic_CommandSizeBuckets_T WriteCommandSizeBuckets
Definition: BusLogic958.h:268
BusLogic_ByteCounter_T TotalBytesRead
Definition: BusLogic958.h:265
unsigned short BusDeviceResetsCompleted
Definition: BusLogic958.h:274
unsigned short BusDeviceResetsRequested
Definition: BusLogic958.h:272
unsigned short CommandAbortsAttempted
Definition: BusLogic958.h:270
unsigned short HostAdapterResetsCompleted
Definition: BusLogic958.h:277
BusLogic_ByteCounter_T TotalBytesWritten
Definition: BusLogic958.h:266
BusLogic_BusAddress_T BaseMailboxAddress
Definition: BusLogic958.h:801
BOOLEAN WBus32
Definition: BusLogic958.h:788
UCHAR DeviceTypeModifier
Definition: BusLogic958.h:770
BOOLEAN AENC
Definition: BusLogic958.h:778
UCHAR PeripheralQualifier
Definition: BusLogic958.h:769
BOOLEAN CmdQue
Definition: BusLogic958.h:783
UCHAR ProductIdentification[16]
Definition: BusLogic958.h:791
BOOLEAN Sync
Definition: BusLogic958.h:786
UCHAR PeripheralDeviceType
Definition: BusLogic958.h:768
BOOLEAN SftRe
Definition: BusLogic958.h:782
BOOLEAN RelAdr
Definition: BusLogic958.h:789
UCHAR ISO_Version
Definition: BusLogic958.h:774
BOOLEAN RMB
Definition: BusLogic958.h:771
UCHAR ResponseDataFormat
Definition: BusLogic958.h:775
UCHAR ProductRevisionLevel[4]
Definition: BusLogic958.h:792
UCHAR ECMA_Version
Definition: BusLogic958.h:773
UCHAR AdditionalLength
Definition: BusLogic958.h:779
UCHAR ANSI_ApprovedVersion
Definition: BusLogic958.h:772
UCHAR VendorIdentification[8]
Definition: BusLogic958.h:790
BOOLEAN WBus16
Definition: BusLogic958.h:787
BOOLEAN TrmIOP
Definition: BusLogic958.h:777
BOOLEAN Linked
Definition: BusLogic958.h:785
Definition: cdstruc.h:1067
SCSI_WMILIB_CONTEXT WmiLibContext
Definition: BusLogic958.h:759
PNONCACHED_EXTENSION NoncachedExtension
Definition: BusLogic958.h:758
BusLogic_HostAdapter_T hcs
Definition: BusLogic958.h:757
UCHAR MailboxIn[BusLogic_MaxMailboxes *sizeof(BusLogic_IncomingMailbox_T)]
Definition: BusLogic958.h:633
UCHAR MailboxOut[BusLogic_MaxMailboxes *sizeof(BusLogic_OutgoingMailbox_T)]
Definition: BusLogic958.h:632
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
struct BusLogic_ControlRegister::@1329 Bits
struct BusLogic_GeometryRegister::@1332 Bits
BusLogic_BIOS_DiskGeometryTranslation_T Drive1Geometry
Definition: BusLogic958.h:1020
BusLogic_BIOS_DiskGeometryTranslation_T Drive0Geometry
Definition: BusLogic958.h:1019
struct BusLogic_InterruptRegister::@1331 Bits
struct BusLogic_StatusRegister::@1330 Bits
BOOLEAN CommandParameterRegisterBusy
Definition: BusLogic958.h:979
_In_ ULONG ParameterLength
Definition: usbdlib.h:206
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFDEVICE _In_ PPNP_BUS_INFORMATION BusInformation
Definition: wdfdevice.h:3915
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:869
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
unsigned char UCHAR
Definition: xmlstorage.h:181