mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 08:00:24 +00:00
Silence GCC 4.4.0 warnings.
svn path=/trunk/; revision=38563
This commit is contained in:
parent
bc752511c5
commit
fa2d477672
8 changed files with 426 additions and 238 deletions
|
@ -1067,8 +1067,8 @@ AtapiFindController(
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
AtapiParseArgumentString(
|
AtapiParseArgumentString(
|
||||||
IN PCHAR String,
|
IN PCCH String,
|
||||||
IN PCHAR KeyWord
|
IN PCCH KeyWord
|
||||||
);
|
);
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
|
@ -1206,15 +1206,15 @@ AtapiRegCheckDevValue(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN ULONG chan,
|
IN ULONG chan,
|
||||||
IN ULONG dev,
|
IN ULONG dev,
|
||||||
IN PWSTR Name,
|
IN PCWSTR Name,
|
||||||
IN ULONG Default
|
IN ULONG Default
|
||||||
);
|
);
|
||||||
|
|
||||||
extern ULONG
|
extern ULONG
|
||||||
AtapiRegCheckParameterValue(
|
AtapiRegCheckParameterValue(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PWSTR PathSuffix,
|
IN PCWSTR PathSuffix,
|
||||||
IN PWSTR Name,
|
IN PCWSTR Name,
|
||||||
IN ULONG Default
|
IN ULONG Default
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1224,7 +1224,7 @@ extern "C"
|
||||||
VOID
|
VOID
|
||||||
_cdecl
|
_cdecl
|
||||||
_PrintNtConsole(
|
_PrintNtConsole(
|
||||||
PCHAR DebugMessage,
|
PCCH DebugMessage,
|
||||||
...
|
...
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -482,7 +482,7 @@ typedef struct _BUSMASTER_CONTROLLER_INFORMATION {
|
||||||
{ #idlo, 4, 0x##idlo, #idhi, 4, 0x##idhi, rev, mode, name, flags}
|
{ #idlo, 4, 0x##idlo, #idhi, 4, 0x##idhi, rev, mode, name, flags}
|
||||||
#else
|
#else
|
||||||
#define PCI_DEV_HW_SPEC_BM(idhi, idlo, rev, mode, name, flags) \
|
#define PCI_DEV_HW_SPEC_BM(idhi, idlo, rev, mode, name, flags) \
|
||||||
{ #idlo, 4, 0x##idlo, #idhi, 4, 0x##idhi, rev, mode, NULL, flags}
|
{ (PCHAR) #idlo, 4, 0x##idlo, (PCHAR) #idhi, 4, 0x##idhi, rev, mode, NULL, flags}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BMLIST_TERMINATOR (0xffffffffL)
|
#define BMLIST_TERMINATOR (0xffffffffL)
|
||||||
|
|
|
@ -987,7 +987,7 @@ typedef struct _HW_DEVICE_EXTENSION {
|
||||||
BOOLEAN opt_AtapiDmaRawRead; // default TRUE
|
BOOLEAN opt_AtapiDmaRawRead; // default TRUE
|
||||||
BOOLEAN opt_AtapiDmaReadWrite; // default TRUE
|
BOOLEAN opt_AtapiDmaReadWrite; // default TRUE
|
||||||
|
|
||||||
PCHAR FullDevName;
|
PCCH FullDevName;
|
||||||
|
|
||||||
} HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION;
|
} HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION;
|
||||||
|
|
||||||
|
@ -1172,9 +1172,9 @@ AtapiDmaInit(
|
||||||
IN ULONG DeviceNumber,
|
IN ULONG DeviceNumber,
|
||||||
IN ULONG lChannel, // logical channel,
|
IN ULONG lChannel, // logical channel,
|
||||||
// is always 0 except simplex-only controllers
|
// is always 0 except simplex-only controllers
|
||||||
IN CHAR apiomode,
|
IN SCHAR apiomode,
|
||||||
IN CHAR wdmamode,
|
IN SCHAR wdmamode,
|
||||||
IN CHAR udmamode
|
IN SCHAR udmamode
|
||||||
);
|
);
|
||||||
|
|
||||||
extern BOOLEAN NTAPI
|
extern BOOLEAN NTAPI
|
||||||
|
|
|
@ -2861,12 +2861,12 @@ Return Values:
|
||||||
--*/
|
--*/
|
||||||
ULONG
|
ULONG
|
||||||
AtapiParseArgumentString(
|
AtapiParseArgumentString(
|
||||||
IN PCHAR String,
|
IN PCCH String,
|
||||||
IN PCHAR KeyWord
|
IN PCCH KeyWord
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
PCHAR cptr;
|
PCCH cptr;
|
||||||
PCHAR kptr;
|
PCCH kptr;
|
||||||
ULONG value;
|
ULONG value;
|
||||||
ULONG stringLength = 0;
|
ULONG stringLength = 0;
|
||||||
ULONG keyWordLength = 0;
|
ULONG keyWordLength = 0;
|
||||||
|
@ -2879,24 +2879,15 @@ AtapiParseArgumentString(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the string length and lower case all characters.
|
// Calculate the string length.
|
||||||
cptr = String;
|
cptr = String;
|
||||||
while (*cptr) {
|
while (*cptr++) {
|
||||||
if (*cptr >= 'A' && *cptr <= 'Z') {
|
|
||||||
*cptr = *cptr + ('a' - 'A');
|
|
||||||
}
|
|
||||||
cptr++;
|
|
||||||
stringLength++;
|
stringLength++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the keyword length and lower case all characters.
|
// Calculate the keyword length.
|
||||||
cptr = KeyWord;
|
kptr = KeyWord;
|
||||||
while (*cptr) {
|
while (*kptr++) {
|
||||||
|
|
||||||
if (*cptr >= 'A' && *cptr <= 'Z') {
|
|
||||||
*cptr = *cptr + ('a' - 'A');
|
|
||||||
}
|
|
||||||
cptr++;
|
|
||||||
keyWordLength++;
|
keyWordLength++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2922,18 +2913,21 @@ ContinueSearch:
|
||||||
}
|
}
|
||||||
|
|
||||||
kptr = KeyWord;
|
kptr = KeyWord;
|
||||||
while (*cptr++ == *kptr++) {
|
while ((*cptr == *kptr) ||
|
||||||
|
(*cptr <= 'Z' && *cptr + ('a' - 'A') == *kptr) ||
|
||||||
|
(*cptr >= 'a' && *cptr - ('a' - 'A') == *kptr)) {
|
||||||
|
cptr++;
|
||||||
|
kptr++;
|
||||||
|
|
||||||
if (*(cptr - 1) == '\0') {
|
if (*cptr == '\0') {
|
||||||
// end of string
|
// end of string
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*(kptr - 1) == '\0') {
|
if (*kptr == '\0') {
|
||||||
|
|
||||||
// May have a match backup and check for blank or equals.
|
// May have a match backup and check for blank or equals.
|
||||||
cptr--;
|
|
||||||
while (*cptr == ' ' || *cptr == '\t') {
|
while (*cptr == ' ' || *cptr == '\t') {
|
||||||
cptr++;
|
cptr++;
|
||||||
}
|
}
|
||||||
|
@ -2969,7 +2963,7 @@ ContinueSearch:
|
||||||
}
|
}
|
||||||
|
|
||||||
value = 0;
|
value = 0;
|
||||||
if ((*cptr == '0') && (*(cptr + 1) == 'x')) {
|
if ((*cptr == '0') && ((*(cptr + 1) == 'x') || (*(cptr + 1) == 'X'))) {
|
||||||
// Value is in Hex. Skip the "0x"
|
// Value is in Hex. Skip the "0x"
|
||||||
cptr += 2;
|
cptr += 2;
|
||||||
for (index = 0; *(cptr + index); index++) {
|
for (index = 0; *(cptr + index); index++) {
|
||||||
|
@ -2985,6 +2979,8 @@ ContinueSearch:
|
||||||
} else {
|
} else {
|
||||||
if ((*(cptr + index) >= 'a') && (*(cptr + index) <= 'f')) {
|
if ((*(cptr + index) >= 'a') && (*(cptr + index) <= 'f')) {
|
||||||
value = (16 * value) + (*(cptr + index) - 'a' + 10);
|
value = (16 * value) + (*(cptr + index) - 'a' + 10);
|
||||||
|
} else if ((*(cptr + index) >= 'A') && (*(cptr + index) <= 'F')) {
|
||||||
|
value = (16 * value) + (*(cptr + index) - 'A' + 10);
|
||||||
} else {
|
} else {
|
||||||
// Syntax error, return not found.
|
// Syntax error, return not found.
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -8754,10 +8750,10 @@ BuildRequestSenseSrb (
|
||||||
ULONG
|
ULONG
|
||||||
AtapiRegCheckDevLunValue(
|
AtapiRegCheckDevLunValue(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PWCHAR NamePrefix,
|
IN PCWCH NamePrefix,
|
||||||
IN ULONG chan,
|
IN ULONG chan,
|
||||||
IN ULONG dev,
|
IN ULONG dev,
|
||||||
IN PWSTR Name,
|
IN PCWSTR Name,
|
||||||
IN ULONG Default
|
IN ULONG Default
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -8824,7 +8820,7 @@ AtapiRegCheckDevValue(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN ULONG chan,
|
IN ULONG chan,
|
||||||
IN ULONG dev,
|
IN ULONG dev,
|
||||||
IN PWSTR Name,
|
IN PCWSTR Name,
|
||||||
IN ULONG Default
|
IN ULONG Default
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -8942,8 +8938,8 @@ AtapiRegCheckDevValue(
|
||||||
ULONG
|
ULONG
|
||||||
AtapiRegCheckParameterValue(
|
AtapiRegCheckParameterValue(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PWSTR PathSuffix,
|
IN PCWSTR PathSuffix,
|
||||||
IN PWSTR Name,
|
IN PCWSTR Name,
|
||||||
IN ULONG Default
|
IN ULONG Default
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -9110,7 +9106,7 @@ extern "C"
|
||||||
VOID
|
VOID
|
||||||
_cdecl
|
_cdecl
|
||||||
_PrintNtConsole(
|
_PrintNtConsole(
|
||||||
PCHAR DebugMessage,
|
PCCH DebugMessage,
|
||||||
...
|
...
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
|
@ -281,7 +281,7 @@ retry_DB_IO:
|
||||||
if(!dma_count || ((LONG)(dma_base) == -1)) {
|
if(!dma_count || ((LONG)(dma_base) == -1)) {
|
||||||
KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No 1st block\n" ));
|
KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No 1st block\n" ));
|
||||||
//AtaReq->dma_base = NULL;
|
//AtaReq->dma_base = NULL;
|
||||||
AtaReq->ahci_base64 = (ULONGLONG)NULL;
|
AtaReq->ahci_base64 = 0;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ retry_DB_IO:
|
||||||
if (i >= max_entries) {
|
if (i >= max_entries) {
|
||||||
KdPrint2((PRINT_PREFIX "too many segments in DMA table\n" ));
|
KdPrint2((PRINT_PREFIX "too many segments in DMA table\n" ));
|
||||||
//AtaReq->dma_base = NULL;
|
//AtaReq->dma_base = NULL;
|
||||||
AtaReq->ahci_base64 = (ULONGLONG)NULL;
|
AtaReq->ahci_base64 = 0;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
KdPrint2((PRINT_PREFIX " get Phys(data[n]=%x)\n", data ));
|
KdPrint2((PRINT_PREFIX " get Phys(data[n]=%x)\n", data ));
|
||||||
|
@ -321,7 +321,7 @@ retry_DB_IO:
|
||||||
} else
|
} else
|
||||||
if(!dma_count || !dma_base || ((LONG)(dma_base) == -1)) {
|
if(!dma_count || !dma_base || ((LONG)(dma_base) == -1)) {
|
||||||
//AtaReq->dma_base = NULL;
|
//AtaReq->dma_base = NULL;
|
||||||
AtaReq->ahci_base64 = (ULONGLONG)NULL;
|
AtaReq->ahci_base64 = 0;
|
||||||
KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No NEXT block\n" ));
|
KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No NEXT block\n" ));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -596,7 +596,7 @@ AtapiDmaReinit(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
PHW_LU_EXTENSION LunExt = &(deviceExtension->lun[ldev]);
|
PHW_LU_EXTENSION LunExt = &(deviceExtension->lun[ldev]);
|
||||||
CHAR apiomode;
|
SCHAR apiomode;
|
||||||
|
|
||||||
apiomode = (CHAR)AtaPioMode(&(LunExt->IdentifyData));
|
apiomode = (CHAR)AtaPioMode(&(LunExt->IdentifyData));
|
||||||
|
|
||||||
|
@ -754,9 +754,9 @@ AtapiDmaInit(
|
||||||
IN ULONG DeviceNumber,
|
IN ULONG DeviceNumber,
|
||||||
IN ULONG lChannel, // logical channel,
|
IN ULONG lChannel, // logical channel,
|
||||||
// is always 0 except simplex-only controllers
|
// is always 0 except simplex-only controllers
|
||||||
IN CHAR apiomode,
|
IN SCHAR apiomode,
|
||||||
IN CHAR wdmamode,
|
IN SCHAR wdmamode,
|
||||||
IN CHAR udmamode
|
IN SCHAR udmamode
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
|
PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
|
||||||
|
@ -1046,7 +1046,7 @@ set_new_acard:
|
||||||
/* set PIO mode timings */
|
/* set PIO mode timings */
|
||||||
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
||||||
if((apiomode >= 0) && (ChipType != VIA133)) {
|
if((apiomode >= 0) && (ChipType != VIA133)) {
|
||||||
SetPciConfig1(reg-0x08, via_pio[(UCHAR)apiomode]);
|
SetPciConfig1(reg-0x08, via_pio[apiomode]);
|
||||||
}
|
}
|
||||||
via82c_timing(deviceExtension, dev, ATA_PIO0 + apiomode);
|
via82c_timing(deviceExtension, dev, ATA_PIO0 + apiomode);
|
||||||
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
||||||
|
@ -1067,18 +1067,18 @@ set_new_acard:
|
||||||
apiomode = 4;
|
apiomode = 4;
|
||||||
for(i=udmamode; i>=0; i--) {
|
for(i=udmamode; i>=0; i--) {
|
||||||
if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_UDMA0 + i)) {
|
if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_UDMA0 + i)) {
|
||||||
AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_udmatiming[(UCHAR)udmamode]);
|
AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_udmatiming[udmamode]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(i=wdmamode; i>=0; i--) {
|
for(i=wdmamode; i>=0; i--) {
|
||||||
if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) {
|
if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) {
|
||||||
AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_wdmatiming[(UCHAR)wdmamode]);
|
AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_wdmatiming[wdmamode]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode)) {
|
if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode)) {
|
||||||
AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_piotiming[(UCHAR)apiomode]);
|
AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_piotiming[apiomode]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -1113,7 +1113,7 @@ set_new_acard:
|
||||||
}
|
}
|
||||||
if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode)) {
|
if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode)) {
|
||||||
ChangePciConfig4(0x44 + (dev * 8), a | 0x80000000);
|
ChangePciConfig4(0x44 + (dev * 8), a | 0x80000000);
|
||||||
SetPciConfig4(0x40 + (dev * 8), nat_piotiming[(UCHAR)apiomode]);
|
SetPciConfig4(0x40 + (dev * 8), nat_piotiming[apiomode]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Use GENERIC PIO */
|
/* Use GENERIC PIO */
|
||||||
|
@ -1413,7 +1413,7 @@ set_new_acard:
|
||||||
// 44
|
// 44
|
||||||
GetPciConfig4(0x44, reg44);
|
GetPciConfig4(0x44, reg44);
|
||||||
reg44 = (reg44 & ~(0xff << bit_offset)) |
|
reg44 = (reg44 & ~(0xff << bit_offset)) |
|
||||||
(sw_dma_modes[(UCHAR)wdmamode] << bit_offset);
|
(sw_dma_modes[wdmamode] << bit_offset);
|
||||||
SetPciConfig4(0x44, reg44);
|
SetPciConfig4(0x44, reg44);
|
||||||
// 40
|
// 40
|
||||||
GetPciConfig4(0x40, reg40);
|
GetPciConfig4(0x40, reg40);
|
||||||
|
@ -1439,7 +1439,7 @@ set_new_acard:
|
||||||
// 40
|
// 40
|
||||||
GetPciConfig4(0x40, reg40);
|
GetPciConfig4(0x40, reg40);
|
||||||
reg40 = (reg40 & ~(0xff << bit_offset)) |
|
reg40 = (reg40 & ~(0xff << bit_offset)) |
|
||||||
(sw_pio_modes[(UCHAR)apiomode] << bit_offset);
|
(sw_pio_modes[apiomode] << bit_offset);
|
||||||
SetPciConfig4(0x40, reg40);
|
SetPciConfig4(0x40, reg40);
|
||||||
return;
|
return;
|
||||||
break; }
|
break; }
|
||||||
|
@ -1488,7 +1488,7 @@ l_ATA_SILICON_IMAGE_ID:
|
||||||
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
||||||
|
|
||||||
SetPciConfig1(mreg, mode | (mask & 0x11));
|
SetPciConfig1(mreg, mode | (mask & 0x11));
|
||||||
SetPciConfig2(ureg - 0x8, sil_pio_modes[i]);
|
SetPciConfig2(ureg - 0x8, sil_pio_modes[apiomode]);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -1527,7 +1527,7 @@ l_ATA_SILICON_IMAGE_ID:
|
||||||
/* set PIO mode timings */
|
/* set PIO mode timings */
|
||||||
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
||||||
|
|
||||||
SetPciConfig1(treg, cmd_pio_modes[(UCHAR)apiomode]);
|
SetPciConfig1(treg, cmd_pio_modes[apiomode]);
|
||||||
ChangePciConfig1(Channel ? 0x7b : 0x73, a & ~(!(DeviceNumber & 1) ? 0x35 : 0xca));
|
ChangePciConfig1(Channel ? 0x7b : 0x73, a & ~(!(DeviceNumber & 1) ? 0x35 : 0xca));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1731,8 +1731,8 @@ setup_drive_ite:
|
||||||
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
||||||
ChangePciConfig1(0x50, a | (1 << (dev + 3)) );
|
ChangePciConfig1(0x50, a | (1 << (dev + 3)) );
|
||||||
GetPciConfig1(0x54 + offset, reg54);
|
GetPciConfig1(0x54 + offset, reg54);
|
||||||
if(reg54 < chtiming[i]) {
|
if(reg54 < chtiming[apiomode]) {
|
||||||
SetPciConfig1(0x54 + offset, chtiming[i]);
|
SetPciConfig1(0x54 + offset, chtiming[apiomode]);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -503,8 +503,8 @@ UniataEnumBusMasterController__(
|
||||||
/* if(known) {
|
/* if(known) {
|
||||||
RtlCopyMemory(newBMListPtr, (PVOID)&(BusMasterAdapters[i]), sizeof(BUSMASTER_CONTROLLER_INFORMATION));
|
RtlCopyMemory(newBMListPtr, (PVOID)&(BusMasterAdapters[i]), sizeof(BUSMASTER_CONTROLLER_INFORMATION));
|
||||||
} else {*/
|
} else {*/
|
||||||
sprintf((PCHAR)vendorStrPtr, "%4.4x", (UINT32)VendorID);
|
sprintf((PCHAR)vendorStrPtr, "%4.4lx", VendorID);
|
||||||
sprintf((PCHAR)deviceStrPtr, "%4.4x", (UINT32)DeviceID);
|
sprintf((PCHAR)deviceStrPtr, "%4.4lx", DeviceID);
|
||||||
|
|
||||||
RtlCopyMemory(&(newBMListPtr->VendorIdStr), (PCHAR)vendorStrPtr, 4);
|
RtlCopyMemory(&(newBMListPtr->VendorIdStr), (PCHAR)vendorStrPtr, 4);
|
||||||
RtlCopyMemory(&(newBMListPtr->DeviceIdStr), (PCHAR)deviceStrPtr, 4);
|
RtlCopyMemory(&(newBMListPtr->DeviceIdStr), (PCHAR)deviceStrPtr, 4);
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
#ifndef __NTDDK_EX__H__
|
#ifndef __NTDDK_EX__H__
|
||||||
#define __NTDDK_EX__H__
|
#define __NTDDK_EX__H__
|
||||||
|
|
||||||
#ifndef __REACTOS__
|
#ifdef ASSERT
|
||||||
#undef ASSERT
|
#undef ASSERT
|
||||||
#define ASSERT
|
#define ASSERT(x) ((void)0)
|
||||||
#else
|
// #define ASSERT(x) if (!(x)) { RtlAssert("#x",__FILE__,__LINE__, ""); }
|
||||||
#undef ASSERT
|
#endif
|
||||||
//#define ASSERT //(x) if (!(x)) {RtlAssert("#x",__FILE__,__LINE__, ""); }
|
|
||||||
#define ASSERT(x) // FIXME: WTF!
|
|
||||||
#endif //__REACTOS__
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef FILE_CHARACTERISTIC_PNP_DEVICE // DDK 2003
|
#ifndef FILE_CHARACTERISTIC_PNP_DEVICE // DDK 2003
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Index: atapi.h
|
Index: atapi.h
|
||||||
===================================================================
|
===================================================================
|
||||||
--- atapi.h (revision 38425)
|
--- atapi.h (revision 38451)
|
||||||
+++ atapi.h (working copy)
|
+++ atapi.h (working copy)
|
||||||
@@ -138,6 +138,10 @@
|
@@ -138,6 +138,10 @@
|
||||||
|
|
||||||
|
@ -13,39 +13,94 @@ Index: atapi.h
|
||||||
#define PRINT_PREFIX "UniATA: "
|
#define PRINT_PREFIX "UniATA: "
|
||||||
|
|
||||||
//#define KdPrint3(_x_) {if(LOG_ON_RAISED_IRQL_W2K || MajorVersion < 0x05 || KeGetCurrentIrql() <= 2){/*DbgPrint("%x: ", PsGetCurrentThread()) ;*/ DbgPrint _x_ ; if(g_LogToDisplay){ PrintNtConsole _x_ ;} }}
|
//#define KdPrint3(_x_) {if(LOG_ON_RAISED_IRQL_W2K || MajorVersion < 0x05 || KeGetCurrentIrql() <= 2){/*DbgPrint("%x: ", PsGetCurrentThread()) ;*/ DbgPrint _x_ ; if(g_LogToDisplay){ PrintNtConsole _x_ ;} }}
|
||||||
Index: id_ata.cpp
|
@@ -1063,8 +1067,8 @@
|
||||||
===================================================================
|
|
||||||
--- id_ata.cpp (revision 38425)
|
|
||||||
+++ id_ata.cpp (working copy)
|
|
||||||
@@ -1864,7 +1864,9 @@
|
|
||||||
ULONG slotNumber = deviceExtension->slotNumber;
|
|
||||||
ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber;
|
|
||||||
ULONG VendorID = deviceExtension->DevID & 0xffff;
|
|
||||||
+#ifdef _DEBUG
|
|
||||||
ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff;
|
|
||||||
+#endif
|
|
||||||
//ULONG RevID = deviceExtension->RevID;
|
|
||||||
ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
|
|
||||||
UCHAR tmp8;
|
|
||||||
Index: id_badblock.cpp
|
|
||||||
===================================================================
|
|
||||||
--- id_badblock.cpp (revision 38425)
|
|
||||||
+++ id_badblock.cpp (working copy)
|
|
||||||
@@ -159,7 +159,11 @@
|
|
||||||
L"UniATA\\Parameters\\BadBlocks",
|
|
||||||
QueryTable, 0, 0);
|
|
||||||
|
|
||||||
+#ifdef _DEBUG
|
ULONG
|
||||||
KdPrint(( "InitBadBlocks returned: %#x\n", status));
|
AtapiParseArgumentString(
|
||||||
+#else
|
- IN PCHAR String,
|
||||||
+ UNREFERENCED_PARAMETER(status);
|
- IN PCHAR KeyWord
|
||||||
+#endif
|
+ IN PCCH String,
|
||||||
} else {
|
+ IN PCCH KeyWord
|
||||||
|
);
|
||||||
|
|
||||||
KdPrint(( "InitBadBlocks local\n"));
|
BOOLEAN
|
||||||
|
@@ -1202,15 +1206,15 @@
|
||||||
|
IN PVOID HwDeviceExtension,
|
||||||
|
IN ULONG chan,
|
||||||
|
IN ULONG dev,
|
||||||
|
- IN PWSTR Name,
|
||||||
|
+ IN PCWSTR Name,
|
||||||
|
IN ULONG Default
|
||||||
|
);
|
||||||
|
|
||||||
|
extern ULONG
|
||||||
|
AtapiRegCheckParameterValue(
|
||||||
|
IN PVOID HwDeviceExtension,
|
||||||
|
- IN PWSTR PathSuffix,
|
||||||
|
- IN PWSTR Name,
|
||||||
|
+ IN PCWSTR PathSuffix,
|
||||||
|
+ IN PCWSTR Name,
|
||||||
|
IN ULONG Default
|
||||||
|
);
|
||||||
|
|
||||||
|
@@ -1220,7 +1224,7 @@
|
||||||
|
VOID
|
||||||
|
_cdecl
|
||||||
|
_PrintNtConsole(
|
||||||
|
- PCHAR DebugMessage,
|
||||||
|
+ PCCH DebugMessage,
|
||||||
|
...
|
||||||
|
);
|
||||||
|
|
||||||
|
Index: id_sata.cpp
|
||||||
|
===================================================================
|
||||||
|
--- id_sata.cpp (revision 38451)
|
||||||
|
+++ id_sata.cpp (working copy)
|
||||||
|
@@ -7,7 +7,7 @@
|
||||||
|
)
|
||||||
|
{
|
||||||
|
PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
|
||||||
|
- ULONG Channel = deviceExtension->Channel + lChannel;
|
||||||
|
+ //ULONG Channel = deviceExtension->Channel + lChannel;
|
||||||
|
PHW_CHANNEL chan = &deviceExtension->chan[lChannel];
|
||||||
|
SATA_SSTATUS_REG SStatus;
|
||||||
|
ULONG i;
|
||||||
|
@@ -126,7 +126,7 @@
|
||||||
|
{
|
||||||
|
PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
|
||||||
|
PHW_CHANNEL chan = &deviceExtension->chan[lChannel];
|
||||||
|
- ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
|
||||||
|
+ //ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
|
||||||
|
SATA_SSTATUS_REG SStatus;
|
||||||
|
SATA_SERROR_REG SError;
|
||||||
|
|
||||||
|
Index: ntddk_ex.h
|
||||||
|
===================================================================
|
||||||
|
--- ntddk_ex.h (revision 38451)
|
||||||
|
+++ ntddk_ex.h (working copy)
|
||||||
|
@@ -1,15 +1,12 @@
|
||||||
|
#ifndef __NTDDK_EX__H__
|
||||||
|
#define __NTDDK_EX__H__
|
||||||
|
|
||||||
|
-#ifndef __REACTOS__
|
||||||
|
+#ifdef ASSERT
|
||||||
|
#undef ASSERT
|
||||||
|
-#define ASSERT
|
||||||
|
-#else
|
||||||
|
-#undef ASSERT
|
||||||
|
-#define ASSERT //(x) if (!(x)) {RtlAssert("#x",__FILE__,__LINE__, ""); }
|
||||||
|
-#endif //__REACTOS__
|
||||||
|
+#define ASSERT(x) ((void)0)
|
||||||
|
+// #define ASSERT(x) if (!(x)) { RtlAssert("#x",__FILE__,__LINE__, ""); }
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
-
|
||||||
|
#ifndef FILE_CHARACTERISTIC_PNP_DEVICE // DDK 2003
|
||||||
|
|
||||||
|
#define FILE_CHARACTERISTIC_PNP_DEVICE 0x00000800
|
||||||
Index: id_dma.cpp
|
Index: id_dma.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- id_dma.cpp (revision 38425)
|
--- id_dma.cpp (revision 38451)
|
||||||
+++ id_dma.cpp (working copy)
|
+++ id_dma.cpp (working copy)
|
||||||
@@ -219,7 +219,7 @@
|
@@ -219,7 +219,7 @@
|
||||||
PHW_CHANNEL chan = &(deviceExtension->chan[lChannel]);
|
PHW_CHANNEL chan = &(deviceExtension->chan[lChannel]);
|
||||||
|
@ -61,7 +116,7 @@ Index: id_dma.cpp
|
||||||
KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No 1st block\n" ));
|
KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No 1st block\n" ));
|
||||||
//AtaReq->dma_base = NULL;
|
//AtaReq->dma_base = NULL;
|
||||||
- AtaReq->ahci_base64 = NULL;
|
- AtaReq->ahci_base64 = NULL;
|
||||||
+ AtaReq->ahci_base64 = (ULONGLONG)NULL;
|
+ AtaReq->ahci_base64 = 0;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +125,7 @@ Index: id_dma.cpp
|
||||||
KdPrint2((PRINT_PREFIX "too many segments in DMA table\n" ));
|
KdPrint2((PRINT_PREFIX "too many segments in DMA table\n" ));
|
||||||
//AtaReq->dma_base = NULL;
|
//AtaReq->dma_base = NULL;
|
||||||
- AtaReq->ahci_base64 = NULL;
|
- AtaReq->ahci_base64 = NULL;
|
||||||
+ AtaReq->ahci_base64 = (ULONGLONG)NULL;
|
+ AtaReq->ahci_base64 = 0;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
KdPrint2((PRINT_PREFIX " get Phys(data[n]=%x)\n", data ));
|
KdPrint2((PRINT_PREFIX " get Phys(data[n]=%x)\n", data ));
|
||||||
|
@ -79,10 +134,19 @@ Index: id_dma.cpp
|
||||||
if(!dma_count || !dma_base || ((LONG)(dma_base) == -1)) {
|
if(!dma_count || !dma_base || ((LONG)(dma_base) == -1)) {
|
||||||
//AtaReq->dma_base = NULL;
|
//AtaReq->dma_base = NULL;
|
||||||
- AtaReq->ahci_base64 = NULL;
|
- AtaReq->ahci_base64 = NULL;
|
||||||
+ AtaReq->ahci_base64 = (ULONGLONG)NULL;
|
+ AtaReq->ahci_base64 = 0;
|
||||||
KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No NEXT block\n" ));
|
KdPrint2((PRINT_PREFIX "AtapiDmaSetup: No NEXT block\n" ));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -596,7 +596,7 @@
|
||||||
|
)
|
||||||
|
{
|
||||||
|
PHW_LU_EXTENSION LunExt = &(deviceExtension->lun[ldev]);
|
||||||
|
- CHAR apiomode;
|
||||||
|
+ SCHAR apiomode;
|
||||||
|
|
||||||
|
apiomode = (CHAR)AtaPioMode(&(LunExt->IdentifyData));
|
||||||
|
|
||||||
@@ -612,7 +612,7 @@
|
@@ -612,7 +612,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,73 +165,28 @@ Index: id_dma.cpp
|
||||||
limit_lba48:
|
limit_lba48:
|
||||||
LunExt->DeviceFlags |= REQ_FLAG_FORCE_DOWNRATE_LBA48;
|
LunExt->DeviceFlags |= REQ_FLAG_FORCE_DOWNRATE_LBA48;
|
||||||
limit_pio:
|
limit_pio:
|
||||||
@@ -1046,7 +1046,7 @@
|
@@ -754,9 +754,9 @@
|
||||||
/* set PIO mode timings */
|
IN ULONG DeviceNumber,
|
||||||
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
IN ULONG lChannel, // logical channel,
|
||||||
if((apiomode >= 0) && (ChipType != VIA133)) {
|
// is always 0 except simplex-only controllers
|
||||||
- SetPciConfig1(reg-0x08, via_pio[apiomode]);
|
- IN CHAR apiomode,
|
||||||
+ SetPciConfig1(reg-0x08, via_pio[(UCHAR)apiomode]);
|
- IN CHAR wdmamode,
|
||||||
}
|
- IN CHAR udmamode
|
||||||
via82c_timing(deviceExtension, dev, ATA_PIO0 + apiomode);
|
+ IN SCHAR apiomode,
|
||||||
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
+ IN SCHAR wdmamode,
|
||||||
@@ -1067,18 +1067,18 @@
|
+ IN SCHAR udmamode
|
||||||
apiomode = 4;
|
)
|
||||||
for(i=udmamode; i>=0; i--) {
|
{
|
||||||
if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_UDMA0 + i)) {
|
PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
|
||||||
- AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_udmatiming[udmamode]);
|
@@ -1488,7 +1488,7 @@
|
||||||
+ AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_udmatiming[(UCHAR)udmamode]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(i=wdmamode; i>=0; i--) {
|
|
||||||
if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) {
|
|
||||||
- AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_wdmatiming[wdmamode]);
|
|
||||||
+ AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_wdmatiming[(UCHAR)wdmamode]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode)) {
|
|
||||||
- AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_piotiming[apiomode]);
|
|
||||||
+ AtapiWritePortEx4(chan, (ULONG)(&deviceExtension->BaseIoAddressBM_0), mode_reg, cyr_piotiming[(UCHAR)apiomode]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
@@ -1113,7 +1113,7 @@
|
|
||||||
}
|
|
||||||
if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode)) {
|
|
||||||
ChangePciConfig4(0x44 + (dev * 8), a | 0x80000000);
|
|
||||||
- SetPciConfig4(0x40 + (dev * 8), nat_piotiming[apiomode]);
|
|
||||||
+ SetPciConfig4(0x40 + (dev * 8), nat_piotiming[(UCHAR)apiomode]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/* Use GENERIC PIO */
|
|
||||||
@@ -1413,7 +1413,7 @@
|
|
||||||
// 44
|
|
||||||
GetPciConfig4(0x44, reg44);
|
|
||||||
reg44 = (reg44 & ~(0xff << bit_offset)) |
|
|
||||||
- (sw_dma_modes[wdmamode] << bit_offset);
|
|
||||||
+ (sw_dma_modes[(UCHAR)wdmamode] << bit_offset);
|
|
||||||
SetPciConfig4(0x44, reg44);
|
|
||||||
// 40
|
|
||||||
GetPciConfig4(0x40, reg40);
|
|
||||||
@@ -1439,7 +1439,7 @@
|
|
||||||
// 40
|
|
||||||
GetPciConfig4(0x40, reg40);
|
|
||||||
reg40 = (reg40 & ~(0xff << bit_offset)) |
|
|
||||||
- (sw_pio_modes[apiomode] << bit_offset);
|
|
||||||
+ (sw_pio_modes[(UCHAR)apiomode] << bit_offset);
|
|
||||||
SetPciConfig4(0x40, reg40);
|
|
||||||
return;
|
|
||||||
break; }
|
|
||||||
@@ -1527,7 +1527,7 @@
|
|
||||||
/* set PIO mode timings */
|
|
||||||
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
||||||
|
|
||||||
- SetPciConfig1(treg, cmd_pio_modes[apiomode]);
|
SetPciConfig1(mreg, mode | (mask & 0x11));
|
||||||
+ SetPciConfig1(treg, cmd_pio_modes[(UCHAR)apiomode]);
|
- SetPciConfig2(ureg - 0x8, sil_pio_modes[i]);
|
||||||
ChangePciConfig1(Channel ? 0x7b : 0x73, a & ~(!(DeviceNumber & 1) ? 0x35 : 0xca));
|
+ SetPciConfig2(ureg - 0x8, sil_pio_modes[apiomode]);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
} else {
|
||||||
@@ -1538,7 +1538,7 @@
|
@@ -1538,7 +1538,7 @@
|
||||||
/*******/
|
/*******/
|
||||||
/* SiS */
|
/* SiS */
|
||||||
|
@ -189,6 +208,17 @@ Index: id_dma.cpp
|
||||||
ULONG offs;
|
ULONG offs;
|
||||||
|
|
||||||
switch(ChipType) {
|
switch(ChipType) {
|
||||||
|
@@ -1731,8 +1731,8 @@
|
||||||
|
AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode);
|
||||||
|
ChangePciConfig1(0x50, a | (1 << (dev + 3)) );
|
||||||
|
GetPciConfig1(0x54 + offset, reg54);
|
||||||
|
- if(reg54 < chtiming[i]) {
|
||||||
|
- SetPciConfig1(0x54 + offset, chtiming[i]);
|
||||||
|
+ if(reg54 < chtiming[apiomode]) {
|
||||||
|
+ SetPciConfig1(0x54 + offset, chtiming[apiomode]);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
@@ -1901,7 +1901,7 @@
|
@@ -1901,7 +1901,7 @@
|
||||||
ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK;
|
ULONG ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK;
|
||||||
//ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
|
//ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
|
||||||
|
@ -198,9 +228,25 @@ Index: id_dma.cpp
|
||||||
|
|
||||||
if(mode == ATA_PIO5)
|
if(mode == ATA_PIO5)
|
||||||
mode = ATA_PIO4;
|
mode = ATA_PIO4;
|
||||||
|
Index: id_badblock.cpp
|
||||||
|
===================================================================
|
||||||
|
--- id_badblock.cpp (revision 38451)
|
||||||
|
+++ id_badblock.cpp (working copy)
|
||||||
|
@@ -159,7 +159,11 @@
|
||||||
|
L"UniATA\\Parameters\\BadBlocks",
|
||||||
|
QueryTable, 0, 0);
|
||||||
|
|
||||||
|
+#ifdef _DEBUG
|
||||||
|
KdPrint(( "InitBadBlocks returned: %#x\n", status));
|
||||||
|
+#else
|
||||||
|
+ UNREFERENCED_PARAMETER(status);
|
||||||
|
+#endif
|
||||||
|
} else {
|
||||||
|
|
||||||
|
KdPrint(( "InitBadBlocks local\n"));
|
||||||
Index: id_init.cpp
|
Index: id_init.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- id_init.cpp (revision 38425)
|
--- id_init.cpp (revision 38451)
|
||||||
+++ id_init.cpp (working copy)
|
+++ id_init.cpp (working copy)
|
||||||
@@ -52,11 +52,11 @@
|
@@ -52,11 +52,11 @@
|
||||||
)
|
)
|
||||||
|
@ -273,9 +319,156 @@ Index: id_init.cpp
|
||||||
ULONG RevID = deviceExtension->RevID;
|
ULONG RevID = deviceExtension->RevID;
|
||||||
// ULONG i;
|
// ULONG i;
|
||||||
// BUSMASTER_CONTROLLER_INFORMATION* DevTypeInfo;
|
// BUSMASTER_CONTROLLER_INFORMATION* DevTypeInfo;
|
||||||
|
Index: id_ata.cpp
|
||||||
|
===================================================================
|
||||||
|
--- id_ata.cpp (revision 38451)
|
||||||
|
+++ id_ata.cpp (working copy)
|
||||||
|
@@ -1864,7 +1864,9 @@
|
||||||
|
ULONG slotNumber = deviceExtension->slotNumber;
|
||||||
|
ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber;
|
||||||
|
ULONG VendorID = deviceExtension->DevID & 0xffff;
|
||||||
|
+#ifdef _DEBUG
|
||||||
|
ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff;
|
||||||
|
+#endif
|
||||||
|
//ULONG RevID = deviceExtension->RevID;
|
||||||
|
ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
|
||||||
|
UCHAR tmp8;
|
||||||
|
@@ -2859,12 +2861,12 @@
|
||||||
|
--*/
|
||||||
|
ULONG
|
||||||
|
AtapiParseArgumentString(
|
||||||
|
- IN PCHAR String,
|
||||||
|
- IN PCHAR KeyWord
|
||||||
|
+ IN PCCH String,
|
||||||
|
+ IN PCCH KeyWord
|
||||||
|
)
|
||||||
|
{
|
||||||
|
- PCHAR cptr;
|
||||||
|
- PCHAR kptr;
|
||||||
|
+ PCCH cptr;
|
||||||
|
+ PCCH kptr;
|
||||||
|
ULONG value;
|
||||||
|
ULONG stringLength = 0;
|
||||||
|
ULONG keyWordLength = 0;
|
||||||
|
@@ -2877,24 +2879,15 @@
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
- // Calculate the string length and lower case all characters.
|
||||||
|
+ // Calculate the string length.
|
||||||
|
cptr = String;
|
||||||
|
- while (*cptr) {
|
||||||
|
- if (*cptr >= 'A' && *cptr <= 'Z') {
|
||||||
|
- *cptr = *cptr + ('a' - 'A');
|
||||||
|
- }
|
||||||
|
- cptr++;
|
||||||
|
+ while (*cptr++) {
|
||||||
|
stringLength++;
|
||||||
|
}
|
||||||
|
|
||||||
|
- // Calculate the keyword length and lower case all characters.
|
||||||
|
- cptr = KeyWord;
|
||||||
|
- while (*cptr) {
|
||||||
|
-
|
||||||
|
- if (*cptr >= 'A' && *cptr <= 'Z') {
|
||||||
|
- *cptr = *cptr + ('a' - 'A');
|
||||||
|
- }
|
||||||
|
- cptr++;
|
||||||
|
+ // Calculate the keyword length.
|
||||||
|
+ kptr = KeyWord;
|
||||||
|
+ while (*kptr++) {
|
||||||
|
keyWordLength++;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2920,18 +2913,21 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
kptr = KeyWord;
|
||||||
|
- while (*cptr++ == *kptr++) {
|
||||||
|
+ while ((*cptr == *kptr) ||
|
||||||
|
+ (*cptr <= 'Z' && *cptr + ('a' - 'A') == *kptr) ||
|
||||||
|
+ (*cptr >= 'a' && *cptr - ('a' - 'A') == *kptr)) {
|
||||||
|
+ cptr++;
|
||||||
|
+ kptr++;
|
||||||
|
|
||||||
|
- if (*(cptr - 1) == '\0') {
|
||||||
|
+ if (*cptr == '\0') {
|
||||||
|
// end of string
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (*(kptr - 1) == '\0') {
|
||||||
|
+ if (*kptr == '\0') {
|
||||||
|
|
||||||
|
// May have a match backup and check for blank or equals.
|
||||||
|
- cptr--;
|
||||||
|
while (*cptr == ' ' || *cptr == '\t') {
|
||||||
|
cptr++;
|
||||||
|
}
|
||||||
|
@@ -2967,7 +2963,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
value = 0;
|
||||||
|
- if ((*cptr == '0') && (*(cptr + 1) == 'x')) {
|
||||||
|
+ if ((*cptr == '0') && ((*(cptr + 1) == 'x') || (*(cptr + 1) == 'X'))) {
|
||||||
|
// Value is in Hex. Skip the "0x"
|
||||||
|
cptr += 2;
|
||||||
|
for (index = 0; *(cptr + index); index++) {
|
||||||
|
@@ -2983,6 +2979,8 @@
|
||||||
|
} else {
|
||||||
|
if ((*(cptr + index) >= 'a') && (*(cptr + index) <= 'f')) {
|
||||||
|
value = (16 * value) + (*(cptr + index) - 'a' + 10);
|
||||||
|
+ } else if ((*(cptr + index) >= 'A') && (*(cptr + index) <= 'F')) {
|
||||||
|
+ value = (16 * value) + (*(cptr + index) - 'A' + 10);
|
||||||
|
} else {
|
||||||
|
// Syntax error, return not found.
|
||||||
|
return 0;
|
||||||
|
@@ -8752,10 +8750,10 @@
|
||||||
|
ULONG
|
||||||
|
AtapiRegCheckDevLunValue(
|
||||||
|
IN PVOID HwDeviceExtension,
|
||||||
|
- IN PWCHAR NamePrefix,
|
||||||
|
+ IN PCWCH NamePrefix,
|
||||||
|
IN ULONG chan,
|
||||||
|
IN ULONG dev,
|
||||||
|
- IN PWSTR Name,
|
||||||
|
+ IN PCWSTR Name,
|
||||||
|
IN ULONG Default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
@@ -8822,7 +8820,7 @@
|
||||||
|
IN PVOID HwDeviceExtension,
|
||||||
|
IN ULONG chan,
|
||||||
|
IN ULONG dev,
|
||||||
|
- IN PWSTR Name,
|
||||||
|
+ IN PCWSTR Name,
|
||||||
|
IN ULONG Default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
@@ -8940,8 +8938,8 @@
|
||||||
|
ULONG
|
||||||
|
AtapiRegCheckParameterValue(
|
||||||
|
IN PVOID HwDeviceExtension,
|
||||||
|
- IN PWSTR PathSuffix,
|
||||||
|
- IN PWSTR Name,
|
||||||
|
+ IN PCWSTR PathSuffix,
|
||||||
|
+ IN PCWSTR Name,
|
||||||
|
IN ULONG Default
|
||||||
|
)
|
||||||
|
{
|
||||||
|
@@ -9108,7 +9106,7 @@
|
||||||
|
VOID
|
||||||
|
_cdecl
|
||||||
|
_PrintNtConsole(
|
||||||
|
- PCHAR DebugMessage,
|
||||||
|
+ PCCH DebugMessage,
|
||||||
|
...
|
||||||
|
)
|
||||||
|
{
|
||||||
Index: id_probe.cpp
|
Index: id_probe.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- id_probe.cpp (revision 38425)
|
--- id_probe.cpp (revision 38451)
|
||||||
+++ id_probe.cpp (working copy)
|
+++ id_probe.cpp (working copy)
|
||||||
@@ -76,7 +76,6 @@
|
@@ -76,7 +76,6 @@
|
||||||
VOID
|
VOID
|
||||||
|
@ -291,8 +484,8 @@ Index: id_probe.cpp
|
||||||
} else {*/
|
} else {*/
|
||||||
- sprintf((PCHAR)vendorStrPtr, "%4.4x", VendorID);
|
- sprintf((PCHAR)vendorStrPtr, "%4.4x", VendorID);
|
||||||
- sprintf((PCHAR)deviceStrPtr, "%4.4x", DeviceID);
|
- sprintf((PCHAR)deviceStrPtr, "%4.4x", DeviceID);
|
||||||
+ sprintf((PCHAR)vendorStrPtr, "%4.4x", (UINT32)VendorID);
|
+ sprintf((PCHAR)vendorStrPtr, "%4.4lx", VendorID);
|
||||||
+ sprintf((PCHAR)deviceStrPtr, "%4.4x", (UINT32)DeviceID);
|
+ sprintf((PCHAR)deviceStrPtr, "%4.4lx", DeviceID);
|
||||||
|
|
||||||
RtlCopyMemory(&(newBMListPtr->VendorIdStr), (PCHAR)vendorStrPtr, 4);
|
RtlCopyMemory(&(newBMListPtr->VendorIdStr), (PCHAR)vendorStrPtr, 4);
|
||||||
RtlCopyMemory(&(newBMListPtr->DeviceIdStr), (PCHAR)deviceStrPtr, 4);
|
RtlCopyMemory(&(newBMListPtr->DeviceIdStr), (PCHAR)deviceStrPtr, 4);
|
||||||
|
@ -355,39 +548,42 @@ Index: id_probe.cpp
|
||||||
|
|
||||||
// The following table specifies the ports to be checked when searching for
|
// The following table specifies the ports to be checked when searching for
|
||||||
// an IDE controller. A zero entry terminates the search.
|
// an IDE controller. A zero entry terminates the search.
|
||||||
Index: id_sata.cpp
|
Index: bm_devs.h
|
||||||
===================================================================
|
===================================================================
|
||||||
--- id_sata.cpp (revision 38425)
|
--- bm_devs.h (revision 38451)
|
||||||
+++ id_sata.cpp (working copy)
|
+++ bm_devs.h (working copy)
|
||||||
@@ -7,7 +7,7 @@
|
@@ -482,7 +482,7 @@
|
||||||
)
|
{ #idlo, 4, 0x##idlo, #idhi, 4, 0x##idhi, rev, mode, name, flags}
|
||||||
{
|
|
||||||
PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
|
|
||||||
- ULONG Channel = deviceExtension->Channel + lChannel;
|
|
||||||
+ //ULONG Channel = deviceExtension->Channel + lChannel;
|
|
||||||
PHW_CHANNEL chan = &deviceExtension->chan[lChannel];
|
|
||||||
SATA_SSTATUS_REG SStatus;
|
|
||||||
ULONG i;
|
|
||||||
@@ -126,7 +126,7 @@
|
|
||||||
{
|
|
||||||
PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension;
|
|
||||||
PHW_CHANNEL chan = &deviceExtension->chan[lChannel];
|
|
||||||
- ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
|
|
||||||
+ //ULONG ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK;
|
|
||||||
SATA_SSTATUS_REG SStatus;
|
|
||||||
SATA_SERROR_REG SError;
|
|
||||||
|
|
||||||
Index: ntddk_ex.h
|
|
||||||
===================================================================
|
|
||||||
--- ntddk_ex.h (revision 38425)
|
|
||||||
+++ ntddk_ex.h (working copy)
|
|
||||||
@@ -6,7 +6,8 @@
|
|
||||||
#define ASSERT
|
|
||||||
#else
|
#else
|
||||||
#undef ASSERT
|
#define PCI_DEV_HW_SPEC_BM(idhi, idlo, rev, mode, name, flags) \
|
||||||
-#define ASSERT //(x) if (!(x)) {RtlAssert("#x",__FILE__,__LINE__, ""); }
|
- { #idlo, 4, 0x##idlo, #idhi, 4, 0x##idhi, rev, mode, NULL, flags}
|
||||||
+//#define ASSERT //(x) if (!(x)) {RtlAssert("#x",__FILE__,__LINE__, ""); }
|
+ { (PCHAR) #idlo, 4, 0x##idlo, (PCHAR) #idhi, 4, 0x##idhi, rev, mode, NULL, flags}
|
||||||
+#define ASSERT(x) // FIXME: WTF!
|
#endif
|
||||||
#endif //__REACTOS__
|
|
||||||
|
|
||||||
|
#define BMLIST_TERMINATOR (0xffffffffL)
|
||||||
|
Index: bsmaster.h
|
||||||
|
===================================================================
|
||||||
|
--- bsmaster.h (revision 38451)
|
||||||
|
+++ bsmaster.h (working copy)
|
||||||
|
@@ -987,7 +987,7 @@
|
||||||
|
BOOLEAN opt_AtapiDmaRawRead; // default TRUE
|
||||||
|
BOOLEAN opt_AtapiDmaReadWrite; // default TRUE
|
||||||
|
|
||||||
|
- PCHAR FullDevName;
|
||||||
|
+ PCCH FullDevName;
|
||||||
|
|
||||||
|
} HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION;
|
||||||
|
|
||||||
|
@@ -1172,9 +1172,9 @@
|
||||||
|
IN ULONG DeviceNumber,
|
||||||
|
IN ULONG lChannel, // logical channel,
|
||||||
|
// is always 0 except simplex-only controllers
|
||||||
|
- IN CHAR apiomode,
|
||||||
|
- IN CHAR wdmamode,
|
||||||
|
- IN CHAR udmamode
|
||||||
|
+ IN SCHAR apiomode,
|
||||||
|
+ IN SCHAR wdmamode,
|
||||||
|
+ IN SCHAR udmamode
|
||||||
|
);
|
||||||
|
|
||||||
|
extern BOOLEAN NTAPI
|
||||||
|
|
Loading…
Reference in a new issue