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

Commit bced92b0 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_gsi: Support IPA scatter-gather for DL"

parents 557d662b 790e14a4
Loading
Loading
Loading
Loading
+18 −10
Original line number Diff line number Diff line
@@ -17,10 +17,10 @@
#include <linux/usb/f_gsi.h>
#include "rndis.h"

static unsigned int dl_aggr_size = GSI_IN_BUFF_SIZE;
module_param(dl_aggr_size, uint, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(dl_aggr_size,
		"Max size of bus transfer to host");
static unsigned int gsi_in_aggr_size;
module_param(gsi_in_aggr_size, uint, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(gsi_in_aggr_size,
		"Aggr size of bus transfer to host");

static unsigned int ul_aggr_size = GSI_OUT_BUFF_SIZE;
module_param(ul_aggr_size, uint, S_IRUGO | S_IWUSR);
@@ -495,8 +495,12 @@ static int ipa_connect_channels(struct gsi_data_port *d_port)
	conn_params->ipa_to_usb_xferrscidx_valid = true;
	conn_params->teth_prot = gsi->prot_id;
	conn_params->teth_prot_params.max_xfer_size_bytes_to_dev = 23700;
	if (gsi_in_aggr_size)
		conn_params->teth_prot_params.max_xfer_size_bytes_to_host
					= GSI_IN_BUFF_SIZE;
					= gsi_in_aggr_size;
	else
		conn_params->teth_prot_params.max_xfer_size_bytes_to_host
					= d_port->in_aggr_size;
	conn_params->teth_prot_params.max_packet_number_to_dev =
		DEFAULT_MAX_PKT_PER_XFER;
	conn_params->max_supported_bandwidth_mbps =
@@ -2481,7 +2485,8 @@ static int gsi_bind(struct usb_configuration *c, struct usb_function *f)
		info.fs_desc_hdr = gsi_eth_fs_function;
		info.hs_desc_hdr = gsi_eth_hs_function;
		info.ss_desc_hdr = gsi_eth_ss_function;
		info.in_req_buf_len = dl_aggr_size;
		info.in_req_buf_len = GSI_IN_BUFF_SIZE;
		gsi->d_port.in_aggr_size = GSI_IN_RNDIS_AGGR_SIZE;
		info.in_req_num_buf = num_in_bufs;
		info.out_req_buf_len = ul_aggr_size;
		info.out_req_num_buf = num_out_bufs;
@@ -2545,7 +2550,8 @@ static int gsi_bind(struct usb_configuration *c, struct usb_function *f)
		info.fs_desc_hdr = mbim_gsi_fs_function;
		info.hs_desc_hdr = mbim_gsi_hs_function;
		info.ss_desc_hdr = mbim_gsi_ss_function;
		info.in_req_buf_len = 0x4000;
		gsi->d_port.in_aggr_size = GSI_IN_MBIM_AGGR_SIZE;
		info.in_req_buf_len = GSI_IN_BUFF_SIZE;
		info.in_req_num_buf = num_in_bufs;
		info.out_req_buf_len = 0x4000;
		info.out_req_num_buf = num_out_bufs;
@@ -2582,7 +2588,8 @@ static int gsi_bind(struct usb_configuration *c, struct usb_function *f)
		info.fs_desc_hdr = rmnet_gsi_fs_function;
		info.hs_desc_hdr = rmnet_gsi_hs_function;
		info.ss_desc_hdr = rmnet_gsi_ss_function;
		info.in_req_buf_len = 16384;
		gsi->d_port.in_aggr_size = GSI_IN_RMNET_AGGR_SIZE;
		info.in_req_buf_len = GSI_IN_BUFF_SIZE;
		info.in_req_num_buf = num_in_bufs;
		info.out_req_buf_len = 16384;
		info.out_req_num_buf = num_out_bufs;
@@ -2610,7 +2617,8 @@ static int gsi_bind(struct usb_configuration *c, struct usb_function *f)
		info.fs_desc_hdr = ecm_gsi_fs_function;
		info.hs_desc_hdr = ecm_gsi_hs_function;
		info.ss_desc_hdr = ecm_gsi_ss_function;
		info.in_req_buf_len = 2048;
		gsi->d_port.in_aggr_size = GSI_IN_ECM_AGGR_SIZE;
		info.in_req_buf_len = GSI_IN_BUFF_SIZE;
		info.in_req_num_buf = num_in_bufs;
		info.out_req_buf_len = 2048;
		info.out_req_num_buf = num_out_bufs;
+8 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2016, 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
@@ -21,10 +21,15 @@
#define GSI_MAX_CTRL_PKT_SIZE 4096

#define GSI_NUM_IN_BUFFERS 7
#define GSI_IN_BUFF_SIZE 9216
#define GSI_IN_BUFF_SIZE 2048
#define GSI_NUM_OUT_BUFFERS 7
#define GSI_OUT_BUFF_SIZE 24576

#define GSI_IN_RNDIS_AGGR_SIZE 9216
#define GSI_IN_MBIM_AGGR_SIZE 16384
#define GSI_IN_RMNET_AGGR_SIZE 16384
#define GSI_IN_ECM_AGGR_SIZE 2048

#define GSI_IPA_READY_TIMEOUT 5000

#define ETH_ADDR_STR_LEN 14
@@ -176,6 +181,7 @@ struct gsi_data_port {
	u32 out_xfer_rsc_index;
	u16 in_last_trb_addr;
	u16 cdc_filter;
	u32 in_aggr_size;

	bool ipa_ready;
	bool net_ready_trigger;