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

Commit 690629b4 authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: Send BRK signal to host on flow disable ioctl



Currently in f_cdev driver, we are not handling the TIOCM_CTS
signal generared by SIO_IOCTL_INBOUND_FLOW IOCTL. Hence we
are not able to send BRK signal to the host and it keeps
sending data leading to data loss.

Fix this by handling TIOCM_CTS in the driver.

Change-Id: If8e4774e3e0772cb7189f3400d7e53e258b7d5a3
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent 49e25df1
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1377,6 +1377,9 @@ static int f_cdev_tiocmget(struct f_cdev *port)

	if (cser->serial_state & TIOCM_DSR)
		result |= TIOCM_DSR;

	if (cser->serial_state & TIOCM_CTS)
		result |= TIOCM_CTS;
	return result;
}

@@ -1423,6 +1426,18 @@ static int f_cdev_tiocmset(struct f_cdev *port,
	if (clear & TIOCM_DSR)
		cser->serial_state &= ~TIOCM_DSR;

	if (set & TIOCM_CTS) {
		if (cser->send_break) {
			cser->serial_state |= TIOCM_CTS;
			status = cser->send_break(cser, 0);
		}
	}
	if (clear & TIOCM_CTS) {
		if (cser->send_break) {
			cser->serial_state &= ~TIOCM_CTS;
			status = cser->send_break(cser, 1);
		}
	}
	return status;
}