Skip to contentSkip to conversation

cdc-acm: fix BREAK rx code path adding necessary calls

PATCH New Oliver Neukum 1 participant 1 message Mar 11, 2021

Subsystems (2)
lore
Share & tools
lore

Oliver Neukum

author maintainer
#0 lore raw

PATCH 1/1 cdc-acm: fix BREAK rx code path adding necessary calls

Counting break events is nice but we should actually report them to the tty layer.

Fixes 5a6a62bdb9257 ("cdc-acm: add TIOCMIWAIT")
---
 drivers/usb/class/cdc-acm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/class/cdc-acm.c +3 -1
index b05207bc8265..fd2fce072985 100644
@@ -326,8 +326,10 @@ static void acm_process_notification(struct acm *acm, unsigned char *buf)
 			acm->iocount.dsr++;
 		if (difference & ACM_CTRL_DCD)
 			acm->iocount.dcd++;
-		if (newctrl & ACM_CTRL_BRK)
+		if (newctrl & ACM_CTRL_BRK) {
 			acm->iocount.brk++;
+			tty_insert_flip_char(&acm->port, 0, TTY_BREAK);
+		}
 		if (newctrl & ACM_CTRL_RI)
 			acm->iocount.rng++;
 		if (newctrl & ACM_CTRL_FRAMING)
Signature · 1 line
2.26.2