Commit graph

105 commits

Author SHA1 Message Date
Dmitry Borisov
adac7dc2e5 [ISAPNP] Implement device configuration 2021-06-20 19:24:32 +06:00
Dmitry Borisov
8939abf113 [ISAPNP] Disable bus scan on unsupported platforms
This speeds up boot a bit and also decreases binary size.

- Introduce a new CMake define ISAPNP_ENABLE that defined only in x86 platform
  when ISA PnP is supported.
2021-06-20 19:24:32 +06:00
Dmitry Borisov
e318d22940 [ISAPNP] Disable I/O range check before activation
See Table A-2 of "Plug and Play ISA Specification 1.0a"
2021-06-20 19:24:31 +06:00
Dmitry Borisov
367f4b1581 [ISAPNP] Map configuration states to PnP states
Rework the hardware support code to avoid unneeded transitions
between configuration states.
- Only call WaitForKey when needed.
- Each PnP state transition causes the bus to move to WaitForKey state.

Besides, deactivate logical device during processing remove request.
2021-06-20 19:24:31 +06:00
Dmitry Borisov
d6dca83baf [ISAPNP] Reduce software delay 2021-06-20 19:24:31 +06:00
Dmitry Borisov
8ed43b6907 [ISAPNP] Fix descriptors and support alternative configurations
- Fix empty resource descriptors being created.
- Properly support IRQ descriptors.
- Introduce four helpers made to help search descriptors
  in the logical device's requirements.
- Implement support for memory descriptors and alternative configurations.
- DMA descriptors are always DMA_8.
2021-06-20 19:24:31 +06:00
Dmitry Borisov
b29a3ac524 [ISAPNP] Read all resources when detecting devices 2021-06-20 19:24:31 +06:00
Dmitry Borisov
ca42de9c31 [ISAPNP] Rewrite the tag parser
- Support all resource descriptors.
- Optimize card identification.
- Detect cards that is no longer present on the bus.
- Deactivate cards after the identification phase; they will be activated
  by start device IRP.
- Provide a device description and compatible IDs to the device manager.
- Prevent duplicate IDs across multiple logical devices.
- Suppress warning about the usage of literals in port addresses.
2021-06-20 19:24:31 +06:00
Dmitry Borisov
7c897dfbd1 [ISAPNP] Use the correct types for helper functions 2021-06-20 19:24:31 +06:00
Dmitry Borisov
c4b6330b14 [ISAPNP] Implement the Read Port resource management
Currently disabled until the kernel is ready
2021-06-20 19:24:31 +06:00
Dmitry Borisov
f15de15554 [ISAPNP] Fixes and improvements for IRP handling
- Implement device removal.
- Finish the Read Port special handling
  introduced in 21514e473f.
- Gracefully handle low memory situations.
- Implement IRQ translator.
- Correctly stub power IRP handling.
- Remove unneeded dispatch routines; implement WMI IRP handling.
- Do not handle requests like WRITE_CONFIG.
- Add a signature member to device extensions to make checks clearer.
2021-06-20 19:24:26 +06:00
Dmitry Borisov
e19595572a [ISAPNP] Implement querying bus information 2021-06-20 19:24:25 +06:00
Dmitry Borisov
8f36dee6ff [ISAPNP] Properly count descriptors
Fixes random pool corruptions
2021-06-20 19:24:25 +06:00
Dmitry Borisov
2d367001bd [ISAPNP] Fix device capabilities
- The bus does not supply an address.
- Read Port ID is always unique.

This reverts commit fc0a0b9f84.
See also commit 21514e473f.

CORE-17034
2021-06-20 19:24:19 +06:00
Dmitry Borisov
21514e473f [ISAPNP] Make Read Data Port PDO unique
This PDO is created only once during start of first FDO.
Other buses will remain in an inactive state until
the first FDO receives a remove request.

