summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSujeev Dias <sdias@codeaurora.org>2017-01-19 14:21:09 -0800
committerSujeev Dias <sdias@codeaurora.org>2017-03-11 13:43:31 -0800
commit3d0bc07b5bafd75e34336e8b1acc50fa846df23c (patch)
treef514e75a004ba11d8900bbff280a8e51893f5e7f
parent2583f4c5d6f2cecef46021b9cd94273e53ac7c60 (diff)
mhi: mhi_uci: pass max payload size to mhi during mhi registration
MHI host requires clients to provide maximum payload size during active transfer so MHI host can pre-allocate bounce buffers. CRs-Fixed: 1110280 Change-Id: I5dd38fc49a98629f77cdb7879942b7b1993e43b8 Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
-rw-r--r--drivers/platform/msm/mhi_uci/mhi_uci.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/platform/msm/mhi_uci/mhi_uci.c b/drivers/platform/msm/mhi_uci/mhi_uci.c
index 01d6b9716dfa..0e28ebdd8fea 100644
--- a/drivers/platform/msm/mhi_uci/mhi_uci.c
+++ b/drivers/platform/msm/mhi_uci/mhi_uci.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -31,8 +31,6 @@
#define MHI_DEV_NODE_NAME_LEN 13
#define MHI_SOFTWARE_CLIENT_LIMIT 23
-#define TRE_TYPICAL_SIZE 0x1000
-#define TRE_MAX_SIZE 0xFFFF
#define MHI_UCI_IPC_LOG_PAGES (25)
#define MAX_NR_TRBS_PER_CHAN 10
@@ -331,8 +329,8 @@ static int mhi_uci_send_packet(struct mhi_client_handle **client_handle,
return 0;
for (i = 0; i < nr_avail_trbs; ++i) {
- data_to_insert_now = min(data_left_to_insert,
- TRE_MAX_SIZE);
+ data_to_insert_now = min_t(size_t, data_left_to_insert,
+ uci_handle->out_attr.max_packet_size);
if (is_uspace_buf) {
data_loc = kmalloc(data_to_insert_now, GFP_KERNEL);
if (NULL == data_loc) {
@@ -1231,6 +1229,7 @@ static int mhi_register_client(struct uci_client *mhi_client,
client_info.user_data = mhi_client;
client_info.mhi_client_cb = uci_xfer_cb;
client_info.chan = mhi_client->out_chan;
+ client_info.max_payload = mhi_client->out_attr.max_packet_size;
ret_val = mhi_register_channel(&mhi_client->out_handle, &client_info);
if (0 != ret_val)
uci_log(mhi_client->uci_ipc_log,
@@ -1243,6 +1242,7 @@ static int mhi_register_client(struct uci_client *mhi_client,
UCI_DBG_INFO,
"Registering chan %d\n",
mhi_client->in_chan);
+ client_info.max_payload = mhi_client->in_attr.max_packet_size;
client_info.chan = mhi_client->in_chan;
ret_val = mhi_register_channel(&mhi_client->in_handle, &client_info);
if (0 != ret_val)