Sync with trunk (r48545)
[reactos.git] / lib / drivers / sound / soundblaster / version.c
1 /*
2 ReactOS Sound System
3 Sound Blaster DSP support
4 Version routine
5
6 Author:
7 Andrew Greenwood (silverblade@reactos.org)
8
9 History:
10 2 July 2008 - Created (split from sbdsp.c)
11
12 Notes:
13 Functions documented in sbdsp.h
14 */
15
16 #include <ntddk.h>
17 #include <debug.h>
18
19 #include <sbdsp.h>
20
21 NTSTATUS
22 SbDspGetVersion(
23 IN PUCHAR BasePort,
24 OUT PUCHAR MajorVersion,
25 OUT PUCHAR MinorVersion,
26 IN ULONG Timeout)
27 {
28 NTSTATUS Status;
29
30 /* Make sure our parameters are sane */
31 if ( ! MajorVersion )
32 return STATUS_INVALID_PARAMETER_2;
33
34 if ( ! MinorVersion )
35 return STATUS_INVALID_PARAMETER_3;
36
37 /* Send version request */
38 Status = SbDspWrite(BasePort, SB_DSP_VERSION, Timeout);
39 if ( Status != STATUS_SUCCESS )
40 return Status;
41
42 /* Get the major version */
43 Status = SbDspRead(BasePort, MajorVersion, Timeout);
44 if ( Status != STATUS_SUCCESS )
45 return FALSE;
46
47 /* Get the minor version */
48 Status = SbDspRead(BasePort, MinorVersion, Timeout);
49 return Status;
50 }