1 /******************************************************************************
3 AudioScience HPI driver
4 Copyright (C) 1997-2012 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_
29 /** maximum number of memory regions mapped to an adapter */
30 #define HPI_MAX_ADAPTER_MEM_SPACES (2)
32 /* Each OS needs its own hpios.h */
35 /* physical memory allocation */
37 /** Allocate and map an area of locked memory for bus master DMA operations.
39 On success, *pLockedMemeHandle is a valid handle, and 0 is returned
40 On error *pLockedMemHandle marked invalid, non-zero returned.
42 If this function succeeds, then HpiOs_LockedMem_GetVirtAddr() and
43 HpiOs_LockedMem_GetPyhsAddr() will always succed on the returned handle.
45 u16
hpios_locked_mem_alloc(struct consistent_dma_area
*p_locked_mem_handle
,
47 u32 size
, /**< Size in bytes to allocate */
48 struct pci_dev
*p_os_reference
49 /**< OS specific data required for memory allocation */
52 /** Free mapping and memory represented by LockedMemHandle
54 Frees any resources, then invalidates the handle.
55 Returns 0 on success, 1 if handle is invalid.
58 u16
hpios_locked_mem_free(struct consistent_dma_area
*locked_mem_handle
);
60 /** Get the physical PCI address of memory represented by LockedMemHandle.
62 If handle is invalid *pPhysicalAddr is set to zero and return 1
64 u16
hpios_locked_mem_get_phys_addr(struct consistent_dma_area
65 *locked_mem_handle
, u32
*p_physical_addr
);
67 /** Get the CPU address of of memory represented by LockedMemHandle.
69 If handle is NULL *ppvVirtualAddr is set to NULL and return 1
71 u16
hpios_locked_mem_get_virt_addr(struct consistent_dma_area
72 *locked_mem_handle
, void **ppv_virtual_addr
);
74 /** Check that handle is valid
75 i.e it represents a valid memory area
77 u16
hpios_locked_mem_valid(struct consistent_dma_area
*locked_mem_handle
);
80 void hpios_delay_micro_seconds(u32 num_micro_sec
);
85 typedef void hpi_handler_func(struct hpi_message
*, struct hpi_response
*);
87 /* If the assert fails, compiler complains
88 something like size of array `msg' is negative.
89 Unlike linux BUILD_BUG_ON, this works outside function scope.
91 #define compile_time_assert(cond, msg) \
92 typedef char ASSERT_##msg[(cond) ? 1 : -1]
94 /******************************************* bus types */
102 enum HPI_SUBSYS_OPTIONS
{
103 /* 0, 256 are invalid, 1..255 reserved for global options */
104 HPI_SUBSYS_OPT_NET_ENABLE
= 257,
105 HPI_SUBSYS_OPT_NET_BROADCAST
= 258,
106 HPI_SUBSYS_OPT_NET_UNICAST
= 259,
107 HPI_SUBSYS_OPT_NET_ADDR
= 260,
108 HPI_SUBSYS_OPT_NET_MASK
= 261,
109 HPI_SUBSYS_OPT_NET_ADAPTER_ADDRESS_ADD
= 262
114 enum HPI_VOLUME_FLAGS
{
115 /** Set if the volume control is muted */
116 HPI_VOLUME_FLAG_MUTED
= (1 << 0),
117 /** Set if the volume control has a mute function */
118 HPI_VOLUME_FLAG_HAS_MUTE
= (1 << 1),
119 /** Set if volume control can do autofading */
120 HPI_VOLUME_FLAG_HAS_AUTOFADE
= (1 << 2)
121 /* Note Flags >= (1<<8) are for DSP internal use only */
124 /******************************************* CONTROL ATTRIBUTES ****/
125 /* (in order of control type ID */
127 /* This allows for 255 control types, 256 unique attributes each */
128 #define HPI_CTL_ATTR(ctl, ai) ((HPI_CONTROL_##ctl << 8) + ai)
130 /* Get the sub-index of the attribute for a control type */
131 #define HPI_CTL_ATTR_INDEX(i) (i & 0xff)
133 /* Extract the control from the control attribute */
134 #define HPI_CTL_ATTR_CONTROL(i) (i >> 8)
136 /** Enable event generation for a control.
138 \note generic to all controls that can generate events
141 /** Unique identifiers for every control attribute
143 enum HPI_CONTROL_ATTRIBUTES
{
144 HPI_GENERIC_ENABLE
= HPI_CTL_ATTR(GENERIC
, 1),
145 HPI_GENERIC_EVENT_ENABLE
= HPI_CTL_ATTR(GENERIC
, 2),
147 HPI_VOLUME_GAIN
= HPI_CTL_ATTR(VOLUME
, 1),
148 HPI_VOLUME_AUTOFADE
= HPI_CTL_ATTR(VOLUME
, 2),
149 HPI_VOLUME_MUTE
= HPI_CTL_ATTR(VOLUME
, 3),
150 HPI_VOLUME_GAIN_AND_FLAGS
= HPI_CTL_ATTR(VOLUME
, 4),
151 HPI_VOLUME_NUM_CHANNELS
= HPI_CTL_ATTR(VOLUME
, 6),
152 HPI_VOLUME_RANGE
= HPI_CTL_ATTR(VOLUME
, 10),
154 HPI_METER_RMS
= HPI_CTL_ATTR(METER
, 1),
155 HPI_METER_PEAK
= HPI_CTL_ATTR(METER
, 2),
156 HPI_METER_RMS_BALLISTICS
= HPI_CTL_ATTR(METER
, 3),
157 HPI_METER_PEAK_BALLISTICS
= HPI_CTL_ATTR(METER
, 4),
158 HPI_METER_NUM_CHANNELS
= HPI_CTL_ATTR(METER
, 5),
160 HPI_MULTIPLEXER_SOURCE
= HPI_CTL_ATTR(MULTIPLEXER
, 1),
161 HPI_MULTIPLEXER_QUERYSOURCE
= HPI_CTL_ATTR(MULTIPLEXER
, 2),
163 HPI_AESEBUTX_FORMAT
= HPI_CTL_ATTR(AESEBUTX
, 1),
164 HPI_AESEBUTX_SAMPLERATE
= HPI_CTL_ATTR(AESEBUTX
, 3),
165 HPI_AESEBUTX_CHANNELSTATUS
= HPI_CTL_ATTR(AESEBUTX
, 4),
166 HPI_AESEBUTX_USERDATA
= HPI_CTL_ATTR(AESEBUTX
, 5),
168 HPI_AESEBURX_FORMAT
= HPI_CTL_ATTR(AESEBURX
, 1),
169 HPI_AESEBURX_ERRORSTATUS
= HPI_CTL_ATTR(AESEBURX
, 2),
170 HPI_AESEBURX_SAMPLERATE
= HPI_CTL_ATTR(AESEBURX
, 3),
171 HPI_AESEBURX_CHANNELSTATUS
= HPI_CTL_ATTR(AESEBURX
, 4),
172 HPI_AESEBURX_USERDATA
= HPI_CTL_ATTR(AESEBURX
, 5),
174 HPI_LEVEL_GAIN
= HPI_CTL_ATTR(LEVEL
, 1),
175 HPI_LEVEL_RANGE
= HPI_CTL_ATTR(LEVEL
, 10),
177 HPI_TUNER_BAND
= HPI_CTL_ATTR(TUNER
, 1),
178 HPI_TUNER_FREQ
= HPI_CTL_ATTR(TUNER
, 2),
179 HPI_TUNER_LEVEL_AVG
= HPI_CTL_ATTR(TUNER
, 3),
180 HPI_TUNER_LEVEL_RAW
= HPI_CTL_ATTR(TUNER
, 4),
181 HPI_TUNER_SNR
= HPI_CTL_ATTR(TUNER
, 5),
182 HPI_TUNER_GAIN
= HPI_CTL_ATTR(TUNER
, 6),
183 HPI_TUNER_STATUS
= HPI_CTL_ATTR(TUNER
, 7),
184 HPI_TUNER_MODE
= HPI_CTL_ATTR(TUNER
, 8),
185 HPI_TUNER_RDS
= HPI_CTL_ATTR(TUNER
, 9),
186 HPI_TUNER_DEEMPHASIS
= HPI_CTL_ATTR(TUNER
, 10),
187 HPI_TUNER_PROGRAM
= HPI_CTL_ATTR(TUNER
, 11),
188 HPI_TUNER_HDRADIO_SIGNAL_QUALITY
= HPI_CTL_ATTR(TUNER
, 12),
189 HPI_TUNER_HDRADIO_SDK_VERSION
= HPI_CTL_ATTR(TUNER
, 13),
190 HPI_TUNER_HDRADIO_DSP_VERSION
= HPI_CTL_ATTR(TUNER
, 14),
191 HPI_TUNER_HDRADIO_BLEND
= HPI_CTL_ATTR(TUNER
, 15),
193 HPI_VOX_THRESHOLD
= HPI_CTL_ATTR(VOX
, 1),
195 HPI_CHANNEL_MODE_MODE
= HPI_CTL_ATTR(CHANNEL_MODE
, 1),
197 HPI_BITSTREAM_DATA_POLARITY
= HPI_CTL_ATTR(BITSTREAM
, 1),
198 HPI_BITSTREAM_CLOCK_EDGE
= HPI_CTL_ATTR(BITSTREAM
, 2),
199 HPI_BITSTREAM_CLOCK_SOURCE
= HPI_CTL_ATTR(BITSTREAM
, 3),
200 HPI_BITSTREAM_ACTIVITY
= HPI_CTL_ATTR(BITSTREAM
, 4),
202 HPI_SAMPLECLOCK_SOURCE
= HPI_CTL_ATTR(SAMPLECLOCK
, 1),
203 HPI_SAMPLECLOCK_SAMPLERATE
= HPI_CTL_ATTR(SAMPLECLOCK
, 2),
204 HPI_SAMPLECLOCK_SOURCE_INDEX
= HPI_CTL_ATTR(SAMPLECLOCK
, 3),
205 HPI_SAMPLECLOCK_LOCAL_SAMPLERATE
= HPI_CTL_ATTR(SAMPLECLOCK
, 4),
206 HPI_SAMPLECLOCK_AUTO
= HPI_CTL_ATTR(SAMPLECLOCK
, 5),
207 HPI_SAMPLECLOCK_LOCAL_LOCK
= HPI_CTL_ATTR(SAMPLECLOCK
, 6),
209 HPI_MICROPHONE_PHANTOM_POWER
= HPI_CTL_ATTR(MICROPHONE
, 1),
211 HPI_EQUALIZER_NUM_FILTERS
= HPI_CTL_ATTR(EQUALIZER
, 1),
212 HPI_EQUALIZER_FILTER
= HPI_CTL_ATTR(EQUALIZER
, 2),
213 HPI_EQUALIZER_COEFFICIENTS
= HPI_CTL_ATTR(EQUALIZER
, 3),
215 HPI_COMPANDER_PARAMS
= HPI_CTL_ATTR(COMPANDER
, 1),
216 HPI_COMPANDER_MAKEUPGAIN
= HPI_CTL_ATTR(COMPANDER
, 2),
217 HPI_COMPANDER_THRESHOLD
= HPI_CTL_ATTR(COMPANDER
, 3),
218 HPI_COMPANDER_RATIO
= HPI_CTL_ATTR(COMPANDER
, 4),
219 HPI_COMPANDER_ATTACK
= HPI_CTL_ATTR(COMPANDER
, 5),
220 HPI_COMPANDER_DECAY
= HPI_CTL_ATTR(COMPANDER
, 6),
222 HPI_COBRANET_SET
= HPI_CTL_ATTR(COBRANET
, 1),
223 HPI_COBRANET_GET
= HPI_CTL_ATTR(COBRANET
, 2),
224 HPI_COBRANET_GET_STATUS
= HPI_CTL_ATTR(COBRANET
, 5),
225 HPI_COBRANET_SEND_PACKET
= HPI_CTL_ATTR(COBRANET
, 6),
226 HPI_COBRANET_GET_PACKET
= HPI_CTL_ATTR(COBRANET
, 7),
228 HPI_TONEDETECTOR_THRESHOLD
= HPI_CTL_ATTR(TONEDETECTOR
, 1),
229 HPI_TONEDETECTOR_STATE
= HPI_CTL_ATTR(TONEDETECTOR
, 2),
230 HPI_TONEDETECTOR_FREQUENCY
= HPI_CTL_ATTR(TONEDETECTOR
, 3),
232 HPI_SILENCEDETECTOR_THRESHOLD
= HPI_CTL_ATTR(SILENCEDETECTOR
, 1),
233 HPI_SILENCEDETECTOR_STATE
= HPI_CTL_ATTR(SILENCEDETECTOR
, 2),
234 HPI_SILENCEDETECTOR_DELAY
= HPI_CTL_ATTR(SILENCEDETECTOR
, 3),
236 HPI_PAD_CHANNEL_NAME
= HPI_CTL_ATTR(PAD
, 1),
237 HPI_PAD_ARTIST
= HPI_CTL_ATTR(PAD
, 2),
238 HPI_PAD_TITLE
= HPI_CTL_ATTR(PAD
, 3),
239 HPI_PAD_COMMENT
= HPI_CTL_ATTR(PAD
, 4),
240 HPI_PAD_PROGRAM_TYPE
= HPI_CTL_ATTR(PAD
, 5),
241 HPI_PAD_PROGRAM_ID
= HPI_CTL_ATTR(PAD
, 6),
242 HPI_PAD_TA_SUPPORT
= HPI_CTL_ATTR(PAD
, 7),
243 HPI_PAD_TA_ACTIVE
= HPI_CTL_ATTR(PAD
, 8),
245 HPI_UNIVERSAL_ENTITY
= HPI_CTL_ATTR(UNIVERSAL
, 1)
248 #define HPI_POLARITY_POSITIVE 0
249 #define HPI_POLARITY_NEGATIVE 1
251 /*------------------------------------------------------------
252 Cobranet Chip Bridge - copied from HMI.H
253 ------------------------------------------------------------*/
254 #define HPI_COBRANET_HMI_cobra_bridge 0x20000
255 #define HPI_COBRANET_HMI_cobra_bridge_tx_pkt_buf \
256 (HPI_COBRANET_HMI_cobra_bridge + 0x1000)
257 #define HPI_COBRANET_HMI_cobra_bridge_rx_pkt_buf \
258 (HPI_COBRANET_HMI_cobra_bridge + 0x2000)
259 #define HPI_COBRANET_HMI_cobra_if_table1 0x110000
260 #define HPI_COBRANET_HMI_cobra_if_phy_address \
261 (HPI_COBRANET_HMI_cobra_if_table1 + 0xd)
262 #define HPI_COBRANET_HMI_cobra_protocolIP 0x72000
263 #define HPI_COBRANET_HMI_cobra_ip_mon_currentIP \
264 (HPI_COBRANET_HMI_cobra_protocolIP + 0x0)
265 #define HPI_COBRANET_HMI_cobra_ip_mon_staticIP \
266 (HPI_COBRANET_HMI_cobra_protocolIP + 0x2)
267 #define HPI_COBRANET_HMI_cobra_sys 0x100000
268 #define HPI_COBRANET_HMI_cobra_sys_desc \
269 (HPI_COBRANET_HMI_cobra_sys + 0x0)
270 #define HPI_COBRANET_HMI_cobra_sys_objectID \
271 (HPI_COBRANET_HMI_cobra_sys + 0x100)
272 #define HPI_COBRANET_HMI_cobra_sys_contact \
273 (HPI_COBRANET_HMI_cobra_sys + 0x200)
274 #define HPI_COBRANET_HMI_cobra_sys_name \
275 (HPI_COBRANET_HMI_cobra_sys + 0x300)
276 #define HPI_COBRANET_HMI_cobra_sys_location \
277 (HPI_COBRANET_HMI_cobra_sys + 0x400)
279 /*------------------------------------------------------------
280 Cobranet Chip Status bits
281 ------------------------------------------------------------*/
282 #define HPI_COBRANET_HMI_STATUS_RXPACKET 2
283 #define HPI_COBRANET_HMI_STATUS_TXPACKET 3
285 /*------------------------------------------------------------
287 ------------------------------------------------------------*/
288 #define HPI_ETHERNET_HEADER_SIZE (16)
290 /* These defines are used to fill in protocol information for an Ethernet packet
291 sent using HMI on CS18102 */
292 /** ID supplied by Cirrus for ASI packets. */
293 #define HPI_ETHERNET_PACKET_ID 0x85
294 /** Simple packet - no special routing required */
295 #define HPI_ETHERNET_PACKET_V1 0x01
296 /** This packet must make its way to the host across the HPI interface */
297 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI 0x20
298 /** This packet must make its way to the host across the HPI interface */
299 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HMI_V1 0x21
300 /** This packet must make its way to the host across the HPI interface */
301 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI 0x40
302 /** This packet must make its way to the host across the HPI interface */
303 #define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI_V1 0x41
305 #define HPI_ETHERNET_UDP_PORT 44600 /**< HPI UDP service */
307 /** Default network timeout in milli-seconds. */
308 #define HPI_ETHERNET_TIMEOUT_MS 500
310 /** Locked memory buffer alloc/free phases */
311 enum HPI_BUFFER_CMDS
{
312 /** use one message to allocate or free physical memory */
313 HPI_BUFFER_CMD_EXTERNAL
= 0,
314 /** alloc physical memory */
315 HPI_BUFFER_CMD_INTERNAL_ALLOC
= 1,
316 /** send physical memory address to adapter */
317 HPI_BUFFER_CMD_INTERNAL_GRANTADAPTER
= 2,
318 /** notify adapter to stop using physical buffer */
319 HPI_BUFFER_CMD_INTERNAL_REVOKEADAPTER
= 3,
320 /** free physical buffer */
321 HPI_BUFFER_CMD_INTERNAL_FREE
= 4
324 /*****************************************************************************/
325 /*****************************************************************************/
326 /******** HPI LOW LEVEL MESSAGES *******/
327 /*****************************************************************************/
328 /*****************************************************************************/
330 /** "ASI" - actual is "ASX" - need to change */
331 #define HPI_ID_ISAPNP_AUDIOSCIENCE 0x0669
332 /** PCI vendor ID that AudioScience uses */
333 #define HPI_PCI_VENDOR_ID_AUDIOSCIENCE 0x175C
334 /** PCI vendor ID that the DSP56301 has */
335 #define HPI_PCI_VENDOR_ID_MOTOROLA 0x1057
336 /** PCI vendor ID that TI uses */
337 #define HPI_PCI_VENDOR_ID_TI 0x104C
339 #define HPI_PCI_DEV_ID_PCI2040 0xAC60
340 /** TI's C6205 PCI interface has this ID */
341 #define HPI_PCI_DEV_ID_DSP6205 0xA106
343 #define HPI_USB_VENDOR_ID_AUDIOSCIENCE 0x1257
344 #define HPI_USB_W2K_TAG 0x57495341 /* "ASIW" */
345 #define HPI_USB_LINUX_TAG 0x4C495341 /* "ASIL" */
347 /** Invalid Adapter index
348 Used in HPI messages that are not addressed to a specific adapter
349 Used in DLL to indicate device not present
351 #define HPI_ADAPTER_INDEX_INVALID 0xFFFF
353 /** First 2 hex digits define the adapter family */
354 #define HPI_ADAPTER_FAMILY_MASK 0xff00
355 #define HPI_MODULE_FAMILY_MASK 0xfff0
357 #define HPI_ADAPTER_FAMILY_ASI(f) (f & HPI_ADAPTER_FAMILY_MASK)
358 #define HPI_MODULE_FAMILY_ASI(f) (f & HPI_MODULE_FAMILY_MASK)
359 #define HPI_ADAPTER_ASI(f) (f)
361 enum HPI_MESSAGE_TYPES
{
362 HPI_TYPE_REQUEST
= 1,
363 HPI_TYPE_RESPONSE
= 2,
365 HPI_TYPE_SSX2BYPASS_MESSAGE
= 4,
366 HPI_TYPE_COMMAND
= 5,
367 HPI_TYPE_NOTIFICATION
= 6
370 enum HPI_OBJECT_TYPES
{
371 HPI_OBJ_SUBSYSTEM
= 1,
378 HPI_OBJ_NVMEMORY
= 8,
380 HPI_OBJ_WATCHDOG
= 10,
382 HPI_OBJ_PROFILE
= 12,
383 /* HPI_ OBJ_ CONTROLEX = 13, */
384 HPI_OBJ_ASYNCEVENT
= 14
385 #define HPI_OBJ_MAXINDEX 14
388 #define HPI_OBJ_FUNCTION_SPACING 0x100
389 #define HPI_FUNC_ID(obj, i) (HPI_OBJ_##obj * HPI_OBJ_FUNCTION_SPACING + i)
391 #define HPI_EXTRACT_INDEX(fn) (fn & 0xff)
393 enum HPI_FUNCTION_IDS
{
394 HPI_SUBSYS_OPEN
= HPI_FUNC_ID(SUBSYSTEM
, 1),
395 HPI_SUBSYS_GET_VERSION
= HPI_FUNC_ID(SUBSYSTEM
, 2),
396 HPI_SUBSYS_GET_INFO
= HPI_FUNC_ID(SUBSYSTEM
, 3),
397 HPI_SUBSYS_CREATE_ADAPTER
= HPI_FUNC_ID(SUBSYSTEM
, 5),
398 HPI_SUBSYS_CLOSE
= HPI_FUNC_ID(SUBSYSTEM
, 6),
399 HPI_SUBSYS_DRIVER_LOAD
= HPI_FUNC_ID(SUBSYSTEM
, 8),
400 HPI_SUBSYS_DRIVER_UNLOAD
= HPI_FUNC_ID(SUBSYSTEM
, 9),
401 HPI_SUBSYS_GET_NUM_ADAPTERS
= HPI_FUNC_ID(SUBSYSTEM
, 12),
402 HPI_SUBSYS_GET_ADAPTER
= HPI_FUNC_ID(SUBSYSTEM
, 13),
403 HPI_SUBSYS_SET_NETWORK_INTERFACE
= HPI_FUNC_ID(SUBSYSTEM
, 14),
404 HPI_SUBSYS_OPTION_INFO
= HPI_FUNC_ID(SUBSYSTEM
, 15),
405 HPI_SUBSYS_OPTION_GET
= HPI_FUNC_ID(SUBSYSTEM
, 16),
406 HPI_SUBSYS_OPTION_SET
= HPI_FUNC_ID(SUBSYSTEM
, 17),
407 #define HPI_SUBSYS_FUNCTION_COUNT 17
409 HPI_ADAPTER_OPEN
= HPI_FUNC_ID(ADAPTER
, 1),
410 HPI_ADAPTER_CLOSE
= HPI_FUNC_ID(ADAPTER
, 2),
411 HPI_ADAPTER_GET_INFO
= HPI_FUNC_ID(ADAPTER
, 3),
412 HPI_ADAPTER_GET_ASSERT
= HPI_FUNC_ID(ADAPTER
, 4),
413 HPI_ADAPTER_TEST_ASSERT
= HPI_FUNC_ID(ADAPTER
, 5),
414 HPI_ADAPTER_SET_MODE
= HPI_FUNC_ID(ADAPTER
, 6),
415 HPI_ADAPTER_GET_MODE
= HPI_FUNC_ID(ADAPTER
, 7),
416 HPI_ADAPTER_ENABLE_CAPABILITY
= HPI_FUNC_ID(ADAPTER
, 8),
417 HPI_ADAPTER_SELFTEST
= HPI_FUNC_ID(ADAPTER
, 9),
418 HPI_ADAPTER_FIND_OBJECT
= HPI_FUNC_ID(ADAPTER
, 10),
419 HPI_ADAPTER_QUERY_FLASH
= HPI_FUNC_ID(ADAPTER
, 11),
420 HPI_ADAPTER_START_FLASH
= HPI_FUNC_ID(ADAPTER
, 12),
421 HPI_ADAPTER_PROGRAM_FLASH
= HPI_FUNC_ID(ADAPTER
, 13),
422 HPI_ADAPTER_SET_PROPERTY
= HPI_FUNC_ID(ADAPTER
, 14),
423 HPI_ADAPTER_GET_PROPERTY
= HPI_FUNC_ID(ADAPTER
, 15),
424 HPI_ADAPTER_ENUM_PROPERTY
= HPI_FUNC_ID(ADAPTER
, 16),
425 HPI_ADAPTER_MODULE_INFO
= HPI_FUNC_ID(ADAPTER
, 17),
426 HPI_ADAPTER_DEBUG_READ
= HPI_FUNC_ID(ADAPTER
, 18),
427 HPI_ADAPTER_IRQ_QUERY_AND_CLEAR
= HPI_FUNC_ID(ADAPTER
, 19),
428 HPI_ADAPTER_IRQ_CALLBACK
= HPI_FUNC_ID(ADAPTER
, 20),
429 HPI_ADAPTER_DELETE
= HPI_FUNC_ID(ADAPTER
, 21),
430 HPI_ADAPTER_READ_FLASH
= HPI_FUNC_ID(ADAPTER
, 22),
431 HPI_ADAPTER_END_FLASH
= HPI_FUNC_ID(ADAPTER
, 23),
432 HPI_ADAPTER_FILESTORE_DELETE_ALL
= HPI_FUNC_ID(ADAPTER
, 24),
433 #define HPI_ADAPTER_FUNCTION_COUNT 24
435 HPI_OSTREAM_OPEN
= HPI_FUNC_ID(OSTREAM
, 1),
436 HPI_OSTREAM_CLOSE
= HPI_FUNC_ID(OSTREAM
, 2),
437 HPI_OSTREAM_WRITE
= HPI_FUNC_ID(OSTREAM
, 3),
438 HPI_OSTREAM_START
= HPI_FUNC_ID(OSTREAM
, 4),
439 HPI_OSTREAM_STOP
= HPI_FUNC_ID(OSTREAM
, 5),
440 HPI_OSTREAM_RESET
= HPI_FUNC_ID(OSTREAM
, 6),
441 HPI_OSTREAM_GET_INFO
= HPI_FUNC_ID(OSTREAM
, 7),
442 HPI_OSTREAM_QUERY_FORMAT
= HPI_FUNC_ID(OSTREAM
, 8),
443 HPI_OSTREAM_DATA
= HPI_FUNC_ID(OSTREAM
, 9),
444 HPI_OSTREAM_SET_VELOCITY
= HPI_FUNC_ID(OSTREAM
, 10),
445 HPI_OSTREAM_SET_PUNCHINOUT
= HPI_FUNC_ID(OSTREAM
, 11),
446 HPI_OSTREAM_SINEGEN
= HPI_FUNC_ID(OSTREAM
, 12),
447 HPI_OSTREAM_ANC_RESET
= HPI_FUNC_ID(OSTREAM
, 13),
448 HPI_OSTREAM_ANC_GET_INFO
= HPI_FUNC_ID(OSTREAM
, 14),
449 HPI_OSTREAM_ANC_READ
= HPI_FUNC_ID(OSTREAM
, 15),
450 HPI_OSTREAM_SET_TIMESCALE
= HPI_FUNC_ID(OSTREAM
, 16),
451 HPI_OSTREAM_SET_FORMAT
= HPI_FUNC_ID(OSTREAM
, 17),
452 HPI_OSTREAM_HOSTBUFFER_ALLOC
= HPI_FUNC_ID(OSTREAM
, 18),
453 HPI_OSTREAM_HOSTBUFFER_FREE
= HPI_FUNC_ID(OSTREAM
, 19),
454 HPI_OSTREAM_GROUP_ADD
= HPI_FUNC_ID(OSTREAM
, 20),
455 HPI_OSTREAM_GROUP_GETMAP
= HPI_FUNC_ID(OSTREAM
, 21),
456 HPI_OSTREAM_GROUP_RESET
= HPI_FUNC_ID(OSTREAM
, 22),
457 HPI_OSTREAM_HOSTBUFFER_GET_INFO
= HPI_FUNC_ID(OSTREAM
, 23),
458 HPI_OSTREAM_WAIT_START
= HPI_FUNC_ID(OSTREAM
, 24),
459 HPI_OSTREAM_WAIT
= HPI_FUNC_ID(OSTREAM
, 25),
460 #define HPI_OSTREAM_FUNCTION_COUNT 25
462 HPI_ISTREAM_OPEN
= HPI_FUNC_ID(ISTREAM
, 1),
463 HPI_ISTREAM_CLOSE
= HPI_FUNC_ID(ISTREAM
, 2),
464 HPI_ISTREAM_SET_FORMAT
= HPI_FUNC_ID(ISTREAM
, 3),
465 HPI_ISTREAM_READ
= HPI_FUNC_ID(ISTREAM
, 4),
466 HPI_ISTREAM_START
= HPI_FUNC_ID(ISTREAM
, 5),
467 HPI_ISTREAM_STOP
= HPI_FUNC_ID(ISTREAM
, 6),
468 HPI_ISTREAM_RESET
= HPI_FUNC_ID(ISTREAM
, 7),
469 HPI_ISTREAM_GET_INFO
= HPI_FUNC_ID(ISTREAM
, 8),
470 HPI_ISTREAM_QUERY_FORMAT
= HPI_FUNC_ID(ISTREAM
, 9),
471 HPI_ISTREAM_ANC_RESET
= HPI_FUNC_ID(ISTREAM
, 10),
472 HPI_ISTREAM_ANC_GET_INFO
= HPI_FUNC_ID(ISTREAM
, 11),
473 HPI_ISTREAM_ANC_WRITE
= HPI_FUNC_ID(ISTREAM
, 12),
474 HPI_ISTREAM_HOSTBUFFER_ALLOC
= HPI_FUNC_ID(ISTREAM
, 13),
475 HPI_ISTREAM_HOSTBUFFER_FREE
= HPI_FUNC_ID(ISTREAM
, 14),
476 HPI_ISTREAM_GROUP_ADD
= HPI_FUNC_ID(ISTREAM
, 15),
477 HPI_ISTREAM_GROUP_GETMAP
= HPI_FUNC_ID(ISTREAM
, 16),
478 HPI_ISTREAM_GROUP_RESET
= HPI_FUNC_ID(ISTREAM
, 17),
479 HPI_ISTREAM_HOSTBUFFER_GET_INFO
= HPI_FUNC_ID(ISTREAM
, 18),
480 HPI_ISTREAM_WAIT_START
= HPI_FUNC_ID(ISTREAM
, 19),
481 HPI_ISTREAM_WAIT
= HPI_FUNC_ID(ISTREAM
, 20),
482 #define HPI_ISTREAM_FUNCTION_COUNT 20
485 GET_NODE_INFO, SET_CONNECTION, GET_CONNECTIONS are not currently used */
486 HPI_MIXER_OPEN
= HPI_FUNC_ID(MIXER
, 1),
487 HPI_MIXER_CLOSE
= HPI_FUNC_ID(MIXER
, 2),
488 HPI_MIXER_GET_INFO
= HPI_FUNC_ID(MIXER
, 3),
489 HPI_MIXER_GET_NODE_INFO
= HPI_FUNC_ID(MIXER
, 4),
490 HPI_MIXER_GET_CONTROL
= HPI_FUNC_ID(MIXER
, 5),
491 HPI_MIXER_SET_CONNECTION
= HPI_FUNC_ID(MIXER
, 6),
492 HPI_MIXER_GET_CONNECTIONS
= HPI_FUNC_ID(MIXER
, 7),
493 HPI_MIXER_GET_CONTROL_BY_INDEX
= HPI_FUNC_ID(MIXER
, 8),
494 HPI_MIXER_GET_CONTROL_ARRAY_BY_INDEX
= HPI_FUNC_ID(MIXER
, 9),
495 HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES
= HPI_FUNC_ID(MIXER
, 10),
496 HPI_MIXER_STORE
= HPI_FUNC_ID(MIXER
, 11),
497 HPI_MIXER_GET_CACHE_INFO
= HPI_FUNC_ID(MIXER
, 12),
498 HPI_MIXER_GET_BLOCK_HANDLE
= HPI_FUNC_ID(MIXER
, 13),
499 HPI_MIXER_GET_PARAMETER_HANDLE
= HPI_FUNC_ID(MIXER
, 14),
500 #define HPI_MIXER_FUNCTION_COUNT 14
502 HPI_CONTROL_GET_INFO
= HPI_FUNC_ID(CONTROL
, 1),
503 HPI_CONTROL_GET_STATE
= HPI_FUNC_ID(CONTROL
, 2),
504 HPI_CONTROL_SET_STATE
= HPI_FUNC_ID(CONTROL
, 3),
505 #define HPI_CONTROL_FUNCTION_COUNT 3
507 HPI_NVMEMORY_OPEN
= HPI_FUNC_ID(NVMEMORY
, 1),
508 HPI_NVMEMORY_READ_BYTE
= HPI_FUNC_ID(NVMEMORY
, 2),
509 HPI_NVMEMORY_WRITE_BYTE
= HPI_FUNC_ID(NVMEMORY
, 3),
510 #define HPI_NVMEMORY_FUNCTION_COUNT 3
512 HPI_GPIO_OPEN
= HPI_FUNC_ID(GPIO
, 1),
513 HPI_GPIO_READ_BIT
= HPI_FUNC_ID(GPIO
, 2),
514 HPI_GPIO_WRITE_BIT
= HPI_FUNC_ID(GPIO
, 3),
515 HPI_GPIO_READ_ALL
= HPI_FUNC_ID(GPIO
, 4),
516 HPI_GPIO_WRITE_STATUS
= HPI_FUNC_ID(GPIO
, 5),
517 #define HPI_GPIO_FUNCTION_COUNT 5
519 HPI_ASYNCEVENT_OPEN
= HPI_FUNC_ID(ASYNCEVENT
, 1),
520 HPI_ASYNCEVENT_CLOSE
= HPI_FUNC_ID(ASYNCEVENT
, 2),
521 HPI_ASYNCEVENT_WAIT
= HPI_FUNC_ID(ASYNCEVENT
, 3),
522 HPI_ASYNCEVENT_GETCOUNT
= HPI_FUNC_ID(ASYNCEVENT
, 4),
523 HPI_ASYNCEVENT_GET
= HPI_FUNC_ID(ASYNCEVENT
, 5),
524 HPI_ASYNCEVENT_SENDEVENTS
= HPI_FUNC_ID(ASYNCEVENT
, 6),
525 #define HPI_ASYNCEVENT_FUNCTION_COUNT 6
527 HPI_WATCHDOG_OPEN
= HPI_FUNC_ID(WATCHDOG
, 1),
528 HPI_WATCHDOG_SET_TIME
= HPI_FUNC_ID(WATCHDOG
, 2),
529 HPI_WATCHDOG_PING
= HPI_FUNC_ID(WATCHDOG
, 3),
531 HPI_CLOCK_OPEN
= HPI_FUNC_ID(CLOCK
, 1),
532 HPI_CLOCK_SET_TIME
= HPI_FUNC_ID(CLOCK
, 2),
533 HPI_CLOCK_GET_TIME
= HPI_FUNC_ID(CLOCK
, 3),
535 HPI_PROFILE_OPEN_ALL
= HPI_FUNC_ID(PROFILE
, 1),
536 HPI_PROFILE_START_ALL
= HPI_FUNC_ID(PROFILE
, 2),
537 HPI_PROFILE_STOP_ALL
= HPI_FUNC_ID(PROFILE
, 3),
538 HPI_PROFILE_GET
= HPI_FUNC_ID(PROFILE
, 4),
539 HPI_PROFILE_GET_IDLECOUNT
= HPI_FUNC_ID(PROFILE
, 5),
540 HPI_PROFILE_GET_NAME
= HPI_FUNC_ID(PROFILE
, 6),
541 HPI_PROFILE_GET_UTILIZATION
= HPI_FUNC_ID(PROFILE
, 7)
542 #define HPI_PROFILE_FUNCTION_COUNT 7
545 /* ////////////////////////////////////////////////////////////////////// */
547 #ifndef DISABLE_PRAGMA_PACK1
548 #pragma pack(push, 1)
551 /** PCI bus resource */
553 u32 __iomem
*ap_mem_base
[HPI_MAX_ADAPTER_MEM_SPACES
];
554 struct pci_dev
*pci_dev
;
557 struct hpi_resource
{
559 const struct hpi_pci
*pci
;
562 #ifndef HPI64BIT /* keep structure size constant */
565 u16 bus_type
; /* HPI_BUS_PNPISA, _PCI, _USB etc */
570 /** Format info used inside struct hpi_message
571 Not the same as public API struct hpi_format */
572 struct hpi_msg_format
{
573 u32 sample_rate
; /**< 11025, 32000, 44100 etc. */
574 u32 bit_rate
; /**< for MPEG */
575 u32 attributes
; /**< stereo/joint_stereo/mono */
576 u16 channels
; /**< 1,2..., (or ancillary mode or idle bit */
577 u16 format
; /**< HPI_FORMAT_PCM16, _MPEG etc. see \ref HPI_FORMATS. */
580 /** Buffer+format structure.
581 Must be kept 7 * 32 bits to match public struct hpi_datastruct */
582 struct hpi_msg_data
{
583 struct hpi_msg_format format
;
591 /** struct hpi_datastructure used up to 3.04 driver */
592 struct hpi_data_legacy32
{
593 struct hpi_format format
;
599 /* Compatibility version of struct hpi_data*/
600 struct hpi_data_compat32
{
601 struct hpi_msg_format format
;
609 /** placeholder for backward compatibility (see dwBufferSize) */
610 struct hpi_msg_format reserved
;
611 u32 command
; /**< HPI_BUFFER_CMD_xxx*/
612 u32 pci_address
; /**< PCI physical address of buffer for DSP DMA */
613 u32 buffer_size
; /**< must line up with data_size of HPI_DATA*/
616 /*/////////////////////////////////////////////////////////////////////////// */
617 /* This is used for background buffer bus mastering stream buffers. */
618 struct hpi_hostbuffer_status
{
619 u32 samples_processed
;
620 u32 auxiliary_data_available
;
622 /* DSP index in to the host bus master buffer. */
624 /* Host index in to the host bus master buffer. */
629 struct hpi_streamid
{
631 /**< Type of object, HPI_OBJ_OSTREAM or HPI_OBJ_ISTREAM. */
632 u16 stream_index
; /**< outstream or instream index. */
635 struct hpi_punchinout
{
637 u32 punch_out_sample
;
640 struct hpi_subsys_msg
{
641 struct hpi_resource resource
;
644 struct hpi_subsys_res
{
646 u32 data
; /* extended version */
653 union hpi_adapterx_msg
{
690 struct hpi_adapter_res
{
698 u8 sz_adapter_assert
[HPI_STRING_LEN
];
701 union hpi_adapterx_res
{
702 struct hpi_adapter_res info
;
709 char sz_message
[HPI_STRING_LEN
];
723 struct hpi_stream_msg
{
725 struct hpi_msg_data data
;
726 struct hpi_data_legacy32 data32
;
728 struct hpi_punchinout pio
;
730 struct hpi_buffer buffer
;
731 struct hpi_streamid stream
;
736 struct hpi_stream_res
{
739 /* size of hardware buffer */
741 /* OutStream - data to play,
742 InStream - data recorded */
744 /* OutStream - samples played,
745 InStream - samples recorded */
746 u32 samples_transferred
;
747 /* Adapter - OutStream - data to play,
748 InStream - data recorded */
749 u32 auxiliary_data_available
;
750 u16 state
; /* HPI_STATE_PLAYING, _STATE_STOPPED */
756 u32 samples_transfered
;
761 u32 auxiliary_data_available
;
762 } legacy_stream_info
;
764 /* bitmap of grouped OutStreams */
765 u32 outstream_group_map
;
766 /* bitmap of grouped InStreams */
767 u32 instream_group_map
;
770 /* pointer to the buffer */
772 /* pointer to the hostbuffer status */
773 struct hpi_hostbuffer_status
*p_status
;
778 struct hpi_mixer_msg
{
780 u16 control_type
; /* = HPI_CONTROL_METER _VOLUME etc */
781 u16 padding1
; /* Maintain alignment of subsequent fields */
782 u16 node_type1
; /* = HPI_SOURCENODE_LINEIN etc */
783 u16 node_index1
; /* = 0..N */
786 u16 padding2
; /* round to 4 bytes */
789 struct hpi_mixer_res
{
790 u16 src_node_type
; /* = HPI_SOURCENODE_LINEIN etc */
791 u16 src_node_index
; /* = 0..N */
794 /* Also controlType for MixerGetControlByIndex */
796 /* may indicate which DSP the control is located on */
800 union hpi_mixerx_msg
{
804 u32 length_in_bytes
; /* length in bytes of p_data */
805 u32 p_data
; /* pointer to a data array */
810 } store
; /* for HPI_MIXER_STORE message */
813 union hpi_mixerx_res
{
815 u32 bytes_returned
; /* size of items returned */
816 u32 p_data
; /* pointer to data array */
817 u16 more_to_do
; /* indicates if there is more to do */
820 u32 total_controls
; /* count of controls in the mixer */
821 u32 cache_controls
; /* count of controls in the cac */
822 u32 cache_bytes
; /* size of cache */
826 struct hpi_control_msg
{
827 u16 attribute
; /* control attribute or property */
829 u32 param1
; /* generic parameter 1 */
830 u32 param2
; /* generic parameter 2 */
831 short an_log_value
[HPI_MAX_CHANNELS
];
834 struct hpi_control_union_msg
{
835 u16 attribute
; /* control attribute or property */
836 u16 saved_index
; /* only used in ctrl save/restore */
839 u32 param1
; /* generic parameter 1 */
840 u32 param2
; /* generic parameter 2 */
841 short an_log_value
[HPI_MAX_CHANNELS
];
858 struct hpi_control_res
{
859 /* Could make union. dwParam, anLogValue never used in same response */
862 short an_log_value
[HPI_MAX_CHANNELS
];
865 union hpi_control_union_res
{
869 short an_log_value
[HPI_MAX_CHANNELS
];
900 struct hpi_nvmemory_msg
{
905 struct hpi_nvmemory_res
{
910 struct hpi_gpio_msg
{
915 struct hpi_gpio_res
{
916 u16 number_input_bits
;
917 u16 number_output_bits
;
921 struct hpi_async_msg
{
927 struct hpi_async_res
{
937 struct hpi_async_event event
;
941 struct hpi_watchdog_msg
{
945 struct hpi_watchdog_res
{
949 struct hpi_clock_msg
{
956 struct hpi_clock_res
{
965 struct hpi_profile_msg
{
970 struct hpi_profile_res_open
{
974 struct hpi_profile_res_time
{
975 u32 total_tick_count
;
978 u32 ticks_per_millisecond
;
979 u16 profile_interval
;
982 struct hpi_profile_res_name
{
986 struct hpi_profile_res
{
988 struct hpi_profile_res_open o
;
989 struct hpi_profile_res_time t
;
990 struct hpi_profile_res_name n
;
994 struct hpi_message_header
{
995 u16 size
; /* total size in bytes */
996 u8 type
; /* HPI_TYPE_MESSAGE */
997 u8 version
; /* message version */
998 u16 object
; /* HPI_OBJ_* */
999 u16 function
; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
1000 u16 adapter_index
; /* the adapter index */
1001 u16 obj_index
; /* */
1004 struct hpi_message
{
1005 /* following fields must match HPI_MESSAGE_HEADER */
1006 u16 size
; /* total size in bytes */
1007 u8 type
; /* HPI_TYPE_MESSAGE */
1008 u8 version
; /* message version */
1009 u16 object
; /* HPI_OBJ_* */
1010 u16 function
; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
1011 u16 adapter_index
; /* the adapter index */
1012 u16 obj_index
; /* */
1014 struct hpi_subsys_msg s
;
1015 union hpi_adapterx_msg ax
;
1016 struct hpi_stream_msg d
;
1017 struct hpi_mixer_msg m
;
1018 union hpi_mixerx_msg mx
; /* extended mixer; */
1019 struct hpi_control_msg c
; /* mixer control; */
1020 /* identical to struct hpi_control_msg,
1021 but field naming is improved */
1022 struct hpi_control_union_msg cu
;
1023 struct hpi_nvmemory_msg n
;
1024 struct hpi_gpio_msg l
; /* digital i/o */
1025 struct hpi_watchdog_msg w
;
1026 struct hpi_clock_msg t
; /* dsp time */
1027 struct hpi_profile_msg p
;
1028 struct hpi_async_msg as
;
1029 char fixed_size
[32];
1033 #define HPI_MESSAGE_SIZE_BY_OBJECT { \
1034 sizeof(struct hpi_message_header) , /* Default, no object type 0 */ \
1035 sizeof(struct hpi_message_header) + sizeof(struct hpi_subsys_msg),\
1036 sizeof(struct hpi_message_header) + sizeof(union hpi_adapterx_msg),\
1037 sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
1038 sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
1039 sizeof(struct hpi_message_header) + sizeof(struct hpi_mixer_msg),\
1040 sizeof(struct hpi_message_header) , /* no node message */ \
1041 sizeof(struct hpi_message_header) + sizeof(struct hpi_control_msg),\
1042 sizeof(struct hpi_message_header) + sizeof(struct hpi_nvmemory_msg),\
1043 sizeof(struct hpi_message_header) + sizeof(struct hpi_gpio_msg),\
1044 sizeof(struct hpi_message_header) + sizeof(struct hpi_watchdog_msg),\
1045 sizeof(struct hpi_message_header) + sizeof(struct hpi_clock_msg),\
1046 sizeof(struct hpi_message_header) + sizeof(struct hpi_profile_msg),\
1047 sizeof(struct hpi_message_header), /* controlx obj removed */ \
1048 sizeof(struct hpi_message_header) + sizeof(struct hpi_async_msg) \
1052 Note that the wSpecificError error field should be inspected and potentially
1053 reported whenever HPI_ERROR_DSP_COMMUNICATION or HPI_ERROR_DSP_BOOTLOAD is
1056 struct hpi_response_header
{
1058 u8 type
; /* HPI_TYPE_RESPONSE */
1059 u8 version
; /* response version */
1060 u16 object
; /* HPI_OBJ_* */
1061 u16 function
; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
1062 u16 error
; /* HPI_ERROR_xxx */
1063 u16 specific_error
; /* adapter specific error */
1066 struct hpi_response
{
1067 /* following fields must match HPI_RESPONSE_HEADER */
1069 u8 type
; /* HPI_TYPE_RESPONSE */
1070 u8 version
; /* response version */
1071 u16 object
; /* HPI_OBJ_* */
1072 u16 function
; /* HPI_SUBSYS_xxx, HPI_ADAPTER_xxx */
1073 u16 error
; /* HPI_ERROR_xxx */
1074 u16 specific_error
; /* adapter specific error */
1076 struct hpi_subsys_res s
;
1077 union hpi_adapterx_res ax
;
1078 struct hpi_stream_res d
;
1079 struct hpi_mixer_res m
;
1080 union hpi_mixerx_res mx
; /* extended mixer; */
1081 struct hpi_control_res c
; /* mixer control; */
1082 /* identical to hpi_control_res, but field naming is improved */
1083 union hpi_control_union_res cu
;
1084 struct hpi_nvmemory_res n
;
1085 struct hpi_gpio_res l
; /* digital i/o */
1086 struct hpi_watchdog_res w
;
1087 struct hpi_clock_res t
; /* dsp time */
1088 struct hpi_profile_res p
;
1089 struct hpi_async_res as
;
1094 #define HPI_RESPONSE_SIZE_BY_OBJECT { \
1095 sizeof(struct hpi_response_header) ,/* Default, no object type 0 */ \
1096 sizeof(struct hpi_response_header) + sizeof(struct hpi_subsys_res),\
1097 sizeof(struct hpi_response_header) + sizeof(union hpi_adapterx_res),\
1098 sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
1099 sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
1100 sizeof(struct hpi_response_header) + sizeof(struct hpi_mixer_res),\
1101 sizeof(struct hpi_response_header) , /* no node response */ \
1102 sizeof(struct hpi_response_header) + sizeof(struct hpi_control_res),\
1103 sizeof(struct hpi_response_header) + sizeof(struct hpi_nvmemory_res),\
1104 sizeof(struct hpi_response_header) + sizeof(struct hpi_gpio_res),\
1105 sizeof(struct hpi_response_header) + sizeof(struct hpi_watchdog_res),\
1106 sizeof(struct hpi_response_header) + sizeof(struct hpi_clock_res),\
1107 sizeof(struct hpi_response_header) + sizeof(struct hpi_profile_res),\
1108 sizeof(struct hpi_response_header), /* controlx obj removed */ \
1109 sizeof(struct hpi_response_header) + sizeof(struct hpi_async_res) \
1112 /*********************** version 1 message/response **************************/
1113 #define HPINET_ETHERNET_DATA_SIZE (1500)
1114 #define HPINET_IP_HDR_SIZE (20)
1115 #define HPINET_IP_DATA_SIZE (HPINET_ETHERNET_DATA_SIZE - HPINET_IP_HDR_SIZE)
1116 #define HPINET_UDP_HDR_SIZE (8)
1117 #define HPINET_UDP_DATA_SIZE (HPINET_IP_DATA_SIZE - HPINET_UDP_HDR_SIZE)
1118 #define HPINET_ASI_HDR_SIZE (2)
1119 #define HPINET_ASI_DATA_SIZE (HPINET_UDP_DATA_SIZE - HPINET_ASI_HDR_SIZE)
1121 #define HPI_MAX_PAYLOAD_SIZE (HPINET_ASI_DATA_SIZE - 2)
1123 /* New style message/response, but still V0 compatible */
1124 struct hpi_msg_adapter_get_info
{
1125 struct hpi_message_header h
;
1128 struct hpi_res_adapter_get_info
{
1129 struct hpi_response_header h
; /*v0 */
1130 struct hpi_adapter_res p
;
1133 struct hpi_res_adapter_debug_read
{
1134 struct hpi_response_header h
;
1138 struct hpi_msg_cobranet_hmi
{
1145 struct hpi_msg_cobranet_hmiwrite
{
1146 struct hpi_message_header h
;
1147 struct hpi_msg_cobranet_hmi p
;
1151 struct hpi_msg_cobranet_hmiread
{
1152 struct hpi_message_header h
;
1153 struct hpi_msg_cobranet_hmi p
;
1156 struct hpi_res_cobranet_hmiread
{
1157 struct hpi_response_header h
;
1163 #define hpi_message_header_v1 hpi_message_header
1164 #define hpi_response_header_v1 hpi_response_header
1166 /* V1 headers in Addition to v0 headers */
1167 struct hpi_message_header_v1
{
1168 struct hpi_message_header h0
;
1173 struct hpi_response_header_v1
{
1174 struct hpi_response_header h0
;
1176 u16 adapter_index
; /* the adapter index */
1177 u16 obj_index
; /* object index */
1182 struct hpi_msg_payload_v0
{
1183 struct hpi_message_header h
;
1185 struct hpi_subsys_msg s
;
1186 union hpi_adapterx_msg ax
;
1187 struct hpi_stream_msg d
;
1188 struct hpi_mixer_msg m
;
1189 union hpi_mixerx_msg mx
;
1190 struct hpi_control_msg c
;
1191 struct hpi_control_union_msg cu
;
1192 struct hpi_nvmemory_msg n
;
1193 struct hpi_gpio_msg l
;
1194 struct hpi_watchdog_msg w
;
1195 struct hpi_clock_msg t
;
1196 struct hpi_profile_msg p
;
1197 struct hpi_async_msg as
;
1201 struct hpi_res_payload_v0
{
1202 struct hpi_response_header h
;
1204 struct hpi_subsys_res s
;
1205 union hpi_adapterx_res ax
;
1206 struct hpi_stream_res d
;
1207 struct hpi_mixer_res m
;
1208 union hpi_mixerx_res mx
;
1209 struct hpi_control_res c
;
1210 union hpi_control_union_res cu
;
1211 struct hpi_nvmemory_res n
;
1212 struct hpi_gpio_res l
;
1213 struct hpi_watchdog_res w
;
1214 struct hpi_clock_res t
;
1215 struct hpi_profile_res p
;
1216 struct hpi_async_res as
;
1220 union hpi_message_buffer_v1
{
1221 struct hpi_message m0
; /* version 0 */
1222 struct hpi_message_header_v1 h
;
1223 u8 buf
[HPI_MAX_PAYLOAD_SIZE
];
1226 union hpi_response_buffer_v1
{
1227 struct hpi_response r0
; /* version 0 */
1228 struct hpi_response_header_v1 h
;
1229 u8 buf
[HPI_MAX_PAYLOAD_SIZE
];
1232 compile_time_assert((sizeof(union hpi_message_buffer_v1
) <=
1233 HPI_MAX_PAYLOAD_SIZE
), message_buffer_ok
);
1234 compile_time_assert((sizeof(union hpi_response_buffer_v1
) <=
1235 HPI_MAX_PAYLOAD_SIZE
), response_buffer_ok
);
1237 /*////////////////////////////////////////////////////////////////////////// */
1238 /* declarations for compact control calls */
1239 struct hpi_control_defn
{
1248 /*////////////////////////////////////////////////////////////////////////// */
1249 /* declarations for control caching (internal to HPI<->DSP interaction) */
1251 /** indicates a cached u16 value is invalid. */
1252 #define HPI_CACHE_INVALID_UINT16 0xFFFF
1253 /** indicates a cached short value is invalid. */
1254 #define HPI_CACHE_INVALID_SHORT -32768
1256 /** A compact representation of (part of) a controls state.
1257 Used for efficient transfer of the control state
1258 between DSP and host or across a network
1260 struct hpi_control_cache_info
{
1261 /** one of HPI_CONTROL_* */
1263 /** The total size of cached information in 32-bit words. */
1264 u8 size_in32bit_words
;
1265 /** The original index of the control on the DSP */
1269 struct hpi_control_cache_vol
{
1270 struct hpi_control_cache_info i
;
1272 unsigned short flags
;
1276 struct hpi_control_cache_meter
{
1277 struct hpi_control_cache_info i
;
1278 short an_log_peak
[2];
1282 struct hpi_control_cache_channelmode
{
1283 struct hpi_control_cache_info i
;
1285 char temp_padding
[6];
1288 struct hpi_control_cache_mux
{
1289 struct hpi_control_cache_info i
;
1290 u16 source_node_type
;
1291 u16 source_node_index
;
1292 char temp_padding
[4];
1295 struct hpi_control_cache_level
{
1296 struct hpi_control_cache_info i
;
1298 char temp_padding
[4];
1301 struct hpi_control_cache_tuner
{
1302 struct hpi_control_cache_info i
;
1308 struct hpi_control_cache_aes3rx
{
1309 struct hpi_control_cache_info i
;
1314 struct hpi_control_cache_aes3tx
{
1315 struct hpi_control_cache_info i
;
1317 char temp_padding
[4];
1320 struct hpi_control_cache_tonedetector
{
1321 struct hpi_control_cache_info i
;
1323 char temp_padding
[6];
1326 struct hpi_control_cache_silencedetector
{
1327 struct hpi_control_cache_info i
;
1329 char temp_padding
[4];
1332 struct hpi_control_cache_sampleclock
{
1333 struct hpi_control_cache_info i
;
1339 struct hpi_control_cache_microphone
{
1340 struct hpi_control_cache_info i
;
1342 char temp_padding
[6];
1345 struct hpi_control_cache_single
{
1347 struct hpi_control_cache_info i
;
1348 struct hpi_control_cache_vol vol
;
1349 struct hpi_control_cache_meter meter
;
1350 struct hpi_control_cache_channelmode mode
;
1351 struct hpi_control_cache_mux mux
;
1352 struct hpi_control_cache_level level
;
1353 struct hpi_control_cache_tuner tuner
;
1354 struct hpi_control_cache_aes3rx aes3rx
;
1355 struct hpi_control_cache_aes3tx aes3tx
;
1356 struct hpi_control_cache_tonedetector tone
;
1357 struct hpi_control_cache_silencedetector silence
;
1358 struct hpi_control_cache_sampleclock clk
;
1359 struct hpi_control_cache_microphone microphone
;
1363 struct hpi_control_cache_pad
{
1364 struct hpi_control_cache_info i
;
1365 u32 field_valid_flags
;
1372 u32 traffic_supported
;
1373 u32 traffic_anouncement
;
1376 /* 2^N sized FIFO buffer (internal to HPI<->DSP interaction) */
1377 struct hpi_fifo_buffer
{
1383 #ifndef DISABLE_PRAGMA_PACK1
1387 /* skip host side function declarations for DSP
1388 compile and documentation extraction */
1390 char hpi_handle_object(const u32 handle
);
1392 void hpi_handle_to_indexes(const u32 handle
, u16
*pw_adapter_index
,
1393 u16
*pw_object_index
);
1395 u32
hpi_indexes_to_handle(const char c_object
, const u16 adapter_index
,
1396 const u16 object_index
);
1398 /*////////////////////////////////////////////////////////////////////////// */
1400 /* main HPI entry point */
1401 void hpi_send_recv(struct hpi_message
*phm
, struct hpi_response
*phr
);
1403 /* used in PnP OS/driver */
1404 u16
hpi_subsys_create_adapter(const struct hpi_resource
*p_resource
,
1405 u16
*pw_adapter_index
);
1407 u16
hpi_outstream_host_buffer_get_info(u32 h_outstream
, u8
**pp_buffer
,
1408 struct hpi_hostbuffer_status
**pp_status
);
1410 u16
hpi_instream_host_buffer_get_info(u32 h_instream
, u8
**pp_buffer
,
1411 struct hpi_hostbuffer_status
**pp_status
);
1413 u16
hpi_adapter_restart(u16 adapter_index
);
1416 The following 3 functions were last declared in header files for
1417 driver 3.10. HPI_ControlQuery() used to be the recommended way
1418 of getting a volume range. Declared here for binary asihpi32.dll
1422 void hpi_format_to_msg(struct hpi_msg_format
*pMF
,
1423 const struct hpi_format
*pF
);
1424 void hpi_stream_response_to_legacy(struct hpi_stream_res
*pSR
);
1426 /*////////////////////////////////////////////////////////////////////////// */
1427 /* declarations for individual HPI entry points */
1428 hpi_handler_func HPI_6000
;
1429 hpi_handler_func HPI_6205
;
1431 #endif /* _HPI_INTERNAL_H_ */