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

Commit a7d4d350 authored by Jack Pham's avatar Jack Pham Committed by Matt Wagantall
Browse files

usb: gadget: rndis: Don't call netif_carrier_on/off for IPA



commit 35d3ad1b (f_qc_rndis: Fix issue with bus resume while using
Linux Host) added a new common function rndis_flow_control() which
handles suspend/resume as well as PACKET_FILTER messages. However,
the logic checking for IPA was incorrectly streamlined as:

	if (is_rndis_ipa_supported() &&
		params->state == RNDIS_DATA_INITIALIZED)
		...
	else
		...

when it should have been a nested if check:

	if (is_rndis_ipa_supported()) {
		if (params->state == RNDIS_DATA_INITIALIZED)
			...
	} else {
		...
	}

This fixes the behavior so that the "else" branch only gets
executed when IPA is not supported, not when either half of the
AND statement evaluates to false.

Change-Id: I6dcc709fb591c9793d8b733bb72e673e74259ead
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 418a10f4
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1027,8 +1027,8 @@ void rndis_flow_control(u8 confignr, bool enable_flow_control)
	params = &rndis_per_dev_params[confignr];
	pr_debug("%s(): params->state:%x\n", __func__, params->state);
	if (enable_flow_control) {
		if (is_rndis_ipa_supported() &&
			params->state == RNDIS_DATA_INITIALIZED) {
		if (is_rndis_ipa_supported()) {
			if (params->state == RNDIS_DATA_INITIALIZED)
				u_bam_data_stop_rndis_ipa();
		} else {
			netif_carrier_off(params->dev);
@@ -1036,8 +1036,8 @@ void rndis_flow_control(u8 confignr, bool enable_flow_control)
		}
		params->state = RNDIS_INITIALIZED;
	} else {
		if (is_rndis_ipa_supported() &&
			params->state != RNDIS_DATA_INITIALIZED) {
		if (is_rndis_ipa_supported()) {
			if (params->state != RNDIS_DATA_INITIALIZED)
				u_bam_data_start_rndis_ipa();
		} else {
			netif_carrier_on(params->dev);