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

Commit 114f2afb authored by Siva Kumar Akkireddi's avatar Siva Kumar Akkireddi Committed by Siddartha Mohanadoss
Browse files

msm: mhi_dev: Set correct transfer length in completion events



Set the correct transfer length in completion events sent to the
host to avoid errors in host drivers.

Change-Id: I510f6fd2d24e40ac92cf028ecb14684461b20585
Signed-off-by: default avatarSiva Kumar Akkireddi <sivaa@codeaurora.org>
parent 03cafa97
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1751,7 +1751,7 @@ static void mhi_dev_transfer_completion_cb(void *mreq)
	ch = client->channel;
	mhi = ch->ring->mhi_dev;
	el = req->el;
	transfer_len = req->len;
	transfer_len = req->transfer_len;
	snd_cmpl = req->snd_cmpl;
	rd_offset = req->rd_offset;
	ch->curr_ereq->context = ch;
@@ -2448,7 +2448,7 @@ int mhi_dev_read_channel(struct mhi_req *mreq)
			(mreq->len - usr_buf_remaining);
		ch->tre_bytes_left -= bytes_to_read;
		mreq->el = el;
		mreq->actual_len = bytes_read;
		mreq->transfer_len = bytes_to_read;
		mreq->rd_offset = ring->rd_offset;
		mhi_log(MHI_MSG_VERBOSE, "reading %d bytes from chan %d\n",
				bytes_to_read, mreq->chan);
@@ -2612,6 +2612,7 @@ int mhi_dev_write_channel(struct mhi_req *wreq)
		write_to_loc = el->tre.data_buf_ptr;
		wreq->rd_offset = ring->rd_offset;
		wreq->el = el;
		wreq->transfer_len = bytes_to_write;
		rc = mhi_ctx->device_to_host(write_to_loc,
						(void *) read_from_loc,
						bytes_to_write,
+2 −2
Original line number Diff line number Diff line
@@ -246,10 +246,10 @@ static void mhi_dev_net_read_completion_cb(void *req)
	struct sk_buff *skb = mreq->context;
	unsigned long   flags;

	skb->len = mreq->actual_len;
	skb->len = mreq->transfer_len;
	skb->protocol =
		mhi_dev_net_eth_type_trans(skb);
	skb_put(skb, mreq->actual_len);
	skb_put(skb, mreq->transfer_len);
	net_handle->dev->stats.rx_packets++;
	skb->dev = net_handle->dev;
	netif_rx(skb);
+2 −2
Original line number Diff line number Diff line
@@ -608,7 +608,7 @@ static int mhi_uci_read_async(struct uci_client *uci_handle,
			"wk up Read completed on ch %d\n", ureq->chan);

		uci_handle->pkt_loc = (void *)ureq->buf;
		uci_handle->pkt_size = ureq->actual_len;
		uci_handle->pkt_size = ureq->transfer_len;

		uci_log(UCI_DBG_VERBOSE,
			"Got pkt of sz 0x%x at adr %pK, ch %d\n",
@@ -641,7 +641,7 @@ static int mhi_uci_read_sync(struct uci_client *uci_handle,

	if (*bytes_avail > 0) {
		uci_handle->pkt_loc = (void *)ureq->buf;
		uci_handle->pkt_size = ureq->actual_len;
		uci_handle->pkt_size = ureq->transfer_len;

		uci_log(UCI_DBG_VERBOSE,
			"Got pkt of sz 0x%x at adr %pK, ch %d\n",
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ struct mhi_req {
	u32                             snd_cmpl;
	void                            *context;
	size_t                          len;
	size_t                          actual_len;
	size_t                          transfer_len;
	uint32_t                        rd_offset;
	struct mhi_dev_client           *client;
	struct list_head                list;