https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e318d2294058787af8371…
commit e318d2294058787af83710feb4b581ba36282d46
Author: Dmitry Borisov <di.sean(a)protonmail.com>
AuthorDate: Sat Mar 20 20:53:06 2021 +0600
Commit: Dmitry Borisov <di.sean(a)protonmail.com>
CommitDate: Sun Jun 20 19:24:31 2021 +0600
[ISAPNP] Disable I/O range check before activation
See Table A-2 of "Plug and Play ISA Specification 1.0a"
---
drivers/bus/isapnp/hardware.c | 10 ++++++++--
drivers/bus/isapnp/isapnp.h | 1 +
drivers/bus/isapnp/pdo.c | 2 +-
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/bus/isapnp/hardware.c b/drivers/bus/isapnp/hardware.c
index 62e538a49d4..188d1732447 100644
--- a/drivers/bus/isapnp/hardware.c
+++ b/drivers/bus/isapnp/hardware.c
@@ -168,9 +168,14 @@ static
inline
VOID
ActivateDevice(
+ _In_ PUCHAR ReadDataPort,
_In_ UCHAR LogDev)
{
WriteLogicalDeviceNumber(LogDev);
+
+ WriteByte(ISAPNP_IORANGECHECK,
+ ReadByte(ReadDataPort, ISAPNP_IORANGECHECK) & ~2);
+
WriteByte(ISAPNP_ACTIVATE, 1);
}
@@ -1341,7 +1346,7 @@ IsaHwFillDeviceList(
PISAPNP_PDO_EXTENSION PdoExt =
LogDevice->Pdo->DeviceExtension;
if (PdoExt->Common.State == dsStarted)
- ActivateDevice(LogDev);
+ ActivateDevice(FdoExt->ReadDataPort, LogDev);
}
DPRINT("Skip CSN %u, LDN %u\n", LogDevice->CSN,
LogDevice->LDN);
@@ -1412,9 +1417,10 @@ IsaHwWakeDevice(
_IRQL_requires_max_(DISPATCH_LEVEL)
VOID
IsaHwActivateDevice(
+ _In_ PISAPNP_FDO_EXTENSION FdoExt,
_In_ PISAPNP_LOGICAL_DEVICE LogicalDevice)
{
- ActivateDevice(LogicalDevice->LDN);
+ ActivateDevice(FdoExt->ReadDataPort, LogicalDevice->LDN);
}
_IRQL_requires_max_(DISPATCH_LEVEL)
diff --git a/drivers/bus/isapnp/isapnp.h b/drivers/bus/isapnp/isapnp.h
index e941020f783..19702f36274 100644
--- a/drivers/bus/isapnp/isapnp.h
+++ b/drivers/bus/isapnp/isapnp.h
@@ -388,6 +388,7 @@ IsaHwDeactivateDevice(
_IRQL_requires_max_(DISPATCH_LEVEL)
VOID
IsaHwActivateDevice(
+ _In_ PISAPNP_FDO_EXTENSION FdoExt,
_In_ PISAPNP_LOGICAL_DEVICE LogicalDevice);
_IRQL_requires_max_(DISPATCH_LEVEL)
diff --git a/drivers/bus/isapnp/pdo.c b/drivers/bus/isapnp/pdo.c
index 2c0a4641cb2..1ee0e51b7ea 100644
--- a/drivers/bus/isapnp/pdo.c
+++ b/drivers/bus/isapnp/pdo.c
@@ -899,7 +899,7 @@ IsaPdoPnp(
Status = STATUS_SUCCESS;
- IsaHwActivateDevice(PdoExt->IsaPnpDevice);
+ IsaHwActivateDevice(PdoExt->FdoExt, PdoExt->IsaPnpDevice);
IsaHwWaitForKey();
}
else