1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /******************************************************************************
4 AudioScience HPI driver
8 HPI internal definitions
10 (C) Copyright AudioScience Inc. 1996-2009
11 ******************************************************************************/
13 #ifndef _HPI_INTERNAL_H_
14 #define _HPI_INTERNAL_H_
18 /** maximum number of memory regions mapped to an adapter */
19 #define HPI_MAX_ADAPTER_MEM_SPACES (2)
21 /* Each OS needs its own hpios.h */
24 /* physical memory allocation */
26 /** Allocate and map an area of locked memory for bus master DMA operations.
28 On success, *pLockedMemeHandle is a valid handle, and 0 is returned
29 On error *pLockedMemHandle marked invalid, non-zero returned.
31 If this function succeeds, then HpiOs_LockedMem_GetVirtAddr() and
32 HpiOs_LockedMem_GetPyhsAddr() will always succed on the returned handle.
34 u16 hpios_locked_mem_alloc(struct consistent_dma_area *p_locked_mem_handle,
36 u32 size, /**< Size in bytes to allocate */
37 struct pci_dev *p_os_reference
38 /**< OS specific data required for memory allocation */
41 /** Free mapping and memory represented by LockedMemHandle
43 Frees any resources, then invalidates the handle.
44 Returns 0 on success, 1 if handle is invalid.
47 u16 hpios_locked_mem_free(struct consistent_dma_area *locked_mem_handle);
49 /** Get the physical PCI address of memory represented by LockedMemHandle.
51 If handle is invalid *pPhysicalAddr is set to zero and return 1
53 u16 hpios_locked_mem_get_phys_addr(struct consistent_dma_area
54 *locked_mem_handle, u32 *p_physical_addr);
56 /** Get the CPU address of memory represented by LockedMemHandle.
58 If handle is NULL *ppvVirtualAddr is set to NULL and return 1
60 u16 hpios_locked_mem_get_virt_addr(struct consistent_dma_area
61 *locked_mem_handle, void **ppv_virtual_addr);
63 /** Check that handle is valid
64 i.e it represents a valid memory area
66 u16 hpios_locked_mem_valid(struct consistent_dma_area *locked_mem_handle);
69 void hpios_delay_micro_seconds(u32 num_micro_sec);
74 typedef void hpi_handler_func(struct hpi_message *, struct hpi_response *);
76 /* If the assert fails, compiler complains
77 something like size of array `msg' is negative.
78 Unlike linux BUILD_BUG_ON, this works outside function scope.
80 #define compile_time_assert(cond, msg) \
81 typedef char ASSERT_##msg[(cond) ? 1 : -1]
83 /******************************************* bus types */
91 enum HPI_SUBSYS_OPTIONS {
92 /* 0, 256 are invalid, 1..255 reserved for global options */
93 HPI_SUBSYS_OPT_NET_ENABLE = 257,
94 HPI_SUBSYS_OPT_NET_BROADCAST = 258,
95 HPI_SUBSYS_OPT_NET_UNICAST = 259,
96 HPI_SUBSYS_OPT_NET_ADDR = 260,
97 HPI_SUBSYS_OPT_NET_MASK = 261,
98 HPI_SUBSYS_OPT_NET_ADAPTER_ADDRESS_ADD = 262
103 enum HPI_VOLUME_FLAGS {
104 /** Set if the volume control is muted */
105 HPI_VOLUME_FLAG_MUTED = (1 << 0),
106 /** Set if the volume control has a mute function */
107 HPI_VOLUME_FLAG_HAS_MUTE = (1 << 1),
108 /** Set if volume control can do autofading */
109 HPI_VOLUME_FLAG_HAS_AUTOFADE = (1 << 2)
110 /* Note Flags >= (1<<8) are for DSP internal use only */
113 /******************************************* CONTROL ATTRIBUTES ****/
114 /* (in order of control type ID */
116 /* This allows for 255 control types, 256 unique attributes each */
117 #define HPI_CTL_ATTR(ctl, ai) ((HPI_CONTROL_##ctl << 8) + ai)
119 /* Get the sub-index of the attribute for a control type */
120 #define HPI_CTL_ATTR_INDEX(i) (i & 0xff)
122 /* Extract the control from the control attribute */
123 #define HPI_CTL_ATTR_CONTROL(i) (i >> 8)
125 /** Enable event generation for a control.
127 \note generic to all controls that can generate events
130 /** Unique identifiers for every control attribute
132 enum HPI_CONTROL_ATTRIBUTES {
133 HPI_GENERIC_ENABLE = HPI_CTL_ATTR(GENERIC, 1),
134 HPI_GENERIC_EVENT_ENABLE = HPI_CTL_ATTR(GENERIC, 2),
136 HPI_VOLUME_GAIN = HPI_CTL_ATTR(VOLUME, 1),
137 HPI_VOLUME_AUTOFADE = HPI_CTL_ATTR(VOLUME, 2),
138 HPI_VOLUME_MUTE = HPI_CTL_ATTR(VOLUME, 3),
139 HPI_VOLUME_GAIN_AND_FLAGS = HPI_CTL_ATTR(VOLUME, 4),
140 HPI_VOLUME_NUM_CHANNELS = HPI_CTL_ATTR(VOLUME, 6),
141 HPI_VOLUME_RANGE = HPI_CTL_ATTR(VOLUME, 10),
143 HPI_METER_RMS = HPI_CTL_ATTR(METER, 1),
144 HPI_METER_PEAK = HPI_CTL_ATTR(METER, 2),
145 HPI_METER_RMS_BALLISTICS = HPI_CTL_ATTR(METER, 3),
146 HPI_METER_PEAK_BALLISTICS = HPI_CTL_ATTR(METER, 4),
147 HPI_METER_NUM_CHANNELS = HPI_CTL_ATTR(METER, 5),
149 HPI_MULTIPLEXER_SOURCE = HPI_CTL_ATTR(MULTIPLEXER, 1),
150 HPI_MULTIPLEXER_QUERYSOURCE = HPI_CTL_ATTR(MULTIPLEXER, 2),
152 HPI_AESEBUTX_FORMAT = HPI_CTL_ATTR(AESEBUTX, 1),
153 HPI_AESEBUTX_SAMPLERATE = HPI_CTL_ATTR(AESEBUTX, 3),
154 HPI_AESEBUTX_CHANNELSTATUS = HPI_CTL_ATTR(AESEBUTX, 4),
155 HPI_AESEBUTX_USERDATA = HPI_CTL_ATTR(AESEBUTX, 5),
157 HPI_AESEBURX_FORMAT = HPI_CTL_ATTR(AESEBURX, 1),
158 HPI_AESEBURX_ERRORSTATUS = HPI_CTL_ATTR(AESEBURX, 2),
159 HPI_AESEBURX_SAMPLERATE = HPI_CTL_ATTR(AESEBURX, 3),
160 HPI_AESEBURX_CHANNELSTATUS = HPI_CTL_ATTR(AESEBURX, 4),
161 HPI_AESEBURX_USERDATA = HPI_CTL_ATTR(AESEBURX, 5),
163 HPI_LEVEL_GAIN = HPI_CTL_ATTR(LEVEL, 1),
164 HPI_LEVEL_RANGE = HPI_CTL_ATTR(LEVEL, 10),
166 HPI_TUNER_BAND = HPI_CTL_ATTR(TUNER, 1),
167 HPI_TUNER_FREQ = HPI_CTL_ATTR(TUNER, 2),
168 HPI_TUNER_LEVEL_AVG = HPI_CTL_ATTR(TUNER, 3),
169 HPI_TUNER_LEVEL_RAW = HPI_CTL_ATTR(TUNER, 4),
170 HPI_TUNER_SNR = HPI_CTL_ATTR(TUNER, 5),
171 HPI_TUNER_GAIN = HPI_CTL_ATTR(TUNER, 6),
172 HPI_TUNER_STATUS = HPI_CTL_ATTR(TUNER, 7),
173 HPI_TUNER_MODE = HPI_CTL_ATTR(TUNER, 8),
174 HPI_TUNER_RDS = HPI_CTL_ATTR(TUNER, 9),
175 HPI_TUNER_DEEMPHASIS = HPI_CTL_ATTR(TUNER, 10),
176 HPI_TUNER_PROGRAM = HPI_CTL_ATTR(TUNER, 11),
177 HPI_TUNER_HDRADIO_SIGNAL_QUALITY = HPI_CTL_ATTR(TUNER, 12),
178 HPI_TUNER_HDRADIO_SDK_VERSION = HPI_CTL_ATTR(TUNER, 13),
179 HPI_TUNER_HDRADIO_DSP_VERSION = HPI_CTL_ATTR(TUNER, 14),
180 HPI_TUNER_HDRADIO_BLEND = HPI_CTL_ATTR(TUNER, 15),
182 HPI_VOX_THRESHOLD = HPI_CTL_ATTR(VOX, 1),
184 HPI_CHANNEL_MODE_MODE = HPI_CTL_ATTR(CHANNEL_MODE, 1),
186 HPI_BITSTREAM_DATA_POLARITY = HPI_CTL_ATTR(BITSTREAM, 1),
187 HPI_BITSTREAM_CLOCK_EDGE = HPI_CTL_ATTR(BITSTREAM, 2),
188 HPI_BITSTREAM_CLOCK_SOURCE = HPI_CTL_ATTR(BITSTREAM, 3),
189 HPI_BITSTREAM_ACTIVITY = HPI_CTL_ATTR(BITSTREAM, 4),
191 HPI_SAMPLECLOCK_SOURCE = HPI_CTL_ATTR(SAMPLECLOCK, 1),
192 HPI_SAMPLECLOCK_SAMPLERATE = HPI_CTL_ATTR(SAMPLECLOCK, 2),
193 HPI_SAMPLECLOCK_SOURCE_INDEX = HPI_CTL_ATTR(SAMPLECLOCK, 3),
194 HPI_SAMPLECLOCK_LOCAL_SAMPLERATE = HPI_CTL_ATTR(SAMPLECLOCK, 4),
195 HPI_SAMPLECLOCK_AUTO = HPI_CTL_ATTR(SAMPLECLOCK, 5),
196 HPI_SAMPLECLOCK_LOCAL_LOCK = HPI_CTL_ATTR(SAMPLECLOCK, 6),
198 HPI_MICROPHONE_PHANTOM_POWER = HPI_CTL_ATTR(MICROPHONE, 1),
200 HPI_EQUALIZER_NUM_FILTERS = HPI_CTL_ATTR(EQUALIZER, 1),
201 HPI_EQUALIZER_FILTER = HPI_CTL_ATTR(EQUALIZER, 2),
202 HPI_EQUALIZER_COEFFICIENTS = HPI_CTL_ATTR(EQUALIZER, 3),
204 HPI_COMPANDER_PARAMS = HPI_CTL_ATTR(COMPANDER, 1),
205 HPI_COMPANDER_MAKEUPGAIN = HPI_CTL_ATTR(COMPANDER, 2),
206 HPI_COMPANDER_THRESHOLD = HPI_CTL_ATTR(COMPANDER, 3),
207 HPI_COMPANDER_RATIO = HPI_CTL_ATTR(COMPANDER, 4),
208 HPI_COMPANDER_ATTACK = HPI_CTL_ATTR(COMPANDER, 5),
209 HPI_COMPANDER_DECAY = HPI_CTL_ATTR(COMPANDER, 6),
211 HPI_COBRANET_SET = HPI_CTL_ATTR(COBRANET, 1),
212 HPI_COBRANET_GET = HPI_CTL_ATTR(COBRANET, 2),
213 HPI_COBRANET_GET_STATUS = HPI_CTL_ATTR(COBRANET, 5),
214 HPI_COBRANET_SEND_PACKET = HPI_CTL_ATTR(COBRANET, 6),
215 HPI_COBRANET_GET_PACKET = HPI_CTL_ATTR(COBRANET, 7),
217 HPI_TONEDETECTOR_THRESHOLD = HPI_CTL_ATTR(TONEDETECTOR, 1),
218 HPI_TONEDETECTOR_STATE = HPI_CTL_ATTR(TONEDETECTOR, 2),
219 HPI_TONEDETECTOR_FREQUENCY = HPI_CTL_ATTR(TONEDETECTOR, 3),
221 HPI_SILENCEDETECTOR_THRESHOLD = HPI_CTL_ATTR(SILENCEDETECTOR, 1),
222 HPI_SILENCEDETECTOR_STATE = HPI_CTL_ATTR(SILENCEDETECTOR, 2),
223 HPI_SILENCEDETECTOR_DELAY = HPI_CTL_ATTR(SILENCEDETECTOR, 3),
225 HPI_PAD_CHANNEL_NAME = HPI_CTL_ATTR(PAD, 1),
226 HPI_PAD_ARTIST = HPI_CTL_ATTR(PAD, 2),
227 HPI_PAD_TITLE = HPI_CTL_ATTR(PAD, 3),
228 HPI_PAD_COMMENT = HPI_CTL_ATTR(PAD, 4),
229 HPI_PAD_PROGRAM_TYPE = HPI_CTL_ATTR(PAD, 5),
230 HPI_PAD_PROGRAM_ID = HPI_CTL_ATTR(PAD, 6),
231 HPI_PAD_TA_SUPPORT = HPI_CTL_ATTR(PAD, 7),
232 HPI_PAD_TA_ACTIVE = HPI_CTL_ATTR(PAD, 8),
234 HPI_UNIVERSAL_ENTITY = HPI_CTL_ATTR(UNIVERSAL, 1)
237 #define HPI_POLARITY_POSITIVE 0
238 #define HPI_POLARITY_NEGATIVE 1
240 /*------------------------------------------------------------
241 Cobranet Chip Bridge - copied from HMI.H
242 ------------------------------------------------------------*/
243 #define HPI_COBRANET_HMI_cobra_bridge 0x20000
244 #define HPI_COBRANET_HMI_cobra_bridge_tx_pkt_buf \
245 (HPI_COBRANET_HMI_cobra_bridge + 0x1000)
246 #define HPI_COBRANET_HMI_cobra_bridge_rx_pkt_buf \
247 (HPI_COBRANET_HMI_cobra_bridge + 0x2000)
248 #define HPI_COBRANET_HMI_cobra_if_table1 0x110000
249 #define HPI_COBRANET_HMI_cobra_if_phy_address \
250 (HPI_COBRANET_HMI_cobra_if_table1 + 0xd)
251 #define HPI_COBRANET_HMI_cobra_protocolIP 0x72000
252 #define HPI_COBRANET_HMI_cobra_ip_mon_currentIP \
253 (HPI_COBRANET_HMI_cobra_protocolIP + 0x0)
254 #define HPI_COBRANET_HMI_cobra_ip_mon_staticIP \
255 (HPI_COBRANET_HMI_cobra_protocolIP + 0x2)
256 #define HPI_COBRANET_HMI_cobra_sys 0x100000
257 #define HPI_COBRANET_HMI_cobra_sys_desc \
258 (HPI_COBRANET_HMI_cobra_sys + 0x0)
259 #define HPI_COBRANET_HMI_cobra_sys_objectID \
260 (HPI_COBRANET_HMI_cobra_sys + 0x100)
261 #define HPI_COBRANET_HMI_cobra_sys_contact \
262 (HPI_COBRANET_HMI_cobra_sys + 0x200)
263 #define HPI_COBRANET_HMI_cobra_sys_name \
264 (HPI_COBRANET_HMI_cobra_sys + 0x300)
265 #define HPI_COBRANET_HMI_cobra_sys_location \
266 (HPI_COBRANET_HMI_cobra_sys + 0x400)
268 /*------------------------------------------------------------
269 Cobranet Chip Status bits
270 ------------------------------------------------------------*/
271 #define HPI_COBRANET_HMI_STATUS_RXPACKET 2
272 #define HPI_COBRANET_HMI_STATUS_TXPACKET 3
274 /*------------------------------------------------------------
276 ------------------------------------------------------------*/
277 #define HPI_ETHERNET_HEADER_SIZE (16)
279 /* These defines are used to fill in protocol information for an Ethernet packet
280 sent using HMI on CS18102 */
281 /** ID supplied by Cirrus for ASI packets. */
282 #define HPI_ETHERNET_PACKET_ID 0x85
283 /** Simple packet - no special routing required */
284 #define HPI_ETHERNET_PACKET_V1 0x01
285 /** This packet must make its way to the host across the HPI interface */
286 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI 0x20
287 /** This packet must make its way to the host across the HPI interface */
288 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI_V1 0x21
289 /** This packet must make its way to the host across the HPI interface */
290 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI 0x40
291 /** This packet must make its way to the host across the HPI interface */
292 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI_V1 0x41
294 #define HPI_ETHERNET_UDP_PORT 44600 /**< HPI UDP service */
296 /** Default network timeout in milli-seconds. */
297 #define HPI_ETHERNET_TIMEOUT_MS 500
299 /** Locked memory buffer alloc/free phases */
300 enum HPI_BUFFER_CMDS {
301 /** use one message to allocate or free physical memory */
302 HPI_BUFFER_CMD_EXTERNAL = 0,
303 /** alloc physical memory */
304 HPI_BUFFER_CMD_INTERNAL_ALLOC = 1,
305 /** send physical memory address to adapter */
306 HPI_BUFFER_CMD_INTERNAL_GRANTADAPTER = 2,
307 /** notify adapter to stop using physical buffer */
308 HPI_BUFFER_CMD_INTERNAL_REVOKEADAPTER = 3,
309 /** free physical buffer */
310 HPI_BUFFER_CMD_INTERNAL_FREE = 4
313 /*****************************************************************************/
314 /*****************************************************************************/
315 /******** HPI LOW LEVEL MESSAGES *******/
316 /*****************************************************************************/
317 /*****************************************************************************/
319 /** "ASI" - actual is "ASX" - need to change */
320 #define HPI_ID_ISAPNP_AUDIOSCIENCE 0x0669
321 /** PCI vendor ID that AudioScience uses */
322 #define HPI_PCI_VENDOR_ID_AUDIOSCIENCE 0x175C
323 /** PCI vendor ID that the DSP56301 has */
324 #define HPI_PCI_VENDOR_ID_MOTOROLA 0x1057
325 /** PCI vendor ID that TI uses */
326 #define HPI_PCI_VENDOR_ID_TI 0x104C
328 #define HPI_PCI_DEV_ID_PCI2040 0xAC60
329 /** TI's C6205 PCI interface has this ID */
330 #define HPI_PCI_DEV_ID_DSP6205 0xA106
332 #define HPI_USB_VENDOR_ID_AUDIOSCIENCE 0x1257
333 #define HPI_USB_W2K_TAG 0x57495341 /* "ASIW" */
334 #define HPI_USB_LINUX_TAG 0x4C495341 /* "ASIL" */
336 /** Invalid Adapter index
337 Used in HPI messages that are not addressed to a specific adapter
338 Used in DLL to indicate device not present
340 #define HPI_ADAPTER_INDEX_INVALID 0xFFFF
342 /** First 2 hex digits define the adapter family */
343 #define HPI_ADAPTER_FAMILY_MASK 0xff00
344 #define HPI_MODULE_FAMILY_MASK 0xfff0
346 #define HPI_ADAPTER_FAMILY_ASI(f) (f & HPI_ADAPTER_FAMILY_MASK)
347 #define HPI_MODULE_FAMILY_ASI(f) (f & HPI_MODULE_FAMILY_MASK)
348 #define HPI_ADAPTER_ASI(f) (f)
350 enum HPI_MESSAGE_TYPES {
351 HPI_TYPE_REQUEST = 1,
352 HPI_TYPE_RESPONSE = 2,
354 HPI_TYPE_SSX2BYPASS_MESSAGE = 4,
355 HPI_TYPE_COMMAND = 5,
356 HPI_TYPE_NOTIFICATION = 6
359 enum HPI_OBJECT_TYPES {
360 HPI_OBJ_SUBSYSTEM = 1,
367 HPI_OBJ_NVMEMORY = 8,
369 HPI_OBJ_WATCHDOG = 10,
371 HPI_OBJ_PROFILE = 12,
372 /* HPI_ OBJ_ CONTROLEX = 13, */
373 HPI_OBJ_ASYNCEVENT = 14
374 #define HPI_OBJ_MAXINDEX 14
377 #define HPI_OBJ_FUNCTION_SPACING 0x100
378 #define HPI_FUNC_ID(obj, i) (HPI_OBJ_##obj * HPI_OBJ_FUNCTION_SPACING + i)
380 #define HPI_EXTRACT_INDEX(fn) (fn & 0xff)
382 enum HPI_FUNCTION_IDS {
383 HPI_SUBSYS_OPEN = HPI_FUNC_ID(SUBSYSTEM, 1),
384 HPI_SUBSYS_GET_VERSION = HPI_FUNC_ID(SUBSYSTEM, 2),
385 HPI_SUBSYS_GET_INFO = HPI_FUNC_ID(SUBSYSTEM, 3),
386 HPI_SUBSYS_CREATE_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 5),
387 HPI_SUBSYS_CLOSE = HPI_FUNC_ID(SUBSYSTEM, 6),
388 HPI_SUBSYS_DRIVER_LOAD = HPI_FUNC_ID(SUBSYSTEM, 8),
389 HPI_SUBSYS_DRIVER_UNLOAD = HPI_FUNC_ID(SUBSYSTEM, 9),
390 HPI_SUBSYS_GET_NUM_ADAPTERS = HPI_FUNC_ID(SUBSYSTEM, 12),
391 HPI_SUBSYS_GET_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 13),
392 HPI_SUBSYS_SET_NETWORK_INTERFACE = HPI_FUNC_ID(SUBSYSTEM, 14),
393 HPI_SUBSYS_OPTION_INFO = HPI_FUNC_ID(SUBSYSTEM, 15),
394 HPI_SUBSYS_OPTION_GET = HPI_FUNC_ID(SUBSYSTEM, 16),
395 HPI_SUBSYS_OPTION_SET = HPI_FUNC_ID(SUBSYSTEM, 17),
396 #define HPI_SUBSYS_FUNCTION_COUNT 17
398 HPI_ADAPTER_OPEN = HPI_FUNC_ID(ADAPTER, 1),
399 HPI_ADAPTER_CLOSE = HPI_FUNC_ID(ADAPTER, 2),
400 HPI_ADAPTER_GET_INFO = HPI_FUNC_ID(ADAPTER, 3),
401 HPI_ADAPTER_GET_ASSERT = HPI_FUNC_ID(ADAPTER, 4),
402 HPI_ADAPTER_TEST_ASSERT = HPI_FUNC_ID(ADAPTER, 5),
403 HPI_ADAPTER_SET_MODE = HPI_FUNC_ID(ADAPTER, 6),
404 HPI_ADAPTER_GET_MODE = HPI_FUNC_ID(ADAPTER, 7),
405 HPI_ADAPTER_ENABLE_CAPABILITY = HPI_FUNC_ID(ADAPTER, 8),
406 HPI_ADAPTER_SELFTEST = HPI_FUNC_ID(ADAPTER, 9),
407 HPI_ADAPTER_FIND_OBJECT = HPI_FUNC_ID(ADAPTER, 10),
408 HPI_ADAPTER_QUERY_FLASH = HPI_FUNC_ID(ADAPTER, 11),
409 HPI_ADAPTER_START_FLASH = HPI_FUNC_ID(ADAPTER, 12),
410 HPI_ADAPTER_PROGRAM_FLASH = HPI_FUNC_ID(ADAPTER, 13),
411 HPI_ADAPTER_SET_PROPERTY = HPI_FUNC_ID(ADAPTER, 14),
412 HPI_ADAPTER_GET_PROPERTY = HPI_FUNC_ID(ADAPTER, 15),
413 HPI_ADAPTER_ENUM_PROPERTY = HPI_FUNC_ID(ADAPTER, 16),
414 HPI_ADAPTER_MODULE_INFO = HPI_FUNC_ID(ADAPTER, 17),
415 HPI_ADAPTER_DEBUG_READ = HPI_FUNC_ID(ADAPTER, 18),
416 HPI_ADAPTER_IRQ_QUERY_AND_CLEAR = HPI_FUNC_ID(ADAPTER, 19),
417 HPI_ADAPTER_IRQ_CALLBACK = HPI_FUNC_ID(ADAPTER, 20),
418 HPI_ADAPTER_DELETE = HPI_FUNC_ID(ADAPTER, 21),
419 HPI_ADAPTER_READ_FLASH = HPI_FUNC_ID(ADAPTER, 22),
420 HPI_ADAPTER_END_FLASH = HPI_FUNC_ID(ADAPTER, 23),
421 HPI_ADAPTER_FILESTORE_DELETE_ALL = HPI_FUNC_ID(ADAPTER, 24),
422 #define HPI_ADAPTER_FUNCTION_COUNT 24
424 HPI_OSTREAM_OPEN = HPI_FUNC_ID(OSTREAM, 1),
425 HPI_OSTREAM_CLOSE = HPI_FUNC_ID(OSTREAM, 2),
426 HPI_OSTREAM_WRITE = HPI_FUNC_ID(OSTREAM, 3),
427 HPI_OSTREAM_START = HPI_FUNC_ID(OSTREAM, 4),
428 HPI_OSTREAM_STOP = HPI_FUNC_ID(OSTREAM, 5),
429 HPI_OSTREAM_RESET = HPI_FUNC_ID(OSTREAM, 6),
430 HPI_OSTREAM_GET_INFO = HPI_FUNC_ID(OSTREAM, 7),
431 HPI_OSTREAM_QUERY_FORMAT = HPI_FUNC_ID(OSTREAM, 8),
432 HPI_OSTREAM_DATA = HPI_FUNC_ID(OSTREAM, 9),
433 HPI_OSTREAM_SET_VELOCITY = HPI_FUNC_ID(OSTREAM, 10),
434 HPI_OSTREAM_SET_PUNCHINOUT = HPI_FUNC_ID(OSTREAM, 11),
435 HPI_OSTREAM_SINEGEN = HPI_FUNC_ID(OSTREAM, 12),
436 HPI_OSTREAM_ANC_RESET = HPI_FUNC_ID(OSTREAM, 13),
437 HPI_OSTREAM_ANC_GET_INFO = HPI_FUNC_ID(OSTREAM, 14),
438 HPI_OSTREAM_ANC_READ = HPI_FUNC_ID(OSTREAM, 15),
439 HPI_OSTREAM_SET_TIMESCALE = HPI_FUNC_ID(OSTREAM, 16),
440 HPI_OSTREAM_SET_FORMAT = HPI_FUNC_ID(OSTREAM, 17),
441 HPI_OSTREAM_HOSTBUFFER_ALLOC = HPI_FUNC_ID(OSTREAM, 18),
442 HPI_OSTREAM_HOSTBUFFER_FREE = HPI_FUNC_ID(OSTREAM, 19),
443 HPI_OSTREAM_GROUP_ADD = HPI_FUNC_ID(OSTREAM, 20),
444 HPI_OSTREAM_GROUP_GETMAP = HPI_FUNC_ID(OSTREAM, 21),
445 HPI_OSTREAM_GROUP_RESET = HPI_FUNC_ID(OSTREAM, 22),
446 HPI_OSTREAM_HOSTBUFFER_GET_INFO = HPI_FUNC_ID(OSTREAM, 23),
447 HPI_OSTREAM_WAIT_START = HPI_FUNC_ID(OSTREAM, 24),
448 HPI_OSTREAM_WAIT = HPI_FUNC_ID(OSTREAM, 25),
449 #define HPI_OSTREAM_FUNCTION_COUNT 25
451 HPI_ISTREAM_OPEN = HPI_FUNC_ID(ISTREAM, 1),
452 HPI_ISTREAM_CLOSE = HPI_FUNC_ID(ISTREAM, 2),
453 HPI_ISTREAM_SET_FORMAT = HPI_FUNC_ID(ISTREAM, 3),
454 HPI_ISTREAM_READ = HPI_FUNC_ID(ISTREAM, 4),
455 HPI_ISTREAM_START = HPI_FUNC_ID(ISTREAM, 5),
456 HPI_ISTREAM_STOP = HPI_FUNC_ID(ISTREAM, 6),
457 HPI_ISTREAM_RESET = HPI_FUNC_ID(ISTREAM, 7),
458 HPI_ISTREAM_GET_INFO = HPI_FUNC_ID(ISTREAM, 8),
459 HPI_ISTREAM_QUERY_FORMAT = HPI_FUNC_ID(ISTREAM, 9),
460 HPI_ISTREAM_ANC_RESET = HPI_FUNC_ID(ISTREAM, 10),
461 HPI_ISTREAM_ANC_GET_INFO = HPI_FUNC_ID(ISTREAM, 11),
462 HPI_ISTREAM_ANC_WRITE = HPI_FUNC_ID(ISTREAM, 12),
463 HPI_ISTREAM_HOSTBUFFER_ALLOC = HPI_FUNC_ID(ISTREAM, 13),
464 HPI_ISTREAM_HOSTBUFFER_FREE = HPI_FUNC_ID(ISTREAM, 14),
465 HPI_ISTREAM_GROUP_ADD = HPI_FUNC_ID(ISTREAM, 15),
466 HPI_ISTREAM_GROUP_GETMAP = HPI_FUNC_ID(ISTREAM, 16),
467 HPI_ISTREAM_GROUP_RESET = HPI_FUNC_ID(ISTREAM, 17),
468 HPI_ISTREAM_HOSTBUFFER_GET_INFO = HPI_FUNC_ID(ISTREAM, 18),
469 HPI_ISTREAM_WAIT_START = HPI_FUNC_ID(ISTREAM, 19),
470 HPI_ISTREAM_WAIT = HPI_FUNC_ID(ISTREAM, 20),
471 #define HPI_ISTREAM_FUNCTION_COUNT 20
474 GET_NODE_INFO, SET_CONNECTION, GET_CONNECTIONS are not currently used */
475 HPI_MIXER_OPEN = HPI_FUNC_ID(MIXER, 1),
476 HPI_MIXER_CLOSE = HPI_FUNC_ID(MIXER, 2),
477 HPI_MIXER_GET_INFO = HPI_FUNC_ID(MIXER, 3),
478 HPI_MIXER_GET_NODE_INFO = HPI_FUNC_ID(MIXER, 4),
479 HPI_MIXER_GET_CONTROL = HPI_FUNC_ID(MIXER, 5),
480 HPI_MIXER_SET_CONNECTION = HPI_FUNC_ID(MIXER, 6),
481 HPI_MIXER_GET_CONNECTIONS = HPI_FUNC_ID(MIXER, 7),
482 HPI_MIXER_GET_CONTROL_BY_INDEX = HPI_FUNC_ID(MIXER, 8),
483 HPI_MIXER_GET_CONTROL_ARRAY_BY_INDEX = HPI_FUNC_ID(MIXER, 9),
484 HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES = HPI_FUNC_ID(MIXER, 10),
485 HPI_MIXER_STORE = HPI_FUNC_ID(MIXER, 11),
486 HPI_MIXER_GET_CACHE_INFO = HPI_FUNC_ID(MIXER, 12),
487 HPI_MIXER_GET_BLOCK_HANDLE = HPI_FUNC_ID(MIXER, 13),
488 HPI_MIXER_GET_PARAMETER_HANDLE = HPI_FUNC_ID(MIXER, 14),
489 #define HPI_MIXER_FUNCTION_COUNT 14
491 HPI_CONTROL_GET_INFO = HPI_FUNC_ID(CONTROL, 1),
492 HPI_CONTROL_GET_STATE = HPI_FUNC_ID(CONTROL, 2),
493 HPI_CONTROL_SET_STATE = HPI_FUNC_ID(CONTROL, 3),
494 #define HPI_CONTROL_FUNCTION_COUNT 3
496 HPI_NVMEMORY_OPEN = HPI_FUNC_ID(NVMEMORY, 1),
497 HPI_NVMEMORY_READ_BYTE = HPI_FUNC_ID(NVMEMORY, 2),
498 HPI_NVMEMORY_WRITE_BYTE = HPI_FUNC_ID(NVMEMORY, 3),
499 #define HPI_NVMEMORY_FUNCTION_COUNT 3
501 HPI_GPIO_OPEN = HPI_FUNC_ID(GPIO, 1),
502 HPI_GPIO_READ_BIT = HPI_FUNC_ID(GPIO, 2),
503 HPI_GPIO_WRITE_BIT = HPI_FUNC_ID(GPIO, 3),
504 HPI_GPIO_READ_ALL = HPI_FUNC_ID(GPIO, 4),
505 HPI_GPIO_WRITE_STATUS = HPI_FUNC_ID(GPIO, 5),
506 #define HPI_GPIO_FUNCTION_COUNT 5
508 HPI_ASYNCEVENT_OPEN = HPI_FUNC_ID(ASYNCEVENT, 1),
509 HPI_ASYNCEVENT_CLOSE = HPI_FUNC_ID(ASYNCEVENT, 2),
510 HPI_ASYNCEVENT_WAIT = HPI_FUNC_ID(ASYNCEVENT, 3),
511 HPI_ASYNCEVENT_GETCOUNT = HPI_FUNC_ID(ASYNCEVENT, 4),
512 HPI_ASYNCEVENT_GET = HPI_FUNC_ID(ASYNCEVENT, 5),
513 HPI_ASYNCEVENT_SENDEVENTS = HPI_FUNC_ID(ASYNCEVENT, 6),
514 #define HPI_ASYNCEVENT_FUNCTION_COUNT 6
516 HPI_WATCHDOG_OPEN = HPI_FUNC_ID(WATCHDOG, 1),
517 HPI_WATCHDOG_SET_TIME = HPI_FUNC_ID(WATCHDOG, 2),
518 HPI_WATCHDOG_PING = HPI_FUNC_ID(WATCHDOG, 3),
520 HPI_CLOCK_OPEN = HPI_FUNC_ID(CLOCK, 1),
521 HPI_CLOCK_SET_TIME = HPI_FUNC_ID(CLOCK, 2),
522 HPI_CLOCK_GET_TIME = HPI_FUNC_ID(CLOCK, 3),
524 HPI_PROFILE_OPEN_ALL = HPI_FUNC_ID(PROFILE, 1),
525 HPI_PROFILE_START_ALL = HPI_FUNC_ID(PROFILE, 2),
526 HPI_PROFILE_STOP_ALL = HPI_FUNC_ID(PROFILE, 3),
527 HPI_PROFILE_GET = HPI_FUNC_ID(PROFILE, 4),
528 HPI_PROFILE_GET_IDLECOUNT = HPI_FUNC_ID(PROFILE, 5),
529 HPI_PROFILE_GET_NAME = HPI_FUNC_ID(PROFILE, 6),
530 HPI_PROFILE_GET_UTILIZATION = HPI_FUNC_ID(PROFILE, 7)
531 #define HPI_PROFILE_FUNCTION_COUNT 7
534 /* ////////////////////////////////////////////////////////////////////// */
536 #ifndef DISABLE_PRAGMA_PACK1
537 #pragma pack(push, 1)
540 /** PCI bus resource */
542 u32 __iomem *ap_mem_base[HPI_MAX_ADAPTER_MEM_SPACES];
543 struct pci_dev *pci_dev;
546 /** Adapter specification resource */
547 struct hpi_adapter_specification {
552 struct hpi_resource {
554 const struct hpi_pci *pci;
556 struct hpi_adapter_specification adapter_spec;
559 u16 bus_type; /* HPI_BUS_PNPISA, _PCI, _USB etc */
563 /** Format info used inside struct hpi_message
564 Not the same as public API struct hpi_format */
565 struct hpi_msg_format {
566 u32 sample_rate; /**< 11025, 32000, 44100 etc. */
567 u32 bit_rate; /**< for MPEG */
568 u32 attributes; /**< stereo/joint_stereo/mono */
569 u16 channels; /**< 1,2..., (or ancillary mode or idle bit */
570 u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see \ref HPI_FORMATS. */
573 /** Buffer+format structure.
574 Must be kept 7 * 32 bits to match public struct hpi_datastruct */
575 struct hpi_msg_data {
576 struct hpi_msg_format format;
584 /** struct hpi_datastructure used up to 3.04 driver */
585 struct hpi_data_legacy32 {
586 struct hpi_format format;
592 /* Compatibility version of struct hpi_data*/
593 struct hpi_data_compat32 {
594 struct hpi_msg_format format;
602 /** placeholder for backward compatibility (see dwBufferSize) */
603 struct hpi_msg_format reserved;
604 u32 command; /**< HPI_BUFFER_CMD_xxx*/
605 u32 pci_address; /**< PCI physical address of buffer for DSP DMA */
606 u32 buffer_size; /**< must line up with data_size of HPI_DATA*/
609 /*/////////////////////////////////////////////////////////////////////////// */
610 /* This is used for background buffer bus mastering stream buffers. */
611 struct hpi_hostbuffer_status {
612 u32 samples_processed;
613 u32 auxiliary_data_available;
615 /* DSP index in to the host bus master buffer. */
617 /* Host index in to the host bus master buffer. */
622 struct hpi_streamid {
624 /**< Type of object, HPI_OBJ_OSTREAM or HPI_OBJ_ISTREAM. */
625 u16 stream_index; /**< outstream or instream index. */
628 struct hpi_punchinout {
630 u32 punch_out_sample;
633 struct hpi_subsys_msg {
634 struct hpi_resource resource;
637 struct hpi_subsys_res {
639 u32 data; /* extended version */
646 union hpi_adapterx_msg {
683 struct hpi_adapter_res {
691 u8 sz_adapter_assert[HPI_STRING_LEN];
694 union hpi_adapterx_res {
695 struct hpi_adapter_res info;
702 char sz_message[HPI_STRING_LEN];
716 struct hpi_stream_msg {
718 struct hpi_msg_data data;
719 struct hpi_data_legacy32 data32;
721 struct hpi_punchinout pio;
723 struct hpi_buffer buffer;
724 struct hpi_streamid stream;
729 struct hpi_stream_res {
732 /* size of hardware buffer */
734 /* OutStream - data to play,
735 InStream - data recorded */
737 /* OutStream - samples played,
738 InStream - samples recorded */
739 u32 samples_transferred;
740 /* Adapter - OutStream - data to play,
741 InStream - data recorded */
742 u32 auxiliary_data_available;
743 u16 state; /* HPI_STATE_PLAYING, _STATE_STOPPED */
749 u32 samples_transfered;
754 u32 auxiliary_data_available;
755 } legacy_stream_info;
757 /* bitmap of grouped OutStreams */
758 u32 outstream_group_map;
759 /* bitmap of grouped InStreams */
760 u32 instream_group_map;
763 /* pointer to the buffer */
765 /* pointer to the hostbuffer status */
766 struct hpi_hostbuffer_status *p_status;
771 struct hpi_mixer_msg {
773 u16 control_type; /* = HPI_CONTROL_METER _VOLUME etc */
774 u16 padding1; /* Maintain alignment of subsequent fields */
775 u16 node_type1; /* = HPI_SOURCENODE_LINEIN etc */
776 u16 node_index1; /* = 0..N */
779 u16 padding2; /* round to 4 bytes */
782 struct hpi_mixer_res {
783 u16 src_node_type; /* = HPI_SOURCENODE_LINEIN etc */
784 u16 src_node_index; /* = 0..N */
787 /* Also controlType for MixerGetControlByIndex */
789 /* may indicate which DSP the control is located on */
793 union hpi_mixerx_msg {
797 u32 length_in_bytes; /* length in bytes of p_data */
798 u32 p_data; /* pointer to a data array */
803 } store; /* for HPI_MIXER_STORE message */
806 union hpi_mixerx_res {
808 u32 bytes_returned; /* size of items returned */
809 u32 p_data; /* pointer to data array */
810 u16 more_to_do; /* indicates if there is more to do */
813 u32 total_controls; /* count of controls in the mixer */
814 u32 cache_controls; /* count of controls in the cac */
815 u32 cache_bytes; /* size of cache */
819 struct hpi_control_msg {
820 u16 attribute; /* control attribute or property */
822 u32 param1; /* generic parameter 1 */
823 u32 param2; /* generic parameter 2 */
824 short an_log_value[HPI_MAX_CHANNELS];
827 struct hpi_control_union_msg {
828 u16 attribute; /* control attribute or property */
829 u16 saved_index; /* only used in ctrl save/restore */
832 u32 param1; /* generic parameter 1 */
833 u32 param2; /* generic parameter 2 */
834 short an_log_value[HPI_MAX_CHANNELS];
851 struct hpi_control_res {
852 /* Could make union. dwParam, anLogValue never used in same response */
855 short an_log_value[HPI_MAX_CHANNELS];
858 union hpi_control_union_res {
862 short an_log_value[HPI_MAX_CHANNELS];
893 struct hpi_nvmemory_msg {
898 struct hpi_nvmemory_res {
903 struct hpi_gpio_msg {
908 struct hpi_gpio_res {
909 u16 number_input_bits;
910 u16 number_output_bits;
914 struct hpi_async_msg {
920 struct hpi_async_res {
930 struct hpi_async_event event;
934 struct hpi_watchdog_msg {
938 struct hpi_watchdog_res {
942 struct hpi_clock_msg {
949 struct hpi_clock_res {
958 struct hpi_profile_msg {
963 struct hpi_profile_res_open {
967 struct hpi_profile_res_time {
968 u32 total_tick_count;
971 u32 ticks_per_millisecond;
972 u16 profile_interval;
975 struct hpi_profile_res_name {
979 struct hpi_profile_res {
981 struct hpi_profile_res_open o;
982 struct hpi_profile_res_time t;
983 struct hpi_profile_res_name n;
987 struct hpi_message_header {
988 u16 size; /* total size in bytes */
989 u8 type; /* HPI_TYPE_MESSAGE */
990 u8 version; /* message version */
991 u16 object; /* HPI_OBJ_* */
992 u16 function; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
993 u16 adapter_index; /* the adapter index */
998 /* following fields must match HPI_MESSAGE_HEADER */
999 u16 size; /* total size in bytes */
1000 u8 type; /* HPI_TYPE_MESSAGE */
1001 u8 version; /* message version */
1002 u16 object; /* HPI_OBJ_* */
1003 u16 function; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
1004 u16 adapter_index; /* the adapter index */
1005 u16 obj_index; /* */
1007 struct hpi_subsys_msg s;
1008 union hpi_adapterx_msg ax;
1009 struct hpi_stream_msg d;
1010 struct hpi_mixer_msg m;
1011 union hpi_mixerx_msg mx; /* extended mixer; */
1012 struct hpi_control_msg c; /* mixer control; */
1013 /* identical to struct hpi_control_msg,
1014 but field naming is improved */
1015 struct hpi_control_union_msg cu;
1016 struct hpi_nvmemory_msg n;
1017 struct hpi_gpio_msg l; /* digital i/o */
1018 struct hpi_watchdog_msg w;
1019 struct hpi_clock_msg t; /* dsp time */
1020 struct hpi_profile_msg p;
1021 struct hpi_async_msg as;
1022 char fixed_size[32];
1026 #define HPI_MESSAGE_SIZE_BY_OBJECT { \
1027 sizeof(struct hpi_message_header) , /* Default, no object type 0 */ \
1028 sizeof(struct hpi_message_header) + sizeof(struct hpi_subsys_msg),\
1029 sizeof(struct hpi_message_header) + sizeof(union hpi_adapterx_msg),\
1030 sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
1031 sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
1032 sizeof(struct hpi_message_header) + sizeof(struct hpi_mixer_msg),\
1033 sizeof(struct hpi_message_header) , /* no node message */ \
1034 sizeof(struct hpi_message_header) + sizeof(struct hpi_control_msg),\
1035 sizeof(struct hpi_message_header) + sizeof(struct hpi_nvmemory_msg),\
1036 sizeof(struct hpi_message_header) + sizeof(struct hpi_gpio_msg),\
1037 sizeof(struct hpi_message_header) + sizeof(struct hpi_watchdog_msg),\
1038 sizeof(struct hpi_message_header) + sizeof(struct hpi_clock_msg),\
1039 sizeof(struct hpi_message_header) + sizeof(struct hpi_profile_msg),\
1040 sizeof(struct hpi_message_header), /* controlx obj removed */ \
1041 sizeof(struct hpi_message_header) + sizeof(struct hpi_async_msg) \
1045 Note that the wSpecificError error field should be inspected and potentially
1046 reported whenever HPI_ERROR_DSP_COMMUNICATION or HPI_ERROR_DSP_BOOTLOAD is
1049 struct hpi_response_header {
1051 u8 type; /* HPI_TYPE_RESPONSE */
1052 u8 version; /* response version */
1053 u16 object; /* HPI_OBJ_* */
1054 u16 function; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
1055 u16 error; /* HPI_ERROR_xxx */
1056 u16 specific_error; /* adapter specific error */
1059 struct hpi_response {
1060 /* following fields must match HPI_RESPONSE_HEADER */
1062 u8 type; /* HPI_TYPE_RESPONSE */
1063 u8 version; /* response version */
1064 u16 object; /* HPI_OBJ_* */
1065 u16 function; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
1066 u16 error; /* HPI_ERROR_xxx */
1067 u16 specific_error; /* adapter specific error */
1069 struct hpi_subsys_res s;
1070 union hpi_adapterx_res ax;
1071 struct hpi_stream_res d;
1072 struct hpi_mixer_res m;
1073 union hpi_mixerx_res mx; /* extended mixer; */
1074 struct hpi_control_res c; /* mixer control; */
1075 /* identical to hpi_control_res, but field naming is improved */
1076 union hpi_control_union_res cu;
1077 struct hpi_nvmemory_res n;
1078 struct hpi_gpio_res l; /* digital i/o */
1079 struct hpi_watchdog_res w;
1080 struct hpi_clock_res t; /* dsp time */
1081 struct hpi_profile_res p;
1082 struct hpi_async_res as;
1087 #define HPI_RESPONSE_SIZE_BY_OBJECT { \
1088 sizeof(struct hpi_response_header) ,/* Default, no object type 0 */ \
1089 sizeof(struct hpi_response_header) + sizeof(struct hpi_subsys_res),\
1090 sizeof(struct hpi_response_header) + sizeof(union hpi_adapterx_res),\
1091 sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
1092 sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
1093 sizeof(struct hpi_response_header) + sizeof(struct hpi_mixer_res),\
1094 sizeof(struct hpi_response_header) , /* no node response */ \
1095 sizeof(struct hpi_response_header) + sizeof(struct hpi_control_res),\
1096 sizeof(struct hpi_response_header) + sizeof(struct hpi_nvmemory_res),\
1097 sizeof(struct hpi_response_header) + sizeof(struct hpi_gpio_res),\
1098 sizeof(struct hpi_response_header) + sizeof(struct hpi_watchdog_res),\
1099 sizeof(struct hpi_response_header) + sizeof(struct hpi_clock_res),\
1100 sizeof(struct hpi_response_header) + sizeof(struct hpi_profile_res),\
1101 sizeof(struct hpi_response_header), /* controlx obj removed */ \
1102 sizeof(struct hpi_response_header) + sizeof(struct hpi_async_res) \
1105 /*********************** version 1 message/response **************************/
1106 #define HPINET_ETHERNET_DATA_SIZE (1500)
1107 #define HPINET_IP_HDR_SIZE (20)
1108 #define HPINET_IP_DATA_SIZE (HPINET_ETHERNET_DATA_SIZE - HPINET_IP_HDR_SIZE)
1109 #define HPINET_UDP_HDR_SIZE (8)
1110 #define HPINET_UDP_DATA_SIZE (HPINET_IP_DATA_SIZE - HPINET_UDP_HDR_SIZE)
1111 #define HPINET_ASI_HDR_SIZE (2)
1112 #define HPINET_ASI_DATA_SIZE (HPINET_UDP_DATA_SIZE - HPINET_ASI_HDR_SIZE)
1114 #define HPI_MAX_PAYLOAD_SIZE (HPINET_ASI_DATA_SIZE - 2)
1116 /* New style message/response, but still V0 compatible */
1117 struct hpi_msg_adapter_get_info {
1118 struct hpi_message_header h;
1121 struct hpi_res_adapter_get_info {
1122 struct hpi_response_header h; /*v0 */
1123 struct hpi_adapter_res p;
1126 struct hpi_res_adapter_debug_read {
1127 struct hpi_response_header h;
1131 struct hpi_msg_cobranet_hmi {
1138 struct hpi_msg_cobranet_hmiwrite {
1139 struct hpi_message_header h;
1140 struct hpi_msg_cobranet_hmi p;
1144 struct hpi_msg_cobranet_hmiread {
1145 struct hpi_message_header h;
1146 struct hpi_msg_cobranet_hmi p;
1149 struct hpi_res_cobranet_hmiread {
1150 struct hpi_response_header h;
1156 #define hpi_message_header_v1 hpi_message_header
1157 #define hpi_response_header_v1 hpi_response_header
1159 /* V1 headers in Addition to v0 headers */
1160 struct hpi_message_header_v1 {
1161 struct hpi_message_header h0;
1166 struct hpi_response_header_v1 {
1167 struct hpi_response_header h0;
1169 u16 adapter_index; /* the adapter index */
1170 u16 obj_index; /* object index */
1175 struct hpi_msg_payload_v0 {
1176 struct hpi_message_header h;
1178 struct hpi_subsys_msg s;
1179 union hpi_adapterx_msg ax;
1180 struct hpi_stream_msg d;
1181 struct hpi_mixer_msg m;
1182 union hpi_mixerx_msg mx;
1183 struct hpi_control_msg c;
1184 struct hpi_control_union_msg cu;
1185 struct hpi_nvmemory_msg n;
1186 struct hpi_gpio_msg l;
1187 struct hpi_watchdog_msg w;
1188 struct hpi_clock_msg t;
1189 struct hpi_profile_msg p;
1190 struct hpi_async_msg as;
1194 struct hpi_res_payload_v0 {
1195 struct hpi_response_header h;
1197 struct hpi_subsys_res s;
1198 union hpi_adapterx_res ax;
1199 struct hpi_stream_res d;
1200 struct hpi_mixer_res m;
1201 union hpi_mixerx_res mx;
1202 struct hpi_control_res c;
1203 union hpi_control_union_res cu;
1204 struct hpi_nvmemory_res n;
1205 struct hpi_gpio_res l;
1206 struct hpi_watchdog_res w;
1207 struct hpi_clock_res t;
1208 struct hpi_profile_res p;
1209 struct hpi_async_res as;
1213 union hpi_message_buffer_v1 {
1214 struct hpi_message m0; /* version 0 */
1215 struct hpi_message_header_v1 h;
1216 u8 buf[HPI_MAX_PAYLOAD_SIZE];
1219 union hpi_response_buffer_v1 {
1220 struct hpi_response r0; /* version 0 */
1221 struct hpi_response_header_v1 h;
1222 u8 buf[HPI_MAX_PAYLOAD_SIZE];
1225 compile_time_assert((sizeof(union hpi_message_buffer_v1) <=
1226 HPI_MAX_PAYLOAD_SIZE), message_buffer_ok);
1227 compile_time_assert((sizeof(union hpi_response_buffer_v1) <=
1228 HPI_MAX_PAYLOAD_SIZE), response_buffer_ok);
1230 /*////////////////////////////////////////////////////////////////////////// */
1231 /* declarations for compact control calls */
1232 struct hpi_control_defn {
1241 /*////////////////////////////////////////////////////////////////////////// */
1242 /* declarations for control caching (internal to HPI<->DSP interaction) */
1244 /** indicates a cached u16 value is invalid. */
1245 #define HPI_CACHE_INVALID_UINT16 0xFFFF
1246 /** indicates a cached short value is invalid. */
1247 #define HPI_CACHE_INVALID_SHORT -32768
1249 /** A compact representation of (part of) a controls state.
1250 Used for efficient transfer of the control state
1251 between DSP and host or across a network
1253 struct hpi_control_cache_info {
1254 /** one of HPI_CONTROL_* */
1256 /** The total size of cached information in 32-bit words. */
1257 u8 size_in32bit_words;
1258 /** The original index of the control on the DSP */
1262 struct hpi_control_cache_vol {
1263 struct hpi_control_cache_info i;
1265 unsigned short flags;
1269 struct hpi_control_cache_meter {
1270 struct hpi_control_cache_info i;
1271 short an_log_peak[2];
1275 struct hpi_control_cache_channelmode {
1276 struct hpi_control_cache_info i;
1278 char temp_padding[6];
1281 struct hpi_control_cache_mux {
1282 struct hpi_control_cache_info i;
1283 u16 source_node_type;
1284 u16 source_node_index;
1285 char temp_padding[4];
1288 struct hpi_control_cache_level {
1289 struct hpi_control_cache_info i;
1291 char temp_padding[4];
1294 struct hpi_control_cache_tuner {
1295 struct hpi_control_cache_info i;
1301 struct hpi_control_cache_aes3rx {
1302 struct hpi_control_cache_info i;
1307 struct hpi_control_cache_aes3tx {
1308 struct hpi_control_cache_info i;
1310 char temp_padding[4];
1313 struct hpi_control_cache_tonedetector {
1314 struct hpi_control_cache_info i;
1316 char temp_padding[6];
1319 struct hpi_control_cache_silencedetector {
1320 struct hpi_control_cache_info i;
1322 char temp_padding[4];
1325 struct hpi_control_cache_sampleclock {
1326 struct hpi_control_cache_info i;
1332 struct hpi_control_cache_microphone {
1333 struct hpi_control_cache_info i;
1335 char temp_padding[6];
1338 struct hpi_control_cache_single {
1340 struct hpi_control_cache_info i;
1341 struct hpi_control_cache_vol vol;
1342 struct hpi_control_cache_meter meter;
1343 struct hpi_control_cache_channelmode mode;
1344 struct hpi_control_cache_mux mux;
1345 struct hpi_control_cache_level level;
1346 struct hpi_control_cache_tuner tuner;
1347 struct hpi_control_cache_aes3rx aes3rx;
1348 struct hpi_control_cache_aes3tx aes3tx;
1349 struct hpi_control_cache_tonedetector tone;
1350 struct hpi_control_cache_silencedetector silence;
1351 struct hpi_control_cache_sampleclock clk;
1352 struct hpi_control_cache_microphone microphone;
1356 struct hpi_control_cache_pad {
1357 struct hpi_control_cache_info i;
1358 u32 field_valid_flags;
1365 u32 traffic_supported;
1366 u32 traffic_anouncement;
1369 /* 2^N sized FIFO buffer (internal to HPI<->DSP interaction) */
1370 struct hpi_fifo_buffer {
1376 #ifndef DISABLE_PRAGMA_PACK1
1380 /* skip host side function declarations for DSP
1381 compile and documentation extraction */
1383 char hpi_handle_object(const u32 handle);
1385 void hpi_handle_to_indexes(const u32 handle, u16 *pw_adapter_index,
1386 u16 *pw_object_index);
1388 u32 hpi_indexes_to_handle(const char c_object, const u16 adapter_index,
1389 const u16 object_index);
1391 /*////////////////////////////////////////////////////////////////////////// */
1393 /* main HPI entry point */
1394 void hpi_send_recv(struct hpi_message *phm, struct hpi_response *phr);
1396 /* used in PnP OS/driver */
1397 u16 hpi_subsys_create_adapter(const struct hpi_resource *p_resource,
1398 u16 *pw_adapter_index);
1400 u16 hpi_outstream_host_buffer_get_info(u32 h_outstream, u8 **pp_buffer,
1401 struct hpi_hostbuffer_status **pp_status);
1403 u16 hpi_instream_host_buffer_get_info(u32 h_instream, u8 **pp_buffer,
1404 struct hpi_hostbuffer_status **pp_status);
1406 u16 hpi_adapter_restart(u16 adapter_index);
1409 The following 3 functions were last declared in header files for
1410 driver 3.10. HPI_ControlQuery() used to be the recommended way
1411 of getting a volume range. Declared here for binary asihpi32.dll
1415 void hpi_format_to_msg(struct hpi_msg_format *pMF,
1416 const struct hpi_format *pF);
1417 void hpi_stream_response_to_legacy(struct hpi_stream_res *pSR);
1419 /*////////////////////////////////////////////////////////////////////////// */
1420 /* declarations for individual HPI entry points */
1421 hpi_handler_func HPI_6000;
1422 hpi_handler_func HPI_6205;
1424 #endif /* _HPI_INTERNAL_H_ */