btfmcodec: unblock waiting threads during usecase shutdown

This change notifies waiting thread when usecase shutdown
is triggered and also flush work queues.

Change-Id: If523e806dc23fc256e82c4eac30f7aa79b119f55
This commit is contained in:
Balakrishna Godavarthi
2023-01-27 10:52:49 +05:30
committed by Gerrit - the friendly Code Review server
parent 4a2649332e
commit e7e85692a1
4 changed files with 34 additions and 5 deletions

View File

@@ -30,7 +30,8 @@ void btfmcodec_initiate_hwep_shutdown(struct btfmcodec_char_device *btfmcodec_de
if (*status == BTM_RSP_RECV) {
BTFMCODEC_ERR("sucessfully closed hwep");
return;
} else if (*status == BTM_FAIL_RESP_RECV) {
} else if (*status == BTM_FAIL_RESP_RECV ||
*status == BTM_RSP_NOT_RECV_CLIENT_KILLED) {
BTFMCODEC_ERR("Failed to close hwep");
return;
}
@@ -136,6 +137,9 @@ int btfmcodec_wait_for_bearer_ind(struct btfmcodec_char_device *btfmcodec_dev)
} else if (*status == BTM_FAIL_RESP_RECV) {
BTFMCODEC_ERR("Rx BTM_BEARER_SWITCH_IND with failure status");
ret = -1;
} else if (*status == BTM_RSP_NOT_RECV_CLIENT_KILLED) {
BTFMCODEC_ERR("client killed so moving further");
ret = -1;
}
}
@@ -162,7 +166,8 @@ int btfmcodec_initiate_hwep_configuration(struct btfmcodec_char_device *btfmcode
} else {
if (*status == BTM_RSP_RECV) {
ret = 0;
} else if (*status == BTM_FAIL_RESP_RECV) {
} else if (*status == BTM_FAIL_RESP_RECV ||
*status == BTM_RSP_NOT_RECV_CLIENT_KILLED) {
BTFMCODEC_ERR("Failed to close hwep moving back to previous state");
ret = -1;
}