ReactOS  0.4.15-dev-4920-g5fa8403
wavepcistream.h
Go to the documentation of this file.
1 /********************************************************************************
2 ** Copyright (c) 1998-2000 Microsoft Corporation. All Rights Reserved.
3 **
4 ** Portions Copyright (c) 1998-1999 Intel Corporation
5 **
6 ********************************************************************************/
7 
8 /* The file wavepcistream.h was reviewed by LCA in June 2011 and is acceptable for use by Microsoft. */
9 
10 #ifndef _ICHWAVE_H_
11 #define _ICHWAVE_H_
12 
13 #include "shared.h"
14 #include "miniport.h"
15 
16 
17 //*****************************************************************************
18 // Data Structures and Typedefs
19 //*****************************************************************************
20 
21 //
22 // This is a description of one mapping entry. It contains information
23 // about the buffer and a tag which is used for "cancel mappings".
24 // For one mapping that is described here, there is an entry in the
25 // scatter gather engine.
26 //
27 typedef struct tagMapData
28 {
29  ULONG ulBufferLength; //buffer length
30  ULONG ulState; //buffer state
31 } tMapData;
32 
33 //
34 // Structure needed to keep track of the BDL tables.
35 // This structure is seperated from tBDEntry because we want to
36 // have it in cached memory (and not along with tBDEntry in non-
37 // cached memory).
38 //
39 typedef struct tagBDList
40 {
41  int nHead; // index for the BDL Head
42  int nTail; // index for the BDL Tail
43  int nBDEntries; // number of entries.
44  tMapData pMapData[32]; // mapping list
45 } tBDList;
46 
47 
48 //*****************************************************************************
49 // Classes
50 //*****************************************************************************
51 
52 /*****************************************************************************
53  * CMiniportWaveICHStream
54  *****************************************************************************
55  * AC97 wave miniport stream.
56  */
57 class CMiniportWaveICHStream : public IMiniportWavePciStream,
58  public CUnknown,
59  public CMiniportStream
60 {
61 private:
62  //
63  // CMiniportWaveICHStream private variables
64  //
65  KSPIN_LOCK MapLock; // for processing mappings.
66  ULONGLONG TotalBytesMapped; // factor in position calculation
67  ULONGLONG TotalBytesReleased; // factor in position calculation
69 
70  tBDList stBDList; // needed for scatter gather org.
71 
72 
73  /*************************************************************************
74  * CMiniportWaveICHStream methods
75  *************************************************************************
76  *
77  * These are private member functions used internally by the object. See
78  * ICHWAVE.CPP for specific descriptions.
79  */
80 
81  //
82  // Called when new mappings have to be processed.
83  //
84  NTSTATUS GetNewMappings (void);
85 
86  //
87  // Called when we want to release some mappings.
88  //
90 
92  return (CMiniportWaveICH*)Miniport; }
93 
94 
95 public:
96  /*************************************************************************
97  * The following two macros are from STDUNK.H. DECLARE_STD_UNKNOWN()
98  * defines inline IUnknown implementations that use CUnknown's aggregation
99  * support. NonDelegatingQueryInterface() is declared, but it cannot be
100  * implemented generically. Its definition appears in ICHWAVE.CPP.
101  * DEFINE_STD_CONSTRUCTOR() defines inline a constructor which accepts
102  * only the outer unknown, which is used for aggregation. The standard
103  * create macro (in ICHWAVE.CPP) uses this constructor.
104  */
107 
109 
110  /*************************************************************************
111  * Include IMiniportWavePciStream (public/exported) methods.
112  *************************************************************************
113  */
115 
116  /*************************************************************************
117  * CMiniportWaveICHStream methods
118  *************************************************************************
119  */
120 
121  //
122  // Initializes the Stream object.
123  //
124  NTSTATUS Init_();
125 
126  //
127  // This method is called when the device changes power states.
128  //
129  void PowerChangeNotify_
130  (
131  IN POWER_STATE NewState
132  );
133 
135 };
136 
137 #endif
138 
ULONG ulBufferLength
CMiniport * Miniport
Definition: stream.h:42
#define IN
Definition: typedefs.h:39
struct tagMapData tMapData
tMapData * pMapData
LONG NTSTATUS
Definition: precomp.h:26
DEFINE_STD_CONSTRUCTOR(CMiniportWaveICHStream)
unsigned int BOOL
Definition: ntddk_ex.h:94
void InterruptServiceRoutine()
Definition: rtstream.cpp:417
NTSTATUS ReleaseUsedMappings(void)
ULONG ulState
Definition: wavepcistream.h:30
uint64_t ULONGLONG
Definition: typedefs.h:67
NTSTATUS GetNewMappings(void)
ULONGLONG TotalBytesReleased
Definition: wavepcistream.h:67
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
struct tagBDList tBDList
unsigned int ULONG
Definition: retypes.h:1
CMiniportWaveICH * Wave()
Definition: wavepcistream.h:91
void PowerChangeNotify_(IN POWER_STATE NewState)