1 /******************************************************************************
3 AudioScience HPI driver
4 Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of version 2 of the GNU General Public License as
8 published by the Free Software Foundation;
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 HPI internal definitions
21 (C) Copyright AudioScience Inc. 1996-2009
22 ******************************************************************************/
24 #ifndef _HPI_INTERNAL_H_
25 #define _HPI_INTERNAL_H_
28 /** maximum number of memory regions mapped to an adapter */
29 #define HPI_MAX_ADAPTER_MEM_SPACES (2)
31 /* Each OS needs its own hpios.h, or specific define as above */
34 /* physical memory allocation */
35 void hpios_locked_mem_init(void
37 void hpios_locked_mem_free_all(void
39 #define hpios_locked_mem_prepare(a, b, c, d);
40 #define hpios_locked_mem_unprepare(a)
42 /** Allocate and map an area of locked memory for bus master DMA operations.
44 On success, *pLockedMemeHandle is a valid handle, and 0 is returned
45 On error *pLockedMemHandle marked invalid, non-zero returned.
47 If this function succeeds, then HpiOs_LockedMem_GetVirtAddr() and
48 HpiOs_LockedMem_GetPyhsAddr() will always succed on the returned handle.
50 u16
hpios_locked_mem_alloc(struct consistent_dma_area
*p_locked_mem_handle
,
52 u32 size
, /**< size in bytes to allocate */
53 struct pci_dev
*p_os_reference
54 /**< OS specific data required for memory allocation */
57 /** Free mapping and memory represented by LockedMemHandle
59 Frees any resources, then invalidates the handle.
60 Returns 0 on success, 1 if handle is invalid.
63 u16
hpios_locked_mem_free(struct consistent_dma_area
*locked_mem_handle
);
65 /** Get the physical PCI address of memory represented by LockedMemHandle.
67 If handle is invalid *pPhysicalAddr is set to zero and return 1
69 u16
hpios_locked_mem_get_phys_addr(struct consistent_dma_area
70 *locked_mem_handle
, u32
*p_physical_addr
);
72 /** Get the CPU address of of memory represented by LockedMemHandle.
74 If handle is NULL *ppvVirtualAddr is set to NULL and return 1
76 u16
hpios_locked_mem_get_virt_addr(struct consistent_dma_area
77 *locked_mem_handle
, void **ppv_virtual_addr
);
79 /** Check that handle is valid
80 i.e it represents a valid memory area
82 u16
hpios_locked_mem_valid(struct consistent_dma_area
*locked_mem_handle
);
85 void hpios_delay_micro_seconds(u32 num_micro_sec
);
90 typedef void hpi_handler_func(struct hpi_message
*, struct hpi_response
*);
92 /* If the assert fails, compiler complains
93 something like size of array `msg' is negative.
94 Unlike linux BUILD_BUG_ON, this works outside function scope.
96 #define compile_time_assert(cond, msg) \
97 typedef char ASSERT_##msg[(cond) ? 1 : -1]
99 /*/////////////////////////////////////////////////////////////////////////// */
100 /* Private HPI Entity related definitions */
102 #define STR_SIZE_FIELD_MAX 65535U
103 #define STR_TYPE_FIELD_MAX 255U
104 #define STR_ROLE_FIELD_MAX 255U
106 struct hpi_entity_str
{
112 #if defined(_MSC_VER)
113 #pragma warning(push)
114 #pragma warning(disable : 4200)
118 struct hpi_entity_str header
;
119 #if ! defined(HPI_OS_DSP_C6000) || (defined(HPI_OS_DSP_C6000) && (__TI_COMPILER_VERSION__ > 6000008))
120 /* DSP C6000 compiler v6.0.8 and lower
121 do not support flexible array member */
124 /* NOTE! Using sizeof(struct hpi_entity) will give erroneous results */
125 #define HPI_INTERNAL_WARN_ABOUT_ENTITY_VALUE
130 #if defined(_MSC_VER)
134 /******************************************* bus types */
142 /******************************************* CONTROL ATTRIBUTES ****/
143 /* (in order of control type ID */
145 /* This allows for 255 control types, 256 unique attributes each */
146 #define HPI_CTL_ATTR(ctl, ai) (HPI_CONTROL_##ctl * 0x100 + ai)
148 /* Get the sub-index of the attribute for a control type */
149 #define HPI_CTL_ATTR_INDEX(i) (i&0xff)
151 /* Generic control attributes. */
153 /** Enable a control.
155 \note generic to all mixer plugins?
157 #define HPI_GENERIC_ENABLE HPI_CTL_ATTR(GENERIC, 1)
159 /** Enable event generation for a control.
161 \note generic to all controls that can generate events
163 #define HPI_GENERIC_EVENT_ENABLE HPI_CTL_ATTR(GENERIC, 2)
165 /* Volume Control attributes */
166 #define HPI_VOLUME_GAIN HPI_CTL_ATTR(VOLUME, 1)
167 #define HPI_VOLUME_AUTOFADE HPI_CTL_ATTR(VOLUME, 2)
169 /** For HPI_ControlQuery() to get the number of channels of a volume control*/
170 #define HPI_VOLUME_NUM_CHANNELS HPI_CTL_ATTR(VOLUME, 6)
171 #define HPI_VOLUME_RANGE HPI_CTL_ATTR(VOLUME, 10)
173 /** Level Control attributes */
174 #define HPI_LEVEL_GAIN HPI_CTL_ATTR(LEVEL, 1)
175 #define HPI_LEVEL_RANGE HPI_CTL_ATTR(LEVEL, 10)
177 /* Meter Control attributes */
178 /** return RMS signal level */
179 #define HPI_METER_RMS HPI_CTL_ATTR(METER, 1)
180 /** return peak signal level */
181 #define HPI_METER_PEAK HPI_CTL_ATTR(METER, 2)
182 /** ballistics for ALL rms meters on adapter */
183 #define HPI_METER_RMS_BALLISTICS HPI_CTL_ATTR(METER, 3)
184 /** ballistics for ALL peak meters on adapter */
185 #define HPI_METER_PEAK_BALLISTICS HPI_CTL_ATTR(METER, 4)
187 /** For HPI_ControlQuery() to get the number of channels of a meter control*/
188 #define HPI_METER_NUM_CHANNELS HPI_CTL_ATTR(METER, 5)
190 /* Multiplexer control attributes */
191 #define HPI_MULTIPLEXER_SOURCE HPI_CTL_ATTR(MULTIPLEXER, 1)
192 #define HPI_MULTIPLEXER_QUERYSOURCE HPI_CTL_ATTR(MULTIPLEXER, 2)
194 /** AES/EBU transmitter control attributes */
195 /** AESEBU or SPDIF */
196 #define HPI_AESEBUTX_FORMAT HPI_CTL_ATTR(AESEBUTX, 1)
197 #define HPI_AESEBUTX_SAMPLERATE HPI_CTL_ATTR(AESEBUTX, 3)
198 #define HPI_AESEBUTX_CHANNELSTATUS HPI_CTL_ATTR(AESEBUTX, 4)
199 #define HPI_AESEBUTX_USERDATA HPI_CTL_ATTR(AESEBUTX, 5)
201 /** AES/EBU receiver control attributes */
202 #define HPI_AESEBURX_FORMAT HPI_CTL_ATTR(AESEBURX, 1)
203 #define HPI_AESEBURX_ERRORSTATUS HPI_CTL_ATTR(AESEBURX, 2)
204 #define HPI_AESEBURX_SAMPLERATE HPI_CTL_ATTR(AESEBURX, 3)
205 #define HPI_AESEBURX_CHANNELSTATUS HPI_CTL_ATTR(AESEBURX, 4)
206 #define HPI_AESEBURX_USERDATA HPI_CTL_ATTR(AESEBURX, 5)
208 /** \defgroup tuner_defs Tuners
211 /** \defgroup tuner_attrs Tuner control attributes
214 #define HPI_TUNER_BAND HPI_CTL_ATTR(TUNER, 1)
215 #define HPI_TUNER_FREQ HPI_CTL_ATTR(TUNER, 2)
216 #define HPI_TUNER_LEVEL HPI_CTL_ATTR(TUNER, 3)
217 #define HPI_TUNER_AUDIOMUTE HPI_CTL_ATTR(TUNER, 4)
218 /* use TUNER_STATUS instead */
219 #define HPI_TUNER_VIDEO_STATUS HPI_CTL_ATTR(TUNER, 5)
220 #define HPI_TUNER_GAIN HPI_CTL_ATTR(TUNER, 6)
221 #define HPI_TUNER_STATUS HPI_CTL_ATTR(TUNER, 7)
222 #define HPI_TUNER_MODE HPI_CTL_ATTR(TUNER, 8)
224 #define HPI_TUNER_RDS HPI_CTL_ATTR(TUNER, 9)
225 /** Audio pre-emphasis. */
226 #define HPI_TUNER_DEEMPHASIS HPI_CTL_ATTR(TUNER, 10)
227 /** HD Radio tuner program control. */
228 #define HPI_TUNER_PROGRAM HPI_CTL_ATTR(TUNER, 11)
229 /** HD Radio tuner digital signal quality. */
230 #define HPI_TUNER_HDRADIO_SIGNAL_QUALITY HPI_CTL_ATTR(TUNER, 12)
231 /** HD Radio SDK firmware version. */
232 #define HPI_TUNER_HDRADIO_SDK_VERSION HPI_CTL_ATTR(TUNER, 13)
233 /** HD Radio DSP firmware version. */
234 #define HPI_TUNER_HDRADIO_DSP_VERSION HPI_CTL_ATTR(TUNER, 14)
235 /** HD Radio signal blend (force analog, or automatic). */
236 #define HPI_TUNER_HDRADIO_BLEND HPI_CTL_ATTR(TUNER, 15)
240 /** \defgroup pads_attrs Tuner PADs control attributes
243 /** The text string containing the station/channel combination. */
244 #define HPI_PAD_CHANNEL_NAME HPI_CTL_ATTR(PAD, 1)
245 /** The text string containing the artist. */
246 #define HPI_PAD_ARTIST HPI_CTL_ATTR(PAD, 2)
247 /** The text string containing the title. */
248 #define HPI_PAD_TITLE HPI_CTL_ATTR(PAD, 3)
249 /** The text string containing the comment. */
250 #define HPI_PAD_COMMENT HPI_CTL_ATTR(PAD, 4)
251 /** The integer containing the PTY code. */
252 #define HPI_PAD_PROGRAM_TYPE HPI_CTL_ATTR(PAD, 5)
253 /** The integer containing the program identification. */
254 #define HPI_PAD_PROGRAM_ID HPI_CTL_ATTR(PAD, 6)
255 /** The integer containing whether traffic information is supported.
256 Contains either 1 or 0. */
257 #define HPI_PAD_TA_SUPPORT HPI_CTL_ATTR(PAD, 7)
258 /** The integer containing whether traffic announcement is in progress.
259 Contains either 1 or 0. */
260 #define HPI_PAD_TA_ACTIVE HPI_CTL_ATTR(PAD, 8)
264 /* VOX control attributes */
265 #define HPI_VOX_THRESHOLD HPI_CTL_ATTR(VOX, 1)
267 /*?? channel mode used hpi_multiplexer_source attribute == 1 */
268 #define HPI_CHANNEL_MODE_MODE HPI_CTL_ATTR(CHANNEL_MODE, 1)
270 /** \defgroup channel_modes Channel Modes
271 Used for HPI_ChannelModeSet/Get()
274 /** Left channel out = left channel in, Right channel out = right channel in. */
275 #define HPI_CHANNEL_MODE_NORMAL 1
276 /** Left channel out = right channel in, Right channel out = left channel in. */
277 #define HPI_CHANNEL_MODE_SWAP 2
278 /** Left channel out = left channel in, Right channel out = left channel in. */
279 #define HPI_CHANNEL_MODE_LEFT_TO_STEREO 3
280 /** Left channel out = right channel in, Right channel out = right channel in.*/
281 #define HPI_CHANNEL_MODE_RIGHT_TO_STEREO 4
282 /** Left channel out = (left channel in + right channel in)/2,
283 Right channel out = mute. */
284 #define HPI_CHANNEL_MODE_STEREO_TO_LEFT 5
285 /** Left channel out = mute,
286 Right channel out = (right channel in + left channel in)/2. */
287 #define HPI_CHANNEL_MODE_STEREO_TO_RIGHT 6
288 #define HPI_CHANNEL_MODE_LAST 6
291 /* Bitstream control set attributes */
292 #define HPI_BITSTREAM_DATA_POLARITY HPI_CTL_ATTR(BITSTREAM, 1)
293 #define HPI_BITSTREAM_CLOCK_EDGE HPI_CTL_ATTR(BITSTREAM, 2)
294 #define HPI_BITSTREAM_CLOCK_SOURCE HPI_CTL_ATTR(BITSTREAM, 3)
296 #define HPI_POLARITY_POSITIVE 0
297 #define HPI_POLARITY_NEGATIVE 1
299 /* Bitstream control get attributes */
300 #define HPI_BITSTREAM_ACTIVITY 1
302 /* SampleClock control attributes */
303 #define HPI_SAMPLECLOCK_SOURCE HPI_CTL_ATTR(SAMPLECLOCK, 1)
304 #define HPI_SAMPLECLOCK_SAMPLERATE HPI_CTL_ATTR(SAMPLECLOCK, 2)
305 #define HPI_SAMPLECLOCK_SOURCE_INDEX HPI_CTL_ATTR(SAMPLECLOCK, 3)
306 #define HPI_SAMPLECLOCK_LOCAL_SAMPLERATE\
307 HPI_CTL_ATTR(SAMPLECLOCK, 4)
308 #define HPI_SAMPLECLOCK_AUTO HPI_CTL_ATTR(SAMPLECLOCK, 5)
309 #define HPI_SAMPLECLOCK_LOCAL_LOCK HPI_CTL_ATTR(SAMPLECLOCK, 6)
311 /* Microphone control attributes */
312 #define HPI_MICROPHONE_PHANTOM_POWER HPI_CTL_ATTR(MICROPHONE, 1)
314 /** Equalizer control attributes
316 /** Used to get number of filters in an EQ. (Can't set) */
317 #define HPI_EQUALIZER_NUM_FILTERS HPI_CTL_ATTR(EQUALIZER, 1)
318 /** Set/get the filter by type, freq, Q, gain */
319 #define HPI_EQUALIZER_FILTER HPI_CTL_ATTR(EQUALIZER, 2)
320 /** Get the biquad coefficients */
321 #define HPI_EQUALIZER_COEFFICIENTS HPI_CTL_ATTR(EQUALIZER, 3)
323 #define HPI_COMPANDER_PARAMS HPI_CTL_ATTR(COMPANDER, 1)
325 /* Cobranet control attributes.
326 MUST be distinct from all other control attributes.
327 This is so that host side processing can easily identify a Cobranet control
328 and apply additional host side operations (like copying data) as required.
330 #define HPI_COBRANET_SET HPI_CTL_ATTR(COBRANET, 1)
331 #define HPI_COBRANET_GET HPI_CTL_ATTR(COBRANET, 2)
332 #define HPI_COBRANET_SET_DATA HPI_CTL_ATTR(COBRANET, 3)
333 #define HPI_COBRANET_GET_DATA HPI_CTL_ATTR(COBRANET, 4)
334 #define HPI_COBRANET_GET_STATUS HPI_CTL_ATTR(COBRANET, 5)
335 #define HPI_COBRANET_SEND_PACKET HPI_CTL_ATTR(COBRANET, 6)
336 #define HPI_COBRANET_GET_PACKET HPI_CTL_ATTR(COBRANET, 7)
338 /*------------------------------------------------------------
339 Cobranet Chip Bridge - copied from HMI.H
340 ------------------------------------------------------------*/
341 #define HPI_COBRANET_HMI_cobra_bridge 0x20000
342 #define HPI_COBRANET_HMI_cobra_bridge_tx_pkt_buf \
343 (HPI_COBRANET_HMI_cobra_bridge + 0x1000)
344 #define HPI_COBRANET_HMI_cobra_bridge_rx_pkt_buf \
345 (HPI_COBRANET_HMI_cobra_bridge + 0x2000)
346 #define HPI_COBRANET_HMI_cobra_if_table1 0x110000
347 #define HPI_COBRANET_HMI_cobra_if_phy_address \
348 (HPI_COBRANET_HMI_cobra_if_table1 + 0xd)
349 #define HPI_COBRANET_HMI_cobra_protocolIP 0x72000
350 #define HPI_COBRANET_HMI_cobra_ip_mon_currentIP \
351 (HPI_COBRANET_HMI_cobra_protocolIP + 0x0)
352 #define HPI_COBRANET_HMI_cobra_ip_mon_staticIP \
353 (HPI_COBRANET_HMI_cobra_protocolIP + 0x2)
354 #define HPI_COBRANET_HMI_cobra_sys 0x100000
355 #define HPI_COBRANET_HMI_cobra_sys_desc \
356 (HPI_COBRANET_HMI_cobra_sys + 0x0)
357 #define HPI_COBRANET_HMI_cobra_sys_objectID \
358 (HPI_COBRANET_HMI_cobra_sys + 0x100)
359 #define HPI_COBRANET_HMI_cobra_sys_contact \
360 (HPI_COBRANET_HMI_cobra_sys + 0x200)
361 #define HPI_COBRANET_HMI_cobra_sys_name \
362 (HPI_COBRANET_HMI_cobra_sys + 0x300)
363 #define HPI_COBRANET_HMI_cobra_sys_location \
364 (HPI_COBRANET_HMI_cobra_sys + 0x400)
366 /*------------------------------------------------------------
367 Cobranet Chip Status bits
368 ------------------------------------------------------------*/
369 #define HPI_COBRANET_HMI_STATUS_RXPACKET 2
370 #define HPI_COBRANET_HMI_STATUS_TXPACKET 3
372 /*------------------------------------------------------------
374 ------------------------------------------------------------*/
375 #define HPI_ETHERNET_HEADER_SIZE (16)
377 /* These defines are used to fill in protocol information for an Ethernet packet
378 sent using HMI on CS18102 */
379 /** ID supplied by Cirrius for ASI packets. */
380 #define HPI_ETHERNET_PACKET_ID 0x85
381 /** Simple packet - no special routing required */
382 #define HPI_ETHERNET_PACKET_V1 0x01
383 /** This packet must make its way to the host across the HPI interface */
384 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI 0x20
385 /** This packet must make its way to the host across the HPI interface */
386 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI_V1 0x21
387 /** This packet must make its way to the host across the HPI interface */
388 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI 0x40
389 /** This packet must make its way to the host across the HPI interface */
390 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI_V1 0x41
392 #define HPI_ETHERNET_UDP_PORT (44600) /*!< UDP messaging port */
394 /** Base network time out is set to 100 milli-seconds. */
395 #define HPI_ETHERNET_TIMEOUT_MS (100)
397 /** \defgroup tonedet_attr Tonedetector attributes
399 Used by HPI_ToneDetector_Set() and HPI_ToneDetector_Get()
402 /** Set the threshold level of a tonedetector,
403 Threshold is a -ve number in units of dB/100,
405 #define HPI_TONEDETECTOR_THRESHOLD HPI_CTL_ATTR(TONEDETECTOR, 1)
407 /** Get the current state of tonedetection
408 The result is a bitmap of detected tones. pairs of bits represent the left
409 and right channels, with left channel in LSB.
410 The lowest frequency detector state is in the LSB
412 #define HPI_TONEDETECTOR_STATE HPI_CTL_ATTR(TONEDETECTOR, 2)
414 /** Get the frequency of a tonedetector band.
416 #define HPI_TONEDETECTOR_FREQUENCY HPI_CTL_ATTR(TONEDETECTOR, 3)
420 /** \defgroup silencedet_attr SilenceDetector attributes
424 /** Get the current state of tonedetection
425 The result is a bitmap with 1s for silent channels. Left channel is in LSB
427 #define HPI_SILENCEDETECTOR_STATE \
428 HPI_CTL_ATTR(SILENCEDETECTOR, 2)
430 /** Set the threshold level of a SilenceDetector,
431 Threshold is a -ve number in units of dB/100,
433 #define HPI_SILENCEDETECTOR_THRESHOLD \
434 HPI_CTL_ATTR(SILENCEDETECTOR, 1)
436 /** get/set the silence time before the detector triggers
438 #define HPI_SILENCEDETECTOR_DELAY \
439 HPI_CTL_ATTR(SILENCEDETECTOR, 3)
443 /* Locked memory buffer alloc/free phases */
444 /** use one message to allocate or free physical memory */
445 #define HPI_BUFFER_CMD_EXTERNAL 0
446 /** alloc physical memory */
447 #define HPI_BUFFER_CMD_INTERNAL_ALLOC 1
448 /** send physical memory address to adapter */
449 #define HPI_BUFFER_CMD_INTERNAL_GRANTADAPTER 2
450 /** notify adapter to stop using physical buffer */
451 #define HPI_BUFFER_CMD_INTERNAL_REVOKEADAPTER 3
452 /** free physical buffer */
453 #define HPI_BUFFER_CMD_INTERNAL_FREE 4
455 /******************************************* CONTROLX ATTRIBUTES ****/
456 /* NOTE: All controlx attributes must be unique, unlike control attributes */
458 /*****************************************************************************/
459 /*****************************************************************************/
460 /******** HPI LOW LEVEL MESSAGES *******/
461 /*****************************************************************************/
462 /*****************************************************************************/
464 /** "ASI" - actual is "ASX" - need to change */
465 #define HPI_ID_ISAPNP_AUDIOSCIENCE 0x0669
466 /** PCI vendor ID that AudioScience uses */
467 #define HPI_PCI_VENDOR_ID_AUDIOSCIENCE 0x175C
468 /** PCI vendor ID that the DSP56301 has */
469 #define HPI_PCI_VENDOR_ID_MOTOROLA 0x1057
470 /** PCI vendor ID that TI uses */
471 #define HPI_PCI_VENDOR_ID_TI 0x104C
473 #define HPI_PCI_DEV_ID_PCI2040 0xAC60
474 /** TI's C6205 PCI interface has this ID */
475 #define HPI_PCI_DEV_ID_DSP6205 0xA106
477 #define HPI_USB_VENDOR_ID_AUDIOSCIENCE 0x1257
478 #define HPI_USB_W2K_TAG 0x57495341 /* "ASIW" */
479 #define HPI_USB_LINUX_TAG 0x4C495341 /* "ASIL" */
481 /** First 2 hex digits define the adapter family */
482 #define HPI_ADAPTER_FAMILY_MASK 0xff00
483 #define HPI_MODULE_FAMILY_MASK 0xfff0
485 #define HPI_ADAPTER_FAMILY_ASI(f) (f & HPI_ADAPTER_FAMILY_MASK)
486 #define HPI_MODULE_FAMILY_ASI(f) (f & HPI_MODULE_FAMILY_MASK)
487 #define HPI_ADAPTER_ASI(f) (f)
489 /******************************************* message types */
490 #define HPI_TYPE_MESSAGE 1
491 #define HPI_TYPE_RESPONSE 2
492 #define HPI_TYPE_DATA 3
493 #define HPI_TYPE_SSX2BYPASS_MESSAGE 4
495 /******************************************* object types */
496 #define HPI_OBJ_SUBSYSTEM 1
497 #define HPI_OBJ_ADAPTER 2
498 #define HPI_OBJ_OSTREAM 3
499 #define HPI_OBJ_ISTREAM 4
500 #define HPI_OBJ_MIXER 5
501 #define HPI_OBJ_NODE 6
502 #define HPI_OBJ_CONTROL 7
503 #define HPI_OBJ_NVMEMORY 8
504 #define HPI_OBJ_GPIO 9
505 #define HPI_OBJ_WATCHDOG 10
506 #define HPI_OBJ_CLOCK 11
507 #define HPI_OBJ_PROFILE 12
508 #define HPI_OBJ_CONTROLEX 13
509 #define HPI_OBJ_ASYNCEVENT 14
511 #define HPI_OBJ_MAXINDEX 14
513 /******************************************* methods/functions */
515 #define HPI_OBJ_FUNCTION_SPACING 0x100
516 #define HPI_MAKE_INDEX(obj, index) (obj * HPI_OBJ_FUNCTION_SPACING + index)
517 #define HPI_EXTRACT_INDEX(fn) (fn & 0xff)
520 #define HPI_SUBSYS_OPEN HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 1)
521 #define HPI_SUBSYS_GET_VERSION HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 2)
522 #define HPI_SUBSYS_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 3)
523 #define HPI_SUBSYS_FIND_ADAPTERS HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 4)
524 #define HPI_SUBSYS_CREATE_ADAPTER HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 5)
525 #define HPI_SUBSYS_CLOSE HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 6)
526 #define HPI_SUBSYS_DELETE_ADAPTER HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 7)
527 #define HPI_SUBSYS_DRIVER_LOAD HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 8)
528 #define HPI_SUBSYS_DRIVER_UNLOAD HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 9)
529 #define HPI_SUBSYS_READ_PORT_8 HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 10)
530 #define HPI_SUBSYS_WRITE_PORT_8 HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 11)
531 #define HPI_SUBSYS_GET_NUM_ADAPTERS HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 12)
532 #define HPI_SUBSYS_GET_ADAPTER HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 13)
533 #define HPI_SUBSYS_SET_NETWORK_INTERFACE HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 14)
534 #define HPI_SUBSYS_FUNCTION_COUNT 14
536 #define HPI_ADAPTER_OPEN HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 1)
537 #define HPI_ADAPTER_CLOSE HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 2)
538 #define HPI_ADAPTER_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 3)
539 #define HPI_ADAPTER_GET_ASSERT HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 4)
540 #define HPI_ADAPTER_TEST_ASSERT HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 5)
541 #define HPI_ADAPTER_SET_MODE HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 6)
542 #define HPI_ADAPTER_GET_MODE HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 7)
543 #define HPI_ADAPTER_ENABLE_CAPABILITY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 8)
544 #define HPI_ADAPTER_SELFTEST HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 9)
545 #define HPI_ADAPTER_FIND_OBJECT HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 10)
546 #define HPI_ADAPTER_QUERY_FLASH HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 11)
547 #define HPI_ADAPTER_START_FLASH HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 12)
548 #define HPI_ADAPTER_PROGRAM_FLASH HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 13)
549 #define HPI_ADAPTER_SET_PROPERTY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 14)
550 #define HPI_ADAPTER_GET_PROPERTY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 15)
551 #define HPI_ADAPTER_ENUM_PROPERTY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 16)
552 #define HPI_ADAPTER_MODULE_INFO HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 17)
553 #define HPI_ADAPTER_DEBUG_READ HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 18)
554 #define HPI_ADAPTER_FUNCTION_COUNT 18
556 #define HPI_OSTREAM_OPEN HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 1)
557 #define HPI_OSTREAM_CLOSE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 2)
558 #define HPI_OSTREAM_WRITE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 3)
559 #define HPI_OSTREAM_START HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 4)
560 #define HPI_OSTREAM_STOP HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 5)
561 #define HPI_OSTREAM_RESET HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 6)
562 #define HPI_OSTREAM_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 7)
563 #define HPI_OSTREAM_QUERY_FORMAT HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 8)
564 #define HPI_OSTREAM_DATA HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 9)
565 #define HPI_OSTREAM_SET_VELOCITY HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 10)
566 #define HPI_OSTREAM_SET_PUNCHINOUT HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 11)
567 #define HPI_OSTREAM_SINEGEN HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 12)
568 #define HPI_OSTREAM_ANC_RESET HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 13)
569 #define HPI_OSTREAM_ANC_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 14)
570 #define HPI_OSTREAM_ANC_READ HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 15)
571 #define HPI_OSTREAM_SET_TIMESCALE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 16)
572 #define HPI_OSTREAM_SET_FORMAT HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 17)
573 #define HPI_OSTREAM_HOSTBUFFER_ALLOC HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 18)
574 #define HPI_OSTREAM_HOSTBUFFER_FREE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 19)
575 #define HPI_OSTREAM_GROUP_ADD HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 20)
576 #define HPI_OSTREAM_GROUP_GETMAP HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 21)
577 #define HPI_OSTREAM_GROUP_RESET HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 22)
578 #define HPI_OSTREAM_HOSTBUFFER_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 23)
579 #define HPI_OSTREAM_WAIT_START HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 24)
580 #define HPI_OSTREAM_FUNCTION_COUNT 24
582 #define HPI_ISTREAM_OPEN HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 1)
583 #define HPI_ISTREAM_CLOSE HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 2)
584 #define HPI_ISTREAM_SET_FORMAT HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 3)
585 #define HPI_ISTREAM_READ HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 4)
586 #define HPI_ISTREAM_START HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 5)
587 #define HPI_ISTREAM_STOP HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 6)
588 #define HPI_ISTREAM_RESET HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 7)
589 #define HPI_ISTREAM_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 8)
590 #define HPI_ISTREAM_QUERY_FORMAT HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 9)
591 #define HPI_ISTREAM_ANC_RESET HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 10)
592 #define HPI_ISTREAM_ANC_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 11)
593 #define HPI_ISTREAM_ANC_WRITE HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 12)
594 #define HPI_ISTREAM_HOSTBUFFER_ALLOC HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 13)
595 #define HPI_ISTREAM_HOSTBUFFER_FREE HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 14)
596 #define HPI_ISTREAM_GROUP_ADD HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 15)
597 #define HPI_ISTREAM_GROUP_GETMAP HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 16)
598 #define HPI_ISTREAM_GROUP_RESET HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 17)
599 #define HPI_ISTREAM_HOSTBUFFER_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 18)
600 #define HPI_ISTREAM_WAIT_START HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 19)
601 #define HPI_ISTREAM_FUNCTION_COUNT 19
604 GET_NODE_INFO, SET_CONNECTION, GET_CONNECTIONS are not currently used */
605 #define HPI_MIXER_OPEN HPI_MAKE_INDEX(HPI_OBJ_MIXER, 1)
606 #define HPI_MIXER_CLOSE HPI_MAKE_INDEX(HPI_OBJ_MIXER, 2)
607 #define HPI_MIXER_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_MIXER, 3)
608 #define HPI_MIXER_GET_NODE_INFO HPI_MAKE_INDEX(HPI_OBJ_MIXER, 4)
609 #define HPI_MIXER_GET_CONTROL HPI_MAKE_INDEX(HPI_OBJ_MIXER, 5)
610 #define HPI_MIXER_SET_CONNECTION HPI_MAKE_INDEX(HPI_OBJ_MIXER, 6)
611 #define HPI_MIXER_GET_CONNECTIONS HPI_MAKE_INDEX(HPI_OBJ_MIXER, 7)
612 #define HPI_MIXER_GET_CONTROL_BY_INDEX HPI_MAKE_INDEX(HPI_OBJ_MIXER, 8)
613 #define HPI_MIXER_GET_CONTROL_ARRAY_BY_INDEX HPI_MAKE_INDEX(HPI_OBJ_MIXER, 9)
614 #define HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES HPI_MAKE_INDEX(HPI_OBJ_MIXER, 10)
615 #define HPI_MIXER_STORE HPI_MAKE_INDEX(HPI_OBJ_MIXER, 11)
616 #define HPI_MIXER_FUNCTION_COUNT 11
618 #define HPI_CONTROL_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_CONTROL, 1)
619 #define HPI_CONTROL_GET_STATE HPI_MAKE_INDEX(HPI_OBJ_CONTROL, 2)
620 #define HPI_CONTROL_SET_STATE HPI_MAKE_INDEX(HPI_OBJ_CONTROL, 3)
621 #define HPI_CONTROL_FUNCTION_COUNT 3
623 #define HPI_NVMEMORY_OPEN HPI_MAKE_INDEX(HPI_OBJ_NVMEMORY, 1)
624 #define HPI_NVMEMORY_READ_BYTE HPI_MAKE_INDEX(HPI_OBJ_NVMEMORY, 2)
625 #define HPI_NVMEMORY_WRITE_BYTE HPI_MAKE_INDEX(HPI_OBJ_NVMEMORY, 3)
626 #define HPI_NVMEMORY_FUNCTION_COUNT 3
628 #define HPI_GPIO_OPEN HPI_MAKE_INDEX(HPI_OBJ_GPIO, 1)
629 #define HPI_GPIO_READ_BIT HPI_MAKE_INDEX(HPI_OBJ_GPIO, 2)
630 #define HPI_GPIO_WRITE_BIT HPI_MAKE_INDEX(HPI_OBJ_GPIO, 3)
631 #define HPI_GPIO_READ_ALL HPI_MAKE_INDEX(HPI_OBJ_GPIO, 4)
632 #define HPI_GPIO_WRITE_STATUS HPI_MAKE_INDEX(HPI_OBJ_GPIO, 5)
633 #define HPI_GPIO_FUNCTION_COUNT 5
635 #define HPI_ASYNCEVENT_OPEN HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 1)
636 #define HPI_ASYNCEVENT_CLOSE HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 2)
637 #define HPI_ASYNCEVENT_WAIT HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 3)
638 #define HPI_ASYNCEVENT_GETCOUNT HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 4)
639 #define HPI_ASYNCEVENT_GET HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 5)
640 #define HPI_ASYNCEVENT_SENDEVENTS HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 6)
641 #define HPI_ASYNCEVENT_FUNCTION_COUNT 6
643 #define HPI_WATCHDOG_OPEN HPI_MAKE_INDEX(HPI_OBJ_WATCHDOG, 1)
644 #define HPI_WATCHDOG_SET_TIME HPI_MAKE_INDEX(HPI_OBJ_WATCHDOG, 2)
645 #define HPI_WATCHDOG_PING HPI_MAKE_INDEX(HPI_OBJ_WATCHDOG, 3)
647 #define HPI_CLOCK_OPEN HPI_MAKE_INDEX(HPI_OBJ_CLOCK, 1)
648 #define HPI_CLOCK_SET_TIME HPI_MAKE_INDEX(HPI_OBJ_CLOCK, 2)
649 #define HPI_CLOCK_GET_TIME HPI_MAKE_INDEX(HPI_OBJ_CLOCK, 3)
651 #define HPI_PROFILE_OPEN_ALL HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 1)
652 #define HPI_PROFILE_START_ALL HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 2)
653 #define HPI_PROFILE_STOP_ALL HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 3)
654 #define HPI_PROFILE_GET HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 4)
655 #define HPI_PROFILE_GET_IDLECOUNT HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 5)
656 #define HPI_PROFILE_GET_NAME HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 6)
657 #define HPI_PROFILE_GET_UTILIZATION HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 7)
658 #define HPI_PROFILE_FUNCTION_COUNT 7
659 /* ////////////////////////////////////////////////////////////////////// */
660 /* PRIVATE ATTRIBUTES */
662 /* ////////////////////////////////////////////////////////////////////// */
664 #ifndef DISABLE_PRAGMA_PACK1
665 #pragma pack(push, 1)
668 /** PCI bus resource */
670 u32 __iomem
*ap_mem_base
[HPI_MAX_ADAPTER_MEM_SPACES
];
671 struct pci_dev
*p_os_data
;
673 #ifndef HPI64BIT /* keep structure size constant */
674 u32 padding
[HPI_MAX_ADAPTER_MEM_SPACES
+ 1];
678 u16 subsys_vendor_id
;
679 u16 subsys_device_id
;
685 struct hpi_resource
{
687 const struct hpi_pci
*pci
;
690 #ifndef HPI64BIT /* keep structure size constant */
693 u16 bus_type
; /* HPI_BUS_PNPISA, _PCI, _USB etc */
698 /** Format info used inside struct hpi_message
699 Not the same as public API struct hpi_format */
700 struct hpi_msg_format
{
702 /**< 11025, 32000, 44100 ... */
703 u32 bit_rate
; /**< for MPEG */
705 /**< Stereo/JointStereo/Mono */
706 u16 channels
; /**< 1,2..., (or ancillary mode or idle bit */
707 u16 format
; /**< HPI_FORMAT_PCM16, _MPEG etc. see \ref HPI_FORMATS. */
710 /** Buffer+format structure.
711 Must be kept 7 * 32 bits to match public struct hpi_datastruct */
712 struct hpi_msg_data
{
713 struct hpi_msg_format format
;
721 /** struct hpi_datastructure used up to 3.04 driver */
722 struct hpi_data_legacy32
{
723 struct hpi_format format
;
729 /* Compatibility version of struct hpi_data*/
730 struct hpi_data_compat32
{
731 struct hpi_msg_format format
;
739 /** placehoder for backward compatability (see dwBufferSize) */
740 struct hpi_msg_format reserved
;
741 u32 command
; /**< HPI_BUFFER_CMD_xxx*/
742 u32 pci_address
; /**< PCI physical address of buffer for DSP DMA */
743 u32 buffer_size
; /**< must line up with data_size of HPI_DATA*/
746 /*/////////////////////////////////////////////////////////////////////////// */
747 /* This is used for background buffer bus mastering stream buffers. */
748 struct hpi_hostbuffer_status
{
749 u32 samples_processed
;
750 u32 auxiliary_data_available
;
752 /* DSP index in to the host bus master buffer. */
754 /* Host index in to the host bus master buffer. */
759 struct hpi_streamid
{
761 /**< Type of object, HPI_OBJ_OSTREAM or HPI_OBJ_ISTREAM. */
762 u16 stream_index
; /**< outstream or instream index. */
765 struct hpi_punchinout
{
767 u32 punch_out_sample
;
770 struct hpi_subsys_msg
{
771 struct hpi_resource resource
;
774 struct hpi_subsys_res
{
776 u32 data
; /* used to return extended version */
777 u16 num_adapters
; /* number of adapters */
779 u16 aw_adapter_list
[HPI_MAX_ADAPTERS
];
782 struct hpi_adapter_msg
{
783 u32 adapter_mode
; /* adapter mode */
784 u16 assert_id
; /* assert number for "test assert" call
785 object_index for find object call
786 query_or_set for hpi_adapter_set_mode_ex() */
787 u16 object_type
; /* for adapter find object call */
790 union hpi_adapterx_msg
{
791 struct hpi_adapter_msg adapter
;
804 u16 offset
; /**< offset from start of msg to data */
826 struct hpi_adapter_res
{
829 u16 adapter_index
; /* is this needed? also used for dsp_index */
834 u8 sz_adapter_assert
[HPI_STRING_LEN
];
837 union hpi_adapterx_res
{
838 struct hpi_adapter_res adapter
;
853 struct hpi_stream_msg
{
855 struct hpi_msg_data data
;
856 struct hpi_data_legacy32 data32
;
858 struct hpi_punchinout pio
;
860 struct hpi_buffer buffer
;
861 struct hpi_streamid stream
;
865 struct hpi_stream_res
{
868 /* size of hardware buffer */
870 /* OutStream - data to play,
871 InStream - data recorded */
873 /* OutStream - samples played,
874 InStream - samples recorded */
875 u32 samples_transferred
;
876 /* Adapter - OutStream - data to play,
877 InStream - data recorded */
878 u32 auxiliary_data_available
;
879 u16 state
; /* HPI_STATE_PLAYING, _STATE_STOPPED */
885 u32 samples_transfered
;
890 u32 auxiliary_data_available
;
891 } legacy_stream_info
;
893 /* bitmap of grouped OutStreams */
894 u32 outstream_group_map
;
895 /* bitmap of grouped InStreams */
896 u32 instream_group_map
;
899 /* pointer to the buffer */
901 /* pointer to the hostbuffer status */
902 struct hpi_hostbuffer_status
*p_status
;
907 struct hpi_mixer_msg
{
909 u16 control_type
; /* = HPI_CONTROL_METER _VOLUME etc */
910 u16 padding1
; /* maintain alignment of subsequent fields */
911 u16 node_type1
; /* = HPI_SOURCENODE_LINEIN etc */
912 u16 node_index1
; /* = 0..N */
915 u16 padding2
; /* round to 4 bytes */
918 struct hpi_mixer_res
{
919 u16 src_node_type
; /* = HPI_SOURCENODE_LINEIN etc */
920 u16 src_node_index
; /* = 0..N */
923 /* Also controlType for MixerGetControlByIndex */
925 /* may indicate which DSP the control is located on */
929 union hpi_mixerx_msg
{
933 u32 length_in_bytes
; /* length in bytes of p_data */
934 u32 p_data
; /* pointer to a data array */
939 } store
; /* for HPI_MIXER_STORE message */
942 union hpi_mixerx_res
{
944 u32 bytes_returned
; /* size of items returned */
945 u32 p_data
; /* pointer to data array */
946 u16 more_to_do
; /* indicates if there is more to do */
950 struct hpi_control_msg
{
951 u16 attribute
; /* control attribute or property */
953 u32 param1
; /* generic parameter 1 */
954 u32 param2
; /* generic parameter 2 */
955 short an_log_value
[HPI_MAX_CHANNELS
];
958 struct hpi_control_union_msg
{
959 u16 attribute
; /* control attribute or property */
960 u16 saved_index
; /* only used in ctrl save/restore */
963 u32 param1
; /* generic parameter 1 */
964 u32 param2
; /* generic parameter 2 */
965 short an_log_value
[HPI_MAX_CHANNELS
];
982 struct hpi_control_res
{
983 /* Could make union. dwParam, anLogValue never used in same response */
986 short an_log_value
[HPI_MAX_CHANNELS
];
989 union hpi_control_union_res
{
993 short an_log_value
[HPI_MAX_CHANNELS
];
1008 u32 remaining_chars
;
1013 /* HPI_CONTROLX_STRUCTURES */
1017 /** Used for all HMI variables where max length <= 8 bytes
1019 struct hpi_controlx_msg_cobranet_data
{
1025 /** Used for string data, and for packet bridge
1027 struct hpi_controlx_msg_cobranet_bigdata
{
1036 /** Used for PADS control reading of string fields.
1038 struct hpi_controlx_msg_pad_data
{
1047 /** Used for generic data
1050 struct hpi_controlx_msg_generic
{
1055 struct hpi_controlx_msg
{
1056 u16 attribute
; /* control attribute or property */
1059 struct hpi_controlx_msg_cobranet_data cobranet_data
;
1060 struct hpi_controlx_msg_cobranet_bigdata cobranet_bigdata
;
1061 struct hpi_controlx_msg_generic generic
;
1062 struct hpi_controlx_msg_pad_data pad_data
;
1063 /*struct param_value universal_value; */
1064 /* nothing extra to send for status read */
1071 struct hpi_controlx_res_cobranet_data
{
1076 struct hpi_controlx_res_cobranet_bigdata
{
1080 struct hpi_controlx_res_cobranet_status
{
1086 struct hpi_controlx_res_generic
{
1091 struct hpi_controlx_res
{
1093 struct hpi_controlx_res_cobranet_bigdata cobranet_bigdata
;
1094 struct hpi_controlx_res_cobranet_data cobranet_data
;
1095 struct hpi_controlx_res_cobranet_status cobranet_status
;
1096 struct hpi_controlx_res_generic generic
;
1097 /*struct param_info universal_info; */
1098 /*struct param_value universal_value; */
1102 struct hpi_nvmemory_msg
{
1107 struct hpi_nvmemory_res
{
1112 struct hpi_gpio_msg
{
1117 struct hpi_gpio_res
{
1118 u16 number_input_bits
;
1119 u16 number_output_bits
;
1123 struct hpi_async_msg
{
1129 struct hpi_async_res
{
1136 u16 number_returned
;
1139 struct hpi_async_event event
;
1143 struct hpi_watchdog_msg
{
1147 struct hpi_watchdog_res
{
1151 struct hpi_clock_msg
{
1158 struct hpi_clock_res
{
1167 struct hpi_profile_msg
{
1172 struct hpi_profile_res_open
{
1176 struct hpi_profile_res_time
{
1179 u32 max_micro_seconds
;
1180 u32 min_micro_seconds
;
1184 struct hpi_profile_res_name
{
1188 struct hpi_profile_res
{
1190 struct hpi_profile_res_open o
;
1191 struct hpi_profile_res_time t
;
1192 struct hpi_profile_res_name n
;
1196 struct hpi_message_header
{
1197 u16 size
; /* total size in bytes */
1198 u8 type
; /* HPI_TYPE_MESSAGE */
1199 u8 version
; /* message version */
1200 u16 object
; /* HPI_OBJ_* */
1201 u16 function
; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
1202 u16 adapter_index
; /* the adapter index */
1203 u16 obj_index
; /* */
1206 struct hpi_message
{
1207 /* following fields must match HPI_MESSAGE_HEADER */
1208 u16 size
; /* total size in bytes */
1209 u8 type
; /* HPI_TYPE_MESSAGE */
1210 u8 version
; /* message version */
1211 u16 object
; /* HPI_OBJ_* */
1212 u16 function
; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
1213 u16 adapter_index
; /* the adapter index */
1214 u16 obj_index
; /* */
1216 struct hpi_subsys_msg s
;
1217 struct hpi_adapter_msg a
;
1218 union hpi_adapterx_msg ax
;
1219 struct hpi_stream_msg d
;
1220 struct hpi_mixer_msg m
;
1221 union hpi_mixerx_msg mx
; /* extended mixer; */
1222 struct hpi_control_msg c
; /* mixer control; */
1223 /* identical to struct hpi_control_msg,
1224 but field naming is improved */
1225 struct hpi_control_union_msg cu
;
1226 struct hpi_controlx_msg cx
; /* extended mixer control; */
1227 struct hpi_nvmemory_msg n
;
1228 struct hpi_gpio_msg l
; /* digital i/o */
1229 struct hpi_watchdog_msg w
;
1230 struct hpi_clock_msg t
; /* dsp time */
1231 struct hpi_profile_msg p
;
1232 struct hpi_async_msg as
;
1233 char fixed_size
[32];
1237 #define HPI_MESSAGE_SIZE_BY_OBJECT { \
1238 sizeof(struct hpi_message_header) , /* default, no object type 0 */ \
1239 sizeof(struct hpi_message_header) + sizeof(struct hpi_subsys_msg),\
1240 sizeof(struct hpi_message_header) + sizeof(union hpi_adapterx_msg),\
1241 sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
1242 sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
1243 sizeof(struct hpi_message_header) + sizeof(struct hpi_mixer_msg),\
1244 sizeof(struct hpi_message_header) , /* no node message */ \
1245 sizeof(struct hpi_message_header) + sizeof(struct hpi_control_msg),\
1246 sizeof(struct hpi_message_header) + sizeof(struct hpi_nvmemory_msg),\
1247 sizeof(struct hpi_message_header) + sizeof(struct hpi_gpio_msg),\
1248 sizeof(struct hpi_message_header) + sizeof(struct hpi_watchdog_msg),\
1249 sizeof(struct hpi_message_header) + sizeof(struct hpi_clock_msg),\
1250 sizeof(struct hpi_message_header) + sizeof(struct hpi_profile_msg),\
1251 sizeof(struct hpi_message_header) + sizeof(struct hpi_controlx_msg),\
1252 sizeof(struct hpi_message_header) + sizeof(struct hpi_async_msg) \
1255 struct hpi_response_header
{
1257 u8 type
; /* HPI_TYPE_RESPONSE */
1258 u8 version
; /* response version */
1259 u16 object
; /* HPI_OBJ_* */
1260 u16 function
; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
1261 u16 error
; /* HPI_ERROR_xxx */
1262 u16 specific_error
; /* adapter specific error */
1265 struct hpi_response
{
1266 /* following fields must match HPI_RESPONSE_HEADER */
1268 u8 type
; /* HPI_TYPE_RESPONSE */
1269 u8 version
; /* response version */
1270 u16 object
; /* HPI_OBJ_* */
1271 u16 function
; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
1272 u16 error
; /* HPI_ERROR_xxx */
1273 u16 specific_error
; /* adapter specific error */
1275 struct hpi_subsys_res s
;
1276 struct hpi_adapter_res a
;
1277 union hpi_adapterx_res ax
;
1278 struct hpi_stream_res d
;
1279 struct hpi_mixer_res m
;
1280 union hpi_mixerx_res mx
; /* extended mixer; */
1281 struct hpi_control_res c
; /* mixer control; */
1282 /* identical to hpi_control_res, but field naming is improved */
1283 union hpi_control_union_res cu
;
1284 struct hpi_controlx_res cx
; /* extended mixer control; */
1285 struct hpi_nvmemory_res n
;
1286 struct hpi_gpio_res l
; /* digital i/o */
1287 struct hpi_watchdog_res w
;
1288 struct hpi_clock_res t
; /* dsp time */
1289 struct hpi_profile_res p
;
1290 struct hpi_async_res as
;
1295 #define HPI_RESPONSE_SIZE_BY_OBJECT { \
1296 sizeof(struct hpi_response_header) ,/* default, no object type 0 */ \
1297 sizeof(struct hpi_response_header) + sizeof(struct hpi_subsys_res),\
1298 sizeof(struct hpi_response_header) + sizeof(union hpi_adapterx_res),\
1299 sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
1300 sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
1301 sizeof(struct hpi_response_header) + sizeof(struct hpi_mixer_res),\
1302 sizeof(struct hpi_response_header) , /* no node response */ \
1303 sizeof(struct hpi_response_header) + sizeof(struct hpi_control_res),\
1304 sizeof(struct hpi_response_header) + sizeof(struct hpi_nvmemory_res),\
1305 sizeof(struct hpi_response_header) + sizeof(struct hpi_gpio_res),\
1306 sizeof(struct hpi_response_header) + sizeof(struct hpi_watchdog_res),\
1307 sizeof(struct hpi_response_header) + sizeof(struct hpi_clock_res),\
1308 sizeof(struct hpi_response_header) + sizeof(struct hpi_profile_res),\
1309 sizeof(struct hpi_response_header) + sizeof(struct hpi_controlx_res),\
1310 sizeof(struct hpi_response_header) + sizeof(struct hpi_async_res) \
1313 /*********************** version 1 message/response *****************************/
1314 #define HPINET_ETHERNET_DATA_SIZE (1500)
1315 #define HPINET_IP_HDR_SIZE (20)
1316 #define HPINET_IP_DATA_SIZE (HPINET_ETHERNET_DATA_SIZE - HPINET_IP_HDR_SIZE)
1317 #define HPINET_UDP_HDR_SIZE (8)
1318 #define HPINET_UDP_DATA_SIZE (HPINET_IP_DATA_SIZE - HPINET_UDP_HDR_SIZE)
1319 #define HPINET_ASI_HDR_SIZE (2)
1320 #define HPINET_ASI_DATA_SIZE (HPINET_UDP_DATA_SIZE - HPINET_ASI_HDR_SIZE)
1322 #define HPI_MAX_PAYLOAD_SIZE (HPINET_ASI_DATA_SIZE - 2)
1324 /* New style message/response, but still V0 compatible */
1325 struct hpi_msg_adapter_get_info
{
1326 struct hpi_message_header h
;
1329 struct hpi_res_adapter_get_info
{
1330 struct hpi_response_header h
; /*v0 */
1331 struct hpi_adapter_res p
;
1334 /* padding is so these are same size as v0 hpi_message */
1335 struct hpi_msg_adapter_query_flash
{
1336 struct hpi_message_header h
;
1338 u8 pad_to_version0_size
[sizeof(struct hpi_message
) - /* V0 res */
1339 sizeof(struct hpi_message_header
) - 1 * sizeof(u32
)];
1342 /* padding is so these are same size as v0 hpi_response */
1343 struct hpi_res_adapter_query_flash
{
1344 struct hpi_response_header h
;
1348 u8 pad_to_version0_size
[sizeof(struct hpi_response
) - /* V0 res */
1349 sizeof(struct hpi_response_header
) - 3 * sizeof(u32
)];
1352 struct hpi_msg_adapter_start_flash
{
1353 struct hpi_message_header h
;
1357 u8 pad_to_version0_size
[sizeof(struct hpi_message
) - /* V0 res */
1358 sizeof(struct hpi_message_header
) - 3 * sizeof(u32
)];
1361 struct hpi_res_adapter_start_flash
{
1362 struct hpi_response_header h
;
1363 u8 pad_to_version0_size
[sizeof(struct hpi_response
) - /* V0 res */
1364 sizeof(struct hpi_response_header
)];
1367 struct hpi_msg_adapter_program_flash_payload
{
1371 u16 offset
; /**< offset from start of msg to data */
1373 /* ensure sizeof(header + payload) == sizeof(hpi_message_V0)
1374 because old firmware expects data after message of this size */
1375 u8 pad_to_version0_size
[sizeof(struct hpi_message
) - /* V0 message */
1376 sizeof(struct hpi_message_header
) - sizeof(u32
) -
1380 struct hpi_msg_adapter_program_flash
{
1381 struct hpi_message_header h
;
1382 struct hpi_msg_adapter_program_flash_payload p
;
1386 struct hpi_res_adapter_program_flash
{
1387 struct hpi_response_header h
;
1389 u8 pad_to_version0_size
[sizeof(struct hpi_response
) - /* V0 res */
1390 sizeof(struct hpi_response_header
) - sizeof(u16
)];
1394 #define hpi_message_header_v1 hpi_message_header
1395 #define hpi_response_header_v1 hpi_response_header
1397 /* V1 headers in Addition to v0 headers */
1398 struct hpi_message_header_v1
{
1399 struct hpi_message_header h0
;
1404 struct hpi_response_header_v1
{
1405 struct hpi_response_header h0
;
1407 u16 adapter_index
; /* the adapter index */
1408 u16 obj_index
; /* object index */
1413 /* STRV HPI Packet */
1414 struct hpi_msg_strv
{
1415 struct hpi_message_header h
;
1416 struct hpi_entity strv
;
1419 struct hpi_res_strv
{
1420 struct hpi_response_header h
;
1421 struct hpi_entity strv
;
1423 #define MIN_STRV_PACKET_SIZE sizeof(struct hpi_res_strv)
1425 struct hpi_msg_payload_v0
{
1426 struct hpi_message_header h
;
1428 struct hpi_subsys_msg s
;
1429 struct hpi_adapter_msg a
;
1430 union hpi_adapterx_msg ax
;
1431 struct hpi_stream_msg d
;
1432 struct hpi_mixer_msg m
;
1433 union hpi_mixerx_msg mx
;
1434 struct hpi_control_msg c
;
1435 struct hpi_control_union_msg cu
;
1436 struct hpi_controlx_msg cx
;
1437 struct hpi_nvmemory_msg n
;
1438 struct hpi_gpio_msg l
;
1439 struct hpi_watchdog_msg w
;
1440 struct hpi_clock_msg t
;
1441 struct hpi_profile_msg p
;
1442 struct hpi_async_msg as
;
1446 struct hpi_res_payload_v0
{
1447 struct hpi_response_header h
;
1449 struct hpi_subsys_res s
;
1450 struct hpi_adapter_res a
;
1451 union hpi_adapterx_res ax
;
1452 struct hpi_stream_res d
;
1453 struct hpi_mixer_res m
;
1454 union hpi_mixerx_res mx
;
1455 struct hpi_control_res c
;
1456 union hpi_control_union_res cu
;
1457 struct hpi_controlx_res cx
;
1458 struct hpi_nvmemory_res n
;
1459 struct hpi_gpio_res l
;
1460 struct hpi_watchdog_res w
;
1461 struct hpi_clock_res t
;
1462 struct hpi_profile_res p
;
1463 struct hpi_async_res as
;
1467 union hpi_message_buffer_v1
{
1468 struct hpi_message m0
; /* version 0 */
1469 struct hpi_message_header_v1 h
;
1470 unsigned char buf
[HPI_MAX_PAYLOAD_SIZE
];
1473 union hpi_response_buffer_v1
{
1474 struct hpi_response r0
; /* version 0 */
1475 struct hpi_response_header_v1 h
;
1476 unsigned char buf
[HPI_MAX_PAYLOAD_SIZE
];
1479 compile_time_assert((sizeof(union hpi_message_buffer_v1
) <=
1480 HPI_MAX_PAYLOAD_SIZE
), message_buffer_ok
);
1481 compile_time_assert((sizeof(union hpi_response_buffer_v1
) <=
1482 HPI_MAX_PAYLOAD_SIZE
), response_buffer_ok
);
1484 /*////////////////////////////////////////////////////////////////////////// */
1485 /* declarations for compact control calls */
1486 struct hpi_control_defn
{
1495 /*////////////////////////////////////////////////////////////////////////// */
1496 /* declarations for control caching (internal to HPI<->DSP interaction) */
1498 /** A compact representation of (part of) a controls state.
1499 Used for efficient transfer of the control state
1500 between DSP and host or across a network
1502 struct hpi_control_cache_info
{
1503 /** one of HPI_CONTROL_* */
1505 /** The total size of cached information in 32-bit words. */
1506 u8 size_in32bit_words
;
1507 /** The original index of the control on the DSP */
1511 struct hpi_control_cache_single
{
1512 struct hpi_control_cache_info i
;
1514 struct { /* volume */
1517 struct { /* peak meter */
1521 struct { /* channel mode */
1524 struct { /* multiplexer */
1525 u16 source_node_type
;
1526 u16 source_node_index
;
1528 struct { /* level/trim */
1531 struct { /* tuner - partial caching.
1532 some attributes go to the DSP. */
1537 struct { /* AESEBU rx status */
1541 struct { /* AESEBU tx */
1544 struct { /* tone detector */
1547 struct { /* silence detector */
1551 struct { /* sample clock */
1556 struct { /* microphone control */
1559 struct { /* generic control */
1566 struct hpi_control_cache_pad
{
1567 struct hpi_control_cache_info i
;
1568 u32 field_valid_flags
;
1575 u32 traffic_supported
;
1576 u32 traffic_anouncement
;
1579 /*/////////////////////////////////////////////////////////////////////////// */
1580 /* declarations for 2^N sized FIFO buffer (internal to HPI<->DSP interaction) */
1581 struct hpi_fifo_buffer
{
1587 #ifndef DISABLE_PRAGMA_PACK1
1591 /* skip host side function declarations for DSP
1592 compile and documentation extraction */
1594 char hpi_handle_object(const u32 handle
);
1596 void hpi_handle_to_indexes(const u32 handle
, u16
*pw_adapter_index
,
1597 u16
*pw_object_index
);
1599 u32
hpi_indexes_to_handle(const char c_object
, const u16 adapter_index
,
1600 const u16 object_index
);
1602 /*////////////////////////////////////////////////////////////////////////// */
1604 /* main HPI entry point */
1605 hpi_handler_func hpi_send_recv
;
1608 void hpi_send_recvUDP(struct hpi_message
*phm
, struct hpi_response
*phr
,
1609 const unsigned int timeout
);
1611 /* used in PnP OS/driver */
1612 u16
hpi_subsys_create_adapter(const struct hpi_hsubsys
*ph_subsys
,
1613 const struct hpi_resource
*p_resource
, u16
*pw_adapter_index
);
1615 u16
hpi_subsys_delete_adapter(const struct hpi_hsubsys
*ph_subsys
,
1618 u16
hpi_outstream_host_buffer_get_info(const struct hpi_hsubsys
*ph_subsys
,
1619 u32 h_outstream
, u8
**pp_buffer
,
1620 struct hpi_hostbuffer_status
**pp_status
);
1622 u16
hpi_instream_host_buffer_get_info(const struct hpi_hsubsys
*ph_subsys
,
1623 u32 h_instream
, u8
**pp_buffer
,
1624 struct hpi_hostbuffer_status
**pp_status
);
1626 u16
hpi_adapter_restart(u16 adapter_index
);
1629 The following 3 functions were last declared in header files for
1630 driver 3.10. HPI_ControlQuery() used to be the recommended way
1631 of getting a volume range. Declared here for binary asihpi32.dll
1635 void hpi_format_to_msg(struct hpi_msg_format
*pMF
,
1636 const struct hpi_format
*pF
);
1637 void hpi_stream_response_to_legacy(struct hpi_stream_res
*pSR
);
1639 /*////////////////////////////////////////////////////////////////////////// */
1640 /* declarations for individual HPI entry points */
1641 hpi_handler_func HPI_1000
;
1642 hpi_handler_func HPI_6000
;
1643 hpi_handler_func HPI_6205
;
1644 hpi_handler_func HPI_COMMON
;
1646 #endif /* _HPI_INTERNAL_H_ */