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: Ajay Agarwal <ajaya@codeaurora.org>
Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
This commit is contained in:
Chandana Kishori Chiluveru 2018-06-26 16:38:08 +05:30 • committed by Gerrit - the friendly Code Review server
commit 5fa858f5d4

View file

@ -1382,6 +1382,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;
}
@ -1428,6 +1431,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;
}