Skip to content

Commit

Permalink
Return AEE_ECONNREFUSED when Fastrpc device is not available
Browse files Browse the repository at this point in the history
Currently, during device open, if Fastrpc device is not available
AEE_ERPC error code is returned. AEE_ERPC is a generic error code and
clients are not expecting AEE_ERPC in this scenario. To address
this, change the error code to AEE_ECONNREFUSED.

Signed-off-by: ANANDU KRISHNAN E <[email protected]>
  • Loading branch information
quic-anane authored and quic-bkumar committed Aug 1, 2024
1 parent bc0c380 commit 0b74583
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/fastrpc_apps_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ int fastrpc_session_open(int domain, int *dev) {
*dev = device;
return 0;
}
return AEE_EUNKNOWN;
return AEE_ECONNREFUSED;
}

int fastrpc_session_close(int domain, int dev) {
Expand Down Expand Up @@ -3214,7 +3214,9 @@ static int open_device_node(int domain_id) {
if (dev < 0)
FARF(ERROR,
"Error 0x%x: %s failed for domain ID %d, sess ID %d secure dev : %s, "
"dev : %s. (errno %d, %s)",
"dev : %s. (errno %d, %s) (Either the remote processor is down, or "
"application does not have permission to access the remote "
"processor\n",
nErr, __func__, domain_id, sess_id, get_secure_domain_name(domain),
get_domain_name(domain), errno, strerror(errno));
return dev;
Expand Down Expand Up @@ -3523,7 +3525,7 @@ static int remote_init(int domain) {
VERIFYC(pd_type > DEFAULT_UNUSED && pd_type < MAX_PD_TYPE, AEE_EBADITEM);
if (hlist[domain].dev == -1) {
dev = open_device_node(domain);
VERIFYM(dev >= 0, AEE_ERPC, "open dev failed\n");
VERIFYC(dev >= 0, AEE_ECONNREFUSED);
// Set session relation info using FASTRPC_INVOKE2_SESS_INFO
sess_info.domain_id = info;
sess_info.pd_type = pd_type;
Expand Down

0 comments on commit 0b74583

Please sign in to comment.