2 ===================================================================
3 --- atapi.h (revision 38451)
4 +++ atapi.h (working copy)
13 #define PRINT_PREFIX "UniATA: "
15 //#define KdPrint3(_x_) {if(LOG_ON_RAISED_IRQL_W2K || MajorVersion < 0x05 || KeGetCurrentIrql() <= 2){/*DbgPrint("%x: ", PsGetCurrentThread()) ;*/ DbgPrint _x_ ; if(g_LogToDisplay){ PrintNtConsole _x_ ;} }}
19 AtapiParseArgumentString(
27 @@ -1202,15 +1206,15 @@
28 IN PVOID HwDeviceExtension,
37 AtapiRegCheckParameterValue(
38 IN PVOID HwDeviceExtension,
39 - IN PWSTR PathSuffix,
41 + IN PCWSTR PathSuffix,
56 ===================================================================
57 --- id_sata.cpp (revision 38451)
58 +++ id_sata.cpp (working copy)
62 PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
63 - ULONG Channel = deviceExtension->Channel + lChannel;
64 + //ULONG Channel = deviceExtension->Channel + lChannel;
65 PHW_CHANNEL chan = &deviceExtension->chan[lChannel];
66 SATA_SSTATUS_REG SStatus;
70 PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
71 PHW_CHANNEL chan = &deviceExtension->chan[lChannel];
72 - ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
73 + //ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
74 SATA_SSTATUS_REG SStatus;
75 SATA_SERROR_REG SError;
78 ===================================================================
79 --- ntddk_ex.h (revision 38451)
80 +++ ntddk_ex.h (working copy)
82 #ifndef __NTDDK_EX__H__
83 #define __NTDDK_EX__H__
91 -#define ASSERT //(x) if (!(x)) {RtlAssert("#x",__FILE__,__LINE__, ""); }
93 +#define ASSERT(x) ((void)0)
94 +// #define ASSERT(x) if (!(x)) { RtlAssert("#x",__FILE__,__LINE__, ""); }
98 #ifndef FILE_CHARACTERISTIC_PNP_DEVICE // DDK 2003
100 #define FILE_CHARACTERISTIC_PNP_DEVICE 0x00000800
102 ===================================================================
103 --- id_dma.cpp (revision 38451)
104 +++ id_dma.cpp (working copy)
106 PHW_CHANNEL chan = &(deviceExtension->chan[lChannel]);
107 PATA_REQ AtaReq = (PATA_REQ)(Srb->SrbExtension);
108 BOOLEAN use_DB_IO = FALSE;
109 - BOOLEAN use_AHCI = FALSE;
110 + //BOOLEAN use_AHCI = FALSE;
111 ULONG orig_count = count;
112 ULONG max_entries = (deviceExtension->HwFlags & UNIATA_AHCI) ? ATA_AHCI_DMA_ENTRIES : ATA_DMA_ENTRIES;
115 if(!dma_count || ((LONG)(dma_base) == -1)) {
116 KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No 1st block\n" ));
117 //AtaReq->dma_base = NULL;
118 - AtaReq->ahci_base64 = NULL;
119 + AtaReq->ahci_base64 = 0;
124 if (i >= max_entries) {
125 KdPrint2((PRINT_PREFIX "too many segments in DMA table\n" ));
126 //AtaReq->dma_base = NULL;
127 - AtaReq->ahci_base64 = NULL;
128 + AtaReq->ahci_base64 = 0;
131 KdPrint2((PRINT_PREFIX " get Phys(data[n]=%x)\n", data ));
134 if(!dma_count || !dma_base || ((LONG)(dma_base) == -1)) {
135 //AtaReq->dma_base = NULL;
136 - AtaReq->ahci_base64 = NULL;
137 + AtaReq->ahci_base64 = 0;
138 KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No NEXT block\n" ));
144 PHW_LU_EXTENSION LunExt = &(deviceExtension->lun[ldev]);
148 apiomode = (CHAR)AtaPioMode(&(LunExt->IdentifyData));
153 if((deviceExtension->HbaCtrlFlags & HBAFLAGS_DMA_DISABLED_LBA48) &&
154 - (AtaReq->lba >= ATA_MAX_LBA28) &&
155 + (AtaReq->lba >= (LONGLONG)ATA_MAX_LBA28) &&
156 (LunExt->TransferMode > ATA_PIO5) ) {
157 KdPrint2((PRINT_PREFIX
158 "AtapiDmaReinit: FORCE_DOWNRATE on Device %d for LBA48\n", ldev & 1));
160 if(AtaReq->Flags & REQ_FLAG_FORCE_DOWNRATE) {
161 KdPrint2((PRINT_PREFIX
162 "AtapiDmaReinit: FORCE_DOWNRATE on Device %d\n", ldev & 1));
163 - if(AtaReq->lba >= ATA_MAX_LBA28) {
164 + if(AtaReq->lba >= (LONGLONG)ATA_MAX_LBA28) {
166 LunExt->DeviceFlags |= REQ_FLAG_FORCE_DOWNRATE_LBA48;
169 IN ULONG DeviceNumber,
170 IN ULONG lChannel, // logical channel,
171 // is always 0 except simplex-only controllers
180 PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
181 @@ -1488,7 +1488,7 @@
182 AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
184 SetPciConfig1(mreg, mode | (mask & 0x11));
185 - SetPciConfig2(ureg - 0x8, sil_pio_modes[i]);
186 + SetPciConfig2(ureg - 0x8, sil_pio_modes[apiomode]);
190 @@ -1538,7 +1538,7 @@
195 + PULONG sis_modes = NULL;
196 static const ULONG sis_modes_new133[] =
197 { 0x28269008, 0x0c266008, 0x04263008, 0x0c0a3008, 0x05093008,
198 0x22196008, 0x0c0a3008, 0x05093008, 0x050939fc, 0x050936ac,
199 @@ -1553,9 +1553,9 @@
200 { 0x00cb, 0x0067, 0x0044, 0x0033, 0x0031, 0x0044, 0x0033, 0x0031,
201 0x8b31, 0x8731, 0x8531, 0x8431, 0x8231, 0x8131 };
207 + ULONG reg_size = 0;
211 @@ -1731,8 +1731,8 @@
212 AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
213 ChangePciConfig1(0x50, a | (1 << (dev + 3)) );
214 GetPciConfig1(0x54 + offset, reg54);
215 - if(reg54 < chtiming[i]) {
216 - SetPciConfig1(0x54 + offset, chtiming[i]);
217 + if(reg54 < chtiming[apiomode]) {
218 + SetPciConfig1(0x54 + offset, chtiming[apiomode]);
222 @@ -1901,7 +1901,7 @@
223 ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK;
224 //ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
231 Index: id_badblock.cpp
232 ===================================================================
233 --- id_badblock.cpp (revision 38451)
234 +++ id_badblock.cpp (working copy)
236 L"UniATA\\Parameters\\BadBlocks",
240 KdPrint(( "InitBadBlocks returned: %#x\n", status));
242 + UNREFERENCED_PARAMETER(status);
246 KdPrint(( "InitBadBlocks local\n"));
248 ===================================================================
249 --- id_init.cpp (revision 38451)
250 +++ id_init.cpp (working copy)
254 PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
255 - ULONG slotNumber = deviceExtension->slotNumber;
256 - ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber;
257 + //ULONG slotNumber = deviceExtension->slotNumber;
258 + //ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber;
259 ULONG VendorID = deviceExtension->DevID & 0xffff;
260 - ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff;
261 - ULONG RevID = deviceExtension->RevID;
262 + //ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff;
263 + //ULONG RevID = deviceExtension->RevID;
264 ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK;
265 ULONG ChipFlags= deviceExtension->HwFlags & CHIPFLAG_MASK;
268 PCI_DEV_HW_SPEC_BM( 0730, 1039, 0x00, ATA_UDMA5, "SiS 730" , SIS100OLD ),
270 PCI_DEV_HW_SPEC_BM( 0646, 1039, 0x00, ATA_UDMA6, "SiS 645DX", SIS133NEW ),
271 -/* PCI_DEV_HW_SPEC_BM( 0645, 1039, 0x00, ATA_UDMA6, "SiS 645" , SIS133NEW ),
272 +/* PCI_DEV_HW_SPEC_BM( 0645, 1039, 0x00, ATA_UDMA6, "SiS 645" , SIS133NEW ),*/
273 /* PCI_DEV_HW_SPEC_BM( 0640, 1039, 0x00, ATA_UDMA4, "SiS 640" , SIS_SOUTH ),*/
274 PCI_DEV_HW_SPEC_BM( 0635, 1039, 0x00, ATA_UDMA5, "SiS 635" , SIS100NEW ),
275 PCI_DEV_HW_SPEC_BM( 0633, 1039, 0x00, ATA_UDMA5, "SiS 633" , SIS100NEW ),
277 BaseIoAddressBM = AtapiGetIoRange(HwDeviceExtension, ConfigInfo, pciData, SystemIoBusNumber,
278 4, 0, deviceExtension->NumberChannels*sizeof(IDE_BUSMASTER_REGISTERS));
279 for(c=0; c<deviceExtension->NumberChannels; c++) {
280 - ULONG unit01 = (c & 1);
281 + //ULONG unit01 = (c & 1);
282 ULONG unit10 = (c & 2);
283 chan = &deviceExtension->chan[c];
289 - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
290 + //PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
291 PCI_COMMON_CONFIG pciData;
294 @@ -1039,7 +1039,7 @@
298 - PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
299 + //PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
300 PCI_COMMON_CONFIG pciData;
303 @@ -1174,7 +1174,7 @@
304 ULONG slotNumber = deviceExtension->slotNumber;
305 ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber;
307 - ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK;
308 + //ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK;
310 ULONG c; // logical channel (for Compatible Mode controllers)
312 @@ -1332,7 +1332,9 @@
313 ULONG slotNumber = deviceExtension->slotNumber;
314 ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber;
315 ULONG VendorID = deviceExtension->DevID & 0xffff;
317 ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff;
319 ULONG RevID = deviceExtension->RevID;
321 // BUSMASTER_CONTROLLER_INFORMATION* DevTypeInfo;
323 ===================================================================
324 --- id_ata.cpp (revision 38451)
325 +++ id_ata.cpp (working copy)
326 @@ -1864,7 +1864,9 @@
327 ULONG slotNumber = deviceExtension->slotNumber;
328 ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber;
329 ULONG VendorID = deviceExtension->DevID & 0xffff;
331 ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff;
333 //ULONG RevID = deviceExtension->RevID;
334 ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
336 @@ -2859,12 +2861,12 @@
339 AtapiParseArgumentString(
351 ULONG stringLength = 0;
352 ULONG keyWordLength = 0;
353 @@ -2877,24 +2879,15 @@
357 - // Calculate the string length and lower case all characters.
358 + // Calculate the string length.
361 - if (*cptr >= 'A' && *cptr <= 'Z') {
362 - *cptr = *cptr + ('a' - 'A');
369 - // Calculate the keyword length and lower case all characters.
373 - if (*cptr >= 'A' && *cptr <= 'Z') {
374 - *cptr = *cptr + ('a' - 'A');
377 + // Calculate the keyword length.
383 @@ -2920,18 +2913,21 @@
387 - while (*cptr++ == *kptr++) {
388 + while ((*cptr == *kptr) ||
389 + (*cptr <= 'Z' && *cptr + ('a' - 'A') == *kptr) ||
390 + (*cptr >= 'a' && *cptr - ('a' - 'A') == *kptr)) {
394 - if (*(cptr - 1) == '\0') {
395 + if (*cptr == '\0') {
401 - if (*(kptr - 1) == '\0') {
402 + if (*kptr == '\0') {
404 // May have a match backup and check for blank or equals.
406 while (*cptr == ' ' || *cptr == '\t') {
409 @@ -2967,7 +2963,7 @@
413 - if ((*cptr == '0') && (*(cptr + 1) == 'x')) {
414 + if ((*cptr == '0') && ((*(cptr + 1) == 'x') || (*(cptr + 1) == 'X'))) {
415 // Value is in Hex. Skip the "0x"
417 for (index = 0; *(cptr + index); index++) {
418 @@ -2983,6 +2979,8 @@
420 if ((*(cptr + index) >= 'a') && (*(cptr + index) <= 'f')) {
421 value = (16 * value) + (*(cptr + index) - 'a' + 10);
422 + } else if ((*(cptr + index) >= 'A') && (*(cptr + index) <= 'F')) {
423 + value = (16 * value) + (*(cptr + index) - 'A' + 10);
425 // Syntax error, return not found.
427 @@ -8752,10 +8750,10 @@
429 AtapiRegCheckDevLunValue(
430 IN PVOID HwDeviceExtension,
431 - IN PWCHAR NamePrefix,
432 + IN PCWCH NamePrefix,
440 @@ -8822,7 +8820,7 @@
441 IN PVOID HwDeviceExtension,
449 @@ -8940,8 +8938,8 @@
451 AtapiRegCheckParameterValue(
452 IN PVOID HwDeviceExtension,
453 - IN PWSTR PathSuffix,
455 + IN PCWSTR PathSuffix,
460 @@ -9108,7 +9106,7 @@
464 - PCHAR DebugMessage,
470 ===================================================================
471 --- id_probe.cpp (revision 38451)
472 +++ id_probe.cpp (working copy)
479 } // end AtapiDoNothing()
483 RtlCopyMemory(newBMListPtr, (PVOID)&(BusMasterAdapters[i]), sizeof(BUSMASTER_CONTROLLER_INFORMATION));
485 - sprintf((PCHAR)vendorStrPtr, "%4.4x", VendorID);
486 - sprintf((PCHAR)deviceStrPtr, "%4.4x", DeviceID);
487 + sprintf((PCHAR)vendorStrPtr, "%4.4lx", VendorID);
488 + sprintf((PCHAR)deviceStrPtr, "%4.4lx", DeviceID);
490 RtlCopyMemory(&(newBMListPtr->VendorIdStr), (PCHAR)vendorStrPtr, 4);
491 RtlCopyMemory(&(newBMListPtr->DeviceIdStr), (PCHAR)deviceStrPtr, 4);
493 BOOLEAN found = FALSE;
495 BOOLEAN simplexOnly = FALSE;
497 +#ifdef UNIATA_INIT_ON_PROBE
498 BOOLEAN skip_find_dev = FALSE;
501 BOOLEAN AltInit = FALSE;
503 SCSI_PHYSICAL_ADDRESS IoBasePort1;
504 @@ -1712,7 +1715,7 @@
507 PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
508 - PHW_CHANNEL chan = NULL;
509 + //PHW_CHANNEL chan = NULL;
510 // this buffer must be global for UNIATA_CORE build
511 PCI_COMMON_CONFIG pciData;
513 @@ -1743,8 +1746,8 @@
514 BOOLEAN found = FALSE;
516 BOOLEAN simplexOnly = FALSE;
517 - BOOLEAN skip_find_dev = FALSE;
518 - BOOLEAN AltInit = FALSE;
519 + //BOOLEAN skip_find_dev = FALSE;
520 + //BOOLEAN AltInit = FALSE;
522 PIDE_BUSMASTER_REGISTERS BaseIoAddressBM_0 = NULL;
524 @@ -1797,7 +1800,7 @@
526 PCI_COMMON_HDR_LENGTH);
528 - if (busDataRead < PCI_COMMON_HDR_LENGTH) {
529 + if (busDataRead < (ULONG)PCI_COMMON_HDR_LENGTH) {
530 KdPrint2((PRINT_PREFIX "busDataRead < PCI_COMMON_HDR_LENGTH => SP_RETURN_ERROR\n"));
533 @@ -2207,7 +2210,7 @@
534 PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
536 PULONG adapterCount = (PULONG)Context;
538 + PUCHAR ioSpace = NULL;
542 @@ -2217,7 +2220,7 @@
543 BOOLEAN preConfig = FALSE;
545 PIDE_REGISTERS_1 BaseIoAddress1;
546 - PIDE_REGISTERS_2 BaseIoAddress2;
547 + PIDE_REGISTERS_2 BaseIoAddress2 = NULL;
549 // The following table specifies the ports to be checked when searching for
550 // an IDE controller. A zero entry terminates the search.
552 ===================================================================
553 --- bm_devs.h (revision 38451)
554 +++ bm_devs.h (working copy)
556 { #idlo, 4, 0x##idlo, #idhi, 4, 0x##idhi, rev, mode, name, flags}
558 #define PCI_DEV_HW_SPEC_BM(idhi, idlo, rev, mode, name, flags) \
559 - { #idlo, 4, 0x##idlo, #idhi, 4, 0x##idhi, rev, mode, NULL, flags}
560 + { (PCHAR) #idlo, 4, 0x##idlo, (PCHAR) #idhi, 4, 0x##idhi, rev, mode, NULL, flags}
563 #define BMLIST_TERMINATOR (0xffffffffL)
565 ===================================================================
566 --- bsmaster.h (revision 38451)
567 +++ bsmaster.h (working copy)
569 BOOLEAN opt_AtapiDmaRawRead; // default TRUE
570 BOOLEAN opt_AtapiDmaReadWrite; // default TRUE
575 } HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION;
577 @@ -1172,9 +1172,9 @@
578 IN ULONG DeviceNumber,
579 IN ULONG lChannel, // logical channel,
580 // is always 0 except simplex-only controllers