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

Commit 557b8f82 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: f_gsi: Memory optimization for buffers on gsi for low MEM variants"

parents c8b9369a 6e482a1b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -595,6 +595,14 @@ config USB_CONFIGFS_F_GSI
	  related functionalities using GSI hardware accelerated data
	  path and control path.

config USB_LOW_MEM_VARIANT
	bool "USB Memory optimization"
	help
	  Memory requirement for buffers can vary from target to target.
	  Enable this option if memory optimization is required for any
	  low memory variant target. In such case memory needed to be
	  allocated to buffers of various function drivers can be reduced.

config USB_FUNC_WAKEUP_SUPPORTED
	bool "USB Function Remote Wakeup support"
	depends on QGKI
+13 −1
Original line number Diff line number Diff line
@@ -2877,9 +2877,15 @@ static int gsi_bind(struct usb_configuration *c, struct usb_function *f)
		info.ss_desc_hdr = gsi_eth_ss_function;
		info.in_epname = "gsi-epin";
		info.out_epname = "gsi-epout";
#ifdef CONFIG_USB_LOW_MEM_VARIANT
		info.in_req_buf_len = GSI_IN_BUFF_SIZE;
		gsi->d_port.in_aggr_size = GSI_IN_LOW_MEM_RNDIS_AGGR_SIZE;
		info.in_req_num_buf = GSI_NUM_IN_BUFFERS;
#else
		info.in_req_buf_len = GSI_IN_RNDIS_BUFF_SIZE;
		gsi->d_port.in_aggr_size = GSI_IN_RNDIS_AGGR_SIZE;
		info.in_req_num_buf = GSI_NUM_IN_RNDIS_BUFFERS;
#endif
		gsi->d_port.out_aggr_size = GSI_OUT_AGGR_SIZE;
		info.out_req_buf_len = GSI_OUT_AGGR_SIZE;
		info.out_req_num_buf = GSI_NUM_OUT_BUFFERS;
@@ -3053,10 +3059,16 @@ static int gsi_bind(struct usb_configuration *c, struct usb_function *f)
		info.in_epname = "gsi-epin";
		info.out_epname = "gsi-epout";
		gsi->d_port.in_aggr_size = GSI_IN_RMNET_AGGR_SIZE;
#ifdef CONFIG_USB_LOW_MEM_VARIANT
		info.in_req_buf_len = GSI_IN_BUFF_SIZE;
		info.in_req_num_buf = GSI_NUM_IN_BUFFERS;
		info.out_req_buf_len = GSI_OUT_LOW_MEM_RMNET_BUF_LEN;
#else
		info.in_req_buf_len = GSI_IN_RMNET_BUFF_SIZE;
		info.in_req_num_buf = GSI_NUM_IN_RMNET_BUFFERS;
		gsi->d_port.out_aggr_size = GSI_OUT_AGGR_SIZE;
		info.out_req_buf_len = GSI_OUT_RMNET_BUF_LEN;
#endif
		gsi->d_port.out_aggr_size = GSI_OUT_AGGR_SIZE;
		info.out_req_num_buf = GSI_NUM_OUT_BUFFERS;
		info.notify_buf_len = sizeof(struct usb_cdc_notification);
		break;
+3 −0
Original line number Diff line number Diff line
@@ -42,6 +42,9 @@
#define GSI_IN_RMNET_AGGR_SIZE 16384
#define GSI_ECM_AGGR_SIZE 2048

#define GSI_IN_LOW_MEM_RNDIS_AGGR_SIZE 9216
#define GSI_OUT_LOW_MEM_RMNET_BUF_LEN 16384

#define GSI_OUT_MBIM_BUF_LEN 16384
#define GSI_OUT_RMNET_BUF_LEN 31744
#define GSI_OUT_ECM_BUF_LEN 2048