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

Commit dcdc97d6 authored by Mohit Aggarwal's avatar Mohit Aggarwal
Browse files

diag: Send time sync control packet prior to masks update



This patch forwards the time sync control packet to
peripheral prior to sending masks update.

Change-Id: I173ecfbff0108af3165ccef1f52a3984d8071475
Signed-off-by: default avatarMohit Aggarwal <maggarwa@codeaurora.org>
parent f0331928
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -365,11 +365,10 @@ static void diag_send_time_sync_update(uint8_t peripheral)
	time_sync_msg.time_api = driver->uses_time_api;

	err = diagfwd_write(peripheral, TYPE_CNTL, &time_sync_msg, msg_size);
	if (err) {
	if (err)
		pr_err("diag: In %s, unable to write to peripheral: %d, type: %d, len: %d, err: %d\n",
				__func__, peripheral, TYPE_CNTL,
				msg_size, err);
	}
	mutex_unlock(&driver->diag_cntl_mutex);
}

@@ -1525,6 +1524,8 @@ int diag_copy_to_user_log_mask(char __user *buf, size_t count)
void diag_send_updates_peripheral(uint8_t peripheral)
{
	diag_send_feature_mask_update(peripheral);
	if (driver->time_sync_enabled)
		diag_send_time_sync_update(peripheral);
	diag_send_msg_mask_update(peripheral, ALL_SSID, ALL_SSID);
	diag_send_log_mask_update(peripheral, ALL_EQUIP_ID);
	diag_send_event_mask_update(peripheral);
@@ -1532,8 +1533,6 @@ void diag_send_updates_peripheral(uint8_t peripheral)
				driver->real_time_mode[DIAG_LOCAL_PROC]);
	diag_send_peripheral_buffering_mode(
				&driver->buffering_mode[peripheral]);
	if (driver->time_sync_enabled)
		diag_send_time_sync_update(peripheral);
}

int diag_process_apps_masks(unsigned char *buf, int len)
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@
#define STM_RSP_STATUS_INDEX		8
#define STM_RSP_NUM_BYTES		9

int timestamp_switch;
static int timestamp_switch;
module_param(timestamp_switch, int, 0644);

int wrap_enabled;
@@ -592,7 +592,7 @@ int diag_process_time_sync_query_cmd(unsigned char *src_buf, int src_len,
int diag_process_time_sync_switch_cmd(unsigned char *src_buf, int src_len,
				      unsigned char *dest_buf, int dest_len)
{
	uint8_t peripheral, status;
	uint8_t peripheral, status = 0;
	struct diag_cmd_time_sync_switch_req_t *req = NULL;
	struct diag_cmd_time_sync_switch_rsp_t rsp;
	struct diag_ctrl_msg_time_sync time_sync_msg;