Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37132a93 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "diag: Proper update of logging mode"

parents 20b5bbe1 4c294be4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -205,6 +205,8 @@ int diag_mux_switch_logging(int *req_mode, int *peripheral_mask)
		new_mask = ~(*peripheral_mask) & diag_mux->mux_mask;
		if (new_mask != DIAG_CON_NONE)
			*req_mode = DIAG_MULTI_MODE;
		if (new_mask == DIAG_CON_ALL)
			*req_mode = DIAG_MEMORY_DEVICE_MODE;
		break;
	case DIAG_MEMORY_DEVICE_MODE:
		new_mask = (*peripheral_mask) | diag_mux->mux_mask;
+6 −4
Original line number Diff line number Diff line
@@ -1653,7 +1653,9 @@ static int diag_switch_logging(struct diag_logging_mode_param_t *param)
				}
			}
		}
		if (!param->diag_id) {
		if (!param->diag_id ||
			(param->pd_val < UPD_WLAN) ||
			(param->pd_val > NUM_MD_SESSIONS)) {
			DIAG_LOG(DIAG_DEBUG_USERSPACE,
			"diag_id support is not present for the pd mask = %d\n",
			param->pd_mask);
@@ -1666,19 +1668,19 @@ static int diag_switch_logging(struct diag_logging_mode_param_t *param)
			param->peripheral, param->pd_val);

		peripheral = param->peripheral;
		i = param->pd_val - UPD_WLAN;
		if (driver->md_session_map[peripheral] &&
			(MD_PERIPHERAL_MASK(peripheral) &
			diag_mux->mux_mask)) {
			diag_mux->mux_mask) &&
			!driver->pd_session_clear[i]) {
			DIAG_LOG(DIAG_DEBUG_USERSPACE,
			"diag_fr: User PD is already logging onto active peripheral logging\n");
			i = param->pd_val - UPD_WLAN;
			driver->pd_session_clear[i] = 0;
			return -EINVAL;
		}
		peripheral_mask =
			diag_translate_mask(param->pd_mask);
		param->peripheral_mask = peripheral_mask;
		i = param->pd_val - UPD_WLAN;
		if (!driver->pd_session_clear[i]) {
			driver->pd_logging_mode[i] = 1;
			driver->num_pd_session += 1;
+4 −1
Original line number Diff line number Diff line
@@ -1014,8 +1014,11 @@ int diag_process_apps_pkt(unsigned char *buf, int len,
				write_len = diag_send_data(reg_item, buf, len);
		} else {
			if (MD_PERIPHERAL_MASK(reg_item->proc) &
				driver->logging_mask)
				driver->logging_mask) {
				mutex_unlock(&driver->cmd_reg_mutex);
				diag_send_error_rsp(buf, len, info);
				return write_len;
			}
			else
				write_len = diag_send_data(reg_item, buf, len);
		}