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

Commit f431d54b authored by Sujeet Kumar's avatar Sujeet Kumar
Browse files

USB: android: Modify common variable name no_data_bam_ports



no_data_bam_ports variable is named same in both rmnet
and qdss function. Declaring them as static global
and including both function driver in android driver
indicates to allocate a global variable for both
instance.

If QDSS and RMNET composition are activated in one
composition then RMNET bind config fails because
the no_data_bam_ports is incremented to a value 2
where it expects it be just 1 in gbam setup.

Change the name of variable in both qdss and rmnet
function drivers.

Change-Id: Ib647e6a8becccc2d6b9e462aeb8480e7222f913b
Signed-off-by: default avatarSujeet Kumar <ksujeet@codeaurora.org>
parent b3dc3104
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
/*
 * f_qdss.c -- QDSS function Driver
 *
 * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2015, 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
@@ -27,7 +27,7 @@
#include "u_rmnet.h"

static unsigned int nr_qdss_ports;
static unsigned int no_data_bam_ports;
static unsigned int no_qdss_data_bam_ports;
static unsigned int data_hsic_ports_no;
static unsigned int no_ipa_ports;
static unsigned int no_bam_dmux_ports;
@@ -1206,9 +1206,9 @@ static int qdss_init_port(const char *ctrl_name, const char *data_name,

	switch (qdss_port->data_xport) {
	case USB_GADGET_XPORT_BAM:
		qdss_port->data_xport_num = no_data_bam_ports;
		no_data_bam_ports++;
		pr_debug("USB_GADGET_XPORT_BAM %d\n", no_data_bam_ports);
		qdss_port->data_xport_num = no_qdss_data_bam_ports;
		no_qdss_data_bam_ports++;
		pr_debug("USB_GADGET_XPORT_BAM %d\n", no_qdss_data_bam_ports);
		break;
	case USB_GADGET_XPORT_BAM2BAM_IPA:
		qdss_port->data_xport_num = no_ipa_ports;
@@ -1242,7 +1242,7 @@ fail_probe:
		kfree(qdss_ports[i].port);

	nr_qdss_ports = 0;
	no_data_bam_ports = 0;
	no_qdss_data_bam_ports = 0;
	data_hsic_ports_no = 0;
	no_ipa_ports = 0;
	no_bam_dmux_ports = 0;
@@ -1255,7 +1255,7 @@ static int qdss_gport_setup(void)
	int	i;

	pr_debug("%s: bam ports: %u data hsic ports: %u ipa_ports:%u bam_dmux_port:%u nr_qdss_ports:%u\n",
			__func__, no_data_bam_ports, data_hsic_ports_no,
			__func__, no_qdss_data_bam_ports, data_hsic_ports_no,
			no_ipa_ports, no_bam_dmux_ports, nr_qdss_ports);

	if (data_hsic_ports_no) {
+9 −9
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2015, 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
@@ -64,7 +64,7 @@ static unsigned int no_ctrl_smd_ports;
static unsigned int no_ctrl_qti_ports;
static unsigned int no_ctrl_hsic_ports;
static unsigned int no_ctrl_hsuart_ports;
static unsigned int no_data_bam_ports;
static unsigned int no_rmnet_data_bam_ports;
static unsigned int no_data_bam2bam_ports;
static unsigned int no_data_hsic_ports;
static unsigned int no_data_hsuart_ports;
@@ -313,12 +313,12 @@ static int rmnet_gport_setup(void)
	pr_debug("%s: bam ports: %u bam2bam ports: %u data hsic ports: %u data hsuart ports: %u"
		" smd ports: %u ctrl hsic ports: %u ctrl hsuart ports: %u"
		" nr_rmnet_ports: %u\n",
		__func__, no_data_bam_ports, no_data_bam2bam_ports,
		__func__, no_rmnet_data_bam_ports, no_data_bam2bam_ports,
		no_data_hsic_ports, no_data_hsuart_ports, no_ctrl_smd_ports,
		no_ctrl_hsic_ports, no_ctrl_hsuart_ports, nr_rmnet_ports);

	if (no_data_bam_ports) {
		ret = gbam_setup(no_data_bam_ports);
	if (no_rmnet_data_bam_ports) {
		ret = gbam_setup(no_rmnet_data_bam_ports);
		if (ret < 0)
			return ret;
	}
@@ -1395,7 +1395,7 @@ static void frmnet_cleanup(void)
	nr_rmnet_ports = 0;
	no_ctrl_smd_ports = 0;
	no_ctrl_qti_ports = 0;
	no_data_bam_ports = 0;
	no_rmnet_data_bam_ports = 0;
	no_data_bam2bam_ports = 0;
	no_ctrl_hsic_ports = 0;
	no_data_hsic_ports = 0;
@@ -1465,8 +1465,8 @@ static int frmnet_init_port(const char *ctrl_name, const char *data_name,

	switch (rmnet_port->data_xport) {
	case USB_GADGET_XPORT_BAM:
		rmnet_port->data_xport_num = no_data_bam_ports;
		no_data_bam_ports++;
		rmnet_port->data_xport_num = no_rmnet_data_bam_ports;
		no_rmnet_data_bam_ports++;
		break;
	case USB_GADGET_XPORT_BAM2BAM:
	case USB_GADGET_XPORT_BAM2BAM_IPA:
@@ -1502,7 +1502,7 @@ fail_probe:
	nr_rmnet_ports = 0;
	no_ctrl_smd_ports = 0;
	no_ctrl_qti_ports = 0;
	no_data_bam_ports = 0;
	no_rmnet_data_bam_ports = 0;
	no_ctrl_hsic_ports = 0;
	no_data_hsic_ports = 0;
	no_ctrl_hsuart_ports = 0;