diff options
Diffstat (limited to 'sound/pci/asihpi/hpi6000.c')
-rw-r--r-- | sound/pci/asihpi/hpi6000.c | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/sound/pci/asihpi/hpi6000.c b/sound/pci/asihpi/hpi6000.c index 8c8aac4c567e..df4aed5295dd 100644 --- a/sound/pci/asihpi/hpi6000.c +++ b/sound/pci/asihpi/hpi6000.c | |||
@@ -200,8 +200,8 @@ static void hpi_read_block(struct dsp_obj *pdo, u32 address, u32 *pdata, | |||
200 | static void subsys_create_adapter(struct hpi_message *phm, | 200 | static void subsys_create_adapter(struct hpi_message *phm, |
201 | struct hpi_response *phr); | 201 | struct hpi_response *phr); |
202 | 202 | ||
203 | static void subsys_delete_adapter(struct hpi_message *phm, | 203 | static void adapter_delete(struct hpi_adapter_obj *pao, |
204 | struct hpi_response *phr); | 204 | struct hpi_message *phm, struct hpi_response *phr); |
205 | 205 | ||
206 | static void adapter_get_asserts(struct hpi_adapter_obj *pao, | 206 | static void adapter_get_asserts(struct hpi_adapter_obj *pao, |
207 | struct hpi_message *phm, struct hpi_response *phr); | 207 | struct hpi_message *phm, struct hpi_response *phr); |
@@ -222,9 +222,6 @@ static void subsys_message(struct hpi_message *phm, struct hpi_response *phr) | |||
222 | case HPI_SUBSYS_CREATE_ADAPTER: | 222 | case HPI_SUBSYS_CREATE_ADAPTER: |
223 | subsys_create_adapter(phm, phr); | 223 | subsys_create_adapter(phm, phr); |
224 | break; | 224 | break; |
225 | case HPI_SUBSYS_DELETE_ADAPTER: | ||
226 | subsys_delete_adapter(phm, phr); | ||
227 | break; | ||
228 | default: | 225 | default: |
229 | phr->error = HPI_ERROR_INVALID_FUNC; | 226 | phr->error = HPI_ERROR_INVALID_FUNC; |
230 | break; | 227 | break; |
@@ -279,6 +276,10 @@ static void adapter_message(struct hpi_adapter_obj *pao, | |||
279 | adapter_get_asserts(pao, phm, phr); | 276 | adapter_get_asserts(pao, phm, phr); |
280 | break; | 277 | break; |
281 | 278 | ||
279 | case HPI_ADAPTER_DELETE: | ||
280 | adapter_delete(pao, phm, phr); | ||
281 | break; | ||
282 | |||
282 | default: | 283 | default: |
283 | hw_message(pao, phm, phr); | 284 | hw_message(pao, phm, phr); |
284 | break; | 285 | break; |
@@ -333,26 +334,22 @@ void HPI_6000(struct hpi_message *phm, struct hpi_response *phr) | |||
333 | { | 334 | { |
334 | struct hpi_adapter_obj *pao = NULL; | 335 | struct hpi_adapter_obj *pao = NULL; |
335 | 336 | ||
336 | /* subsytem messages get executed by every HPI. */ | ||
337 | /* All other messages are ignored unless the adapter index matches */ | ||
338 | /* an adapter in the HPI */ | ||
339 | /*HPI_DEBUG_LOG(DEBUG, "O %d,F %x\n", phm->wObject, phm->wFunction); */ | ||
340 | |||
341 | /* if Dsp has crashed then do not communicate with it any more */ | ||
342 | if (phm->object != HPI_OBJ_SUBSYSTEM) { | 337 | if (phm->object != HPI_OBJ_SUBSYSTEM) { |
343 | pao = hpi_find_adapter(phm->adapter_index); | 338 | pao = hpi_find_adapter(phm->adapter_index); |
344 | if (!pao) { | 339 | if (!pao) { |
345 | HPI_DEBUG_LOG(DEBUG, | 340 | hpi_init_response(phr, phm->object, phm->function, |
346 | " %d,%d refused, for another HPI?\n", | 341 | HPI_ERROR_BAD_ADAPTER_NUMBER); |
347 | phm->object, phm->function); | 342 | HPI_DEBUG_LOG(DEBUG, "invalid adapter index: %d \n", |
343 | phm->adapter_index); | ||
348 | return; | 344 | return; |
349 | } | 345 | } |
350 | 346 | ||
347 | /* Don't even try to communicate with crashed DSP */ | ||
351 | if (pao->dsp_crashed >= 10) { | 348 | if (pao->dsp_crashed >= 10) { |
352 | hpi_init_response(phr, phm->object, phm->function, | 349 | hpi_init_response(phr, phm->object, phm->function, |
353 | HPI_ERROR_DSP_HARDWARE); | 350 | HPI_ERROR_DSP_HARDWARE); |
354 | HPI_DEBUG_LOG(DEBUG, " %d,%d dsp crashed.\n", | 351 | HPI_DEBUG_LOG(DEBUG, "adapter %d dsp crashed\n", |
355 | phm->object, phm->function); | 352 | phm->adapter_index); |
356 | return; | 353 | return; |
357 | } | 354 | } |
358 | } | 355 | } |
@@ -463,15 +460,9 @@ static void subsys_create_adapter(struct hpi_message *phm, | |||
463 | phr->error = 0; | 460 | phr->error = 0; |
464 | } | 461 | } |
465 | 462 | ||
466 | static void subsys_delete_adapter(struct hpi_message *phm, | 463 | static void adapter_delete(struct hpi_adapter_obj *pao, |
467 | struct hpi_response *phr) | 464 | struct hpi_message *phm, struct hpi_response *phr) |
468 | { | 465 | { |
469 | struct hpi_adapter_obj *pao = NULL; | ||
470 | |||
471 | pao = hpi_find_adapter(phm->obj_index); | ||
472 | if (!pao) | ||
473 | return; | ||
474 | |||
475 | delete_adapter_obj(pao); | 466 | delete_adapter_obj(pao); |
476 | hpi_delete_adapter(pao); | 467 | hpi_delete_adapter(pao); |
477 | phr->error = 0; | 468 | phr->error = 0; |