hpifunc.c (fc3a399019a5a54258095c9bb0e17d4be5d51e67) hpifunc.c (ba3a909962650d81e9c3731d87b8653652869685)
1
2#include "hpi_internal.h"
3#include "hpimsginit.h"
4
5#include "hpidebug.h"
6
7struct hpi_handle {
8 unsigned int obj_index:12;

--- 249 unchanged lines hidden (view full) ---

258 *pw_num_inputs = hr.u.ax.info.num_instreams;
259 *pw_version = hr.u.ax.info.version;
260 *pserial_number = hr.u.ax.info.serial_number;
261 *ph_module = 0;
262
263 return hr.error;
264}
265
1
2#include "hpi_internal.h"
3#include "hpimsginit.h"
4
5#include "hpidebug.h"
6
7struct hpi_handle {
8 unsigned int obj_index:12;

--- 249 unchanged lines hidden (view full) ---

258 *pw_num_inputs = hr.u.ax.info.num_instreams;
259 *pw_version = hr.u.ax.info.version;
260 *pserial_number = hr.u.ax.info.serial_number;
261 *ph_module = 0;
262
263 return hr.error;
264}
265
266u16 hpi_adapter_get_assert2(u16 adapter_index, u16 *p_assert_count,
267 char *psz_assert, u32 *p_param1, u32 *p_param2,
268 u32 *p_dsp_string_addr, u16 *p_processor_id)
269{
270 struct hpi_message hm;
271 struct hpi_response hr;
272 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER,
273 HPI_ADAPTER_GET_ASSERT);
274 hm.adapter_index = adapter_index;
275
276 hpi_send_recv(&hm, &hr);
277
278 *p_assert_count = 0;
279
280 if (!hr.error) {
281 *p_assert_count = hr.u.ax.assert.count;
282
283 if (*p_assert_count) {
284 *p_param1 = hr.u.ax.assert.p1;
285 *p_param2 = hr.u.ax.assert.p2;
286 *p_processor_id = hr.u.ax.assert.dsp_index;
287 *p_dsp_string_addr = hr.u.ax.assert.dsp_msg_addr;
288 memcpy(psz_assert, hr.u.ax.assert.sz_message,
289 HPI_STRING_LEN);
290 } else {
291 *psz_assert = 0;
292 }
293 }
294 return hr.error;
295}
296
297u16 hpi_adapter_test_assert(u16 adapter_index, u16 assert_id)
298{
299 struct hpi_message hm;
300 struct hpi_response hr;
301 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER,
302 HPI_ADAPTER_TEST_ASSERT);
303 hm.adapter_index = adapter_index;
304 hm.u.ax.test_assert.value = assert_id;
305
306 hpi_send_recv(&hm, &hr);
307
308 return hr.error;
309}
310
311u16 hpi_adapter_enable_capability(u16 adapter_index, u16 capability, u32 key)
312{
313#if 1
314 return HPI_ERROR_UNIMPLEMENTED;
315#else
316 struct hpi_message hm;
317 struct hpi_response hr;
318 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER,
319 HPI_ADAPTER_ENABLE_CAPABILITY);
320 hm.adapter_index = adapter_index;
321 hm.u.ax.enable_cap.cap = capability;
322 hm.u.ax.enable_cap.key = key;
323
324 hpi_send_recv(&hm, &hr);
325
326 return hr.error;
327#endif
328}
329
330u16 hpi_adapter_self_test(u16 adapter_index)
331{
332 struct hpi_message hm;
333 struct hpi_response hr;
334 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER,
335 HPI_ADAPTER_SELFTEST);
336 hm.adapter_index = adapter_index;
337 hpi_send_recv(&hm, &hr);
338 return hr.error;
339}
340
341u16 hpi_adapter_debug_read(u16 adapter_index, u32 dsp_address, char *p_buffer,
342 int *count_bytes)
343{
344 struct hpi_msg_adapter_debug_read hm;
345 struct hpi_res_adapter_debug_read hr;
346
347 hpi_init_message_responseV1(&hm.h, sizeof(hm), &hr.h, sizeof(hr),
348 HPI_OBJ_ADAPTER, HPI_ADAPTER_DEBUG_READ);
349
350 hm.h.adapter_index = adapter_index;
351 hm.dsp_address = dsp_address;
352
353 if (*count_bytes > (int)sizeof(hr.bytes))
354 *count_bytes = (int)sizeof(hr.bytes);
355
356 hm.count_bytes = *count_bytes;
357
358 hpi_send_recvV1(&hm.h, &hr.h);
359
360 if (!hr.h.error) {
361 int res_bytes = hr.h.size - sizeof(hr.h);
362 if (res_bytes > *count_bytes)
363 res_bytes = *count_bytes;
364 *count_bytes = res_bytes;
365 memcpy(p_buffer, &hr.bytes, res_bytes);
366 } else
367 *count_bytes = 0;
368
369 return hr.h.error;
370}
371
372u16 hpi_adapter_set_property(u16 adapter_index, u16 property, u16 parameter1,
373 u16 parameter2)
374{
375 struct hpi_message hm;
376 struct hpi_response hr;
377 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER,
378 HPI_ADAPTER_SET_PROPERTY);
379 hm.adapter_index = adapter_index;

--- 2612 unchanged lines hidden ---
266u16 hpi_adapter_set_property(u16 adapter_index, u16 property, u16 parameter1,
267 u16 parameter2)
268{
269 struct hpi_message hm;
270 struct hpi_response hr;
271 hpi_init_message_response(&hm, &hr, HPI_OBJ_ADAPTER,
272 HPI_ADAPTER_SET_PROPERTY);
273 hm.adapter_index = adapter_index;

--- 2612 unchanged lines hidden ---