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

Commit 7c4b317c authored by Ajay Agarwal's avatar Ajay Agarwal Committed by Chris Lew
Browse files

net: qrtr: Handle IPCR control port format of older targets



The destination port value in the IPCR control buffer on older
targets is 0xFFFF. Handle the same by updating the dst_port to
QRTR_PORT_CTRL.

Change-Id: Ia70ce1c078ea84f0de47240f6fc3e764f4ae7a6f
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent a7b81fb7
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@
#define QRTR_MIN_EPH_SOCKET 0x4000
#define QRTR_MAX_EPH_SOCKET 0x7fff

#define QRTR_PORT_CTRL_LEGACY 0xffff

/* qrtr socket states */
#define QRTR_STATE_MULTI	-2
#define QRTR_STATE_INIT		-1
@@ -606,6 +608,9 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len)
		goto err;
	}

	if (cb->dst_port == QRTR_PORT_CTRL_LEGACY)
		cb->dst_port = QRTR_PORT_CTRL;

	if (len != ALIGN(size, 4) + hdrlen)
		goto err;