CORE-17034
2021-06-20 19:22:32 +06:00
Dmitry Borisov
c92bec609b [ISAPNP] Refactor string handling
- Don't allocate string buffers twice.
2021-06-20 19:22:32 +06:00
Dmitry Borisov
70ba96f164 [ISAPNP] Make the driver pageable 2021-06-20 19:22:31 +06:00
Dmitry Borisov
66c195755c [ISAPNP] Use pool tagging 2021-06-20 19:22:31 +06:00
Dmitry Borisov
8f44930f91 [ISAPNP] Code formatting
- Add SAL2 annotations.
- Use RTL_NUMBER_OF macro in kernel mode.
- Use better function/member names.
- Less hardcoded values.
- Add license information. See commit
  d9face83c6 for details.

No functional changes.
2021-06-20 19:22:31 +06:00
Stanislav Motylkov
a4405f9610
[PCI] Filter out devices with null vendor and device ID
Some virtual machines errorneously expose null PCI device function
on PIIX4 chipset where an USB controller should normally reside.

Windows pci.sys driver does not enumerate these devices.

Affected virtual machines:
- Connectix Virtual PC 5.1.370
- Connectix Virtual PC 5.2.418
- Microsoft Virtual PC 2004 SP1 (5.3.582.27)
- Microsoft Virtual PC 2007 SP1 (6.0.156.0)

Non-affected virtual machines:
- Connectix Virtual PC 4.0
- Microsoft Hyper-V

