ReactOS  0.4.14-dev-815-ge410a12
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 //_________________________________________________________________________________________
117 typedef 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.
172 typedef 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.
184 typedef 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 {
206 }
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.
225 typedef 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.
235 typedef struct BusLogic_TargetFlags
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.
251 typedef struct BusLogic_ByteCounter
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;
269  unsigned short CommandAbortsRequested;
270  unsigned short CommandAbortsAttempted;
271  unsigned short CommandAbortsCompleted;
272  unsigned short BusDeviceResetsRequested;
273  unsigned short BusDeviceResetsAttempted;
274  unsigned short BusDeviceResetsCompleted;
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 {
314  BOOLEAN SynchronousInitiationEnabled:1; /* Byte 0 Bit 0 */
315  BOOLEAN ParityCheckingEnabled:1; /* Byte 0 Bit 1 */
316  UCHAR :6; /* Byte 0 Bits 2-7 */
317  UCHAR BusTransferRate; /* Byte 1 */
318  UCHAR PreemptTimeOnBus; /* Byte 2 */
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
341  UCHAR BIOS_Address; // Byte 1
342  unsigned short ScatterGatherLimit; // Bytes 2-3
343  UCHAR MailboxCount; // Byte 4
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
350  BOOLEAN LevelSensitiveInterrupt:1; // Byte 9 Bit 6
351  UCHAR :1;
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.
363 typedef struct BusLogic_AutoSCSIData
364 {
365  UCHAR InternalFactorySignature[2];/* Bytes 0-1 */
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 */
391  UCHAR BIOSRedirectionOfINT19Enabled:1; /* Byte 18 Bit 1 */
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 */
414  UCHAR AutoSCSIMaximumLUN; /* Byte 41 */
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.
437 typedef 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.
448 typedef enum
449 {
457 
458 // Define the Command Control Block (CCB) Opcodes.
459 typedef enum
460 {
468 
469 
470 // Define the CCB Data Direction Codes.
471 typedef 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.
482 typedef enum
483 {
510 
511 // Define the SCSI Target Device Status Codes.
512 typedef enum
513 {
518 
519 // Define the Queue Tag Codes.
520 typedef 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.
540 typedef 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.
562 typedef 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 */
575  UCHAR HostAdapterStatus; /* Byte 14 */
576  UCHAR TargetDeviceStatus; /* Byte 15 */
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 {
604  BusLogic_BusAddress_T CCB;/* Bytes 0-3 */
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 */
615  UCHAR HostAdapterStatus; /* Byte 4 */
616  UCHAR TargetDeviceStatus; /* Byte 5 */
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.
626 typedef struct _NONCACHED_EXTENSION
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.
638 typedef enum
639 {
643 
644 // Define the possible Host Adapter Bus Types.
645 typedef enum
646 {
654 
655 #if 0
656 static 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
668 typedef struct BusLogic_HostAdapter
669 {
670 
673 
678 
682 
702 
706  unsigned short DriverScatterGatherLimit;
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;
721  unsigned short TaggedQueuingPermitted;
724  unsigned short TargetDeviceCount;
725 
727 
731 
741 
751 
752 
753 // Buslogic specific port driver device object extension.
754 typedef struct
756 {
760 
762 
763 
764 // Define a structure for the SCSI Inquiry command results.
765 #pragma pack (1)
766 typedef 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 */
779  UCHAR AdditionalLength; /* Byte 4 */
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
798  UCHAR BIOS_Address; // Byte 1
799  unsigned short ScatterGatherLimit; // Bytes 2-3
800  UCHAR MailboxCount; // Byte 4
802  BOOLEAN FastOnEISA; // Byte 9
804  UCHAR FirmwareRevision[3]; // Bytes 11-14
805  BOOLEAN HostWideSCSI; // Byte 15
808  BOOLEAN HostUltraSCSI; // Byte 18
811 
812 #pragma pack ()
813 
814 //_________________________________________________________________________________________
815 // function declarations
816 //_________________________________________________________________________________________
817 ULONG
818 NTAPI
821  );
822 
823 ULONG
824 NTAPI
825 BT958HwFindAdapter(IN PVOID HwDeviceExtension,
826  IN PVOID Context,
827  IN PVOID BusInformation,
828  IN PCHAR ArgumentString,
830  OUT PBOOLEAN Again
831  );
832 
833 BOOLEAN
834 NTAPI
835 BT958HwInitialize(IN PVOID HwDeviceExtension);
836 
837 BOOLEAN
838 NTAPI
839 BT958HwStartIO(IN PVOID HwDeviceExtension,
841  );
842 
843 BOOLEAN
844 NTAPI
845 BT958HwInterrupt(IN PVOID HwDeviceExtension);
846 
847 BOOLEAN
848 NTAPI
849 BT958HwResetBus(IN PVOID HwDeviceExtension,
850  IN ULONG PathId
851  );
852 
854 NTAPI
855 BT958HwAdapterControl(IN PVOID HwDeviceExtension,
856  IN SCSI_ADAPTER_CONTROL_TYPE ControlType,
858  );
859 #if 0
860 BOOLEAN
861 BT958WmiSrb(IN PHW_DEVICE_EXTENSION HwDeviceExtension,
863 #endif
864 void
865 BT958WmiInitialize( IN PHW_DEVICE_EXTENSION HwDeviceExtension);
866 
867 
868 BOOLEAN
871 
872 BOOLEAN
874 
875 BOOLEAN
877  BOOLEAN HardReset);
878 
879 BOOLEAN
881 
882 int
884  BusLogic_OperationCode_T OperationCode,
885  void *ParameterData,
886  int ParameterLength,
887  void *ReplyData,
888  int ReplyLength);
889 
890 BOOLEAN
892 
893 BOOLEAN
896 
897 BOOLEAN
899 
900 int
901 BusLogic_QueueCommand(IN PVOID HwDeviceExtension,
904 
905 BOOLEAN
907  BusLogic_ActionCode_T ActionCode,
909 
910 void
912 
913 void
915 
916 void
918 
919 UCHAR
921  BusLogic_HostAdapterStatus_T HostAdapterStatus,
922  BusLogic_TargetDeviceStatus_T TargetDeviceStatus,
923  UCHAR SenseDataLength);
924 
925 BOOLEAN
926 BusLogic_SendBusDeviceReset(IN PVOID HwDeviceExtension,
928 
929 static UCHAR
931 {
932  return ScsiPortReadPortUchar( adr );
933 }
934 
935 static 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
962  BOOLEAN SCSIBusReset:1; // Bit 4
964  BOOLEAN SoftReset:1; // Bit 6
965  BOOLEAN HardReset:1; // Bit 7
966  } Bits;
968 
969 
970 // Define the structure of the read-only Status Register.
972 {
974  struct
975  {
977  BOOLEAN Reserved:1; // Bit 1
984  } Bits;
986 
987 
988 
989 // Define the structure of the read-only Interrupt Register.
991 {
993  struct
994  {
999  UCHAR Reserved:3; // Bits 4-6
1001  } Bits;
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
1023  } Bits;
1024 }
1026 
1027 static void
1029 {
1030  BusLogic_ControlRegister_T ControlRegister;
1031  ControlRegister.All = 0;
1032  ControlRegister.Bits.InterruptReset = TRUE;
1033 
1034  WriteBusLogicPort(ControlRegister.All,
1036 }
1037 
1038 static void
1040 {
1041  BusLogic_ControlRegister_T ControlRegister;
1042  ControlRegister.All = 0;
1043  ControlRegister.Bits.SoftReset = TRUE;
1044  WriteBusLogicPort(ControlRegister.All,
1046 }
1047 
1048 static void
1050 {
1051  BusLogic_ControlRegister_T ControlRegister;
1052  ControlRegister.All = 0;
1053  ControlRegister.Bits.HardReset = TRUE;
1054  WriteBusLogicPort(ControlRegister.All,
1056 }
1057 
1058 static UCHAR
1060 {
1062 }
1063 
1064 static UCHAR
1066 {
1068 }
1069 
1070 static UCHAR
1072 {
1074 }
1075 
1076 static UCHAR
1078 {
1080 }
1081 
1082 static 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.
1093 static 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.
1115 typedef 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.
1138 static 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.
1151 static 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.
1178 static void
1179 BusLogic_IncrementErrorCounter(unsigned short *ErrorCounter)
1180 {
1181  if (*ErrorCounter < 65535) (*ErrorCounter)++;
1182 }
1183 //____________________________________________________________________________________________
BOOLEAN ExtendedTranslationEnabled
Definition: BusLogic958.h:683
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2374
unsigned short HostAdapterQueueDepth
Definition: BusLogic958.h:712
signed char * PCHAR
Definition: retypes.h:7
BOOLEAN HostAdapterInternalError
Definition: BusLogic958.h:701
BusLogic_BusAddress_T BaseMailboxAddress
Definition: BusLogic958.h:801
BOOLEAN HostDifferentialSCSI
Definition: BusLogic958.h:688
BOOLEAN WideTransfersActive
Definition: BusLogic958.h:241
#define IN
Definition: typedefs.h:38
_Must_inspect_result_ _In_ LONGLONG _In_ LONGLONG Amount
Definition: fsrtlfuncs.h:550
unsigned short RenegotiateSyncAfterCheckCondition
Definition: BusLogic958.h:429
BusLogic_HostAdapterStatus_T
Definition: BusLogic958.h:482
PVOID SrbAddress
Definition: BusLogic958.h:596
UCHAR DataDirection
Definition: BusLogic958.h:566
#define TRUE
Definition: types.h:120
UCHAR BusLogic_FirmwareVersion3rdDigit_T
Definition: BusLogic958.h:178
UCHAR CDB_Length
Definition: BusLogic958.h:569
BOOLEAN BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.c:1316
union BusLogic_GeometryRegister BusLogic_GeometryRegister_T
struct BusLogic_HostAdapter BusLogic_HostAdapter_T
unsigned int CommandsSinceReset[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:737
enum BusLogic_ISACompatibleIOPort BusLogic_ISACompatibleIOPort_T
BOOLEAN BT958WmiSrb(IN PHW_DEVICE_EXTENSION HwDeviceExtension, IN OUT PSCSI_WMI_REQUEST_BLOCK Srb)
Definition: wmi.c:73
BusLogic_SynchronousValue_T BusLogic_SynchronousValues8_T[8]
Definition: BusLogic958.h:310
int BusLogic_Command(BusLogic_HostAdapter_T *HostAdapter, BusLogic_OperationCode_T OperationCode, void *ParameterData, int ParameterLength, void *ReplyData, int ReplyLength)
Definition: BusLogic958.c:606
BusLogic_ActionCode_T
Definition: BusLogic958.h:437
UCHAR TagEnable
Definition: BusLogic958.h:567
unsigned short SendStartUnitCommand
Definition: BusLogic958.h:403
BOOLEAN Sync
Definition: BusLogic958.h:786
enum _SCSI_ADAPTER_CONTROL_STATUS SCSI_ADAPTER_CONTROL_STATUS
unsigned long LastResetCompleted[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:740
UCHAR VESABusSpeedGreaterThan33MHz
Definition: BusLogic958.h:408
unsigned int BusLogic_ByteCount_T
Definition: BusLogic958.h:184
ULONG NTAPI DriverEntry(IN PVOID DriverObject, IN PVOID Argument2)
Definition: atapi.c:6177
unsigned short TaggedQueuingPermitted
Definition: BusLogic958.h:721
#define BusLogic_CDB_MaxLength
Definition: BusLogic958.h:97
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR PathId
Definition: classpnp.h:1117
UCHAR PeripheralDeviceType
Definition: BusLogic958.h:768
unsigned short DisconnectPermitted
Definition: BusLogic958.h:720
BOOLEAN Linked
Definition: BusLogic958.h:785
Definition: cdstruc.h:1073
unsigned char * PUCHAR
Definition: retypes.h:3
static void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T CommandSizeBuckets, unsigned int Amount)
Definition: BusLogic958.h:1152
unsigned short HostAdapterResetsCompleted
Definition: BusLogic958.h:277
UCHAR TargetID
Definition: BusLogic958.h:577
BOOLEAN StrictRoundRobinModeSupport
Definition: BusLogic958.h:696
BusLogic_CCB_Opcode_T
Definition: BusLogic958.h:459
BusLogic_TargetDeviceStatus_T
Definition: BusLogic958.h:512
UCHAR SynchronousPeriod[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:733
#define BusLogic_ControlRegisterOffset
Definition: BusLogic958.h:947
BOOLEAN BusLogic_SendBusDeviceReset(IN PVOID HwDeviceExtension, PSCSI_REQUEST_BLOCK Srb)
Definition: BusLogic958.c:2535
static void BusLogic_IncrementByteCounter(BusLogic_ByteCounter_T *ByteCounter, unsigned int Amount)
Definition: BusLogic958.h:1139
struct BusLogic_CCB * PBuslogic_CCB_T
static UCHAR BusLogic_ReadGeometryRegister(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1071
unsigned short CommonQueueDepth
Definition: BusLogic958.h:714
unsigned short WidePermitted
Definition: BusLogic958.h:399
BOOLEAN BusLogic_CheckHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.c:569
unsigned int WriteCommands
Definition: BusLogic958.h:264
#define BusLogic_InterruptRegisterOffset
Definition: BusLogic958.h:951
UCHAR FastSynchronousNegotiation
Definition: BusLogic958.h:384
BusLogic_BusAddress_T SenseDataPointer
Definition: BusLogic958.h:585
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
UCHAR SynchronousOffset[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:734
unsigned short IgnoreInBIOSScan
Definition: BusLogic958.h:404
#define BusLogic_StatusRegisterOffset
Definition: BusLogic958.h:948
BOOLEAN TaggedQueuingSupported
Definition: BusLogic958.h:238
struct BusLogic_ControlRegister::@1280 Bits
BusLogic_CCB_T * BusDeviceResetPendingCCB[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:730
static BusLogic_HostAdapterBusType_T BusLogic_HostAdapterBusTypes[]
Definition: BusLogic958.h:659
UCHAR ANSI_ApprovedVersion
Definition: BusLogic958.h:772
unsigned short DriverScatterGatherLimit
Definition: BusLogic958.h:706
struct _HW_DEVICE_EXTENSION * PHW_DEVICE_EXTENSION
UCHAR ActiveCommandsPerTarget[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:735
BusLogic_TargetStatistics_T TargetStatistics[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:749
static VOID WriteBusLogicPort(UCHAR data, PUCHAR adr)
Definition: BusLogic958.h:936
BOOLEAN TargetInfoReported
Definition: BusLogic958.h:243
struct BusLogic_StatusRegister::@1281 Bits
UCHAR FirmwareVersion1stDigit
Definition: BusLogic958.h:229
BusLogic_HostAdapterType_T
Definition: BusLogic958.h:638
BOOLEAN CommandParameterRegisterBusy
Definition: BusLogic958.h:979
BOOLEAN HighByteTerminated
Definition: BusLogic958.h:694
struct BusLogic_TargetStatistics BusLogic_TargetStatistics_T
static UCHAR BusLogic_ReadInterruptRegister(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1065
#define BusLogic_CommandParameterRegisterOffset
Definition: BusLogic958.h:949
void BusLogic_ScanIncomingMailboxes(PHW_DEVICE_EXTENSION deviceExtension)
Definition: BusLogic958.c:2048
unsigned long SerialNumber
Definition: BusLogic958.h:589
UCHAR ProductRevisionLevel[4]
Definition: BusLogic958.h:792
unsigned short WidePermitted
Definition: BusLogic958.h:719
struct BusLogic_InterruptRegister::@1282 Bits
BusLogic_OutgoingMailbox_T * LastOutgoingMailbox
Definition: BusLogic958.h:744
UCHAR SenseDataLength
Definition: BusLogic958.h:570
struct BusLogic_WmiExtendedSetupInformation * PBusLogic_WmiExtendedSetupInformation_T
BusLogic_BIOS_DiskGeometryTranslation
Definition: BusLogic958.h:1005
unsigned int BusLogic_CommandSizeBuckets_T[BusLogic_SizeBuckets]
Definition: BusLogic958.h:257
_Must_inspect_result_ _In_ PFLT_PORT _In_ ULONG _Out_writes_bytes_opt_ ReplyLength PVOID _Inout_opt_ PULONG ReplyLength
Definition: fltkernel.h:1903
void BusLogic_ProcessCompletedCCBs(PHW_DEVICE_EXTENSION deviceExtension)
Definition: BusLogic958.c:2139
#define BusLogic_MaxMailboxes
Definition: BusLogic958.h:90
#define BusLogic_SizeBuckets
Definition: BusLogic958.h:248
unsigned int
Definition: BusLogic958.h:584
UCHAR FullModelName[18]
Definition: BusLogic958.h:676
unsigned short SynchronousPermitted
Definition: BusLogic958.h:401
BusLogic_TargetFlags_T TargetFlags[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:732
unsigned short CommandAbortsRequested
Definition: BusLogic958.h:269
struct BusLogic_ExtendedSetupInformation BusLogic_ExtendedSetupInformation_T
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
unsigned short CommandAbortsAttempted
Definition: BusLogic958.h:270
UCHAR BIOSRedirectionOfINT19Enabled
Definition: BusLogic958.h:391
UCHAR MailboxIn[BusLogic_MaxMailboxes *sizeof(BusLogic_IncomingMailbox_T)]
Definition: BusLogic958.h:633
union BusLogic_InterruptRegister BusLogic_InterruptRegister_T
static void BusLogic_SoftReset(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1039
BusLogic_SynchronousValues8_T SynchronousValuesID0to7
Definition: BusLogic958.h:322
unsigned short ExternalHostAdapterResets
Definition: BusLogic958.h:722
BOOLEAN LevelSensitiveInterrupt
Definition: BusLogic958.h:686
BusLogic_BusAddress_T BaseMailboxAddress
Definition: BusLogic958.h:344
unsigned short DriverQueueDepth
Definition: BusLogic958.h:711
struct BusLogic_PCIHostAdapterInformation BusLogic_PCIHostAdapterInformation_T
#define BusLogic_MaxLogicalUnits
Definition: BusLogic958.h:84
UCHAR ManufacturingDiagnostic[2]
Definition: BusLogic958.h:431
BOOLEAN TerminationInfoValid
Definition: BusLogic958.h:692
BusLogic_IncomingMailbox_T * LastIncomingMailbox
Definition: BusLogic958.h:747
BOOLEAN BusLogic_ProbeHostAdapter(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.c:416
unsigned char BOOLEAN
BusLogic_BIOS_DiskGeometryTranslation_T Drive0Geometry
Definition: BusLogic958.h:1019
BOOLEAN BusLogic_HardwareResetHostAdapter(BusLogic_HostAdapter_T *HostAdapter, BOOLEAN HardReset)
Definition: BusLogic958.c:470
BusLogic_OperationCode_T
Definition: BusLogic958.h:117
struct BusLogic_ExtendedMailboxRequest BusLogic_ExtendedMailboxRequest_T
UCHAR BusLogic_FirmwareVersionLetter_T
Definition: BusLogic958.h:181
BOOLEAN NTAPI BT958HwStartIO(IN PVOID HwDeviceExtension, IN PSCSI_REQUEST_BLOCK Srb)
Definition: BusLogic958.c:1458
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
unsigned short NonTaggedToAlternateLUNPermitted
Definition: BusLogic958.h:428
unsigned short BusDeviceResetsAttempted
Definition: BusLogic958.h:273
struct SCSI_Inquiry SCSI_Inquiry_T
BusLogic_ByteCounter_T TotalBytesRead
Definition: BusLogic958.h:265
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
union BusLogic_StatusRegister BusLogic_StatusRegister_T
UCHAR MailboxOut[BusLogic_MaxMailboxes *sizeof(BusLogic_OutgoingMailbox_T)]
Definition: BusLogic958.h:632
BOOLEAN BounceBuffersRequired
Definition: BusLogic958.h:695
struct BusLogic_FetchHostAdapterLocalRAMRequest BusLogic_FetchHostAdapterLocalRAMRequest_T
unsigned short BusSettleTime
Definition: BusLogic958.h:715
BusLogic_CompletionCode_T CompletionCode
Definition: BusLogic958.h:594
UCHAR LegacyTagEnable
Definition: BusLogic958.h:579
enum BusLogic_BIOS_DiskGeometryTranslation BusLogic_BIOS_DiskGeometryTranslation_T
unsigned short UltraPermitted
Definition: BusLogic958.h:411
_In_ PVOID Argument2
Definition: classpnp.h:680
UCHAR ActiveCommandsPerLun[BusLogic_MaxTargetDevices][BusLogic_MaxLogicalUnits]
Definition: BusLogic958.h:736
UCHAR SCSI_CDB_T[BusLogic_CDB_MaxLength]
Definition: BusLogic958.h:537
SCSI_WMILIB_CONTEXT WmiLibContext
Definition: BusLogic958.h:759
BOOLEAN BusLogic_InitializeHostAdapter(PHW_DEVICE_EXTENSION deviceExtension, PPORT_CONFIGURATION_INFORMATION ConfigInfo)
Definition: BusLogic958.c:1175
BOOLEAN HostAdapterInitialized
Definition: BusLogic958.h:699
BusLogic_HostAdapter_T hcs
Definition: BusLogic958.h:757
PVOID AbortSrb
Definition: BusLogic958.h:597
UCHAR ECMA_Version
Definition: BusLogic958.h:773
struct _NONCACHED_EXTENSION NONCACHED_EXTENSION
unsigned short HostAdapterResetsAttempted
Definition: BusLogic958.h:276
unsigned short DeviceEnabled
Definition: BusLogic958.h:398
BusLogic_BusAddress_T CCB
Definition: BusLogic958.h:604
BOOLEAN RelAdr
Definition: BusLogic958.h:789
BOOLEAN ExtendedLUNSupport
Definition: BusLogic958.h:691
static UCHAR BusLogic_ReadDataInRegister(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1077
int BusLogic_QueueCommand(IN PVOID HwDeviceExtension, IN PSCSI_REQUEST_BLOCK Srb, IN PBuslogic_CCB_T ccb)
static const UCHAR Index[8]
Definition: usbohci.c:18
UCHAR QueueTag
Definition: BusLogic958.h:568
struct BusLogic_AutoSCSIData BusLogic_AutoSCSIData_T
BOOLEAN SftRe
Definition: BusLogic958.h:782
struct BusLogic_CCB * Next
Definition: BusLogic958.h:591
UCHAR ProductIdentification[16]
Definition: BusLogic958.h:791
UCHAR VendorIdentification[8]
Definition: BusLogic958.h:790
SCSI_CDB_T CDB
Definition: BusLogic958.h:581
BusLogic_BusAddress_T SegmentDataPointer
Definition: BusLogic958.h:533
enum BusLogic_SetCCBFormatRequest BusLogic_SetCCBFormatRequest_T
unsigned int CommandsCompleted
Definition: BusLogic958.h:262
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
VOID NTAPI ScsiPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)
Definition: scsiport.c:1531
BusLogic_DataDirection_T
Definition: BusLogic958.h:471
unsigned char UCHAR
Definition: xmlstorage.h:181
char * PBOOLEAN
Definition: retypes.h:11
unsigned short BusLogic_InstalledDevices_T
Definition: BusLogic958.h:1115
_In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters
Definition: iotypes.h:872
BusLogic_CCB_Status_T Status
Definition: BusLogic958.h:588
BusLogic_HostAdapterBusType_T HostAdapterBusType
Definition: BusLogic958.h:672
static UCHAR ReadBusLogicPort(PUCHAR adr)
Definition: BusLogic958.h:930
BusLogic_OutgoingMailbox_T * FirstOutgoingMailbox
Definition: BusLogic958.h:743
unsigned short DisconnectPermitted
Definition: BusLogic958.h:402
#define BusLogic_MaxTargetDevices
Definition: BusLogic958.h:81
struct BusLogic_HostAdapter * HostAdapter
Definition: BusLogic958.h:590
struct BusLogic_TargetFlags BusLogic_TargetFlags_T
UCHAR DeviceTypeModifier
Definition: BusLogic958.h:770
_In_ ULONG ParameterLength
Definition: usbdlib.h:193
unsigned short SynchronousPermitted
Definition: BusLogic958.h:716
unsigned short TargetDeviceCount
Definition: BusLogic958.h:724
UCHAR BusLogic_SynchronousPeriod_T[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:1103
UCHAR ResponseDataFormat
Definition: BusLogic958.h:775
UCHAR InternalFactorySignature[2]
Definition: BusLogic958.h:365
BOOLEAN CmdQue
Definition: BusLogic958.h:783
SCSI_ADAPTER_CONTROL_STATUS NTAPI BT958HwAdapterControl(IN PVOID HwDeviceExtension, IN SCSI_ADAPTER_CONTROL_TYPE ControlType, IN PVOID Parameters)
Definition: BusLogic958.c:2651
BusLogic_BIOS_DiskGeometryTranslation_T Drive1Geometry
Definition: BusLogic958.h:1020
PNONCACHED_EXTENSION NoncachedExtension
Definition: BusLogic958.h:758
BusLogic_BusAddress_T DataPointer
Definition: BusLogic958.h:572
unsigned int CommandsAttempted
Definition: BusLogic958.h:261
BusLogic_BusAddress_T CCB
Definition: BusLogic958.h:614
BusLogic_IncomingMailbox_T * FirstIncomingMailbox
Definition: BusLogic958.h:746
static void BusLogic_HardReset(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1049
UCHAR BusLogic_ComputeResultCode(BusLogic_HostAdapter_T *HostAdapter, BusLogic_HostAdapterStatus_T HostAdapterStatus, BusLogic_TargetDeviceStatus_T TargetDeviceStatus, UCHAR SenseDataLength)
Definition: BusLogic958.c:2309
unsigned int Units
Definition: BusLogic958.h:253
BusLogic_CCB_T * FirstCompletedCCB
Definition: BusLogic958.h:728
BusLogic_HostAdapterBusType_T
Definition: BusLogic958.h:645
BOOLEAN NTAPI BT958HwResetBus(IN PVOID HwDeviceExtension, IN ULONG PathId)
Definition: BusLogic958.c:2448
BOOLEAN AENC
Definition: BusLogic958.h:778
unsigned int Billions
Definition: BusLogic958.h:254
struct BusLogic_BoardID BusLogic_BoardID_T
UCHAR HostAdapterStatus
Definition: BusLogic958.h:575
unsigned short FastPermitted
Definition: BusLogic958.h:400
UCHAR BusLogic_InstalledDevices8_T[8]
Definition: BusLogic958.h:1109
unsigned long LastResetAttempted[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:739
UCHAR BusLogic_HostAdapterModelNumber_T[5]
Definition: BusLogic958.h:175
static void BusLogic_WriteCommandParameterRegister(BusLogic_HostAdapter_T *HostAdapter, UCHAR Value)
Definition: BusLogic958.h:1083
BusLogic_SynchronousValues8_T SynchronousValuesID8to15
Definition: BusLogic958.h:329
UCHAR FirmwareVersion2ndDigit
Definition: BusLogic958.h:230
#define BusLogic_DataInRegisterOffset
Definition: BusLogic958.h:950
BOOLEAN NTAPI BT958HwInterrupt(IN PVOID HwDeviceExtension)
Definition: BusLogic958.c:1973
unsigned long LastSequencePoint[BusLogic_MaxTargetDevices]
Definition: BusLogic958.h:738
unsigned short Checksum
Definition: BusLogic958.h:432
BusLogic_ByteCount_T SegmentByteCount
Definition: BusLogic958.h:532
UCHAR LogicalUnit
Definition: BusLogic958.h:578
BOOLEAN Buslogic_InitBT958(PHW_DEVICE_EXTENSION deviceExtension, PPORT_CONFIGURATION_INFORMATION ConfigInfo)
Definition: BusLogic958.c:316
struct BusLogic_ByteCounter BusLogic_ByteCounter_T
BOOLEAN RMB
Definition: BusLogic958.h:771
BusLogic_SetCCBFormatRequest
Definition: BusLogic958.h:1128
UCHAR LegacyQueueTag
Definition: BusLogic958.h:580
UCHAR MapRemovableAsFixedEnabled
Definition: BusLogic958.h:393
BusLogic_HostAdapterType_T HostAdapterType
Definition: BusLogic958.h:671
static UCHAR BusLogic_ReadStatusRegister(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1059
struct BusLogic_SetupInformation BusLogic_SetupInformation_T
BusLogic_CommandSizeBuckets_T ReadCommandSizeBuckets
Definition: BusLogic958.h:267
UCHAR NTAPI ScsiPortReadPortUchar(IN PUCHAR Port)
Definition: scsiport.c:1374
UCHAR ISO_Version
Definition: BusLogic958.h:774
static void BusLogic_StartMailboxCommand(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1094
enum _SCSI_ADAPTER_CONTROL_TYPE SCSI_ADAPTER_CONTROL_TYPE
unsigned short HostAdapterResetsRequested
Definition: BusLogic958.h:275
unsigned short FastPermitted
Definition: BusLogic958.h:717
BusLogic_OutgoingMailbox_T * NextOutgoingMailbox
Definition: BusLogic958.h:745
BOOLEAN HostAdapterExternalReset
Definition: BusLogic958.h:700
UCHAR StrictRoundRobinModeEnabled
Definition: BusLogic958.h:407
unsigned short UntaggedQueueDepth
Definition: BusLogic958.h:713
#define BOOLEAN
Definition: pedump.c:73
#define OUT
Definition: typedefs.h:39
struct BusLogic_GeometryRegister::@1283 Bits
BOOLEAN SynchronousInitiationEnabled
Definition: BusLogic958.h:314
static void BusLogic_IncrementErrorCounter(unsigned short *ErrorCounter)
Definition: BusLogic958.h:1179
BOOLEAN WBus16
Definition: BusLogic958.h:787
BOOLEAN TaggedQueuingActive
Definition: BusLogic958.h:240
BusLogic_ByteCount_T DataLength
Definition: BusLogic958.h:571
unsigned int ULONG
Definition: retypes.h:1
struct BusLogic_ExtendedSetupInformation::@1279 Misc
struct BusLogic_CCB BusLogic_CCB_T
struct BusLogic_OutgoingMailbox BusLogic_OutgoingMailbox_T
UCHAR ExtendedTranslationEnabled
Definition: BusLogic958.h:392
#define BusLogic_GeometryRegisterOffset
Definition: BusLogic958.h:952
UCHAR TargetDeviceStatus
Definition: BusLogic958.h:576
BusLogic_QueueTag_T
Definition: BusLogic958.h:520
UCHAR BusLogic_RequestedReplyLength_T
Definition: BusLogic958.h:169
struct BusLogic_SynchronousValue BusLogic_SynchronousValue_T
BOOLEAN TrmIOP
Definition: BusLogic958.h:777
BusLogic_ScatterGatherSegment_T ScatterGatherList[BusLogic_ScatterGatherLimit]
Definition: BusLogic958.h:592
BusLogic_CommandSizeBuckets_T WriteCommandSizeBuckets
Definition: BusLogic958.h:268
BOOLEAN ProcessCompletedCCBsActive
Definition: BusLogic958.h:703
IN PSCSI_REQUEST_BLOCK Srb
Definition: class2.h:49
BOOLEAN ParityCheckingEnabled
Definition: BusLogic958.h:684
BOOLEAN WBus32
Definition: BusLogic958.h:788
BusLogic_IncomingMailbox_T * NextIncomingMailbox
Definition: BusLogic958.h:748
UCHAR PeripheralQualifier
Definition: BusLogic958.h:769
UCHAR ForceBusDeviceScanningOrder
Definition: BusLogic958.h:426
union BusLogic_ControlRegister BusLogic_ControlRegister_T
struct BusLogic_Configuration BusLogic_Configuration_T
BOOLEAN CommandSuccessfulFlag
Definition: BusLogic958.h:242
UCHAR FirmwareVersion[6]
Definition: BusLogic958.h:675
unsigned short CommandAbortsCompleted
Definition: BusLogic958.h:271
BOOLEAN BusLogic_WriteOutgoingMailbox(PHW_DEVICE_EXTENSION deviceExtension, BusLogic_ActionCode_T ActionCode, BusLogic_CCB_T *CCB)
Definition: BusLogic958.c:1679
void BT958WmiInitialize(IN PHW_DEVICE_EXTENSION HwDeviceExtension)
Definition: wmi.c:52
struct _NONCACHED_EXTENSION * PNONCACHED_EXTENSION
struct _HW_DEVICE_EXTENSION HW_DEVICE_EXTENSION
unsigned int BusLogic_BusAddress_T
Definition: BusLogic958.h:172
unsigned short HostAdapterInternalErrors
Definition: BusLogic958.h:723
UCHAR AdditionalLength
Definition: BusLogic958.h:779
UCHAR BIOSSupportsMoreThan2DrivesEnabled
Definition: BusLogic958.h:395
struct BusLogic_WmiExtendedSetupInformation BusLogic_WmiExtendedSetupInformation_T
unsigned short BusDeviceResetsCompleted
Definition: BusLogic958.h:274
BusLogic_ByteCounter_T TotalBytesWritten
Definition: BusLogic958.h:266
BusLogic_CCB_Status_T
Definition: BusLogic958.h:540
unsigned short HostAdapterScatterGatherLimit
Definition: BusLogic958.h:705
volatile BOOLEAN HostAdapterCommandCompleted
Definition: BusLogic958.h:704
struct BusLogic_ScatterGatherSegment BusLogic_ScatterGatherSegment_T
void BusLogic_QueueCompletedCCB(PHW_DEVICE_EXTENSION deviceExtension, BusLogic_CCB_T *CCB)
Definition: BusLogic958.c:2108
#define BusLogic_ScatterGatherLimit
Definition: BusLogic958.h:102
BOOLEAN NTAPI BT958HwInitialize(IN PVOID HwDeviceExtension)
Definition: BusLogic958.c:2620
BOOLEAN BusLogic_ReadHostAdapterConfiguration(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.c:833
BusLogic_ISACompatibleIOPort
Definition: BusLogic958.h:196
struct BusLogic_IncomingMailbox BusLogic_IncomingMailbox_T
BusLogic_BusAddress_T BIOS_Address
Definition: BusLogic958.h:726
BusLogic_CompletionCode_T
Definition: BusLogic958.h:448
unsigned short BusDeviceResetsRequested
Definition: BusLogic958.h:272
BOOLEAN WideTransfersSupported
Definition: BusLogic958.h:239
BusLogic_CCB_T * LastCompletedCCB
Definition: BusLogic958.h:729
static void BusLogic_InterruptReset(BusLogic_HostAdapter_T *HostAdapter)
Definition: BusLogic958.h:1028
unsigned short UltraPermitted
Definition: BusLogic958.h:718