1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
|
/*++
Copyright (c) Microsoft Corporation All Rights Reserved
Module Name:
bthhfpminipairs.h
Abstract:
Bluetooth HFP audio endpoint filter definitions.
--*/
#ifndef _SYSVAD_BTHHFPMINIPAIRS_H_
#define _SYSVAD_BTHHFPMINIPAIRS_H_
#include "bthhfpspeakertopo.h"
#include "bthhfpspeakertoptable.h"
#include "bthhfpspeakerwavtable.h"
#include "bthhfpspeakerwbwavtable.h"
#include "bthhfpmictopo.h"
#include "bthhfpmictoptable.h"
#include "bthhfpmicwavtable.h"
#include "bthhfpmicwbwavtable.h"
NTSTATUS
CreateMiniportWaveRTSYSVAD
(
_Out_ PUNKNOWN *,
_In_ REFCLSID,
_In_opt_ PUNKNOWN,
_In_ POOL_FLAGS,
_In_ PUNKNOWN,
_In_opt_ PVOID,
_In_ PENDPOINT_MINIPAIR
);
NTSTATUS
CreateMiniportTopologySYSVAD
(
_Out_ PUNKNOWN *,
_In_ REFCLSID,
_In_opt_ PUNKNOWN,
_In_ POOL_FLAGS,
_In_ PUNKNOWN,
_In_opt_ PVOID,
_In_ PENDPOINT_MINIPAIR
);
//
// Render miniports.
//
/*********************************************************************
* Topology/Wave bridge connection for BTH-HFP speaker *
* *
* +------+ +------+ *
* | Wave | | Topo | *
* | | | | *
* System --->|0 2|---> Loopback | | *
* | | | | *
* Offload --->|1 3|--------------->|0 1|---> Line Out *
* | | | | *
* +------+ +------+ *
*********************************************************************/
static
PHYSICALCONNECTIONTABLE BthHfpSpeakerTopologyPhysicalConnections[] =
{
{
KSPIN_TOPO_WAVEOUT_SOURCE, // TopologyIn
KSPIN_WAVE_RENDER3_SOURCE, // WaveOut
CONNECTIONTYPE_WAVE_OUTPUT
}
};
// A subdevice is created for each HFP device using the reference string in the form of:
// <Base_Reference_String>-<Hashcode>
// where Base_Reference_String is one of the following template names
#define BTHHFP_SPEAKER_TOPO_NAME L"TopologyBthHfpSpeaker"
#define BTHHFP_SPEAKER_WAVE_NAME L"WaveBthHfpSpeaker"
#define BTHHFP_MIC_TOPO_NAME L"TopologyBthHfpMic"
#define BTHHFP_MIC_WAVE_NAME L"WaveBthHfpMic"
// And Hashcode is 8-character long hexadecimal value
// A reference string max length is being set to a value to accommodate them both
#define BTHHFP_INTERFACE_REFSTRING_MAX_LENGTH 100
static
ENDPOINT_MINIPAIR BthHfpSpeakerMiniports =
{
eBthHfpSpeakerDevice,
NULL, // Will be generated based on BTHHFP_SPEAKER_TOPO_NAME and made unique for each side band interface
BTHHFP_SPEAKER_TOPO_NAME, // template name matches with KSNAME_TopologyBthHfpSpeaker in the inf's [Strings] section
CreateMiniportTopologySYSVAD,
&BthHfpSpeakerTopoMiniportFilterDescriptor,
0, NULL, // Interface properties
NULL, // Will be generated based on BTHHFP_SPEAKER_WAVE_NAME and made unique for each side band interface
BTHHFP_SPEAKER_WAVE_NAME, // template name matches with KSNAME_WaveBthHfpSpeaker in the inf's [Strings] section
CreateMiniportWaveRTSYSVAD,
&BthHfpSpeakerWaveMiniportFilterDescriptor,
0, NULL, // Interface properties
1,
BthHfpSpeakerPinDeviceFormatsAndModes,
SIZEOF_ARRAY(BthHfpSpeakerPinDeviceFormatsAndModes),
BthHfpSpeakerTopologyPhysicalConnections,
SIZEOF_ARRAY(BthHfpSpeakerTopologyPhysicalConnections),
ENDPOINT_NO_FLAGS
};
static
ENDPOINT_MINIPAIR BthHfpSpeakerWBMiniports =
{
eBthHfpSpeakerDevice,
NULL, // Will be generated based on BTHHFP_SPEAKER_TOPO_NAME and made unique for each side band interface
BTHHFP_SPEAKER_TOPO_NAME, // Template name that matches with KSNAME_TopologyBthHfpSpeaker in the inf's [Strings] section
CreateMiniportTopologySYSVAD,
&BthHfpSpeakerTopoMiniportFilterDescriptor,
0, NULL, // Interface properties
NULL, // Will be generated based on BTHHFP_SPEAKER_WAVE_NAME and made unique for each side band interface
BTHHFP_SPEAKER_WAVE_NAME, // Template name matches with KSNAME_WaveBthHfpSpeaker in the inf's [Strings] section
CreateMiniportWaveRTSYSVAD,
&BthHfpSpeakerWBWaveMiniportFilterDescriptor,
0, NULL, // Interface properties
1,
BthHfpSpeakerWBPinDeviceFormatsAndModes,
SIZEOF_ARRAY(BthHfpSpeakerWBPinDeviceFormatsAndModes),
BthHfpSpeakerTopologyPhysicalConnections,
SIZEOF_ARRAY(BthHfpSpeakerTopologyPhysicalConnections),
ENDPOINT_NO_FLAGS
};
//
// Capture miniports.
//
/*********************************************************************
* Topology/Wave bridge connection for BTH-HFP mic *
* *
* +------+ +------+ *
* | Topo | | Wave | *
* | | | | *
* Mic in --->|0 1|===>|0 1|---> Capture Host Pin *
* | | | | *
* +------+ +------+ *
*********************************************************************/
static
PHYSICALCONNECTIONTABLE BthHfpMicTopologyPhysicalConnections[] =
{
{
KSPIN_TOPO_BRIDGE, // TopologyOut
KSPIN_WAVE_BRIDGE, // WaveIn
CONNECTIONTYPE_TOPOLOGY_OUTPUT
}
};
static
ENDPOINT_MINIPAIR BthHfpMicMiniports =
{
eBthHfpMicDevice,
NULL, // Will be generated based on BTHHFP_MIC_TOPO_NAME and made unique for each side band interface
BTHHFP_MIC_TOPO_NAME, // template name matches with KSNAME_TopologyBthHfpMic in the inf's [Strings] section
CreateMiniportTopologySYSVAD,
&BthHfpMicTopoMiniportFilterDescriptor,
0, NULL, // Interface properties
NULL, // Will be generated based on BTHHFP_SPEAKER_WAVE_NAME and made unique for each side band interface
BTHHFP_MIC_WAVE_NAME, // template name matches with KSNAME_WaveBthHfpMic in the inf's [Strings] section
CreateMiniportWaveRTSYSVAD,
&BthHfpMicWaveMiniportFilterDescriptor,
0, NULL, // Interface properties
1,
BthHfpMicPinDeviceFormatsAndModes,
SIZEOF_ARRAY(BthHfpMicPinDeviceFormatsAndModes),
BthHfpMicTopologyPhysicalConnections,
SIZEOF_ARRAY(BthHfpMicTopologyPhysicalConnections),
ENDPOINT_NO_FLAGS
};
static
ENDPOINT_MINIPAIR BthHfpMicWBMiniports =
{
eBthHfpMicDevice,
NULL, // Will be generated based on BTHHFP_MIC_TOPO_NAME and made unique for each side band interface
BTHHFP_MIC_TOPO_NAME, // template name matches with KSNAME_TopologyBthHfpMic in the inf's [Strings] section
CreateMiniportTopologySYSVAD,
&BthHfpMicTopoMiniportFilterDescriptor,
0, NULL, // Interface properties
NULL, // Will be generated based on BTHHFP_SPEAKER_WAVE_NAME and made unique for each side band interface
BTHHFP_MIC_WAVE_NAME, // template name matches with KSNAME_WaveBthHfpMic in the inf's [Strings] section
CreateMiniportWaveRTSYSVAD,
&BthHfpMicWBWaveMiniportFilterDescriptor,
0, NULL, // Interface properties
1,
BthHfpMicWBPinDeviceFormatsAndModes,
SIZEOF_ARRAY(BthHfpMicWBPinDeviceFormatsAndModes),
BthHfpMicTopologyPhysicalConnections,
SIZEOF_ARRAY(BthHfpMicTopologyPhysicalConnections),
ENDPOINT_NO_FLAGS
};
//=============================================================================
//
// Render miniport pairs.
//
static
PENDPOINT_MINIPAIR g_BthHfpRenderEndpoints[] =
{
&BthHfpSpeakerMiniports,
&BthHfpSpeakerWBMiniports
};
#define g_cBthHfpRenderEndpoints (SIZEOF_ARRAY(g_BthHfpRenderEndpoints))
// If the count of Render endpoints changes, update formula below
C_ASSERT(g_cBthHfpRenderEndpoints == 2);
//=============================================================================
//
// Capture miniport pairs.
//
static
PENDPOINT_MINIPAIR g_BthHfpCaptureEndpoints[] =
{
&BthHfpMicMiniports,
&BthHfpMicWBMiniports
};
#define g_cBthHfpCaptureEndpoints (SIZEOF_ARRAY(g_BthHfpCaptureEndpoints))
// If the count of Capture endpoints changes, update formula below
C_ASSERT(g_cBthHfpCaptureEndpoints == 2);
//=============================================================================
//
// Total miniports = # endpoints * 2 (topology + wave) / 2 (since we have one each for narrowband-only and wideband)
//
//
// Allow 10 Bluetooth hands-free profile devices.
//
#define MAX_BTHHFP_DEVICES (10)
#define g_MaxBthHfpMiniports ((g_cBthHfpRenderEndpoints + g_cBthHfpCaptureEndpoints) * MAX_BTHHFP_DEVICES)
// g_MaxBthHfpMiniports is used when calculating the MaxObjects inside AddDevice.
C_ASSERT(g_MaxBthHfpMiniports == 40);
#endif // _SYSVAD_BTHHFPMINIPAIRS_H_
|