mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
usb: gadget: f_gsi: Add support to enable/disable using TCM MEM
This change adds support to enable/disable using TCM memory for USB IN data buffer with RMNET interface. Change-Id: I27f04c1bc170e06ccbc9c57ef0e9b8f870e4fe97 Signed-off-by: Mayank Rana <mrana@codeaurora.org>
This commit is contained in:
parent
e334d6d2ed
commit
99e27d7d9b
2 changed files with 44 additions and 2 deletions
|
|
@ -501,8 +501,8 @@ static int ipa_connect_channels(struct gsi_data_port *d_port)
|
|||
struct ipa_req_chan_out_params ipa_in_channel_out_params;
|
||||
struct ipa_req_chan_out_params ipa_out_channel_out_params;
|
||||
|
||||
log_event_dbg("IN: num_bufs:=%zu, buf_len=%zu\n",
|
||||
d_port->in_request.num_bufs, d_port->in_request.buf_len);
|
||||
if (gsi->prot_id == IPA_USB_RMNET)
|
||||
d_port->in_request.use_tcm_mem = gsi->rmnet_use_tcm_mem;
|
||||
|
||||
ret = usb_gsi_ep_op(d_port->in_ep, &d_port->in_request,
|
||||
GSI_EP_OP_PREPARE_TRBS);
|
||||
|
|
@ -512,6 +512,9 @@ static int ipa_connect_channels(struct gsi_data_port *d_port)
|
|||
return ret;
|
||||
}
|
||||
|
||||
log_event_dbg("IN: num_bufs:=%zu, buf_len=%zu\n",
|
||||
d_port->in_request.num_bufs, d_port->in_request.buf_len);
|
||||
|
||||
ret = usb_gsi_ep_op(d_port->in_ep, &d_port->in_request,
|
||||
GSI_EP_OP_STARTXFER);
|
||||
if (ret) {
|
||||
|
|
@ -3797,6 +3800,40 @@ static struct config_item_type gsi_func_ecm_type = {
|
|||
.ct_owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
static ssize_t gsi_rmnet_use_tcm_mem_show(struct config_item *item, char *page)
|
||||
{
|
||||
struct f_gsi *gsi = to_gsi_opts(item)->gsi;
|
||||
|
||||
return scnprintf(page, PAGE_SIZE, "%s\n",
|
||||
gsi->rmnet_use_tcm_mem ? "Enabled" : "Disabled");
|
||||
}
|
||||
|
||||
static ssize_t gsi_rmnet_use_tcm_mem_store(struct config_item *item,
|
||||
const char *page, size_t len)
|
||||
{
|
||||
struct f_gsi *gsi = to_gsi_opts(item)->gsi;
|
||||
bool enable;
|
||||
|
||||
if (kstrtobool(page, &enable))
|
||||
return -EINVAL;
|
||||
|
||||
gsi->rmnet_use_tcm_mem = enable;
|
||||
return len;
|
||||
}
|
||||
CONFIGFS_ATTR(gsi_, rmnet_use_tcm_mem);
|
||||
|
||||
static struct configfs_attribute *gsi_rmnet_attrs[] = {
|
||||
&gsi_attr_info,
|
||||
&gsi_attr_rmnet_use_tcm_mem,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct config_item_type gsi_func_rmnet_type = {
|
||||
.ct_item_ops = &gsi_item_ops,
|
||||
.ct_attrs = gsi_rmnet_attrs,
|
||||
.ct_owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
static void gsi_inst_clean(struct gsi_opts *opts)
|
||||
{
|
||||
if (opts->gsi->c_port.cdev.dev) {
|
||||
|
|
@ -3858,6 +3895,10 @@ static int gsi_set_inst_name(struct usb_function_instance *fi,
|
|||
}
|
||||
mutex_unlock(&inst_status[prot_id].gsi_lock);
|
||||
|
||||
if (prot_id == IPA_USB_RMNET)
|
||||
config_group_init_type_name(&opts->func_inst.group,
|
||||
fi->group.cg_item.ci_name,
|
||||
&gsi_func_rmnet_type);
|
||||
if (prot_id == IPA_USB_RNDIS)
|
||||
config_group_init_type_name(&opts->func_inst.group,
|
||||
fi->group.cg_item.ci_name,
|
||||
|
|
|
|||
|
|
@ -312,6 +312,7 @@ struct f_gsi {
|
|||
struct gsi_ctrl_port c_port;
|
||||
void *ipc_log_ctxt;
|
||||
bool rmnet_dtr_status;
|
||||
bool rmnet_use_tcm_mem;
|
||||
|
||||
bool rwake_inprogress;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue