[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJnFFh3XRFEC49yFvjstreqqkeraA9GA1_AL-s9rj87HksdgBg@mail.gmail.com>
Date: Fri, 23 Sep 2011 10:59:43 +0200
From: Nikola Diklic-Perin <diklic.perin.nikola@...il.com>
To: linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org
Cc: diklic.perin.nikola@...il.com
Subject: [PATCH] tty/n_gsm: fix bug in tiocmset
From: Nikola Diklic-Perin <diklic.perin.nikola@...il.com>
Clear bitmask was not inverted before masking modem_tx.
Calling ioctl(fd, TIOCMBIC, TIOCM_RTS) results in:
[ 197.430000] pre_modem_tx: 0x00000006
[ 197.430000] clear: 0x00000004
[ 197.430000] set: 0x00000000
[ 197.440000] post_modem_tx: 0x00000004
which is wrong.
Signed-off-by: Nikola Diklic-Perin <diklic.perin.nikola@...il.com>
---
--- a/drivers/tty/n_gsm.c 2011-09-22 18:19:16.592480805 +0200
+++ b/drivers/tty/n_gsm.c 2011-09-21 16:15:29.506800052 +0200
@@ -2982,7 +2982,7 @@ static int gsmtty_tiocmset(struct tty_st
struct gsm_dlci *dlci = tty->driver_data;
unsigned int modem_tx = dlci->modem_tx;
- modem_tx &= clear;
+ modem_tx &= ~clear;
modem_tx |= set;
if (modem_tx != dlci->modem_tx) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists