1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#ifndef _HPI_INTERNAL_H_
25#define _HPI_INTERNAL_H_
26
27#include "hpi.h"
28
29#define HPI_MAX_ADAPTER_MEM_SPACES (2)
30
31
32#include "hpios.h"
33
34
35void hpios_locked_mem_init(void
36 );
37void hpios_locked_mem_free_all(void
38 );
39#define hpios_locked_mem_prepare(a, b, c, d);
40#define hpios_locked_mem_unprepare(a)
41
42
43
44
45
46
47
48
49
50u16 hpios_locked_mem_alloc(struct consistent_dma_area *p_locked_mem_handle,
51
52 u32 size,
53 struct pci_dev *p_os_reference
54
55 );
56
57
58
59
60
61
62
63u16 hpios_locked_mem_free(struct consistent_dma_area *locked_mem_handle);
64
65
66
67
68
69u16 hpios_locked_mem_get_phys_addr(struct consistent_dma_area
70 *locked_mem_handle, u32 *p_physical_addr);
71
72
73
74
75
76u16 hpios_locked_mem_get_virt_addr(struct consistent_dma_area
77 *locked_mem_handle, void **ppv_virtual_addr);
78
79
80
81
82u16 hpios_locked_mem_valid(struct consistent_dma_area *locked_mem_handle);
83
84
85void hpios_delay_micro_seconds(u32 num_micro_sec);
86
87struct hpi_message;
88struct hpi_response;
89
90typedef void hpi_handler_func(struct hpi_message *, struct hpi_response *);
91
92
93
94
95
96#define compile_time_assert(cond, msg) \
97 typedef char ASSERT_##msg[(cond) ? 1 : -1]
98
99
100enum HPI_BUSES {
101 HPI_BUS_ISAPNP = 1,
102 HPI_BUS_PCI = 2,
103 HPI_BUS_USB = 3,
104 HPI_BUS_NET = 4
105};
106
107enum HPI_SUBSYS_OPTIONS {
108
109 HPI_SUBSYS_OPT_NET_ENABLE = 257,
110 HPI_SUBSYS_OPT_NET_BROADCAST = 258,
111 HPI_SUBSYS_OPT_NET_UNICAST = 259,
112 HPI_SUBSYS_OPT_NET_ADDR = 260,
113 HPI_SUBSYS_OPT_NET_MASK = 261,
114 HPI_SUBSYS_OPT_NET_ADAPTER_ADDRESS_ADD = 262
115};
116
117
118
119enum HPI_VOLUME_FLAGS {
120
121 HPI_VOLUME_FLAG_MUTED = (1 << 0),
122
123 HPI_VOLUME_FLAG_HAS_MUTE = (1 << 1),
124
125 HPI_VOLUME_FLAG_HAS_AUTOFADE = (1 << 2)
126
127};
128
129
130
131
132
133#define HPI_CTL_ATTR(ctl, ai) ((HPI_CONTROL_##ctl << 8) + ai)
134
135
136#define HPI_CTL_ATTR_INDEX(i) (i & 0xff)
137
138
139#define HPI_CTL_ATTR_CONTROL(i) (i >> 8)
140
141
142
143
144
145
146
147
148enum HPI_CONTROL_ATTRIBUTES {
149 HPI_GENERIC_ENABLE = HPI_CTL_ATTR(GENERIC, 1),
150 HPI_GENERIC_EVENT_ENABLE = HPI_CTL_ATTR(GENERIC, 2),
151
152 HPI_VOLUME_GAIN = HPI_CTL_ATTR(VOLUME, 1),
153 HPI_VOLUME_AUTOFADE = HPI_CTL_ATTR(VOLUME, 2),
154 HPI_VOLUME_MUTE = HPI_CTL_ATTR(VOLUME, 3),
155 HPI_VOLUME_GAIN_AND_FLAGS = HPI_CTL_ATTR(VOLUME, 4),
156 HPI_VOLUME_NUM_CHANNELS = HPI_CTL_ATTR(VOLUME, 6),
157 HPI_VOLUME_RANGE = HPI_CTL_ATTR(VOLUME, 10),
158
159 HPI_METER_RMS = HPI_CTL_ATTR(METER, 1),
160 HPI_METER_PEAK = HPI_CTL_ATTR(METER, 2),
161 HPI_METER_RMS_BALLISTICS = HPI_CTL_ATTR(METER, 3),
162 HPI_METER_PEAK_BALLISTICS = HPI_CTL_ATTR(METER, 4),
163 HPI_METER_NUM_CHANNELS = HPI_CTL_ATTR(METER, 5),
164
165 HPI_MULTIPLEXER_SOURCE = HPI_CTL_ATTR(MULTIPLEXER, 1),
166 HPI_MULTIPLEXER_QUERYSOURCE = HPI_CTL_ATTR(MULTIPLEXER, 2),
167
168 HPI_AESEBUTX_FORMAT = HPI_CTL_ATTR(AESEBUTX, 1),
169 HPI_AESEBUTX_SAMPLERATE = HPI_CTL_ATTR(AESEBUTX, 3),
170 HPI_AESEBUTX_CHANNELSTATUS = HPI_CTL_ATTR(AESEBUTX, 4),
171 HPI_AESEBUTX_USERDATA = HPI_CTL_ATTR(AESEBUTX, 5),
172
173 HPI_AESEBURX_FORMAT = HPI_CTL_ATTR(AESEBURX, 1),
174 HPI_AESEBURX_ERRORSTATUS = HPI_CTL_ATTR(AESEBURX, 2),
175 HPI_AESEBURX_SAMPLERATE = HPI_CTL_ATTR(AESEBURX, 3),
176 HPI_AESEBURX_CHANNELSTATUS = HPI_CTL_ATTR(AESEBURX, 4),
177 HPI_AESEBURX_USERDATA = HPI_CTL_ATTR(AESEBURX, 5),
178
179 HPI_LEVEL_GAIN = HPI_CTL_ATTR(LEVEL, 1),
180 HPI_LEVEL_RANGE = HPI_CTL_ATTR(LEVEL, 10),
181
182 HPI_TUNER_BAND = HPI_CTL_ATTR(TUNER, 1),
183 HPI_TUNER_FREQ = HPI_CTL_ATTR(TUNER, 2),
184 HPI_TUNER_LEVEL_AVG = HPI_CTL_ATTR(TUNER, 3),
185 HPI_TUNER_LEVEL_RAW = HPI_CTL_ATTR(TUNER, 4),
186 HPI_TUNER_SNR = HPI_CTL_ATTR(TUNER, 5),
187 HPI_TUNER_GAIN = HPI_CTL_ATTR(TUNER, 6),
188 HPI_TUNER_STATUS = HPI_CTL_ATTR(TUNER, 7),
189 HPI_TUNER_MODE = HPI_CTL_ATTR(TUNER, 8),
190 HPI_TUNER_RDS = HPI_CTL_ATTR(TUNER, 9),
191 HPI_TUNER_DEEMPHASIS = HPI_CTL_ATTR(TUNER, 10),
192 HPI_TUNER_PROGRAM = HPI_CTL_ATTR(TUNER, 11),
193 HPI_TUNER_HDRADIO_SIGNAL_QUALITY = HPI_CTL_ATTR(TUNER, 12),
194 HPI_TUNER_HDRADIO_SDK_VERSION = HPI_CTL_ATTR(TUNER, 13),
195 HPI_TUNER_HDRADIO_DSP_VERSION = HPI_CTL_ATTR(TUNER, 14),
196 HPI_TUNER_HDRADIO_BLEND = HPI_CTL_ATTR(TUNER, 15),
197
198 HPI_VOX_THRESHOLD = HPI_CTL_ATTR(VOX, 1),
199
200 HPI_CHANNEL_MODE_MODE = HPI_CTL_ATTR(CHANNEL_MODE, 1),
201
202 HPI_BITSTREAM_DATA_POLARITY = HPI_CTL_ATTR(BITSTREAM, 1),
203 HPI_BITSTREAM_CLOCK_EDGE = HPI_CTL_ATTR(BITSTREAM, 2),
204 HPI_BITSTREAM_CLOCK_SOURCE = HPI_CTL_ATTR(BITSTREAM, 3),
205 HPI_BITSTREAM_ACTIVITY = HPI_CTL_ATTR(BITSTREAM, 4),
206
207 HPI_SAMPLECLOCK_SOURCE = HPI_CTL_ATTR(SAMPLECLOCK, 1),
208 HPI_SAMPLECLOCK_SAMPLERATE = HPI_CTL_ATTR(SAMPLECLOCK, 2),
209 HPI_SAMPLECLOCK_SOURCE_INDEX = HPI_CTL_ATTR(SAMPLECLOCK, 3),
210 HPI_SAMPLECLOCK_LOCAL_SAMPLERATE = HPI_CTL_ATTR(SAMPLECLOCK, 4),
211 HPI_SAMPLECLOCK_AUTO = HPI_CTL_ATTR(SAMPLECLOCK, 5),
212 HPI_SAMPLECLOCK_LOCAL_LOCK = HPI_CTL_ATTR(SAMPLECLOCK, 6),
213
214 HPI_MICROPHONE_PHANTOM_POWER = HPI_CTL_ATTR(MICROPHONE, 1),
215
216 HPI_EQUALIZER_NUM_FILTERS = HPI_CTL_ATTR(EQUALIZER, 1),
217 HPI_EQUALIZER_FILTER = HPI_CTL_ATTR(EQUALIZER, 2),
218 HPI_EQUALIZER_COEFFICIENTS = HPI_CTL_ATTR(EQUALIZER, 3),
219
220 HPI_COMPANDER_PARAMS = HPI_CTL_ATTR(COMPANDER, 1),
221 HPI_COMPANDER_MAKEUPGAIN = HPI_CTL_ATTR(COMPANDER, 2),
222 HPI_COMPANDER_THRESHOLD = HPI_CTL_ATTR(COMPANDER, 3),
223 HPI_COMPANDER_RATIO = HPI_CTL_ATTR(COMPANDER, 4),
224 HPI_COMPANDER_ATTACK = HPI_CTL_ATTR(COMPANDER, 5),
225 HPI_COMPANDER_DECAY = HPI_CTL_ATTR(COMPANDER, 6),
226
227 HPI_COBRANET_SET = HPI_CTL_ATTR(COBRANET, 1),
228 HPI_COBRANET_GET = HPI_CTL_ATTR(COBRANET, 2),
229 HPI_COBRANET_SET_DATA = HPI_CTL_ATTR(COBRANET, 3),
230 HPI_COBRANET_GET_DATA = HPI_CTL_ATTR(COBRANET, 4),
231 HPI_COBRANET_GET_STATUS = HPI_CTL_ATTR(COBRANET, 5),
232 HPI_COBRANET_SEND_PACKET = HPI_CTL_ATTR(COBRANET, 6),
233 HPI_COBRANET_GET_PACKET = HPI_CTL_ATTR(COBRANET, 7),
234
235 HPI_TONEDETECTOR_THRESHOLD = HPI_CTL_ATTR(TONEDETECTOR, 1),
236 HPI_TONEDETECTOR_STATE = HPI_CTL_ATTR(TONEDETECTOR, 2),
237 HPI_TONEDETECTOR_FREQUENCY = HPI_CTL_ATTR(TONEDETECTOR, 3),
238
239 HPI_SILENCEDETECTOR_THRESHOLD = HPI_CTL_ATTR(SILENCEDETECTOR, 1),
240 HPI_SILENCEDETECTOR_STATE = HPI_CTL_ATTR(SILENCEDETECTOR, 2),
241 HPI_SILENCEDETECTOR_DELAY = HPI_CTL_ATTR(SILENCEDETECTOR, 3),
242
243 HPI_PAD_CHANNEL_NAME = HPI_CTL_ATTR(PAD, 1),
244 HPI_PAD_ARTIST = HPI_CTL_ATTR(PAD, 2),
245 HPI_PAD_TITLE = HPI_CTL_ATTR(PAD, 3),
246 HPI_PAD_COMMENT = HPI_CTL_ATTR(PAD, 4),
247 HPI_PAD_PROGRAM_TYPE = HPI_CTL_ATTR(PAD, 5),
248 HPI_PAD_PROGRAM_ID = HPI_CTL_ATTR(PAD, 6),
249 HPI_PAD_TA_SUPPORT = HPI_CTL_ATTR(PAD, 7),
250 HPI_PAD_TA_ACTIVE = HPI_CTL_ATTR(PAD, 8)
251};
252
253#define HPI_POLARITY_POSITIVE 0
254#define HPI_POLARITY_NEGATIVE 1
255
256
257
258
259#define HPI_COBRANET_HMI_cobra_bridge 0x20000
260#define HPI_COBRANET_HMI_cobra_bridge_tx_pkt_buf \
261 (HPI_COBRANET_HMI_cobra_bridge + 0x1000)
262#define HPI_COBRANET_HMI_cobra_bridge_rx_pkt_buf \
263 (HPI_COBRANET_HMI_cobra_bridge + 0x2000)
264#define HPI_COBRANET_HMI_cobra_if_table1 0x110000
265#define HPI_COBRANET_HMI_cobra_if_phy_address \
266 (HPI_COBRANET_HMI_cobra_if_table1 + 0xd)
267#define HPI_COBRANET_HMI_cobra_protocolIP 0x72000
268#define HPI_COBRANET_HMI_cobra_ip_mon_currentIP \
269 (HPI_COBRANET_HMI_cobra_protocolIP + 0x0)
270#define HPI_COBRANET_HMI_cobra_ip_mon_staticIP \
271 (HPI_COBRANET_HMI_cobra_protocolIP + 0x2)
272#define HPI_COBRANET_HMI_cobra_sys 0x100000
273#define HPI_COBRANET_HMI_cobra_sys_desc \
274 (HPI_COBRANET_HMI_cobra_sys + 0x0)
275#define HPI_COBRANET_HMI_cobra_sys_objectID \
276 (HPI_COBRANET_HMI_cobra_sys + 0x100)
277#define HPI_COBRANET_HMI_cobra_sys_contact \
278 (HPI_COBRANET_HMI_cobra_sys + 0x200)
279#define HPI_COBRANET_HMI_cobra_sys_name \
280 (HPI_COBRANET_HMI_cobra_sys + 0x300)
281#define HPI_COBRANET_HMI_cobra_sys_location \
282 (HPI_COBRANET_HMI_cobra_sys + 0x400)
283
284
285
286
287#define HPI_COBRANET_HMI_STATUS_RXPACKET 2
288#define HPI_COBRANET_HMI_STATUS_TXPACKET 3
289
290
291
292
293#define HPI_ETHERNET_HEADER_SIZE (16)
294
295
296
297
298#define HPI_ETHERNET_PACKET_ID 0x85
299
300#define HPI_ETHERNET_PACKET_V1 0x01
301
302#define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI 0x20
303
304#define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI_V1 0x21
305
306#define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI 0x40
307
308#define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI_V1 0x41
309
310#define HPI_ETHERNET_UDP_PORT (44600)
311
312
313#define HPI_ETHERNET_TIMEOUT_MS 500
314
315
316enum HPI_BUFFER_CMDS {
317
318 HPI_BUFFER_CMD_EXTERNAL = 0,
319
320 HPI_BUFFER_CMD_INTERNAL_ALLOC = 1,
321
322 HPI_BUFFER_CMD_INTERNAL_GRANTADAPTER = 2,
323
324 HPI_BUFFER_CMD_INTERNAL_REVOKEADAPTER = 3,
325
326 HPI_BUFFER_CMD_INTERNAL_FREE = 4
327};
328
329
330
331
332
333
334
335
336#define HPI_ID_ISAPNP_AUDIOSCIENCE 0x0669
337
338#define HPI_PCI_VENDOR_ID_AUDIOSCIENCE 0x175C
339
340#define HPI_PCI_VENDOR_ID_MOTOROLA 0x1057
341
342#define HPI_PCI_VENDOR_ID_TI 0x104C
343
344#define HPI_PCI_DEV_ID_PCI2040 0xAC60
345
346#define HPI_PCI_DEV_ID_DSP6205 0xA106
347
348#define HPI_USB_VENDOR_ID_AUDIOSCIENCE 0x1257
349#define HPI_USB_W2K_TAG 0x57495341
350#define HPI_USB_LINUX_TAG 0x4C495341
351
352
353
354
355
356#define HPI_ADAPTER_INDEX_INVALID 0xFFFF
357
358
359#define HPI_ADAPTER_FAMILY_MASK 0xff00
360#define HPI_MODULE_FAMILY_MASK 0xfff0
361
362#define HPI_ADAPTER_FAMILY_ASI(f) (f & HPI_ADAPTER_FAMILY_MASK)
363#define HPI_MODULE_FAMILY_ASI(f) (f & HPI_MODULE_FAMILY_MASK)
364#define HPI_ADAPTER_ASI(f) (f)
365
366enum HPI_MESSAGE_TYPES {
367 HPI_TYPE_MESSAGE = 1,
368 HPI_TYPE_RESPONSE = 2,
369 HPI_TYPE_DATA = 3,
370 HPI_TYPE_SSX2BYPASS_MESSAGE = 4
371};
372
373enum HPI_OBJECT_TYPES {
374 HPI_OBJ_SUBSYSTEM = 1,
375 HPI_OBJ_ADAPTER = 2,
376 HPI_OBJ_OSTREAM = 3,
377 HPI_OBJ_ISTREAM = 4,
378 HPI_OBJ_MIXER = 5,
379 HPI_OBJ_NODE = 6,
380 HPI_OBJ_CONTROL = 7,
381 HPI_OBJ_NVMEMORY = 8,
382 HPI_OBJ_GPIO = 9,
383 HPI_OBJ_WATCHDOG = 10,
384 HPI_OBJ_CLOCK = 11,
385 HPI_OBJ_PROFILE = 12,
386 HPI_OBJ_CONTROLEX = 13,
387 HPI_OBJ_ASYNCEVENT = 14
388#define HPI_OBJ_MAXINDEX 14
389};
390
391#define HPI_OBJ_FUNCTION_SPACING 0x100
392#define HPI_FUNC_ID(obj, i) (HPI_OBJ_##obj * HPI_OBJ_FUNCTION_SPACING + i)
393
394#define HPI_EXTRACT_INDEX(fn) (fn & 0xff)
395
396enum HPI_FUNCTION_IDS {
397 HPI_SUBSYS_OPEN = HPI_FUNC_ID(SUBSYSTEM, 1),
398 HPI_SUBSYS_GET_VERSION = HPI_FUNC_ID(SUBSYSTEM, 2),
399 HPI_SUBSYS_GET_INFO = HPI_FUNC_ID(SUBSYSTEM, 3),
400 HPI_SUBSYS_FIND_ADAPTERS = HPI_FUNC_ID(SUBSYSTEM, 4),
401 HPI_SUBSYS_CREATE_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 5),
402 HPI_SUBSYS_CLOSE = HPI_FUNC_ID(SUBSYSTEM, 6),
403 HPI_SUBSYS_DELETE_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 7),
404 HPI_SUBSYS_DRIVER_LOAD = HPI_FUNC_ID(SUBSYSTEM, 8),
405 HPI_SUBSYS_DRIVER_UNLOAD = HPI_FUNC_ID(SUBSYSTEM, 9),
406 HPI_SUBSYS_READ_PORT_8 = HPI_FUNC_ID(SUBSYSTEM, 10),
407 HPI_SUBSYS_WRITE_PORT_8 = HPI_FUNC_ID(SUBSYSTEM, 11),
408 HPI_SUBSYS_GET_NUM_ADAPTERS = HPI_FUNC_ID(SUBSYSTEM, 12),
409 HPI_SUBSYS_GET_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 13),
410 HPI_SUBSYS_SET_NETWORK_INTERFACE = HPI_FUNC_ID(SUBSYSTEM, 14),
411 HPI_SUBSYS_OPTION_INFO = HPI_FUNC_ID(SUBSYSTEM, 15),
412 HPI_SUBSYS_OPTION_GET = HPI_FUNC_ID(SUBSYSTEM, 16),
413 HPI_SUBSYS_OPTION_SET = HPI_FUNC_ID(SUBSYSTEM, 17),
414#define HPI_SUBSYS_FUNCTION_COUNT 17
415
416 HPI_ADAPTER_OPEN = HPI_FUNC_ID(ADAPTER, 1),
417 HPI_ADAPTER_CLOSE = HPI_FUNC_ID(ADAPTER, 2),
418 HPI_ADAPTER_GET_INFO = HPI_FUNC_ID(ADAPTER, 3),
419 HPI_ADAPTER_GET_ASSERT = HPI_FUNC_ID(ADAPTER, 4),
420 HPI_ADAPTER_TEST_ASSERT = HPI_FUNC_ID(ADAPTER, 5),
421 HPI_ADAPTER_SET_MODE = HPI_FUNC_ID(ADAPTER, 6),
422 HPI_ADAPTER_GET_MODE = HPI_FUNC_ID(ADAPTER, 7),
423 HPI_ADAPTER_ENABLE_CAPABILITY = HPI_FUNC_ID(ADAPTER, 8),
424 HPI_ADAPTER_SELFTEST = HPI_FUNC_ID(ADAPTER, 9),
425 HPI_ADAPTER_FIND_OBJECT = HPI_FUNC_ID(ADAPTER, 10),
426 HPI_ADAPTER_QUERY_FLASH = HPI_FUNC_ID(ADAPTER, 11),
427 HPI_ADAPTER_START_FLASH = HPI_FUNC_ID(ADAPTER, 12),
428 HPI_ADAPTER_PROGRAM_FLASH = HPI_FUNC_ID(ADAPTER, 13),
429 HPI_ADAPTER_SET_PROPERTY = HPI_FUNC_ID(ADAPTER, 14),
430 HPI_ADAPTER_GET_PROPERTY = HPI_FUNC_ID(ADAPTER, 15),
431 HPI_ADAPTER_ENUM_PROPERTY = HPI_FUNC_ID(ADAPTER, 16),
432 HPI_ADAPTER_MODULE_INFO = HPI_FUNC_ID(ADAPTER, 17),
433 HPI_ADAPTER_DEBUG_READ = HPI_FUNC_ID(ADAPTER, 18),
434 HPI_ADAPTER_IRQ_QUERY_AND_CLEAR = HPI_FUNC_ID(ADAPTER, 19),
435 HPI_ADAPTER_IRQ_CALLBACK = HPI_FUNC_ID(ADAPTER, 20),
436#define HPI_ADAPTER_FUNCTION_COUNT 20
437
438 HPI_OSTREAM_OPEN = HPI_FUNC_ID(OSTREAM, 1),
439 HPI_OSTREAM_CLOSE = HPI_FUNC_ID(OSTREAM, 2),
440 HPI_OSTREAM_WRITE = HPI_FUNC_ID(OSTREAM, 3),
441 HPI_OSTREAM_START = HPI_FUNC_ID(OSTREAM, 4),
442 HPI_OSTREAM_STOP = HPI_FUNC_ID(OSTREAM, 5),
443 HPI_OSTREAM_RESET = HPI_FUNC_ID(OSTREAM, 6),
444 HPI_OSTREAM_GET_INFO = HPI_FUNC_ID(OSTREAM, 7),
445 HPI_OSTREAM_QUERY_FORMAT = HPI_FUNC_ID(OSTREAM, 8),
446 HPI_OSTREAM_DATA = HPI_FUNC_ID(OSTREAM, 9),
447 HPI_OSTREAM_SET_VELOCITY = HPI_FUNC_ID(OSTREAM, 10),
448 HPI_OSTREAM_SET_PUNCHINOUT = HPI_FUNC_ID(OSTREAM, 11),
449 HPI_OSTREAM_SINEGEN = HPI_FUNC_ID(OSTREAM, 12),
450 HPI_OSTREAM_ANC_RESET = HPI_FUNC_ID(OSTREAM, 13),
451 HPI_OSTREAM_ANC_GET_INFO = HPI_FUNC_ID(OSTREAM, 14),
452 HPI_OSTREAM_ANC_READ = HPI_FUNC_ID(OSTREAM, 15),
453 HPI_OSTREAM_SET_TIMESCALE = HPI_FUNC_ID(OSTREAM, 16),
454 HPI_OSTREAM_SET_FORMAT = HPI_FUNC_ID(OSTREAM, 17),
455 HPI_OSTREAM_HOSTBUFFER_ALLOC = HPI_FUNC_ID(OSTREAM, 18),
456 HPI_OSTREAM_HOSTBUFFER_FREE = HPI_FUNC_ID(OSTREAM, 19),
457 HPI_OSTREAM_GROUP_ADD = HPI_FUNC_ID(OSTREAM, 20),
458 HPI_OSTREAM_GROUP_GETMAP = HPI_FUNC_ID(OSTREAM, 21),
459 HPI_OSTREAM_GROUP_RESET = HPI_FUNC_ID(OSTREAM, 22),
460 HPI_OSTREAM_HOSTBUFFER_GET_INFO = HPI_FUNC_ID(OSTREAM, 23),
461 HPI_OSTREAM_WAIT_START = HPI_FUNC_ID(OSTREAM, 24),
462 HPI_OSTREAM_WAIT = HPI_FUNC_ID(OSTREAM, 25),
463#define HPI_OSTREAM_FUNCTION_COUNT 25
464
465 HPI_ISTREAM_OPEN = HPI_FUNC_ID(ISTREAM, 1),
466 HPI_ISTREAM_CLOSE = HPI_FUNC_ID(ISTREAM, 2),
467 HPI_ISTREAM_SET_FORMAT = HPI_FUNC_ID(ISTREAM, 3),
468 HPI_ISTREAM_READ = HPI_FUNC_ID(ISTREAM, 4),
469 HPI_ISTREAM_START = HPI_FUNC_ID(ISTREAM, 5),
470 HPI_ISTREAM_STOP = HPI_FUNC_ID(ISTREAM, 6),
471 HPI_ISTREAM_RESET = HPI_FUNC_ID(ISTREAM, 7),
472 HPI_ISTREAM_GET_INFO = HPI_FUNC_ID(ISTREAM, 8),
473 HPI_ISTREAM_QUERY_FORMAT = HPI_FUNC_ID(ISTREAM, 9),
474 HPI_ISTREAM_ANC_RESET = HPI_FUNC_ID(ISTREAM, 10),
475 HPI_ISTREAM_ANC_GET_INFO = HPI_FUNC_ID(ISTREAM, 11),
476 HPI_ISTREAM_ANC_WRITE = HPI_FUNC_ID(ISTREAM, 12),
477 HPI_ISTREAM_HOSTBUFFER_ALLOC = HPI_FUNC_ID(ISTREAM, 13),
478 HPI_ISTREAM_HOSTBUFFER_FREE = HPI_FUNC_ID(ISTREAM, 14),
479 HPI_ISTREAM_GROUP_ADD = HPI_FUNC_ID(ISTREAM, 15),
480 HPI_ISTREAM_GROUP_GETMAP = HPI_FUNC_ID(ISTREAM, 16),
481 HPI_ISTREAM_GROUP_RESET = HPI_FUNC_ID(ISTREAM, 17),
482 HPI_ISTREAM_HOSTBUFFER_GET_INFO = HPI_FUNC_ID(ISTREAM, 18),
483 HPI_ISTREAM_WAIT_START = HPI_FUNC_ID(ISTREAM, 19),
484 HPI_ISTREAM_WAIT = HPI_FUNC_ID(ISTREAM, 20),
485#define HPI_ISTREAM_FUNCTION_COUNT 20
486
487
488
489 HPI_MIXER_OPEN = HPI_FUNC_ID(MIXER, 1),
490 HPI_MIXER_CLOSE = HPI_FUNC_ID(MIXER, 2),
491 HPI_MIXER_GET_INFO = HPI_FUNC_ID(MIXER, 3),
492 HPI_MIXER_GET_NODE_INFO = HPI_FUNC_ID(MIXER, 4),
493 HPI_MIXER_GET_CONTROL = HPI_FUNC_ID(MIXER, 5),
494 HPI_MIXER_SET_CONNECTION = HPI_FUNC_ID(MIXER, 6),
495 HPI_MIXER_GET_CONNECTIONS = HPI_FUNC_ID(MIXER, 7),
496 HPI_MIXER_GET_CONTROL_BY_INDEX = HPI_FUNC_ID(MIXER, 8),
497 HPI_MIXER_GET_CONTROL_ARRAY_BY_INDEX = HPI_FUNC_ID(MIXER, 9),
498 HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES = HPI_FUNC_ID(MIXER, 10),
499 HPI_MIXER_STORE = HPI_FUNC_ID(MIXER, 11),
500 HPI_MIXER_GET_CACHE_INFO = HPI_FUNC_ID(MIXER, 12),
501#define HPI_MIXER_FUNCTION_COUNT 12
502
503 HPI_CONTROL_GET_INFO = HPI_FUNC_ID(CONTROL, 1),
504 HPI_CONTROL_GET_STATE = HPI_FUNC_ID(CONTROL, 2),
505 HPI_CONTROL_SET_STATE = HPI_FUNC_ID(CONTROL, 3),
506#define HPI_CONTROL_FUNCTION_COUNT 3
507
508 HPI_NVMEMORY_OPEN = HPI_FUNC_ID(NVMEMORY, 1),
509 HPI_NVMEMORY_READ_BYTE = HPI_FUNC_ID(NVMEMORY, 2),
510 HPI_NVMEMORY_WRITE_BYTE = HPI_FUNC_ID(NVMEMORY, 3),
511#define HPI_NVMEMORY_FUNCTION_COUNT 3
512
513 HPI_GPIO_OPEN = HPI_FUNC_ID(GPIO, 1),
514 HPI_GPIO_READ_BIT = HPI_FUNC_ID(GPIO, 2),
515 HPI_GPIO_WRITE_BIT = HPI_FUNC_ID(GPIO, 3),
516 HPI_GPIO_READ_ALL = HPI_FUNC_ID(GPIO, 4),
517 HPI_GPIO_WRITE_STATUS = HPI_FUNC_ID(GPIO, 5),
518#define HPI_GPIO_FUNCTION_COUNT 5
519
520 HPI_ASYNCEVENT_OPEN = HPI_FUNC_ID(ASYNCEVENT, 1),
521 HPI_ASYNCEVENT_CLOSE = HPI_FUNC_ID(ASYNCEVENT, 2),
522 HPI_ASYNCEVENT_WAIT = HPI_FUNC_ID(ASYNCEVENT, 3),
523 HPI_ASYNCEVENT_GETCOUNT = HPI_FUNC_ID(ASYNCEVENT, 4),
524 HPI_ASYNCEVENT_GET = HPI_FUNC_ID(ASYNCEVENT, 5),
525 HPI_ASYNCEVENT_SENDEVENTS = HPI_FUNC_ID(ASYNCEVENT, 6),
526#define HPI_ASYNCEVENT_FUNCTION_COUNT 6
527
528 HPI_WATCHDOG_OPEN = HPI_FUNC_ID(WATCHDOG, 1),
529 HPI_WATCHDOG_SET_TIME = HPI_FUNC_ID(WATCHDOG, 2),
530 HPI_WATCHDOG_PING = HPI_FUNC_ID(WATCHDOG, 3),
531
532 HPI_CLOCK_OPEN = HPI_FUNC_ID(CLOCK, 1),
533 HPI_CLOCK_SET_TIME = HPI_FUNC_ID(CLOCK, 2),
534 HPI_CLOCK_GET_TIME = HPI_FUNC_ID(CLOCK, 3),
535
536 HPI_PROFILE_OPEN_ALL = HPI_FUNC_ID(PROFILE, 1),
537 HPI_PROFILE_START_ALL = HPI_FUNC_ID(PROFILE, 2),
538 HPI_PROFILE_STOP_ALL = HPI_FUNC_ID(PROFILE, 3),
539 HPI_PROFILE_GET = HPI_FUNC_ID(PROFILE, 4),
540 HPI_PROFILE_GET_IDLECOUNT = HPI_FUNC_ID(PROFILE, 5),
541 HPI_PROFILE_GET_NAME = HPI_FUNC_ID(PROFILE, 6),
542 HPI_PROFILE_GET_UTILIZATION = HPI_FUNC_ID(PROFILE, 7)
543#define HPI_PROFILE_FUNCTION_COUNT 7
544};
545
546
547
548#ifndef DISABLE_PRAGMA_PACK1
549#pragma pack(push, 1)
550#endif
551
552
553struct hpi_pci {
554 u32 __iomem *ap_mem_base[HPI_MAX_ADAPTER_MEM_SPACES];
555 struct pci_dev *pci_dev;
556};
557
558struct hpi_resource {
559 union {
560 const struct hpi_pci *pci;
561 const char *net_if;
562 } r;
563#ifndef HPI64BIT
564 u32 pad_to64;
565#endif
566 u16 bus_type;
567 u16 padding;
568
569};
570
571
572
573struct hpi_msg_format {
574 u32 sample_rate;
575 u32 bit_rate;
576 u32 attributes;
577 u16 channels;
578 u16 format;
579};
580
581
582
583struct hpi_msg_data {
584 struct hpi_msg_format format;
585 u8 *pb_data;
586#ifndef HPI64BIT
587 u32 padding;
588#endif
589 u32 data_size;
590};
591
592
593struct hpi_data_legacy32 {
594 struct hpi_format format;
595 u32 pb_data;
596 u32 data_size;
597};
598
599#ifdef HPI64BIT
600
601struct hpi_data_compat32 {
602 struct hpi_msg_format format;
603 u32 pb_data;
604 u32 padding;
605 u32 data_size;
606};
607#endif
608
609struct hpi_buffer {
610
611 struct hpi_msg_format reserved;
612 u32 command;
613 u32 pci_address;
614 u32 buffer_size;
615};
616
617
618
619struct hpi_hostbuffer_status {
620 u32 samples_processed;
621 u32 auxiliary_data_available;
622 u32 stream_state;
623
624 u32 dSP_index;
625
626 u32 host_index;
627 u32 size_in_bytes;
628};
629
630struct hpi_streamid {
631 u16 object_type;
632
633 u16 stream_index;
634};
635
636struct hpi_punchinout {
637 u32 punch_in_sample;
638 u32 punch_out_sample;
639};
640
641struct hpi_subsys_msg {
642 struct hpi_resource resource;
643};
644
645struct hpi_subsys_res {
646 u32 version;
647 u32 data;
648 u16 num_adapters;
649 u16 adapter_index;
650 u16 adapter_type;
651 u16 pad16;
652};
653
654union hpi_adapterx_msg {
655 struct {
656 u32 dsp_address;
657 u32 count_bytes;
658 } debug_read;
659 struct {
660 u32 adapter_mode;
661 u16 query_or_set;
662 } mode;
663 struct {
664 u16 index;
665 } module_info;
666 struct {
667 u32 checksum;
668 u16 sequence;
669 u16 length;
670 u16 offset;
671 u16 unused;
672 } program_flash;
673 struct {
674 u16 index;
675 u16 what;
676 u16 property_index;
677 } property_enum;
678 struct {
679 u16 property;
680 u16 parameter1;
681 u16 parameter2;
682 } property_set;
683 struct {
684 u32 offset;
685 } query_flash;
686 struct {
687 u32 pad32;
688 u16 key1;
689 u16 key2;
690 } restart;
691 struct {
692 u32 offset;
693 u32 length;
694 u32 key;
695 } start_flash;
696 struct {
697 u32 pad32;
698 u16 value;
699 } test_assert;
700 struct {
701 u32 yes;
702 } irq_query;
703};
704
705struct hpi_adapter_res {
706 u32 serial_number;
707 u16 adapter_type;
708 u16 adapter_index;
709 u16 num_instreams;
710 u16 num_outstreams;
711 u16 num_mixers;
712 u16 version;
713 u8 sz_adapter_assert[HPI_STRING_LEN];
714};
715
716union hpi_adapterx_res {
717 struct hpi_adapter_res info;
718 struct {
719 u32 p1;
720 u16 count;
721 u16 dsp_index;
722 u32 p2;
723 u32 dsp_msg_addr;
724 char sz_message[HPI_STRING_LEN];
725 } assert;
726 struct {
727 u32 adapter_mode;
728 } mode;
729 struct {
730 u16 sequence;
731 } program_flash;
732 struct {
733 u16 parameter1;
734 u16 parameter2;
735 } property_get;
736 struct {
737 u32 checksum;
738 u32 length;
739 u32 version;
740 } query_flash;
741 struct {
742 u32 yes;
743 } irq_query;
744};
745
746struct hpi_stream_msg {
747 union {
748 struct hpi_msg_data data;
749 struct hpi_data_legacy32 data32;
750 u16 velocity;
751 struct hpi_punchinout pio;
752 u32 time_scale;
753 struct hpi_buffer buffer;
754 struct hpi_streamid stream;
755 u32 threshold_bytes;
756 } u;
757};
758
759struct hpi_stream_res {
760 union {
761 struct {
762
763 u32 buffer_size;
764
765
766 u32 data_available;
767
768
769 u32 samples_transferred;
770
771
772 u32 auxiliary_data_available;
773 u16 state;
774 u16 padding;
775 } stream_info;
776 struct {
777 u32 buffer_size;
778 u32 data_available;
779 u32 samples_transfered;
780 u16 state;
781 u16 outstream_index;
782 u16 instream_index;
783 u16 padding;
784 u32 auxiliary_data_available;
785 } legacy_stream_info;
786 struct {
787
788 u32 outstream_group_map;
789
790 u32 instream_group_map;
791 } group_info;
792 struct {
793
794 u8 *p_buffer;
795
796 struct hpi_hostbuffer_status *p_status;
797 } hostbuffer_info;
798 } u;
799};
800
801struct hpi_mixer_msg {
802 u16 control_index;
803 u16 control_type;
804 u16 padding1;
805 u16 node_type1;
806 u16 node_index1;
807 u16 node_type2;
808 u16 node_index2;
809 u16 padding2;
810};
811
812struct hpi_mixer_res {
813 u16 src_node_type;
814 u16 src_node_index;
815 u16 dst_node_type;
816 u16 dst_node_index;
817
818 u16 control_index;
819
820 u16 dsp_index;
821};
822
823union hpi_mixerx_msg {
824 struct {
825 u16 starting_index;
826 u16 flags;
827 u32 length_in_bytes;
828 u32 p_data;
829 } gcabi;
830 struct {
831 u16 command;
832 u16 index;
833 } store;
834};
835
836union hpi_mixerx_res {
837 struct {
838 u32 bytes_returned;
839 u32 p_data;
840 u16 more_to_do;
841 } gcabi;
842 struct {
843 u32 total_controls;
844 u32 cache_controls;
845 u32 cache_bytes;
846 } cache_info;
847};
848
849struct hpi_control_msg {
850 u16 attribute;
851 u16 saved_index;
852 u32 param1;
853 u32 param2;
854 short an_log_value[HPI_MAX_CHANNELS];
855};
856
857struct hpi_control_union_msg {
858 u16 attribute;
859 u16 saved_index;
860 union {
861 struct {
862 u32 param1;
863 u32 param2;
864 short an_log_value[HPI_MAX_CHANNELS];
865 } old;
866 union {
867 u32 frequency;
868 u32 gain;
869 u32 band;
870 u32 deemphasis;
871 u32 program;
872 struct {
873 u32 mode;
874 u32 value;
875 } mode;
876 u32 blend;
877 } tuner;
878 } u;
879};
880
881struct hpi_control_res {
882
883 u32 param1;
884 u32 param2;
885 short an_log_value[HPI_MAX_CHANNELS];
886};
887
888union hpi_control_union_res {
889 struct {
890 u32 param1;
891 u32 param2;
892 short an_log_value[HPI_MAX_CHANNELS];
893 } old;
894 union {
895 u32 band;
896 u32 frequency;
897 u32 gain;
898 u32 deemphasis;
899 struct {
900 u32 data[2];
901 u32 bLER;
902 } rds;
903 short s_level;
904 struct {
905 u16 value;
906 u16 mask;
907 } status;
908 } tuner;
909 struct {
910 char sz_data[8];
911 u32 remaining_chars;
912 } chars8;
913 char c_data12[12];
914};
915
916
917
918
919
920
921
922struct hpi_controlx_msg_cobranet_data {
923 u32 hmi_address;
924 u32 byte_count;
925 u32 data[2];
926};
927
928
929
930struct hpi_controlx_msg_cobranet_bigdata {
931 u32 hmi_address;
932 u32 byte_count;
933 u8 *pb_data;
934#ifndef HPI64BIT
935 u32 padding;
936#endif
937};
938
939
940
941struct hpi_controlx_msg_pad_data {
942 u32 field;
943 u32 byte_count;
944 u8 *pb_data;
945#ifndef HPI64BIT
946 u32 padding;
947#endif
948};
949
950
951
952
953struct hpi_controlx_msg_generic {
954 u32 param1;
955 u32 param2;
956};
957
958struct hpi_controlx_msg {
959 u16 attribute;
960 u16 saved_index;
961 union {
962 struct hpi_controlx_msg_cobranet_data cobranet_data;
963 struct hpi_controlx_msg_cobranet_bigdata cobranet_bigdata;
964 struct hpi_controlx_msg_generic generic;
965 struct hpi_controlx_msg_pad_data pad_data;
966
967
968 } u;
969};
970
971
972
973
974struct hpi_controlx_res_cobranet_data {
975 u32 byte_count;
976 u32 data[2];
977};
978
979struct hpi_controlx_res_cobranet_bigdata {
980 u32 byte_count;
981};
982
983struct hpi_controlx_res_cobranet_status {
984 u32 status;
985 u32 readable_size;
986 u32 writeable_size;
987};
988
989struct hpi_controlx_res_generic {
990 u32 param1;
991 u32 param2;
992};
993
994struct hpi_controlx_res {
995 union {
996 struct hpi_controlx_res_cobranet_bigdata cobranet_bigdata;
997 struct hpi_controlx_res_cobranet_data cobranet_data;
998 struct hpi_controlx_res_cobranet_status cobranet_status;
999 struct hpi_controlx_res_generic generic;
1000
1001
1002 } u;
1003};
1004
1005struct hpi_nvmemory_msg {
1006 u16 address;
1007 u16 data;
1008};
1009
1010struct hpi_nvmemory_res {
1011 u16 size_in_bytes;
1012 u16 data;
1013};
1014
1015struct hpi_gpio_msg {
1016 u16 bit_index;
1017 u16 bit_data;
1018};
1019
1020struct hpi_gpio_res {
1021 u16 number_input_bits;
1022 u16 number_output_bits;
1023 u16 bit_data[4];
1024};
1025
1026struct hpi_async_msg {
1027 u32 events;
1028 u16 maximum_events;
1029 u16 padding;
1030};
1031
1032struct hpi_async_res {
1033 union {
1034 struct {
1035 u16 count;
1036 } count;
1037 struct {
1038 u32 events;
1039 u16 number_returned;
1040 u16 padding;
1041 } get;
1042 struct hpi_async_event event;
1043 } u;
1044};
1045
1046struct hpi_watchdog_msg {
1047 u32 time_ms;
1048};
1049
1050struct hpi_watchdog_res {
1051 u32 time_ms;
1052};
1053
1054struct hpi_clock_msg {
1055 u16 hours;
1056 u16 minutes;
1057 u16 seconds;
1058 u16 milli_seconds;
1059};
1060
1061struct hpi_clock_res {
1062 u16 size_in_bytes;
1063 u16 hours;
1064 u16 minutes;
1065 u16 seconds;
1066 u16 milli_seconds;
1067 u16 padding;
1068};
1069
1070struct hpi_profile_msg {
1071 u16 bin_index;
1072 u16 padding;
1073};
1074
1075struct hpi_profile_res_open {
1076 u16 max_profiles;
1077};
1078
1079struct hpi_profile_res_time {
1080 u32 total_tick_count;
1081 u32 call_count;
1082 u32 max_tick_count;
1083 u32 ticks_per_millisecond;
1084 u16 profile_interval;
1085};
1086
1087struct hpi_profile_res_name {
1088 u8 sz_name[32];
1089};
1090
1091struct hpi_profile_res {
1092 union {
1093 struct hpi_profile_res_open o;
1094 struct hpi_profile_res_time t;
1095 struct hpi_profile_res_name n;
1096 } u;
1097};
1098
1099struct hpi_message_header {
1100 u16 size;
1101 u8 type;
1102 u8 version;
1103 u16 object;
1104 u16 function;
1105 u16 adapter_index;
1106 u16 obj_index;
1107};
1108
1109struct hpi_message {
1110
1111 u16 size;
1112 u8 type;
1113 u8 version;
1114 u16 object;
1115 u16 function;
1116 u16 adapter_index;
1117 u16 obj_index;
1118 union {
1119 struct hpi_subsys_msg s;
1120 union hpi_adapterx_msg ax;
1121 struct hpi_stream_msg d;
1122 struct hpi_mixer_msg m;
1123 union hpi_mixerx_msg mx;
1124 struct hpi_control_msg c;
1125
1126
1127 struct hpi_control_union_msg cu;
1128 struct hpi_controlx_msg cx;
1129 struct hpi_nvmemory_msg n;
1130 struct hpi_gpio_msg l;
1131 struct hpi_watchdog_msg w;
1132 struct hpi_clock_msg t;
1133 struct hpi_profile_msg p;
1134 struct hpi_async_msg as;
1135 char fixed_size[32];
1136 } u;
1137};
1138
1139#define HPI_MESSAGE_SIZE_BY_OBJECT { \
1140 sizeof(struct hpi_message_header) , \
1141 sizeof(struct hpi_message_header) + sizeof(struct hpi_subsys_msg),\
1142 sizeof(struct hpi_message_header) + sizeof(union hpi_adapterx_msg),\
1143 sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
1144 sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
1145 sizeof(struct hpi_message_header) + sizeof(struct hpi_mixer_msg),\
1146 sizeof(struct hpi_message_header) , \
1147 sizeof(struct hpi_message_header) + sizeof(struct hpi_control_msg),\
1148 sizeof(struct hpi_message_header) + sizeof(struct hpi_nvmemory_msg),\
1149 sizeof(struct hpi_message_header) + sizeof(struct hpi_gpio_msg),\
1150 sizeof(struct hpi_message_header) + sizeof(struct hpi_watchdog_msg),\
1151 sizeof(struct hpi_message_header) + sizeof(struct hpi_clock_msg),\
1152 sizeof(struct hpi_message_header) + sizeof(struct hpi_profile_msg),\
1153 sizeof(struct hpi_message_header) + sizeof(struct hpi_controlx_msg),\
1154 sizeof(struct hpi_message_header) + sizeof(struct hpi_async_msg) \
1155}
1156
1157
1158
1159
1160
1161
1162struct hpi_response_header {
1163 u16 size;
1164 u8 type;
1165 u8 version;
1166 u16 object;
1167 u16 function;
1168 u16 error;
1169 u16 specific_error;
1170};
1171
1172struct hpi_response {
1173
1174 u16 size;
1175 u8 type;
1176 u8 version;
1177 u16 object;
1178 u16 function;
1179 u16 error;
1180 u16 specific_error;
1181 union {
1182 struct hpi_subsys_res s;
1183 union hpi_adapterx_res ax;
1184 struct hpi_stream_res d;
1185 struct hpi_mixer_res m;
1186 union hpi_mixerx_res mx;
1187 struct hpi_control_res c;
1188
1189 union hpi_control_union_res cu;
1190 struct hpi_controlx_res cx;
1191 struct hpi_nvmemory_res n;
1192 struct hpi_gpio_res l;
1193 struct hpi_watchdog_res w;
1194 struct hpi_clock_res t;
1195 struct hpi_profile_res p;
1196 struct hpi_async_res as;
1197 u8 bytes[52];
1198 } u;
1199};
1200
1201#define HPI_RESPONSE_SIZE_BY_OBJECT { \
1202 sizeof(struct hpi_response_header) , \
1203 sizeof(struct hpi_response_header) + sizeof(struct hpi_subsys_res),\
1204 sizeof(struct hpi_response_header) + sizeof(union hpi_adapterx_res),\
1205 sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
1206 sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
1207 sizeof(struct hpi_response_header) + sizeof(struct hpi_mixer_res),\
1208 sizeof(struct hpi_response_header) , \
1209 sizeof(struct hpi_response_header) + sizeof(struct hpi_control_res),\
1210 sizeof(struct hpi_response_header) + sizeof(struct hpi_nvmemory_res),\
1211 sizeof(struct hpi_response_header) + sizeof(struct hpi_gpio_res),\
1212 sizeof(struct hpi_response_header) + sizeof(struct hpi_watchdog_res),\
1213 sizeof(struct hpi_response_header) + sizeof(struct hpi_clock_res),\
1214 sizeof(struct hpi_response_header) + sizeof(struct hpi_profile_res),\
1215 sizeof(struct hpi_response_header) + sizeof(struct hpi_controlx_res),\
1216 sizeof(struct hpi_response_header) + sizeof(struct hpi_async_res) \
1217}
1218
1219
1220#define HPINET_ETHERNET_DATA_SIZE (1500)
1221#define HPINET_IP_HDR_SIZE (20)
1222#define HPINET_IP_DATA_SIZE (HPINET_ETHERNET_DATA_SIZE - HPINET_IP_HDR_SIZE)
1223#define HPINET_UDP_HDR_SIZE (8)
1224#define HPINET_UDP_DATA_SIZE (HPINET_IP_DATA_SIZE - HPINET_UDP_HDR_SIZE)
1225#define HPINET_ASI_HDR_SIZE (2)
1226#define HPINET_ASI_DATA_SIZE (HPINET_UDP_DATA_SIZE - HPINET_ASI_HDR_SIZE)
1227
1228#define HPI_MAX_PAYLOAD_SIZE (HPINET_ASI_DATA_SIZE - 2)
1229
1230
1231struct hpi_msg_adapter_get_info {
1232 struct hpi_message_header h;
1233};
1234
1235struct hpi_res_adapter_get_info {
1236 struct hpi_response_header h;
1237 struct hpi_adapter_res p;
1238};
1239
1240
1241struct hpi_msg_adapter_query_flash {
1242 struct hpi_message_header h;
1243 u32 offset;
1244 u8 pad_to_version0_size[sizeof(struct hpi_message) -
1245 sizeof(struct hpi_message_header) - 1 * sizeof(u32)];
1246};
1247
1248
1249struct hpi_res_adapter_query_flash {
1250 struct hpi_response_header h;
1251 u32 checksum;
1252 u32 length;
1253 u32 version;
1254 u8 pad_to_version0_size[sizeof(struct hpi_response) -
1255 sizeof(struct hpi_response_header) - 3 * sizeof(u32)];
1256};
1257
1258struct hpi_msg_adapter_start_flash {
1259 struct hpi_message_header h;
1260 u32 offset;
1261 u32 length;
1262 u32 key;
1263 u8 pad_to_version0_size[sizeof(struct hpi_message) -
1264 sizeof(struct hpi_message_header) - 3 * sizeof(u32)];
1265};
1266
1267struct hpi_res_adapter_start_flash {
1268 struct hpi_response_header h;
1269 u8 pad_to_version0_size[sizeof(struct hpi_response) -
1270 sizeof(struct hpi_response_header)];
1271};
1272
1273struct hpi_msg_adapter_program_flash_payload {
1274 u32 checksum;
1275 u16 sequence;
1276 u16 length;
1277 u16 offset;
1278 u16 unused;
1279
1280
1281 u8 pad_to_version0_size[sizeof(struct hpi_message) -
1282 sizeof(struct hpi_message_header) - sizeof(u32) -
1283 4 * sizeof(u16)];
1284};
1285
1286struct hpi_msg_adapter_program_flash {
1287 struct hpi_message_header h;
1288 struct hpi_msg_adapter_program_flash_payload p;
1289 u32 data[256];
1290};
1291
1292struct hpi_res_adapter_program_flash {
1293 struct hpi_response_header h;
1294 u16 sequence;
1295 u8 pad_to_version0_size[sizeof(struct hpi_response) -
1296 sizeof(struct hpi_response_header) - sizeof(u16)];
1297};
1298
1299struct hpi_msg_adapter_debug_read {
1300 struct hpi_message_header h;
1301 u32 dsp_address;
1302 u32 count_bytes;
1303};
1304
1305struct hpi_res_adapter_debug_read {
1306 struct hpi_response_header h;
1307 u8 bytes[256];
1308};
1309
1310#if 1
1311#define hpi_message_header_v1 hpi_message_header
1312#define hpi_response_header_v1 hpi_response_header
1313#else
1314
1315struct hpi_message_header_v1 {
1316 struct hpi_message_header h0;
1317
1318
1319};
1320
1321struct hpi_response_header_v1 {
1322 struct hpi_response_header h0;
1323 struct {
1324 u16 adapter_index;
1325 u16 obj_index;
1326 } h1;
1327};
1328#endif
1329
1330struct hpi_msg_payload_v0 {
1331 struct hpi_message_header h;
1332 union {
1333 struct hpi_subsys_msg s;
1334 union hpi_adapterx_msg ax;
1335 struct hpi_stream_msg d;
1336 struct hpi_mixer_msg m;
1337 union hpi_mixerx_msg mx;
1338 struct hpi_control_msg c;
1339 struct hpi_control_union_msg cu;
1340 struct hpi_controlx_msg cx;
1341 struct hpi_nvmemory_msg n;
1342 struct hpi_gpio_msg l;
1343 struct hpi_watchdog_msg w;
1344 struct hpi_clock_msg t;
1345 struct hpi_profile_msg p;
1346 struct hpi_async_msg as;
1347 } u;
1348};
1349
1350struct hpi_res_payload_v0 {
1351 struct hpi_response_header h;
1352 union {
1353 struct hpi_subsys_res s;
1354 union hpi_adapterx_res ax;
1355 struct hpi_stream_res d;
1356 struct hpi_mixer_res m;
1357 union hpi_mixerx_res mx;
1358 struct hpi_control_res c;
1359 union hpi_control_union_res cu;
1360 struct hpi_controlx_res cx;
1361 struct hpi_nvmemory_res n;
1362 struct hpi_gpio_res l;
1363 struct hpi_watchdog_res w;
1364 struct hpi_clock_res t;
1365 struct hpi_profile_res p;
1366 struct hpi_async_res as;
1367 } u;
1368};
1369
1370union hpi_message_buffer_v1 {
1371 struct hpi_message m0;
1372 struct hpi_message_header_v1 h;
1373 u8 buf[HPI_MAX_PAYLOAD_SIZE];
1374};
1375
1376union hpi_response_buffer_v1 {
1377 struct hpi_response r0;
1378 struct hpi_response_header_v1 h;
1379 u8 buf[HPI_MAX_PAYLOAD_SIZE];
1380};
1381
1382compile_time_assert((sizeof(union hpi_message_buffer_v1) <=
1383 HPI_MAX_PAYLOAD_SIZE), message_buffer_ok);
1384compile_time_assert((sizeof(union hpi_response_buffer_v1) <=
1385 HPI_MAX_PAYLOAD_SIZE), response_buffer_ok);
1386
1387
1388
1389struct hpi_control_defn {
1390 u8 type;
1391 u8 channels;
1392 u8 src_node_type;
1393 u8 src_node_index;
1394 u8 dest_node_type;
1395 u8 dest_node_index;
1396};
1397
1398
1399
1400
1401
1402#define HPI_CACHE_INVALID_UINT16 0xFFFF
1403
1404#define HPI_CACHE_INVALID_SHORT -32768
1405
1406
1407
1408
1409
1410struct hpi_control_cache_info {
1411
1412 u8 control_type;
1413
1414 u8 size_in32bit_words;
1415
1416 u16 control_index;
1417};
1418
1419struct hpi_control_cache_vol {
1420 struct hpi_control_cache_info i;
1421 short an_log[2];
1422 unsigned short flags;
1423 char padding[2];
1424};
1425
1426struct hpi_control_cache_meter {
1427 struct hpi_control_cache_info i;
1428 short an_log_peak[2];
1429 short an_logRMS[2];
1430};
1431
1432struct hpi_control_cache_channelmode {
1433 struct hpi_control_cache_info i;
1434 u16 mode;
1435 char temp_padding[6];
1436};
1437
1438struct hpi_control_cache_mux {
1439 struct hpi_control_cache_info i;
1440 u16 source_node_type;
1441 u16 source_node_index;
1442 char temp_padding[4];
1443};
1444
1445struct hpi_control_cache_level {
1446 struct hpi_control_cache_info i;
1447 short an_log[2];
1448 char temp_padding[4];
1449};
1450
1451struct hpi_control_cache_tuner {
1452 struct hpi_control_cache_info i;
1453 u32 freq_ink_hz;
1454 u16 band;
1455 short s_level_avg;
1456};
1457
1458struct hpi_control_cache_aes3rx {
1459 struct hpi_control_cache_info i;
1460 u32 error_status;
1461 u32 format;
1462};
1463
1464struct hpi_control_cache_aes3tx {
1465 struct hpi_control_cache_info i;
1466 u32 format;
1467 char temp_padding[4];
1468};
1469
1470struct hpi_control_cache_tonedetector {
1471 struct hpi_control_cache_info i;
1472 u16 state;
1473 char temp_padding[6];
1474};
1475
1476struct hpi_control_cache_silencedetector {
1477 struct hpi_control_cache_info i;
1478 u32 state;
1479 char temp_padding[4];
1480};
1481
1482struct hpi_control_cache_sampleclock {
1483 struct hpi_control_cache_info i;
1484 u16 source;
1485 u16 source_index;
1486 u32 sample_rate;
1487};
1488
1489struct hpi_control_cache_microphone {
1490 struct hpi_control_cache_info i;
1491 u16 phantom_state;
1492 char temp_padding[6];
1493};
1494
1495struct hpi_control_cache_generic {
1496 struct hpi_control_cache_info i;
1497 u32 dw1;
1498 u32 dw2;
1499};
1500
1501struct hpi_control_cache_single {
1502 union {
1503 struct hpi_control_cache_info i;
1504 struct hpi_control_cache_vol vol;
1505 struct hpi_control_cache_meter meter;
1506 struct hpi_control_cache_channelmode mode;
1507 struct hpi_control_cache_mux mux;
1508 struct hpi_control_cache_level level;
1509 struct hpi_control_cache_tuner tuner;
1510 struct hpi_control_cache_aes3rx aes3rx;
1511 struct hpi_control_cache_aes3tx aes3tx;
1512 struct hpi_control_cache_tonedetector tone;
1513 struct hpi_control_cache_silencedetector silence;
1514 struct hpi_control_cache_sampleclock clk;
1515 struct hpi_control_cache_microphone microphone;
1516 struct hpi_control_cache_generic generic;
1517 } u;
1518};
1519
1520struct hpi_control_cache_pad {
1521 struct hpi_control_cache_info i;
1522 u32 field_valid_flags;
1523 u8 c_channel[8];
1524 u8 c_artist[40];
1525 u8 c_title[40];
1526 u8 c_comment[200];
1527 u32 pTY;
1528 u32 pI;
1529 u32 traffic_supported;
1530 u32 traffic_anouncement;
1531};
1532
1533
1534struct hpi_fifo_buffer {
1535 u32 size;
1536 u32 dSP_index;
1537 u32 host_index;
1538};
1539
1540#ifndef DISABLE_PRAGMA_PACK1
1541#pragma pack(pop)
1542#endif
1543
1544
1545
1546
1547char hpi_handle_object(const u32 handle);
1548
1549void hpi_handle_to_indexes(const u32 handle, u16 *pw_adapter_index,
1550 u16 *pw_object_index);
1551
1552u32 hpi_indexes_to_handle(const char c_object, const u16 adapter_index,
1553 const u16 object_index);
1554
1555
1556
1557
1558void hpi_send_recv(struct hpi_message *phm, struct hpi_response *phr);
1559
1560
1561u16 hpi_subsys_create_adapter(const struct hpi_resource *p_resource,
1562 u16 *pw_adapter_index);
1563
1564u16 hpi_subsys_delete_adapter(u16 adapter_index);
1565
1566u16 hpi_outstream_host_buffer_get_info(u32 h_outstream, u8 **pp_buffer,
1567 struct hpi_hostbuffer_status **pp_status);
1568
1569u16 hpi_instream_host_buffer_get_info(u32 h_instream, u8 **pp_buffer,
1570 struct hpi_hostbuffer_status **pp_status);
1571
1572u16 hpi_adapter_restart(u16 adapter_index);
1573
1574
1575
1576
1577
1578
1579
1580
1581void hpi_format_to_msg(struct hpi_msg_format *pMF,
1582 const struct hpi_format *pF);
1583void hpi_stream_response_to_legacy(struct hpi_stream_res *pSR);
1584
1585
1586
1587hpi_handler_func HPI_1000;
1588hpi_handler_func HPI_6000;
1589hpi_handler_func HPI_6205;
1590hpi_handler_func HPI_COMMON;
1591
1592#endif
1593