Commit graph

30 commits

Author SHA1 Message Date
Dmitry Borisov
10b08aa2bb
[ISAPNP] Detect I/O ports at runtime (#7411)
Improve the driver's portability.
CORE-17977
2024-10-07 16:10:08 +02:00
Dmitry Borisov
6091dde0d3 [ISAPNP] Improvements around hardware access helpers
- Reimplement WriteWord using the WriteByte helper.
- Remove inline qualifiers from the bus read and write functions.
  This code path is considered "cold" and using an inline for it is overkill.
- Don't apply the IRQL restrictions to our PnP state transition helpers.
  They are only called at IRQL below dispatch level.
2024-08-03 17:08:43 +06:00
Dmitry Borisov
2981e63a31 [ISAPNP] Refactor the configuration code
- Remove useless checks
- Increase code readability
2024-08-03 17:08:43 +06:00
Dmitry Borisov
76ec8411a4 [ISAPNP] Fix parsing of complex resource data
- Properly handle the case when the dependent function is placed
  after fixed resources
- Initialize the version and revision fields of resource lists
- Improve validation of resource data
- Add more debug prints

CORE-18562
2024-08-03 17:08:43 +06:00
Dmitry Borisov
9b7f34601a [ISAPNP] Force clear the upper reserved bits on fixed I/O descriptors
CORE-18562
2024-08-03 17:08:43 +06:00
Dmitry Borisov
991dbeff53 [ISAPNP] Fix the truncation of 32-bit configuration I/O reads
CORE-18562
2024-08-03 17:08:43 +06:00
Dmitry Borisov
b36d9bd9c1 [ISAPNP_UNITTEST] Add unit tests exercising device discovery and device resources functionality
CORE-18562
2024-08-03 17:08:43 +06:00
Dmitry Borisov
adac7dc2e5 [ISAPNP] Implement device configuration 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
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
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
Hervé Poussineau
7cda1ed2f5 [ISAPNP] Report DMA channels 2020-03-26 16:36:23 +01:00
Hervé Poussineau
0ca5567894 [ISAPNP] Read all tags when detecting devices, and keep interesting ones
Currently, we only keep device identification, IO ports and IRQs.
2020-03-22 14:29:38 +01:00
Hervé Poussineau
b905c40d2e [ISAPNP] Fix some indentation 2020-03-22 14:29:38 +01:00
Hervé Poussineau
5b9929a076 [ISAPNP] Detect devices only once ReadDataPort is started
Also let kernel choose the read data port address, by using the resources given in IRP_MN_START_DEVICE.
2020-03-20 22:40:11 +01:00
Hervé Poussineau
d0c7bd98c7 [ISAPNP] Fix some return codes 2020-03-20 22:40:11 +01:00
Hervé Poussineau
947b49aac3 [ISAPNP] Reformat files. No code change. 2020-03-20 22:40:11 +01:00
Hervé Poussineau
7a98d28d7f [ISAPNP] Rewrite device reporting method
IoCreateDevice() was called too early, when a spinlock was acquired.
Create ISAPNP_LOGICAL_DEVICE structure when a device is detected, and call IoCreateDevice() later, when required.
2020-03-14 23:39:01 +01:00
Hervé Poussineau
58e8be6258 [ISAPNP] Fix reading of serial number 2020-03-14 23:39:00 +01:00
Hervé Poussineau
c96ba5a713 [ISAPNP] Also read serial numbers of devices 2020-02-10 21:33:36 +01:00
Hervé Poussineau
bec0ceb82f [ISAPNP] Store VendorId/ProdId in the usual form 2020-02-10 21:33:36 +01:00
Hervé Poussineau
8eb3173896 [ISAPNP] When skipping a wrong tag in configuration, skip the length of this tag 2020-02-10 21:33:36 +01:00
Hervé Poussineau
40b2f65f0c [ISAPNP] Correctly calculate checksum
See appendix B.2 of "Plug and Play ISA Specification 1.0a"
2020-02-07 23:48:53 +01:00
Colin Finck
c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
Renamed from reactos/drivers/bus/isapnp/hardware.c (Browse further)