Fixes CORE-17636.
2021-06-19 20:58:27 +03:00
Victor Perevertkin
34593d933b
[FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
Jérôme Gardou
3adf450867 [REACTOS] Addendum to 5c7ce4475e - Fix MSVC 2015 build
Put data into PAGEDATA or INITDATA sections
Keep section declaration for prototypes

CORE-17540
2021-05-12 11:04:29 +02:00
Dmitry Borisov
0fb3c1e91e
[PCIIDE] Make the resource section not discardable. CORE-17401 (#3594)
[PCIX] Make the resource section not discardable.

These drivers need to be able to access their message resources at any time.
2021-05-10 00:36:38 +02:00
Stanislav Motylkov
4959ccc8df
[ACPI] Improve Russian translation INF file
Also some minor whitespace fixes
2021-04-27 23:58:53 +03:00
Hervé Poussineau
31fd1ba0c6 [ACPI] Fix compilation with GCC x64 2021-01-05 14:19:45 +01:00
Thomas Faber
9587fe1c36
[ACPICA] Update to version 20201217. CORE-17410 2021-01-01 16:20:53 +01:00
Serge Gautherie
685f15e253
[ACPI] acpi_create_registry_table(): Close the key handle, on errors (#3372)
Addendum to 44f1cf1 (r74559). CORE-12942
2020-12-31 17:42:42 +03:00
Serge Gautherie
309ed0d1fe
[ACPI] AcpiRegOpenKey(): Add a missing OBJ_KERNEL_HANDLE (#3370)
CORE-10207
2020-12-31 17:42:03 +03:00
Stanislav Motylkov
c57d0b7b98
[ACPI] Do not panic if ProcessorNameString does not exist
Windows does not create this value in the registry if the processor core
does not expose the Brand String. It's an optional value and existing code
accessing it already has proper NULL checks:
https://git.reactos.org/?p=reactos.git;a=blob;f=drivers/bus/acpi/buspdo.c;hb=b96e88894a4d55f5e8b94430deeb0f086151b24f#l748

This is the proper fix for regression in CORE-7952.
Addendum to 48912992 (r61666) and 4d992804 (r62642).

CORE-17413
2020-12-30 19:38:33 +03:00
Thomas Faber
9cc1a26b70
[ACPICA] Update to version 20201113. CORE-17382 2020-11-22 11:23:25 +01:00
Hervé Poussineau
65cc802b73 [PCI] Accept a bus number range instead of a single bus number 2020-11-15 18:38:37 +01:00
Serge Gautherie
33714797f4
[COMPBATT] Add a missing OBJ_KERNEL_HANDLE
CORE-10207
2020-11-14 12:03:27 +01:00
Thomas Faber
3499b96682
[ACPICA] Update to version 20200925. CORE-17170 2020-10-16 01:21:52 +02:00
Thomas Faber
8605f660f4
[ACPICA] Update to version 20200717. CORE-17170 2020-10-16 01:21:47 +02:00
Hervé Poussineau
9df05ba4b6 [ISAPNP] Properly stub IRP_MJ_POWER 2020-07-30 13:24:29 +02:00
Hervé Poussineau
2b9941e7cb [PCI] Fix PDO removal
We must not do anything on PDO removal, especially not deleting it.
We are allowed to delete it, only once we successfully completed a IRP_MN_QUERY_DEVICE_RELATIONS without with PDO.
2020-06-20 08:16:24 +02:00
Thomas Faber
cab7e9ade8
[ACPICA] Update to version 20200528. CORE-17094 2020-06-14 09:19:02 +02:00
Amine Khaldi
139a3d6661
[CMAKE] Implement PCH builds with target_precompile_headers. CORE-16905 2020-06-06 21:58:41 +03:00
Hervé Poussineau
e246b9947e [ISAPNP] Mark read data port as started, even if no ISAPNP card is present
CORE-17056
2020-05-16 23:20:38 +02:00
Mark Jansen
da777baa3d
[ISAPNP] Initialize uninitialized variable
Return value was a suggestion from Thomas,
it still boots for me (tm)
2020-05-16 14:03:04 +02:00
Hervé Poussineau
fc0a0b9f84 [ISAPNP] Mark Read Data Port as not having a unique ID
This fixes a bugcheck in ntoskrnl.exe when computer has multiple ISA buses.

CORE-17034
2020-05-09 16:54:46 +02:00
Thomas Faber
baa3380649
[ACPICA] Update to version 20190430. CORE-16998 2020-05-01 12:18:48 +02:00
Victor Perevertkin
019f21ee1d
[MEDIA][CMAKE] Create add_driver_inf cmake function
*.inf files for drivers can now be placed along with the driver code
2020-04-26 20:28:04 +03:00
Timo Kreuzer
b82bf8ce16
[NTOS:IO] Fix parsing of resource lists
Also add a hack to avoid failing on now occurring resource conflict detection and try to fix at least one resource in ACPI hal.

CORE-10146
CORE-12892
2020-04-24 13:58:09 +03:00
Thomas Faber
152265729b
[ACPI] Properly return a single alternative in Bus_PDO_QueryResourceRequirements. CORE-12892 CORE-14688
In ACPI resource descriptors, alternatives are marked with
StartDependent tags. Only the last set is terminated with EndDependent.
Therefore, since we only return the first alternative list for now,
ignore the first StartDependent tag and terminate enumeration at the second.

In the future we will need to build the full set of alternative lists here,
which will also make the unit test succeed fully.

This should fix random resource conflicts and make COM ports usable.
2020-04-11 23:43:05 +02:00
Thomas Faber
28be285da5
[ACPI] Avoid unnecessary casts. 2020-04-11 23:43:05 +02:00
Thomas Faber
9bcd835074
[ACPI_APITEST] Add a unit test for Bus_PDO_QueryResourceRequirements. CORE-12892
This will allow us to verify fixes made to function, which is quite broken.
2020-04-11 23:42:59 +02:00
Vadim Galyant
ef2323a146
[HALX86][PCIX] Statically link HALx86 and PCIX to the arbiter library. (#2471) 2020-04-09 19:41:16 +02:00
Thomas Faber
040546d8ff
[ACPICA] Update to version 20200326. CORE-16783 2020-04-05 14:44:53 +02:00
Hervé Poussineau
7cda1ed2f5 [ISAPNP] Report DMA channels 2020-03-26 16:36:23 +01:00