diag: Proper update of user PD mdlog session variables
The patch updates global variables of mdlog session for user PD during different scenarios. CRs-Fixed: 2058648 Change-Id: I503caddf8e9d504649ee8d81115da60267a5f560 Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
This commit is contained in:
parent
085ef3652a
commit
2bffd28da2
1 changed files with 10 additions and 7 deletions
|
@ -481,20 +481,21 @@ static void diag_close_logging_process(const int pid)
|
|||
|
||||
params.req_mode = USB_MODE;
|
||||
params.mode_param = 0;
|
||||
params.pd_mask = 0;
|
||||
params.peripheral_mask =
|
||||
diag_translate_kernel_to_user_mask(session_mask);
|
||||
|
||||
for (i = UPD_WLAN; i < NUM_MD_SESSIONS; i++) {
|
||||
if (session_mask &
|
||||
MD_PERIPHERAL_MASK(i)) {
|
||||
if (driver->num_pd_session > 0) {
|
||||
for (i = UPD_WLAN; ((i < NUM_MD_SESSIONS) &&
|
||||
(session_mask & MD_PERIPHERAL_MASK(i)));
|
||||
i++) {
|
||||
j = i - UPD_WLAN;
|
||||
driver->pd_session_clear[j] = 1;
|
||||
driver->pd_logging_mode[j] = 0;
|
||||
driver->num_pd_session -= 1;
|
||||
params.pd_mask =
|
||||
diag_translate_kernel_to_user_mask(session_mask);
|
||||
} else
|
||||
params.pd_mask = 0;
|
||||
}
|
||||
}
|
||||
|
||||
diag_switch_logging(¶ms);
|
||||
|
@ -1612,7 +1613,7 @@ static uint32_t diag_translate_mask(uint32_t peripheral_mask)
|
|||
|
||||
static int diag_switch_logging(struct diag_logging_mode_param_t *param)
|
||||
{
|
||||
int new_mode, i;
|
||||
int new_mode, i = 0;
|
||||
int curr_mode;
|
||||
int err = 0;
|
||||
uint8_t do_switch = 1;
|
||||
|
@ -1653,6 +1654,8 @@ static int diag_switch_logging(struct diag_logging_mode_param_t *param)
|
|||
diag_mux->mux_mask)) {
|
||||
DIAG_LOG(DIAG_DEBUG_USERSPACE,
|
||||
"diag_fr: User PD is already logging onto active peripheral logging\n");
|
||||
i = upd - UPD_WLAN;
|
||||
driver->pd_session_clear[i] = 0;
|
||||
return -EINVAL;
|
||||
}
|
||||
peripheral_mask =
|
||||
|
@ -1662,8 +1665,8 @@ static int diag_switch_logging(struct diag_logging_mode_param_t *param)
|
|||
if (!driver->pd_session_clear[i]) {
|
||||
driver->pd_logging_mode[i] = 1;
|
||||
driver->num_pd_session += 1;
|
||||
driver->pd_session_clear[i] = 0;
|
||||
}
|
||||
driver->pd_session_clear[i] = 0;
|
||||
} else {
|
||||
peripheral_mask =
|
||||
diag_translate_mask(param->peripheral_mask);
|
||||
|
|
Loading…
Add table
Reference in a new issue