Commit graph

65 commits

Author SHA1 Message Date
Stanislav Motylkov bbccad0ed6
[INF] Set manufacturer as ReactOS Project for consistency
Also make it non-localizable. CORE-18191
2022-06-27 17:00:18 +03:00
Victor Perevertkin 447ef2aa4a
[CMAKE] Do not use USE_CLANG_CL variable in CMake scripts 2022-05-27 01:37:37 +03:00
Victor Perevertkin f155b9377f
[CMAKE] Elimitate the use of GCC and CLANG variables 2022-05-27 01:37:34 +03:00
Serge Gautherie 46db6573ab
[DRIVERS] Add some missing OBJ_KERNEL_HANDLE (#4493)
Match Zw*() uses. CORE-10207
2022-05-07 22:12:19 +03:00
Stanislav Motylkov b5e7797604
[AC97] Fix driver provider name
- Also sort out non-localizeable lines
- Fix German translation encoding and add missing one
- Add Russian translation

Addendum to 9c79a798, 68e19a95 and 9ca32a2b.
2022-05-07 18:00:13 +03:00
Thamatip Chitpong 9ca32a2b95
[AC97] Improve driver version info (#4368) 2022-03-06 01:04:56 +03:00
Adam Słaboń 68e19a95d0
[AC97] Enable on all Intel AC'97 audio controllers (#4366) 2022-03-06 01:04:22 +03:00
Obaid51 9c79a7982b
[AC97] Import the AC97 driver sample
The source code is licensed under MIT license, taken from
"MSDN Code Gallery Microsoft Samples" repository
(https://github.com/microsoftarchive/msdn-code-gallery-microsoft)

The original license was MS-PL, but the driver was later relicensed
as MIT.

Adopted to ReactOS code base by Michael Stamper.

Co-authored-by: Michael Stamper <michaelstamper1@gmail.com>
2022-02-16 01:31:28 +03:00
Victor Perevertkin 6e97b4314f
[PORTCLS] Centralize AddRef/Release implementation.
And make it thread-safe.

Co-authored-by: Thomas Faber <thomas.faber@reactos.org>
2022-02-16 01:31:27 +03:00
Thomas Faber 7db9fb3ba6
[PORTCLS] Don't leak CPortWaveCyclic. 2022-02-15 08:43:08 -05:00
Thomas Faber ec1eb52ebf
[PORTCLS] Do not rely on operator new to zero memory.
The standard operator new does not do this, and GCC will in fact
optimize out any zeroing done in the operator.
2022-02-15 08:43:05 -05:00
Hermès Bélusca-Maïto 78a7d7dc32
[CMIDRIVER] Remove useless Visual Studio resource editor file. 2022-02-12 16:21:32 +01:00
Hermès Bélusca-Maïto f73c0e08e2
[FDEBUG][CMIDRIVER] Add missing psdk dependency for user-mode code. 2022-02-12 16:21:30 +01:00
Serge Gautherie fdcefaa7cb [HDAUDBUS] HDA_PdoPnp(): Remove a redundant ASSERT()
Addendum to cf7fc81 (r68311).
2022-01-08 18:00:38 +03:00
Victor Perevertkin 951e52104a
[HDAUDBUS] Fix uninitialized variable usage 2022-01-05 03:22:15 +03:00
Michael Stamper 378294a7df
[PORTCLS] Fix races, fix WavePci Port Drivers
- Split buffers on page to prevent non-contiguous memory being passed to driver.
- Protect CIrpQueue::GetMappingWithTag, ReleaseMappingWithTag with spinlock to prevent race conditions
  (GetMapping, ReleaseMapping do not need spinlock, they are only called from a service routine).
- Remove ASSERT in CIrpQueue::ReleaseMappingWithTag, when mappings are released out of order. Just ignore
  the tag argument and release the next one in the list. This is what windows does, confirmed by calling
  PortWavePciStream::ReleaseMapping() with tag argument set to 0, absolutly no difference observed.
  Allowing out of order release is essential given that a driver is not permitted to hold a spinlock when calling
  ReleaseMapping().
- Remove IIrpQueue::HasLastMappingFailed(), it never worked and there is no way it could work.
  CPortPinWavePci::HandleKsStream() call MappingAvailable() non-conditionally, this is what Windows does,
  verified by debug prints in ac97 driver.
- Implement CIrpQueue::NumData().
- Remove incorrect interlocked operations/volatile variables and several (now unused) class fields.
2022-01-05 03:20:44 +03:00
Victor Perevertkin 7ed1883c8e
[DRIVERS] Use IoForwardIrpSynchronously in drivers
Instead of having an own routine in each driver
IoForwardIrpSynchronously can be used.
2022-01-05 02:17:56 +03:00
Thomas Faber 0af3689c2e
[REACTOS] Fix traces with missing arguments.
Courtesy of VS Code Analysis warning C6064:
Missing integer argument to 'DbgPrint' that corresponds to conversion specifier 'N'.
2021-11-21 12:57:35 -05:00
Hermès Bélusca-Maïto 9393fc320e
[FORMATTING] Remove trailing whitespace. Addendum to 34593d93.
Excluded: 3rd-party code (incl. wine) and most of the win32ss.
2021-09-13 03:52:22 +02:00
Julen Urizar Compains ea6e774050
[TRANSLATION] Fix minor typos and untranslated dialogs in Spanish (#3890)
- usetup: New bootsector page.
- shell32: Copy and paste, and moving elements.
  Also, some strings related to the shutdown and logoff.
- Minor Spanish grammar fix - some female words and minor latin american typos.
- First revision of the .inf, that includes the translation of the Services,
  audio, processors and other drivers and minor things.
2021-09-04 17:22:41 +03:00
Victor Perevertkin 34593d933b
[FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
Serge Gautherie fa47d6f852 [CMIPCI][DOC] Fix 4 DriverVer values
And add entry to '3rd Party Files.txt'.

Addendum to 4b4d95d (r39827) and ee4368d (r58644).
2021-02-02 01:56:50 +03:00
Serge Gautherie 511134ec91 [CMIPCI] Compile it as NT5.2, not NT6.0
Addendum to ba2ab59 (r61334).
2021-02-01 09:43:31 +01:00
Victor Perevertkin af0f8581ad
[HDAUDBUS] Return failure from HDA_SendVerbs on a timeout
Addendum to 48b3c61b5d
2021-01-18 04:02:32 +03:00
Victor Perevertkin 48b3c61b5d
[HDAUDBUS] Add a timeout into HDA_SendVerbs
This function may stuck during device installation if there are issues
with interrupts (or with a device itself).

This fixes the boot on my testing ThinkPad x60s
2020-11-03 23:18:14 +03:00
Jérôme Gardou d6ea8659c8 [CMAKE] Get rid of the set_cpp macro
Instead of messing with global variables and the like, we introduce two target properties:
 - WITH_CXX_EXCEPTIONS: if you want to use C++ exceptions
 - WITH_CXX_RTTI: if you need RTTI in your module
You can use the newly introduced set_target_cpp_properties function, with WITH_EXCEPTIONS and WITH_RTTI arguments
We also introduce two libraries :
 - cpprt: for C++ runtime routines
 - cppstl: for the C++ standard template library

NB: On GCC, this requires to create imported libraries with the related built-in libraries:libsupc++, limingwex, libstdc++

Finally, we manage the relevant flags with the ad-hoc generator expressions

So, if you don't need exceptions, nor RTTI, nor use any runtime at all: you simply have nothing else to do than add your C++ file to your module
2020-10-20 21:44:54 +02:00
Michael Stamper e45bacda07
[PORTCLS] Fix audio stutter with official AC97 driver (#3225)
Replace call to AllocatedBufferSize(), with BufferSize().

Indeed (quoting https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/portcls/nf-portcls-idmachannel-buffersize ):

> The BufferSize() method returns the buffer size that was set by the previous call to IDmaChannel::SetBufferSize(). If SetBufferSize() has not been called since the IDmaChannel::AllocateBuffer() call, BufferSize returns the allocated buffer size. The DMA-channel object does not actually use this value internally. This value is maintained by the object to **allow its various clients to communicate the intended size of the buffer**.

And this is exactly what we want to do.
2020-09-22 15:49:34 +02:00
Serge Gautherie 889b077b23
[REACTOS] *.spec: Fix some function/parameter types (#3154) 2020-09-20 19:21:11 +02:00
Amine Khaldi 139a3d6661
[CMAKE] Implement PCH builds with target_precompile_headers. CORE-16905 2020-06-06 21:58:41 +03: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
Victor Perevertkin 7e069ccdb2
[CMAKE] Replace custom functions to built-in ones
add_target_compile_definitions -> target_compile_definitions
add_target_compile_flags -> target_compile_options
add_target_include_directories -> target_include_directories
2020-04-16 15:59:38 +03:00
Benjamin Aerni 66cf7b6028
[PORTCLS] Stub missing IoControlCode switches (#1756)
Stub missing switches: IOCTL_KS_HANDSHAKE and IOCTL_KS_METHOD.
2020-03-30 12:58:25 +02:00
Thomas Faber e4e86c32e7
[PORTCLS] Handle failure return from QueryPowerChangeState. CORE-16611 2020-02-08 13:07:34 +01:00
Thomas Faber 5a43c52bbb
[PORTCLS] Return STATUS_PENDING after calling IoMarkIrpPending. CORE-16611 2020-02-08 13:07:34 +01:00
Thomas Faber 606c912aa4
[PORTCLS] Don't unnecessarily wait for lower drivers to complete power IRPs. CORE-16611
Also use PoCallDriver to forward power IRPs.
2020-02-08 13:07:34 +01:00
Thomas Faber 6ec38aa942
[HDAUDBUS] Build a device instance ID from Codec & node number. CORE-13702 2019-09-27 21:29:41 +02:00
Thomas Faber 4c6cc29bb8
[HDAUDBUS] Fix timeouts for hardware register operations. CORE-15874
Most needed to be multiplied by 10 to match Haiku's behavior.
In one case, the broken timeout was offset by a higher number of loop
iterations, which is now  restored.

This should fix failures on real hardware that result in the
"unable to exit reset" print, and avoid a possible subsequent Pnp
manager crash.

Compare with the following (both snooze and KeStallExecutionProcessor use microseconds):
ff38df48cf/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp (L466)
ff38df48cf/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp (L357)
ff38df48cf/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp (L978)
2019-09-26 10:27:31 +02:00
Timo Kreuzer 58588b76e2 [REACTOS] Fix MSVC printf format warnings 2019-08-15 15:24:12 +02:00
Thomas Faber 76e00fab7e
[PORTCLS] Zero memory in operator new. CORE-16157
Fixes a regression from 99fa38809f, which
replaced the kcom.h/stdunk.h versions (which zero memory) with local
implementations (which don't).

Standard C++ does not guarantee that memory is zeroed but several classes
rely on this, in particular for their m_Ref and m_bInitialized members.

Ideally the constructors should be fixed to initialize all required members,
but that task is error-prone so for now we simply restore the previous
behavior.
2019-07-05 17:31:46 +02:00
Timo Kreuzer dc0cd07d21 [CMIDRIVER] Try to fix build 3 2019-06-25 09:11:01 +02:00
Timo Kreuzer aad4096475 [CMIDRIVER] Try to fix build 2 2019-06-25 00:54:00 +02:00
Timo Kreuzer a14b509974 [CMIDRIVER] Try to fix build 2019-06-25 00:26:08 +02:00
Timo Kreuzer 99fa38809f [STDUNK][PORTCLS][CMIDriver] Fix issue with operator new/delete
Fix for MSVC warning "C2323: 'operator new': non-member operator new or delete functions may not be declared static or in a namespace other than the global namespace."

See https://docs.microsoft.com/en-us/cpp/porting/visual-cpp-what-s-new-2003-through-2015?view=vs-2019 section "Overloaded operator new and operator delete"
2019-06-24 21:17:00 +02:00
Jérôme Gardou 23373acbb9 [CMAKE] Use modules instead of shared libraries
There is no need to compile our DLLs as shared libraries since we are
managing symbols exports and imports through spec files.

On my system, this reduces the configure-time by a factor of two.
2019-04-06 17:43:38 +02:00
Thomas Faber 1001e6089f
[HDAUDBUS] Wait until the correct number of responses was received. CORE-15465
We previously only gave the device a hard-coded amount of time to respond,
which could lead to interpreting the contents of uninitialized memory as
a response. This would lead to an unreasonably large number of audio function
groups being detected.

A KSEMAPHORE mirrors what Haiku uses here, though it may not be the optimal
synchronization primitive for this case under Windows.
2019-02-28 10:27:06 +01:00
Thomas Faber 8530ae9950
[HDAUDBUS] Handle responses in a DPC instead of the ISR. 2019-02-28 10:06:18 +01:00
Thomas Faber a7431880bd
[HDAUDBUS] Fix a DPRINT. 2019-02-28 10:05:53 +01:00
Thomas Faber 1f76fb738a
[HDAUDBUS] Prevent overflow of the AudioGroups array. CORE-14153 CORE-15465
This protects against crashing in case of faulty/malicious hardware,
but also works around a bug in HDA_SendVerbs that causes it to return
invalid data, thereby suggesting more groups than are actually present.
2019-02-27 11:04:23 +01:00
Thomas Faber a8414f665b
[HDAUDBUS] Implement HDA_Unload. Stub HDA_Power and HDA_SystemControl. 2019-02-26 09:58:53 +01:00
Thomas Faber 25b22131ca
[HDAUDBUS] Correctly mask register values.
See https://github.com/haiku/haiku/blob/master/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
and https://github.com/haiku/haiku/blob/master/src/add-ons/kernel/drivers/audio/hda/driver.h#L118-L140

This fixes various device reset failures and probably other issues.
2019-02-26 09:51:48 +01:00